Skip to content

Commit

Permalink
Query parameters in popup link and table link
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanMiu committed Nov 25, 2020
1 parent df725d1 commit ac7716a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
19 changes: 6 additions & 13 deletions src/components/manage/Blocks/DiscodataOpenlayersMapBlock/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1327,21 +1327,14 @@ const OpenlayersMapView = (props) => {
</div>
</div>
<div className="popover-actions">
<button
aria-label="Site details button"
onClick={() => {
setSiteQueryParams()
.then((response) => {
history.push('/industrial-site');
})
.catch((error) => {
console.log(error);
});
}}
className="solid dark-blue"
<Link
as="a"
className="solid dark-blue display-inline-block"
onClick={setSiteQueryParams}
to={`/industrial-site/introduction/understanding-the-data/?siteInspireId=${state.popupDetails.properties.InspireSiteId}&siteName=${state.popupDetails.properties.siteName}&siteReportingYear=${state.popupDetails.properties.Site_reporting_year}`}
>
Site Details
</button>
</Link>
</div>
</>
)}
Expand Down
10 changes: 8 additions & 2 deletions src/components/manage/Blocks/DiscodataTableBlock/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,14 @@ const components = {
if (updatedSearch) props.setQueryParam({ queryParam: newSearch });
}}
to={
schemaMetadata.urlFieldId + ''
// (newSearch ? `?${qs.stringify(newSearch)}` : '')
schemaMetadata.urlFieldId +
(newSearch
? `?${qs.stringify({
siteInspireId: newSearch.siteInspireId,
siteName: newSearch.siteName,
siteReportingYear: newSearch.siteReportingYear,
})}`
: '')
}
>
{schemaMetadata.title}
Expand Down

0 comments on commit ac7716a

Please sign in to comment.