From 8542cafc9f5e2f64f6c64eb1ba9df0c06e73ada3 Mon Sep 17 00:00:00 2001 From: Jaanus Sellin Date: Wed, 22 May 2024 08:20:11 +0300 Subject: [PATCH] chore: rename toggle to flag #2 (#7097) --- .../integration/feature/feature.spec.ts | 2 +- frontend/cypress/oss/feature/feature.spec.ts | 2 +- .../CreateApiToken/CreateApiToken.tsx | 2 +- .../instance-privacy/InstancePrivacy.tsx | 4 +-- .../ArchiveTable/ArchiveTable.test.tsx | 2 +- .../ArchivedFeatureReviveConfirm.tsx | 4 +-- .../changeRequest/ChangeRequest.test.tsx | 14 ++++----- .../Changes/Change/EditChange.tsx | 4 +-- .../Changes/Change/StrategyChange.tsx | 4 +-- .../ChangeRequestsTabs/ChangeRequestsTabs.tsx | 4 +-- .../changeRequest/UpdateCount.test.tsx | 6 ++-- .../component/changeRequest/UpdateCount.tsx | 2 +- .../FeatureStatusChip/FeatureStatusChip.tsx | 4 +-- .../VariantInfoAlert/VariantInfoAlert.tsx | 2 +- frontend/src/component/demo/demo-topics.tsx | 30 +++++++++---------- .../CreateEnvironment/CreateEnvironment.tsx | 4 +-- .../EditEnvironment/EditEnvironment.tsx | 6 ++-- .../EnvironmentCloneModal.tsx | 6 ++-- .../feature/CreateFeature/CreateFeature.tsx | 18 +++++------ .../CreateFeatureButton.tsx | 4 +-- .../feature/EditFeature/EditFeature.tsx | 12 ++++---- .../feature/FeatureForm/FeatureForm.tsx | 12 ++++---- .../FeatureStrategyEdit.tsx | 4 +-- ...reOverviewSidePanelEnvironmentSwitches.tsx | 2 +- .../FeatureTypeForm/FeatureTypeForm.test.tsx | 6 ++-- .../FeatureTypeForm/FeatureTypeForm.tsx | 22 +++++++------- .../featureTypes/FeatureTypesList.tsx | 6 ++-- .../hooks/useFilteredFlagsSummary.test.ts | 2 +- .../__snapshots__/routes.test.tsx.snap | 6 ++-- frontend/src/component/menu/routes.ts | 6 ++-- .../AdvancedPlaygroundResultsTable.tsx | 6 ++-- .../PlaygroundGuidance/PlaygroundGuidance.tsx | 10 +++---- .../FeatureDetails/FeatureDetails.test.tsx | 14 ++++----- .../FeatureDetails/FeatureDetails.tsx | 14 ++++----- .../EnableEnvironmentDialog.tsx | 8 ++--- .../EditDefaultStrategy.tsx | 2 +- 36 files changed, 128 insertions(+), 128 deletions(-) diff --git a/frontend/cypress/integration/feature/feature.spec.ts b/frontend/cypress/integration/feature/feature.spec.ts index fd3971bdd37..f2b0e5a6772 100644 --- a/frontend/cypress/integration/feature/feature.spec.ts +++ b/frontend/cypress/integration/feature/feature.spec.ts @@ -24,7 +24,7 @@ describe('feature', () => { cy.visit('/features'); }); - it('can create a feature toggle', () => { + it('can create a feature flag', () => { cy.createFeature_UI(featureToggleName, true, projectName); cy.url().should('include', featureToggleName); }); diff --git a/frontend/cypress/oss/feature/feature.spec.ts b/frontend/cypress/oss/feature/feature.spec.ts index 660339d328e..b2996b13f89 100644 --- a/frontend/cypress/oss/feature/feature.spec.ts +++ b/frontend/cypress/oss/feature/feature.spec.ts @@ -17,7 +17,7 @@ describe('feature', () => { cy.visit('/features'); }); - it('can create a feature toggle', () => { + it('can create a feature flag', () => { cy.createFeature_UI(featureToggleName, true, 'default', true); cy.url().should('include', featureToggleName); }); diff --git a/frontend/src/component/admin/apiToken/CreateApiToken/CreateApiToken.tsx b/frontend/src/component/admin/apiToken/CreateApiToken/CreateApiToken.tsx index 236d6a0ca21..e5d30fd576e 100644 --- a/frontend/src/component/admin/apiToken/CreateApiToken/CreateApiToken.tsx +++ b/frontend/src/component/admin/apiToken/CreateApiToken/CreateApiToken.tsx @@ -99,7 +99,7 @@ export const CreateApiToken = ({ modal = false }: ICreateApiTokenProps) => { loading={loading} title={pageTitle} modal={modal} - description="Unleash SDKs use API tokens to authenticate to the Unleash API. Client SDKs need a token with 'client privileges', which allows them to fetch feature toggle configurations and post usage metrics." + description="Unleash SDKs use API tokens to authenticate to the Unleash API. Client SDKs need a token with 'client privileges', which allows them to fetch feature flag configurations and post usage metrics." documentationLink='https://docs.getunleash.io/reference/api-tokens-and-client-keys' documentationLinkLabel='API tokens documentation' formatApiCode={formatApiCode} diff --git a/frontend/src/component/admin/instance-privacy/InstancePrivacy.tsx b/frontend/src/component/admin/instance-privacy/InstancePrivacy.tsx index cc5f80837d2..d4f8812a30a 100644 --- a/frontend/src/component/admin/instance-privacy/InstancePrivacy.tsx +++ b/frontend/src/component/admin/instance-privacy/InstancePrivacy.tsx @@ -36,7 +36,7 @@ const featureCollectionDetails = { infoText: 'We collect data about your instance to improve the Unleash product user experience. We may also use the data in case you need help from our support team. Data collection is for internal use only and is not shared with third parties outside Unleash. As we want you to be in control of your data, we will leave it up to you to allow us to collect your data.', concreteDetails: { - 'Feature flags': 'The number of feature toggles in your instance', + 'Feature flags': 'The number of feature flags in your instance', Users: 'The number of users registered in your instance', Projects: 'The number of projects in your instance', 'Context Fields': 'The number of custom context fields in use', @@ -54,7 +54,7 @@ const featureCollectionDetails = { 'Custom Strategies': 'The number of custom strategies defined in your instance', 'Custom Strategies In Use': - 'The number of custom strategies that are in use by feature toggles', + 'The number of custom strategies that are in use by feature flags', }, }; diff --git a/frontend/src/component/archive/ArchiveTable/ArchiveTable.test.tsx b/frontend/src/component/archive/ArchiveTable/ArchiveTable.test.tsx index 57ac9ba843c..d3c2ee387d4 100644 --- a/frontend/src/component/archive/ArchiveTable/ArchiveTable.test.tsx +++ b/frontend/src/component/archive/ArchiveTable/ArchiveTable.test.tsx @@ -149,6 +149,6 @@ test('should show info box when disableAllEnvsOnRevive flag is on', async () => await screen.findByText('Revive feature flag?'); await screen.findByText( - 'Revived feature toggles will be automatically disabled in all environments', + 'Revived feature flags will be automatically disabled in all environments', ); }); diff --git a/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureReviveConfirm/ArchivedFeatureReviveConfirm.tsx b/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureReviveConfirm/ArchivedFeatureReviveConfirm.tsx index b3a5d996f06..f8c983de8c5 100644 --- a/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureReviveConfirm/ArchivedFeatureReviveConfirm.tsx +++ b/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureReviveConfirm/ArchivedFeatureReviveConfirm.tsx @@ -39,7 +39,7 @@ export const ArchivedFeatureReviveConfirm = ({ setToastData({ type: 'success', title: "And we're back!", - text: 'The feature toggles have been revived.', + text: 'The feature flags have been revived.', }); } catch (error: unknown) { setToastApiError(formatUnknownError(error)); @@ -69,7 +69,7 @@ export const ArchivedFeatureReviveConfirm = ({ onClose={clearModal} > - Revived feature toggles will be automatically disabled in all + Revived feature flags will be automatically disabled in all environments diff --git a/frontend/src/component/changeRequest/ChangeRequest.test.tsx b/frontend/src/component/changeRequest/ChangeRequest.test.tsx index 5ff3346b91f..ed6c83e98ae 100644 --- a/frontend/src/component/changeRequest/ChangeRequest.test.tsx +++ b/frontend/src/component/changeRequest/ChangeRequest.test.tsx @@ -264,11 +264,11 @@ const verifyBannerForPendingChangeRequest = async () => { return screen.findByText('Change request mode', {}, { timeout: 5000 }); }; -const changeToggle = async (environment: string) => { - const featureToggleStatusBox = screen.getByTestId('feature-toggle-status'); - await within(featureToggleStatusBox).findByText(environment); - const toggle = screen.getAllByRole('checkbox')[1]; - fireEvent.click(toggle); +const changeFlag = async (environment: string) => { + const featureFlagStatusBox = screen.getByTestId('feature-flag-status'); + await within(featureFlagStatusBox).findByText(environment); + const flag = screen.getAllByRole('checkbox')[1]; + fireEvent.click(flag); }; const verifyChangeRequestDialog = async (bannerMainText: string) => { @@ -277,7 +277,7 @@ const verifyChangeRequestDialog = async (bannerMainText: string) => { expect(message).toBe(bannerMainText); }; -test('add toggle change to pending change request', async () => { +test('add flag change to pending change request', async () => { setupHttpRoutes({ featureName: 'test', enabled: false }); render( @@ -291,7 +291,7 @@ test('add toggle change to pending change request', async () => { await verifyBannerForPendingChangeRequest(); - await changeToggle('production'); + await changeFlag('production'); await verifyChangeRequestDialog('Enable feature toggle test in production'); }, 10000); diff --git a/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/EditChange.tsx b/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/EditChange.tsx index 97c32245a7c..d6cf55842c3 100644 --- a/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/EditChange.tsx +++ b/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/EditChange.tsx @@ -217,8 +217,8 @@ export const formatUpdateStrategyApiCode = ( }; export const featureStrategyHelp = ` - An activation strategy will only run when a feature toggle is enabled and provides a way to control who will get access to the feature. - If any of a feature toggle's activation strategies returns true, the user will get access. + An activation strategy will only run when a feature flag is enabled and provides a way to control who will get access to the feature. + If any of a feature flag's activation strategies returns true, the user will get access. `; export const featureStrategyDocsLink = diff --git a/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/StrategyChange.tsx b/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/StrategyChange.tsx index c52471a109e..dd2e5d5d5c5 100644 --- a/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/StrategyChange.tsx +++ b/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/StrategyChange.tsx @@ -67,7 +67,7 @@ const DisabledEnabledState: VFC<{ show?: boolean; disabled: boolean }> = ({ if (disabled) { return ( @@ -80,7 +80,7 @@ const DisabledEnabledState: VFC<{ show?: boolean; disabled: boolean }> = ({ return ( diff --git a/frontend/src/component/changeRequest/ProjectChangeRequests/ChangeRequestsTabs/ChangeRequestsTabs.tsx b/frontend/src/component/changeRequest/ProjectChangeRequests/ChangeRequestsTabs/ChangeRequestsTabs.tsx index a19bbfe1a66..fcb3af24152 100644 --- a/frontend/src/component/changeRequest/ProjectChangeRequests/ChangeRequestsTabs/ChangeRequestsTabs.tsx +++ b/frontend/src/component/changeRequest/ProjectChangeRequests/ChangeRequestsTabs/ChangeRequestsTabs.tsx @@ -118,8 +118,8 @@ export const ChangeRequestsTabs = ({ Cell: ChangeRequestTitleCell, }, { - id: 'Updated feature toggles', - Header: 'Updated feature toggles', + id: 'Updated feature flags', + Header: 'Updated feature flags', canSort: false, accessor: 'features', searchable: true, diff --git a/frontend/src/component/changeRequest/UpdateCount.test.tsx b/frontend/src/component/changeRequest/UpdateCount.test.tsx index 15b2c7e2ab8..3a7c79bd415 100644 --- a/frontend/src/component/changeRequest/UpdateCount.test.tsx +++ b/frontend/src/component/changeRequest/UpdateCount.test.tsx @@ -5,20 +5,20 @@ import { screen } from '@testing-library/react'; test('Show only features count when no segments', async () => { render(); - expect(screen.getByText('1 feature toggle')).toBeInTheDocument(); + expect(screen.getByText('1 feature flag')).toBeInTheDocument(); expect(screen.queryByText('0 segments')).not.toBeInTheDocument(); }); test('Show features and segments count', async () => { render(); - expect(screen.getByText('0 feature toggles')).toBeInTheDocument(); + expect(screen.getByText('0 feature flags')).toBeInTheDocument(); expect(screen.getByText('1 segment')).toBeInTheDocument(); }); test('Show features and segments plural count', async () => { render(); - expect(screen.getByText('2 feature toggles')).toBeInTheDocument(); + expect(screen.getByText('2 feature flags')).toBeInTheDocument(); expect(screen.getByText('3 segments')).toBeInTheDocument(); }); diff --git a/frontend/src/component/changeRequest/UpdateCount.tsx b/frontend/src/component/changeRequest/UpdateCount.tsx index b8dfe0b192f..e6a45d118a3 100644 --- a/frontend/src/component/changeRequest/UpdateCount.tsx +++ b/frontend/src/component/changeRequest/UpdateCount.tsx @@ -14,7 +14,7 @@ export const UpdateCount: FC<{ display='inline' > {featuresCount}{' '} - {featuresCount === 1 ? 'feature toggle' : 'feature toggles'} + {featuresCount === 1 ? 'feature flag' : 'feature flags'} 0} diff --git a/frontend/src/component/common/FeatureStatusChip/FeatureStatusChip.tsx b/frontend/src/component/common/FeatureStatusChip/FeatureStatusChip.tsx index 8657f3de52b..befa7f5b20e 100644 --- a/frontend/src/component/common/FeatureStatusChip/FeatureStatusChip.tsx +++ b/frontend/src/component/common/FeatureStatusChip/FeatureStatusChip.tsx @@ -14,8 +14,8 @@ export const FeatureStatusChip = ({ } const title = stale - ? 'Feature toggle is deprecated.' - : 'Feature toggle is active.'; + ? 'Feature flag is deprecated.' + : 'Feature flag is active.'; const value = stale ? 'Stale' : 'Active'; return ( diff --git a/frontend/src/component/common/VariantInfoAlert/VariantInfoAlert.tsx b/frontend/src/component/common/VariantInfoAlert/VariantInfoAlert.tsx index b0ed1dcebfc..2b8fc5a829f 100644 --- a/frontend/src/component/common/VariantInfoAlert/VariantInfoAlert.tsx +++ b/frontend/src/component/common/VariantInfoAlert/VariantInfoAlert.tsx @@ -14,7 +14,7 @@ export const VariantInfoAlert: FC<{ mode: 'feature' | 'strategy' }> = ({ Variant allows you to return a variant object if the{' '} {mode === 'feature' - ? 'feature toggle is considered enabled ' + ? 'feature flag is considered enabled ' : 'this strategy is active '} for the current request. When using variants you should use the{' '} getVariant() method in the Client SDK. diff --git a/frontend/src/component/demo/demo-topics.tsx b/frontend/src/component/demo/demo-topics.tsx index 8be85e7e57e..47e1b5343c7 100644 --- a/frontend/src/component/demo/demo-topics.tsx +++ b/frontend/src/component/demo/demo-topics.tsx @@ -37,7 +37,7 @@ const ENVIRONMENT = 'dev'; export const TOPICS: ITutorialTopic[] = [ { - title: 'Enable/disable a feature toggle', + title: 'Enable/disable a feature flag', steps: [ { href: `/projects/${PROJECT}?sort=name`, @@ -51,12 +51,12 @@ export const TOPICS: ITutorialTopic[] = [ target='_blank' rel='noreferrer' > - Feature toggles + Feature flags {' '} are the central concept of Unleash. - Feature toggles are organized within{' '} + Feature flags are organized within{' '} - Let's try enabling a feature toggle only for a + Let's try enabling a feature flag only for a specific user. @@ -122,7 +122,7 @@ export const TOPICS: ITutorialTopic[] = [ target: `a[href="${basePath}/projects/${PROJECT}/features/demoApp.step2"]`, content: ( - First, open the feature toggle configuration for{' '} + First, open the feature flag configuration for{' '} demoApp.step2 by using this link. @@ -182,7 +182,7 @@ export const TOPICS: ITutorialTopic[] = [ > activation strategy {' '} - to be evaluated for a feature toggle. + to be evaluated for a feature flag. Add a constraint by using this button. @@ -204,7 +204,7 @@ export const TOPICS: ITutorialTopic[] = [ Unleash context {' '} contains information relating to the current feature - toggle request. + flag request. Select the context field by using this dropdown. @@ -335,8 +335,8 @@ export const TOPICS: ITutorialTopic[] = [ . - Let's try enabling a feature toggle only for a - certain percentage of users. + Let's try enabling a feature flag only for a certain + percentage of users. ), @@ -347,7 +347,7 @@ export const TOPICS: ITutorialTopic[] = [ target: `a[href="${basePath}/projects/${PROJECT}/features/demoApp.step3"]`, content: ( - First, open the feature toggle configuration for{' '} + First, open the feature flag configuration for{' '} demoApp.step3 by using this link. @@ -447,8 +447,8 @@ export const TOPICS: ITutorialTopic[] = [ Strategy variants {' '} allow you to define different values for a feature - toggle. They can be used for A/B testing or - segmenting your users. + flag. They can be used for A/B testing or segmenting + your users. Let's try adding a variant to a strategy. @@ -462,7 +462,7 @@ export const TOPICS: ITutorialTopic[] = [ target: `a[href="${basePath}/projects/${PROJECT}/features/demoApp.step4"]`, content: ( - First, open the feature toggle configuration for{' '} + First, open the feature flag configuration for{' '} demoApp.step4 by using this link. @@ -510,7 +510,7 @@ export const TOPICS: ITutorialTopic[] = [ > activation strategy {' '} - to be evaluated for a feature toggle. + to be evaluated for a feature flag. Add a constraint by using this button. @@ -532,7 +532,7 @@ export const TOPICS: ITutorialTopic[] = [ Unleash context {' '} contains information relating to the current feature - toggle request. + flag request. Select the context field by using this dropdown. diff --git a/frontend/src/component/environments/CreateEnvironment/CreateEnvironment.tsx b/frontend/src/component/environments/CreateEnvironment/CreateEnvironment.tsx index 6f86e5c28fa..cf27a543d12 100644 --- a/frontend/src/component/environments/CreateEnvironment/CreateEnvironment.tsx +++ b/frontend/src/component/environments/CreateEnvironment/CreateEnvironment.tsx @@ -79,12 +79,12 @@ const CreateEnvironment = () => { description='Environments allow you to manage your product lifecycle from local development through production. Your projects and - feature toggles are accessible in all your + feature flags are accessible in all your environments, but they can take different configurations per environment. This means that you can enable a feature toggle in a development or test environment without - enabling the feature toggle in the + enabling the feature flag in the production environment.' documentationLink='https://docs.getunleash.io/reference/environments' documentationLinkLabel='Environments documentation' diff --git a/frontend/src/component/environments/EditEnvironment/EditEnvironment.tsx b/frontend/src/component/environments/EditEnvironment/EditEnvironment.tsx index 70cb5059792..8a6d2d5a5cf 100644 --- a/frontend/src/component/environments/EditEnvironment/EditEnvironment.tsx +++ b/frontend/src/component/environments/EditEnvironment/EditEnvironment.tsx @@ -66,12 +66,12 @@ const EditEnvironment = () => { description='Environments allow you to manage your product lifecycle from local development through production. Your projects and - feature toggles are accessible in all your + feature flags are accessible in all your environments, but they can take different configurations per environment. This means - that you can enable a feature toggle in a + that you can enable a feature flag in a development or test environment without - enabling the feature toggle in the + enabling the feature flag in the production environment.' documentationLink='https://docs.getunleash.io/reference/environments' documentationLinkLabel='Environments documentation' diff --git a/frontend/src/component/environments/EnvironmentTable/EnvironmentActionCell/EnvironmentCloneModal/EnvironmentCloneModal.tsx b/frontend/src/component/environments/EnvironmentTable/EnvironmentActionCell/EnvironmentCloneModal/EnvironmentCloneModal.tsx index f3782c739ea..ffca6514a1b 100644 --- a/frontend/src/component/environments/EnvironmentTable/EnvironmentActionCell/EnvironmentCloneModal/EnvironmentCloneModal.tsx +++ b/frontend/src/component/environments/EnvironmentTable/EnvironmentActionCell/EnvironmentCloneModal/EnvironmentCloneModal.tsx @@ -237,7 +237,7 @@ export const EnvironmentCloneModal = ({ loading={loading} modal title={`Clone ${environment.name} environment`} - description='Cloning an environment will clone all feature toggles and their configuration (activation strategies, segments, status, etc) into a new environment.' + description='Cloning an environment will clone all feature flags and their configuration (activation strategies, segments, status, etc) into a new environment.' documentationLink='https://docs.getunleash.io/reference/environments#cloning-environments' documentationLinkLabel='Cloning environments documentation' formatApiCode={formatApiCode} @@ -267,7 +267,7 @@ export const EnvironmentCloneModal = ({ Select which projects you want to clone the environment configuration in? - + If you turn it off, the permission for this - environment across all projects and feature toggles + environment across all projects and feature flags will remain only for admin and editor roles. { return ( - Feature toggle project limit reached. {' '} - To be able to create more feature toggles in this - project please increase the feature toggle upper limit - in the project settings. + Feature flag project limit reached. To + be able to create more feature flags in this project + please increase the feature flag upper limit in the + project settings. } /> @@ -144,7 +144,7 @@ const CreateFeature = () => { featureNaming={projectInfo.featureNaming} > @@ -58,7 +58,7 @@ export const CreateFeatureButton = ({ data-testid={NAVIGATE_TO_CREATE_FEATURE} className={classnames({ skeleton: loading })} > - New feature toggle + New feature flag } /> diff --git a/frontend/src/component/feature/EditFeature/EditFeature.tsx b/frontend/src/component/feature/EditFeature/EditFeature.tsx index 5d51c57d145..993809773e7 100644 --- a/frontend/src/component/feature/EditFeature/EditFeature.tsx +++ b/frontend/src/component/feature/EditFeature/EditFeature.tsx @@ -19,7 +19,7 @@ const EditFeature = () => { const { setToastData, setToastApiError } = useToast(); const { uiConfig } = useUiConfig(); const navigate = useNavigate(); - const { patchFeatureToggle, loading } = useFeatureApi(); + const { patchFeatureToggle: patchFeatureFlag, loading } = useFeatureApi(); const { feature } = useFeature(projectId, featureId); const { @@ -54,7 +54,7 @@ const EditFeature = () => { clearErrors(); const patch = createPatch(); try { - await patchFeatureToggle(project, featureId, patch); + await patchFeatureFlag(project, featureId, patch); navigate(`/projects/${project}/features/${name}`); setToastData({ title: 'Toggle updated successfully', @@ -81,11 +81,11 @@ const EditFeature = () => { return ( = ({ const editable = mode !== 'Edit'; const renderToggleDescription = () => { - return featureTypes.find((toggle) => toggle.id === type)?.description; + return featureTypes.find((flag) => flag.id === type)?.description; }; const displayFeatureNamingInfo = Boolean(featureNaming?.pattern); @@ -138,7 +138,7 @@ const FeatureForm: React.FC = ({ return ( - What would you like to call your toggle? + What would you like to call your flag? = ({ ? 'feature-naming-pattern-info' : undefined } - id='feature-toggle-name' + id='feature-flag-name' error={Boolean(errors.name)} errorText={errors.name} onFocus={() => clearErrors()} @@ -212,7 +212,7 @@ const FeatureForm: React.FC = ({ multiline rows={4} label='Description' - placeholder='A short description of the feature toggle' + placeholder='A short description of the feature flag' value={description} data-testid={CF_DESC_ID} onChange={(e) => setDescription(e.target.value)} @@ -227,9 +227,9 @@ const FeatureForm: React.FC = ({ Impression Data

- When you enable impression data for a feature toggle, your + When you enable impression data for a feature flag, your client SDKs will emit events you can listen for every time - this toggle gets triggered. Learn more in{' '} + this flag gets triggered. Learn more in{' '} environment.enabled && environment.variants?.length, ); return ( - + {header} {feature.environments.map((environment) => { const strategiesLabel = diff --git a/frontend/src/component/featureTypes/FeatureTypeEdit/FeatureTypeForm/FeatureTypeForm.test.tsx b/frontend/src/component/featureTypes/FeatureTypeEdit/FeatureTypeForm/FeatureTypeForm.test.tsx index c06a0a70568..bddaebd1565 100644 --- a/frontend/src/component/featureTypes/FeatureTypeEdit/FeatureTypeForm/FeatureTypeForm.test.tsx +++ b/frontend/src/component/featureTypes/FeatureTypeEdit/FeatureTypeForm/FeatureTypeForm.test.tsx @@ -14,7 +14,7 @@ describe('FeatureTypeForm', () => { render( , ); - expect(screen.getByText('Edit toggle type: Test')).toBeInTheDocument(); + expect(screen.getByText('Edit flag type: Test')).toBeInTheDocument(); expect(screen.getByText('Expected lifetime')).toBeInTheDocument(); }); @@ -29,7 +29,7 @@ describe('FeatureTypeForm', () => { ); expect(screen.getByLabelText('Expected lifetime')).toBeDisabled(); expect(screen.getByLabelText("doesn't expire")).toBeDisabled(); - expect(screen.getByText('Save feature toggle type')).toBeDisabled(); + expect(screen.getByText('Save feature flag type')).toBeDisabled(); }); it('should check "doesn\'t expire" when lifetime is 0', () => { @@ -87,6 +87,6 @@ describe('FeatureTypeForm', () => { loading={false} />, ); - expect(screen.getByText('Save feature toggle type')).toBeDisabled(); + expect(screen.getByText('Save feature flag type')).toBeDisabled(); }); }); diff --git a/frontend/src/component/featureTypes/FeatureTypeEdit/FeatureTypeForm/FeatureTypeForm.tsx b/frontend/src/component/featureTypes/FeatureTypeEdit/FeatureTypeForm/FeatureTypeForm.tsx index 812be3ce8b5..8c874cb9a50 100644 --- a/frontend/src/component/featureTypes/FeatureTypeEdit/FeatureTypeForm/FeatureTypeForm.tsx +++ b/frontend/src/component/featureTypes/FeatureTypeEdit/FeatureTypeForm/FeatureTypeForm.tsx @@ -76,7 +76,7 @@ export const FeatureTypeForm: VFC = ({ e.preventDefault(); try { if (!featureType?.id) - throw new Error('No feature toggle type loaded'); + throw new Error('No feature flag type loaded'); const value = doesntExpire ? 0 : lifetime; await updateFeatureTypeLifetime(featureType.id, value); @@ -121,12 +121,12 @@ export const FeatureTypeForm: VFC = ({ modal title={ loading - ? 'Edit toggle type' - : `Edit toggle type: ${featureType?.name}` + ? 'Edit flag type' + : `Edit flag type: ${featureType?.name}` } description={featureType?.description || ''} documentationLink='https://docs.getunleash.io/reference/feature-toggle-types' - documentationLinkLabel='Feature toggle types documentation' + documentationLinkLabel='Feature flag types documentation' formatApiCode={formatApiCode} > @@ -137,7 +137,7 @@ export const FeatureTypeForm: VFC = ({ alignItems: 'center', })} > - + Expected lifetime = ({ tooltip={ <>

- If your toggle exceeds the expected lifetime - of its toggle type it will be marked as + If your flag exceeds the expected lifetime + of its flag type it will be marked as potentially stale.


@@ -170,11 +170,11 @@ export const FeatureTypeForm: VFC = ({ marginBottom: theme.spacing(1), marginRight: 'auto', })} - htmlFor='feature-toggle-expire' + htmlFor='feature-flag-expire' > @@ -185,7 +185,7 @@ export const FeatureTypeForm: VFC = ({ disabled={doesntExpire || loading} type='number' label='Lifetime in days' - id='feature-toggle-lifetime' + id='feature-flag-lifetime' value={doesntExpire ? '0' : `${lifetime}`} onChange={onChangeLifetime} error={isIncorrect} @@ -198,7 +198,7 @@ export const FeatureTypeForm: VFC = ({ type='submit' disabled={loading || actionLoading} > - Save feature toggle type + Save feature flag type