Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanMiu committed Oct 11, 2020
1 parent a812730 commit 2df6276
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/components/manage/Blocks/GlossarySearchBlock/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
13 changes: 11 additions & 2 deletions src/components/manage/Blocks/Iframe/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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)
) {
Expand Down Expand Up @@ -164,7 +171,9 @@ const View = ({ content, ...props }) => {

return (
<div>
{!flagsState ? (
{!flagsState &&
requiredQueries.length ===
requiredQueries.filter((query) => discodataQuery[query]).length ? (
<Iframe
title={title}
url={applyQueryParameters(getUrlByWidth(), {
Expand Down
3 changes: 2 additions & 1 deletion src/components/manage/Blocks/NavigationBlock/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const View = ({ content, ...props }) => {
Object.keys(pagesProperties).map((page) => pagesProperties[page]) || [];
setPages(newPages);
setNavigationItems([...(props.navigation?.items || []), ...newPages]);
}, [data.pages?.value]);
}, [props.navigation, data.pages?.value]);

return (props.navigation?.items?.length && parent) || pages.length ? (
<div className="tabs-view-menu">
Expand Down Expand Up @@ -147,6 +147,7 @@ export default compose(
state.prefetch?.[state.router.location.pathname] || state.content.data,
pathname: state.router.location.pathname,
discodata_query: state.discodata_query,
navItems: state.navigation.items,
flags: state.flags,
navigation: getNavigationByParent(
state.navigation.items,
Expand Down
6 changes: 3 additions & 3 deletions theme/site/globals/site.overrides
Original file line number Diff line number Diff line change
Expand Up @@ -1320,9 +1320,9 @@ body.has-sidebar {
width: 0;
background-color: transparent !important;
}
&:first-child {
margin-left: 0 !important;
}
// &:first-child {
// margin-left: 0 !important;
// }
}
.active.item {
background-color: transparent !important;
Expand Down

0 comments on commit 2df6276

Please sign in to comment.