1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-05 17:53:12 +02:00

chore(ui): add a separate feature flag for traffic visibility UI (#6832) (#6835)

## About the changes

cherry-picks adding the UI-flag for traffic visibility to 5.11

We're splitting the original `collectTrafficDataUsage` in two, one for
data collection and the new one introduced here is to allow the UI.

Showing the UI makes no sense if we haven't been collecting data, but
starting to collect data makes sense without showing the UI (docs,
training/information etc needed when showing the UI for enterprise
users), so the feature flag in Unleash is set to depend on data
collecting flag being enabled.
This commit is contained in:
David Leek 2024-04-11 15:22:13 +02:00 committed by GitHub
parent 02951d20e0
commit b701941be7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 2 deletions

View File

@ -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));

View File

@ -76,7 +76,7 @@ export type UiFlags = {
userAccessUIEnabled?: boolean;
outdatedSdksBanner?: boolean;
projectOverviewRefactor?: string;
collectTrafficDataUsage?: boolean;
displayTrafficDataUsage?: boolean;
disableShowContextFieldSelectionValues?: boolean;
variantDependencies?: boolean;
projectOverviewRefactorFeedback?: boolean;

View File

@ -89,6 +89,7 @@ exports[`should create default config 1`] = `
"disableShowContextFieldSelectionValues": false,
"disableUpdateMaxRevisionId": false,
"displayEdgeBanner": false,
"displayTrafficDataUsage": false,
"edgeBulkMetrics": false,
"embedProxy": true,
"embedProxyFrontend": true,

View File

@ -42,6 +42,7 @@ export type IFlagKey =
| 'showInactiveUsers'
| 'inMemoryScheduledChangeRequests'
| 'collectTrafficDataUsage'
| 'displayTrafficDataUsage'
| 'useMemoizedActiveTokens'
| 'queryMissingTokens'
| 'userAccessUIEnabled'
@ -226,6 +227,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,