Skip to content

Commit

Permalink
feat: Only activate hardcoded bathing site hierarchy if flag set in s…
Browse files Browse the repository at this point in the history
…earch params
  • Loading branch information
ptbrowne committed Jan 19, 2022
1 parent 7afaaff commit e1c7a03
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions app/utils/dimension-hierarchy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,18 +216,31 @@ export const makeDimensionValuesTree = ({
return tree;
};

const hierarchy = [
{
dimensionIri:
"https://environment.ld.admin.ch/foen/ubd0104/monitoringprogramm",
children: [
{
dimensionIri: "https://environment.ld.admin.ch/foen/ubd0104/station",
children: [],
},
],
},
] as DimensionHierarchy[];
const isHierarchyEnabled = () => {
try {
return window.location.search.includes("bathingsitehierarchy");
} catch {
return false;
}
};

const hierarchy = (
isHierarchyEnabled()
? [
{
dimensionIri:
"https://environment.ld.admin.ch/foen/ubd0104/monitoringprogramm",
children: [
{
dimensionIri:
"https://environment.ld.admin.ch/foen/ubd0104/station",
children: [],
},
],
},
]
: []
) as DimensionHierarchy[];

export const useHierarchicalDimensionValuesQuery = ({
dimensionIri,
Expand Down

0 comments on commit e1c7a03

Please sign in to comment.