Skip to content

Commit

Permalink
feature flag cloudflare ca issuer key field (#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
D-B-Hawk authored Dec 13, 2023
1 parent 1ee844e commit 3b8be36
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
24 changes: 14 additions & 10 deletions containers/clusterForms/shared/setupForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ const SetupForm: FunctionComponent = () => {
installType,
values,
clusterMap,
} = useAppSelector(({ api, installation }) => ({
showCloudflareCaIssuerField,
} = useAppSelector(({ api, installation, featureFlags }) => ({
...api,
...installation,
showCloudflareCaIssuerField: featureFlags.flags.showCloudflareCaIssuerField,
}));

const {
Expand Down Expand Up @@ -274,15 +276,17 @@ const SetupForm: FunctionComponent = () => {
onErrorText="Invalid token."
onChange={handleCloudfareToken}
/>
<ControlledPassword
control={control}
name="cloudflareOriginCaIssuerKey"
label="Cloudflare origin ca issuer key"
rules={{
required: false,
}}
onErrorText="Invalid issuer key"
/>
{showCloudflareCaIssuerField && (
<ControlledPassword
control={control}
name="cloudflareOriginCaIssuerKey"
label="Cloudflare origin ca issuer key"
rules={{
required: false,
}}
onErrorText="Invalid issuer key"
/>
)}
</>
)}
<ControlledAutocomplete
Expand Down
1 change: 1 addition & 0 deletions redux/slices/featureFlags.slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const initialState: FeatureFlagsState = {
[FeatureFlag.PROVISION_DO_PYHS_CLUSTERS]: false,
[FeatureFlag.PROVISION_GCP_PYHS_CLUSTERS]: false,
[FeatureFlag.PROVISION_VULTR_PYHS_CLUSTERS]: false,
[FeatureFlag.SHOW_CLOUDFLARE_CA_ISSUER]: false,
},
isLoading: false,
};
Expand Down
1 change: 1 addition & 0 deletions types/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export enum FeatureFlag {
CLUSTER_PROVISIONING = 'cluster-provisioning',
CLUSTER_MANAGEMENT = 'cluster-managament',
MARKETPLACE = 'marketplace',
SHOW_CLOUDFLARE_CA_ISSUER = 'showCloudflareCaIssuerField',
}

export interface EnvironmentVariables {
Expand Down

0 comments on commit 3b8be36

Please sign in to comment.