File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -209,11 +209,12 @@ const createUseBrowseState = ({ syncWithUrl }: { syncWithUrl: boolean }) => {
209209 dataset,
210210 setDataset,
211211 filters,
212- setFilters : ( filters : BrowseFilter [ ] ) =>
212+ setFilters : ( filters : BrowseFilter [ ] ) => {
213213 setParams ( ( params ) => ( {
214214 ...params ,
215215 ...getParamsFromFilters ( filters ) ,
216- } ) ) ,
216+ } ) ) ;
217+ } ,
217218 } ) ,
218219 [
219220 includeDrafts ,
Original file line number Diff line number Diff line change @@ -66,16 +66,22 @@ export const getParamsFromFilters = (filters: BrowseFilter[]) => {
6666 for ( const filter of filters ) {
6767 const typeAttr = i === 0 ? "type" : ( "subtype" as const ) ;
6868 const iriAttr = i === 0 ? "iri" : ( "subiri" as const ) ;
69- if ( filter . __typename === SearchCubeFilterType . DataCubeTheme ) {
70- params [ typeAttr ] = "theme" ;
71- params [ iriAttr ] = filter . iri ;
72- } else if (
73- filter . __typename === SearchCubeFilterType . DataCubeOrganization
74- ) {
75- params [ typeAttr ] = "organization" ;
76- params [ iriAttr ] = filter . iri ;
77- } else if ( filter . __typename === SearchCubeFilterType . DataCubeAbout ) {
78- params . topic = filter . iri ;
69+ switch ( filter . __typename ) {
70+ case SearchCubeFilterType . DataCubeTheme :
71+ params [ typeAttr ] = "theme" ;
72+ params [ iriAttr ] = filter . iri ;
73+ break ;
74+ case SearchCubeFilterType . DataCubeOrganization :
75+ params [ typeAttr ] = "organization" ;
76+ params [ iriAttr ] = filter . iri ;
77+ break ;
78+ case SearchCubeFilterType . DataCubeAbout :
79+ params . topic = filter . iri ;
80+ break ;
81+ case SearchCubeFilterType . Termset :
82+ params [ typeAttr ] = "termset" ;
83+ params [ iriAttr ] = filter . iri ;
84+ break ;
7985 }
8086 i ++ ;
8187 }
Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ import { ConfiguratorStateProvider } from "@/configurator/configurator-state";
44import { SearchCubeResultOrder } from "@/graphql/query-hooks" ;
55
66export type BrowseParams = {
7- type ?: "theme" | "organization" | "dataset" ;
8- subtype ?: "theme" | "organization" ;
7+ type ?: "theme" | "organization" | "dataset" | "termset" ;
8+ subtype ?: "theme" | "organization" | "termset" ;
99 iri ?: string ;
1010 subiri ?: string ;
1111 topic ?: string ;
You can’t perform that action at this time.
0 commit comments