File tree Expand file tree Collapse file tree 4 files changed +8
-15
lines changed
Expand file tree Collapse file tree 4 files changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ You can also check the
1717- Fixes
1818 - Changed component id separator text to be more unique, as it was causing
1919 issues with some cubes that had iris ending with "-"
20+ - Datasets section in the sidebar is now correctly shown at all times
2021
2122# [ 5.0.1] - 2024-11-26
2223
Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ import {
3232 useConfiguratorState ,
3333} from "@/configurator/configurator-state" ;
3434import { DataCubeMetadata } from "@/domain/data" ;
35- import useFlag from "@/flags/useFlag" ;
3635import {
3736 executeDataCubesComponentsQuery ,
3837 useDataCubesMetadataQuery ,
@@ -220,11 +219,6 @@ export const DatasetsControlSection = () => {
220219 setActiveSection ( "general" ) ;
221220 } ;
222221
223- const addDatasetFlag = useFlag ( "configurator.add-dataset.shared" ) ;
224- if ( ! addDatasetFlag ) {
225- return null ;
226- }
227-
228222 return (
229223 < ControlSection collapse defaultExpanded = { true } >
230224 < SubsectionTitle titleId = "controls-data" gutterBottom = { false } >
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const store = new FlagStore();
1212/**
1313 * Public API to use flags
1414 */
15- const flag = function flag ( ...args : [ FlagName ] | [ FlagName , FlagValue ] ) {
15+ export const flag = function flag ( ...args : [ FlagName ] | [ FlagName , FlagValue ] ) {
1616 if ( args . length === 1 ) {
1717 return store . get ( args [ 0 ] ) ;
1818 } else {
@@ -80,18 +80,20 @@ const isVercelPreviewHost = (host: string) => {
8080} ;
8181
8282const initFromHost = ( host : string ) => {
83+ // @ts -ignore
8384 const setDefaultFlag = ( name : FlagName , value : FlagValue ) => {
8485 const flagValue = flag ( name ) ;
86+
8587 if ( flagValue === null ) {
8688 flag ( name , value ) ;
8789 }
8890 } ;
89- if (
91+ const shouldSetDefaultFlags =
9092 host . includes ( "localhost" ) ||
9193 host . includes ( "test.visualize.admin.ch" ) ||
92- isVercelPreviewHost ( host )
93- ) {
94- setDefaultFlag ( "configurator.add-dataset.shared" , true ) ;
94+ isVercelPreviewHost ( host ) ;
95+
96+ if ( shouldSetDefaultFlags ) {
9597 }
9698} ;
9799
@@ -101,5 +103,3 @@ if (isRunningInBrowser()) {
101103 initFromSearchParams ( window . location . search ) ;
102104 initFromHost ( window . location . host ) ;
103105}
104-
105- export { flag } ;
Original file line number Diff line number Diff line change @@ -3,8 +3,6 @@ export type FlagValue = any;
33export type FlagName =
44 /** Whether debug UI like the configurator debug panel is shown */
55 | "debug"
6- /** Whether we can add dataset from shared dimensions */
7- | "configurator.add-dataset.shared"
86 /** Whether server side cache is disabled */
97 | "server-side-cache.disable"
108 /** The GraphQL endpoint, is used for testing purposes */
You can’t perform that action at this time.
0 commit comments