Skip to content

Commit 2d15009

Browse files
AlexTugarevroboquat
authored andcommitted
[dashboard] add switchToPAYG feature flag
1 parent 532513a commit 2d15009

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

components/dashboard/src/contexts/FeatureFlagContext.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const FeatureFlagContext = createContext<{
2323
enablePersonalAccessTokens: boolean;
2424
oidcServiceEnabled: boolean;
2525
orgGitAuthProviders: boolean;
26+
switchToPAYG: boolean;
2627
}>({
2728
startWithOptions: false,
2829
showUsageView: false,
@@ -32,6 +33,7 @@ const FeatureFlagContext = createContext<{
3233
enablePersonalAccessTokens: false,
3334
oidcServiceEnabled: false,
3435
orgGitAuthProviders: false,
36+
switchToPAYG: false,
3537
});
3638

3739
const FeatureFlagContextProvider: React.FC = ({ children }) => {
@@ -47,6 +49,7 @@ const FeatureFlagContextProvider: React.FC = ({ children }) => {
4749
const [usePublicApiWorkspacesService, setUsePublicApiWorkspacesService] = useState<boolean>(false);
4850
const [oidcServiceEnabled, setOidcServiceEnabled] = useState<boolean>(false);
4951
const [orgGitAuthProviders, setOrgGitAuthProviders] = useState<boolean>(false);
52+
const [switchToPAYG, setSwitchToPAYG] = useState<boolean>(false);
5053

5154
useEffect(() => {
5255
if (!user) return;
@@ -63,6 +66,7 @@ const FeatureFlagContextProvider: React.FC = ({ children }) => {
6366
},
6467
oidcServiceEnabled: { defaultValue: false, setter: setOidcServiceEnabled },
6568
orgGitAuthProviders: { defaultValue: false, setter: setOrgGitAuthProviders },
69+
switchToPAYG: { defaultValue: false, setter: setSwitchToPAYG },
6670
};
6771

6872
for (const [flagName, config] of Object.entries(featureFlags)) {
@@ -110,6 +114,7 @@ const FeatureFlagContextProvider: React.FC = ({ children }) => {
110114
usePublicApiWorkspacesService,
111115
oidcServiceEnabled,
112116
orgGitAuthProviders,
117+
switchToPAYG,
113118
}}
114119
>
115120
{children}

0 commit comments

Comments
 (0)