Skip to content

Commit

Permalink
Fix: breadcrumb feature flag priority order (#804)
Browse files Browse the repository at this point in the history
* chore: feature flag priority order

Signed-off-by: Frank Flitton <[email protected]>

* chore: version bump

Signed-off-by: Frank Flitton <[email protected]>

* chore: add to helper fns

Signed-off-by: Frank Flitton <[email protected]>

---------

Signed-off-by: Frank Flitton <[email protected]>
  • Loading branch information
FrankFlitton authored Jul 26, 2023
1 parent 36311eb commit 801cb81
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/console/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flyteorg/console",
"version": "0.0.46",
"version": "0.0.47",
"description": "Flyteconsole main app module",
"main": "./dist/index.js",
"module": "./lib/index.js",
Expand Down
9 changes: 6 additions & 3 deletions packages/console/src/basics/FeatureFlags/FeatureFlags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const search: string = window.location.search || '';
// To turn on flag for local development only - update flag value here
// REMOVE change prior to commit
let runtimeConfig: FeatureFlagConfig = {
...defaultFlagConfig,
...getSearchParamFlags(search),
// 'test-flag-true': true, <== locally turns flag on
};
Expand Down Expand Up @@ -83,7 +82,11 @@ export const FeatureFlagsProvider = (props: FeatureFlagProviderProps) => {

const setFeatureFlag = useCallback((flag: FeatureFlag, newValue: boolean) => {
runtimeConfig[flag] = newValue;
setFlags({ ...defaultFlagConfig, ...runtimeConfig });
setFlags({
...defaultFlagConfig,
...props.externalFlags,
...runtimeConfig,
});
}, []);

const getFeatureFlag = useCallback(
Expand All @@ -97,7 +100,7 @@ export const FeatureFlagsProvider = (props: FeatureFlagProviderProps) => {
);

const clearRuntimeConfig = useCallback(() => {
runtimeConfig = { ...defaultFlagConfig };
runtimeConfig = { ...defaultFlagConfig, ...props.externalFlags };
}, []);

useEffect(() => {
Expand Down
4 changes: 2 additions & 2 deletions packages/console/src/components/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ export const AppComponent: React.FC<AppComponentProps> = (
<FeatureFlagsProvider
externalFlags={{
...props.env,
breadcrumbs: breadcrumbsFlag,
'horizontal-layout': horizontalLayoutFlag,
breadcrumbs: `${breadcrumbsFlag}`,
'horizontal-layout': `${horizontalLayoutFlag}`,
}}
>
<GlobalStyles />
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"dependencies": {
"@flyteorg/common": "^0.0.4",
"@flyteorg/console": "^0.0.46",
"@flyteorg/console": "^0.0.47",
"long": "^4.0.0",
"protobufjs": "~6.11.3",
"react-ga4": "^1.4.1",
Expand Down

0 comments on commit 801cb81

Please sign in to comment.