Skip to content

Commit 07a3294

Browse files
authored
Merge pull request #1925 from visualize-admin/fix/remove-merging-of-cubes-flag
fix: Missing datasets section
2 parents e918dd0 + 902edd0 commit 07a3294

File tree

4 files changed

+8
-15
lines changed

4 files changed

+8
-15
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

app/configurator/components/dataset-control-section.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import {
3232
useConfiguratorState,
3333
} from "@/configurator/configurator-state";
3434
import { DataCubeMetadata } from "@/domain/data";
35-
import useFlag from "@/flags/useFlag";
3635
import {
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}>

app/flags/flag.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff 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

8282
const 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 };

app/flags/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ export type FlagValue = any;
33
export 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 */

0 commit comments

Comments
 (0)