From 2df627654194306a8e2a1df31ea77612a9ae233b Mon Sep 17 00:00:00 2001 From: Miu Razvan Date: Sun, 11 Oct 2020 16:41:51 +0300 Subject: [PATCH] Update --- .../manage/Blocks/GlossarySearchBlock/View.jsx | 1 + src/components/manage/Blocks/Iframe/View.jsx | 13 +++++++++++-- .../manage/Blocks/NavigationBlock/View.jsx | 3 ++- theme/site/globals/site.overrides | 6 +++--- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/components/manage/Blocks/GlossarySearchBlock/View.jsx b/src/components/manage/Blocks/GlossarySearchBlock/View.jsx index 9d37f8e7..48d39063 100644 --- a/src/components/manage/Blocks/GlossarySearchBlock/View.jsx +++ b/src/components/manage/Blocks/GlossarySearchBlock/View.jsx @@ -175,6 +175,7 @@ class View extends Component { index_pollutant_id: parseInt(pollutant.pollutantId), }, }); + this.setState({ active: false, text: pollutant.name }); this.props.history.push('/glossary/pollutants/pollutant-index'); } diff --git a/src/components/manage/Blocks/Iframe/View.jsx b/src/components/manage/Blocks/Iframe/View.jsx index 7b6f7e52..066f5649 100644 --- a/src/components/manage/Blocks/Iframe/View.jsx +++ b/src/components/manage/Blocks/Iframe/View.jsx @@ -20,7 +20,9 @@ const useWindowSize = () => { }; const View = ({ content, ...props }) => { + let showIframe = true; const [discodataQuery, setDiscodataQuery] = useState({}); + const [requiredQueries, setRequiredQueries] = useState([]); const [flags, setFlags] = useState({}); const [windowWidth, windowHeight] = useWindowSize(); const breakPoints = { @@ -56,7 +58,12 @@ const View = ({ content, ...props }) => { newDiscodataQuery[key] = props.search[value.queryParam] || ''; } }); - + if ( + JSON.stringify(Object.keys(properties)) !== + JSON.stringify(requiredQueries) + ) { + setRequiredQueries(Object.keys(properties)); + } if ( JSON.stringify(newDiscodataQuery) !== JSON.stringify(discodataQuery) ) { @@ -164,7 +171,9 @@ const View = ({ content, ...props }) => { return (
- {!flagsState ? ( + {!flagsState && + requiredQueries.length === + requiredQueries.filter((query) => discodataQuery[query]).length ? (