File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,10 +74,29 @@ const initFromSearchParams = (locationSearch: string) => {
7474 }
7575} ;
7676
77+ const isVercelPreviewHost = ( host : string ) => {
78+ return ! ! / v i s u a l i z a t i o n \- t o o l .* i x t 1 \. v e r c e l \. a p p / . exec ( host ) ;
79+ } ;
80+
81+ const initFromHost = ( host : string ) => {
82+ if (
83+ host . includes ( "localhost" ) ||
84+ host . includes ( "test.visualize.admin.ch" ) ||
85+ isVercelPreviewHost ( host )
86+ ) {
87+ flag ( "configurator.add-dataset.new" , true ) ;
88+ flag ( "configurator.add-dataset.shared" , true ) ;
89+ flag ( "layoutor.dashboard.free-canvas" , true ) ;
90+ flag ( "layoutor.dashboard.shared-filters" , true ) ;
91+ flag ( "search.termsets" , true ) ;
92+ }
93+ } ;
94+
7795if ( isRunningInBrowser ( ) ) {
7896 // @ts -ignore
7997 window . flag = flag ;
8098 initFromSearchParams ( window . location . search ) ;
99+ initFromHost ( window . location . host ) ;
81100}
82101
83102export { flag } ;
You can’t perform that action at this time.
0 commit comments