Skip to content

Commit

Permalink
chore(ui): add a separate feature flag for traffic visibility UI (#6832)
Browse files Browse the repository at this point in the history
## About the changes

Adds a separate feature flag for the traffic data usage UI
  • Loading branch information
daveleek authored Apr 11, 2024
1 parent a979ad8 commit 88b5bfc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ export const NetworkTrafficUsage: VFC = () => {
};

const { isOss } = useUiConfig();
const flagEnabled = useUiFlag('collectTrafficDataUsage');
const flagEnabled = useUiFlag('displayTrafficDataUsage');

useEffect(() => {
setDatasets(toChartData(labels, traffic, endpointsInfo));
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/interfaces/uiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export type UiFlags = {
userAccessUIEnabled?: boolean;
outdatedSdksBanner?: boolean;
projectOverviewRefactor?: string;
collectTrafficDataUsage?: boolean;
displayTrafficDataUsage?: boolean;
disableShowContextFieldSelectionValues?: boolean;
variantDependencies?: boolean;
projectOverviewRefactorFeedback?: boolean;
Expand Down
1 change: 1 addition & 0 deletions src/lib/__snapshots__/create-config.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ exports[`should create default config 1`] = `
"disableShowContextFieldSelectionValues": false,
"disableUpdateMaxRevisionId": false,
"displayEdgeBanner": false,
"displayTrafficDataUsage": false,
"edgeBulkMetrics": false,
"embedProxy": true,
"embedProxyFrontend": true,
Expand Down
5 changes: 5 additions & 0 deletions src/lib/types/experimental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export type IFlagKey =
| 'showInactiveUsers'
| 'inMemoryScheduledChangeRequests'
| 'collectTrafficDataUsage'
| 'displayTrafficDataUsage'
| 'useMemoizedActiveTokens'
| 'queryMissingTokens'
| 'userAccessUIEnabled'
Expand Down Expand Up @@ -223,6 +224,10 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_COLLECT_TRAFFIC_DATA_USAGE,
false,
),
displayTrafficDataUsage: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_DISPLAY_TRAFFIC_DATA_USAGE,
false,
),
userAccessUIEnabled: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_USER_ACCESS_UI_ENABLED,
false,
Expand Down

0 comments on commit 88b5bfc

Please sign in to comment.