Skip to content

Commit 0379dda

Browse files
easyCZroboquat
authored andcommitted
[dashboard] Add feature flag to use Public API Workspaces Service
1 parent b19357f commit 0379dda

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

components/dashboard/src/contexts/FeatureFlagContext.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@ const FeatureFlagContext = createContext<{
2121
showUseLastSuccessfulPrebuild: boolean;
2222
usePublicApiTeamsService: boolean;
2323
usePublicApiProjectsService: boolean;
24+
usePublicApiWorkspacesService: boolean;
2425
enablePersonalAccessTokens: boolean;
2526
}>({
2627
showUsageView: false,
2728
isUsageBasedBillingEnabled: false,
2829
showUseLastSuccessfulPrebuild: false,
2930
usePublicApiTeamsService: false,
3031
usePublicApiProjectsService: false,
32+
usePublicApiWorkspacesService: false,
3133
enablePersonalAccessTokens: false,
3234
});
3335

@@ -43,6 +45,7 @@ const FeatureFlagContextProvider: React.FC = ({ children }) => {
4345
const [usePublicApiTeamsService, setUsePublicApiTeamsService] = useState<boolean>(false);
4446
const [usePublicApiProjectsService, setUsePublicApiProjectsService] = useState<boolean>(false);
4547
const [enablePersonalAccessTokens, setPersonalAccessTokensEnabled] = useState<boolean>(false);
48+
const [usePublicApiWorkspacesService, setUsePublicApiWorkspacesService] = useState<boolean>(false);
4649

4750
useEffect(() => {
4851
if (!user) return;
@@ -54,6 +57,10 @@ const FeatureFlagContextProvider: React.FC = ({ children }) => {
5457
publicApiExperimentalTeamsService: { defaultValue: false, setter: setUsePublicApiTeamsService },
5558
publicApiExperimentalProjectsService: { defaultValue: false, setter: setUsePublicApiProjectsService },
5659
personalAccessTokensEnabled: { defaultValue: false, setter: setPersonalAccessTokensEnabled },
60+
publicApiExperimentalWorkspaceService: {
61+
defaultValue: false,
62+
setter: setUsePublicApiWorkspacesService,
63+
},
5764
};
5865

5966
for (const [flagName, config] of Object.entries(featureFlags)) {
@@ -99,6 +106,7 @@ const FeatureFlagContextProvider: React.FC = ({ children }) => {
99106
usePublicApiTeamsService,
100107
enablePersonalAccessTokens,
101108
usePublicApiProjectsService,
109+
usePublicApiWorkspacesService,
102110
}}
103111
>
104112
{children}

0 commit comments

Comments
 (0)