Skip to content

Commit

Permalink
Query in URL
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanMiu committed Nov 19, 2020
1 parent 8d31dd2 commit d8e2353
Show file tree
Hide file tree
Showing 15 changed files with 236 additions and 114 deletions.
14 changes: 13 additions & 1 deletion src/components/manage/Blocks/ArticlesSparql/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const View = (props) => {
>
<div className="column-4 xs-12 sm-12 article hero pa-1">
<Image
alt={item.title}
src={secureRequest(
item.image ||
`${
Expand Down Expand Up @@ -108,7 +109,7 @@ const View = (props) => {
) : (
''
)}
{preview && redirectPage && items.length ? (
{preview && redirectPage && items.length > 2 ? (
<Link
className="solid dark-blue articles-redirect"
as="a"
Expand All @@ -117,6 +118,17 @@ const View = (props) => {
>
READ MORE
</Link>
) : items.length ? (
<div style={{ textAlign: 'center', marginBottom: '1rem' }}>
<Link
className="solid dark-blue articles-redirect relative"
as="a"
to={redirectPage}
title="READ MORE"
>
READ MORE
</Link>
</div>
) : (
''
)}
Expand Down
10 changes: 9 additions & 1 deletion src/components/manage/Blocks/ArticlesSparql/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,20 @@
}

.articles-redirect {
position: absolute !important;
position: absolute;
bottom: 7em;
left: 50%;
transform: translateX(-50%);
}

.articles-redirect.relative {
display: inline-block;
position: reltive !important;
left: unset;
bottom: unset;
transform: unset;
}

@media (min-width: 500px) and (max-width: 768px) {
.sm-height-fit-content {
height: fit-content !important;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ const airPollutants = [
text: 'Carbon dioxide (CO2)',
},
{
key: 'Heavy metals (Cd, Hg, Pb)',
value: 'Heavy metals (Cd, Hg, Pb)',
key: 'Heavy metals (Cd; Hg; Pb)',
value: 'Heavy metals (Cd; Hg; Pb)',
text: 'Heavy metals (Cd, Hg, Pb)',
},
{
Expand All @@ -82,8 +82,8 @@ const airPollutants = [
];
const waterPollutants = [
{
key: 'Heavy metals (Cd, Hg, Ni, Pb)',
value: 'Heavy metals (Cd, Hg, Ni, Pb)',
key: 'Heavy metals (Cd; Hg; Ni; Pb)',
value: 'Heavy metals (Cd; Hg; Ni; Pb)',
text: 'Heavy metals (Cd, Hg, Ni, Pb)',
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1321,6 +1321,7 @@ const OpenlayersMapView = (props) => {
</div>
<div className="popover-actions">
<button
aria-label="Site details button"
onClick={() => {
setSiteQueryParams();
history.push('/industrial-site');
Expand All @@ -1340,6 +1341,7 @@ const OpenlayersMapView = (props) => {
<Portal node={document.getElementById('map-view-your-area-button')}>
<div id="view-your-area" className="ol-unselectable ol-control">
<button
aria-label="Toggle button"
className="toggle-button"
onClick={() => {
if (navigator.geolocation) {
Expand Down
15 changes: 13 additions & 2 deletions src/components/manage/Blocks/FiltersBlock/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,7 @@ const View = ({ content, ...props }) => {
<div className="search-input-container">
<div className="ref" ref={ref}>
<Input
aria-label="Site search"
className="search"
icon="search"
placeholder="Search for country, region, city or a site name"
Expand Down Expand Up @@ -1188,7 +1189,10 @@ const View = ({ content, ...props }) => {
onOpen={() => setState({ ...state, open: true })}
open={state.open}
trigger={
<button className="outline red ml-0-super mr-0-super">
<button
aria-label="Show modal button"
className="outline red ml-0-super mr-0-super"
>
{modalButtonTitle ? modalButtonTitle : 'Show modal'}
</button>
}
Expand Down Expand Up @@ -1329,10 +1333,15 @@ const View = ({ content, ...props }) => {
})}
</Modal.Content>
<Modal.Actions>
<button className="outline red ma-1" onClick={clearFilters}>
<button
aria-label="Clear button"
className="outline red ma-1"
onClick={clearFilters}
>
Clear Filters
</button>
<button
aria-label="Search and filter button"
className="outline dark-blue ma-1"
onClick={() => {
submit(true);
Expand All @@ -1346,6 +1355,7 @@ const View = ({ content, ...props }) => {
<Portal node={document.getElementById('map-sidebar-button')}>
<div id="dynamic-filter-toggle" className="ol-unselectable ol-control">
<button
aria-label="Toggle button"
className="toggle-button"
onClick={() => {
setSidebar(!sidebar);
Expand Down Expand Up @@ -1443,6 +1453,7 @@ const View = ({ content, ...props }) => {
</div>
<div className="dynamic-filter-actions">
<button
aria-label="Clear filters button"
className="outline red"
onClick={clearFilters}
style={{ margin: 0 }}
Expand Down
2 changes: 1 addition & 1 deletion src/components/manage/Blocks/GlossarySearchBlock/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ class View extends Component {
<Input
className={cx(this.props.data.className?.value)}
ref={this.linkInput}
aria-label={this.props.intl.formatMessage(messages.search)}
aria-label="Glossary search"
placeholder={
this.props.data?.placeholder?.value ||
this.props.intl.formatMessage(messages.searchSite)
Expand Down
7 changes: 5 additions & 2 deletions src/components/manage/Blocks/NavigationBlock/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ const View = ({ content, ...props }) => {
: false
}
onClick={() => {
history.push(`${url}${props.query}`);
if (
props.discodata_query.search.facilityInspireId ||
props.discodata_query.search.installationInspireId ||
Expand All @@ -132,7 +131,7 @@ const View = ({ content, ...props }) => {
] || {};
if (Object.keys(lcp).length) {
history.push(
`/industrial-site/large-scale-fuel-combustion/site-overview/lcp-overview`,
`/industrial-site/large-scale-fuel-combustion/site-overview/lcp-overview/${props.query}`,
);
props.setQueryParam({
queryParam: {
Expand All @@ -141,7 +140,11 @@ const View = ({ content, ...props }) => {
lcpInspireId: lcp.lcpInspireId,
},
});
} else {
history.push(`${url}${props.query}`);
}
} else {
history.push(`${url}${props.query}`);
}
}}
/>
Expand Down
Loading

0 comments on commit d8e2353

Please sign in to comment.