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

chore: rename toggle to flag #2 (#7097)

This commit is contained in:
Jaanus Sellin 2024-05-22 08:20:11 +03:00 committed by GitHub
parent ce67c4d944
commit 8542cafc9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
36 changed files with 128 additions and 128 deletions

View File

@ -24,7 +24,7 @@ describe('feature', () => {
cy.visit('/features'); cy.visit('/features');
}); });
it('can create a feature toggle', () => { it('can create a feature flag', () => {
cy.createFeature_UI(featureToggleName, true, projectName); cy.createFeature_UI(featureToggleName, true, projectName);
cy.url().should('include', featureToggleName); cy.url().should('include', featureToggleName);
}); });

View File

@ -17,7 +17,7 @@ describe('feature', () => {
cy.visit('/features'); cy.visit('/features');
}); });
it('can create a feature toggle', () => { it('can create a feature flag', () => {
cy.createFeature_UI(featureToggleName, true, 'default', true); cy.createFeature_UI(featureToggleName, true, 'default', true);
cy.url().should('include', featureToggleName); cy.url().should('include', featureToggleName);
}); });

View File

@ -99,7 +99,7 @@ export const CreateApiToken = ({ modal = false }: ICreateApiTokenProps) => {
loading={loading} loading={loading}
title={pageTitle} title={pageTitle}
modal={modal} 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' documentationLink='https://docs.getunleash.io/reference/api-tokens-and-client-keys'
documentationLinkLabel='API tokens documentation' documentationLinkLabel='API tokens documentation'
formatApiCode={formatApiCode} formatApiCode={formatApiCode}

View File

@ -36,7 +36,7 @@ const featureCollectionDetails = {
infoText: 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.', '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: { 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', Users: 'The number of users registered in your instance',
Projects: 'The number of projects in your instance', Projects: 'The number of projects in your instance',
'Context Fields': 'The number of custom context fields in use', 'Context Fields': 'The number of custom context fields in use',
@ -54,7 +54,7 @@ const featureCollectionDetails = {
'Custom Strategies': 'Custom Strategies':
'The number of custom strategies defined in your instance', 'The number of custom strategies defined in your instance',
'Custom Strategies In Use': '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',
}, },
}; };

View File

@ -149,6 +149,6 @@ test('should show info box when disableAllEnvsOnRevive flag is on', async () =>
await screen.findByText('Revive feature flag?'); await screen.findByText('Revive feature flag?');
await screen.findByText( await screen.findByText(
'Revived feature toggles will be automatically disabled in all environments', 'Revived feature flags will be automatically disabled in all environments',
); );
}); });

View File

@ -39,7 +39,7 @@ export const ArchivedFeatureReviveConfirm = ({
setToastData({ setToastData({
type: 'success', type: 'success',
title: "And we're back!", title: "And we're back!",
text: 'The feature toggles have been revived.', text: 'The feature flags have been revived.',
}); });
} catch (error: unknown) { } catch (error: unknown) {
setToastApiError(formatUnknownError(error)); setToastApiError(formatUnknownError(error));
@ -69,7 +69,7 @@ export const ArchivedFeatureReviveConfirm = ({
onClose={clearModal} onClose={clearModal}
> >
<Alert severity='info'> <Alert severity='info'>
Revived feature toggles will be automatically disabled in all Revived feature flags will be automatically disabled in all
environments environments
</Alert> </Alert>

View File

@ -264,11 +264,11 @@ const verifyBannerForPendingChangeRequest = async () => {
return screen.findByText('Change request mode', {}, { timeout: 5000 }); return screen.findByText('Change request mode', {}, { timeout: 5000 });
}; };
const changeToggle = async (environment: string) => { const changeFlag = async (environment: string) => {
const featureToggleStatusBox = screen.getByTestId('feature-toggle-status'); const featureFlagStatusBox = screen.getByTestId('feature-flag-status');
await within(featureToggleStatusBox).findByText(environment); await within(featureFlagStatusBox).findByText(environment);
const toggle = screen.getAllByRole('checkbox')[1]; const flag = screen.getAllByRole('checkbox')[1];
fireEvent.click(toggle); fireEvent.click(flag);
}; };
const verifyChangeRequestDialog = async (bannerMainText: string) => { const verifyChangeRequestDialog = async (bannerMainText: string) => {
@ -277,7 +277,7 @@ const verifyChangeRequestDialog = async (bannerMainText: string) => {
expect(message).toBe(bannerMainText); 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 }); setupHttpRoutes({ featureName: 'test', enabled: false });
render( render(
@ -291,7 +291,7 @@ test('add toggle change to pending change request', async () => {
await verifyBannerForPendingChangeRequest(); await verifyBannerForPendingChangeRequest();
await changeToggle('production'); await changeFlag('production');
await verifyChangeRequestDialog('Enable feature toggle test in production'); await verifyChangeRequestDialog('Enable feature toggle test in production');
}, 10000); }, 10000);

View File

@ -217,8 +217,8 @@ export const formatUpdateStrategyApiCode = (
}; };
export const featureStrategyHelp = ` 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. 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 toggle's activation strategies returns true, the user will get access. If any of a feature flag's activation strategies returns true, the user will get access.
`; `;
export const featureStrategyDocsLink = export const featureStrategyDocsLink =

View File

@ -67,7 +67,7 @@ const DisabledEnabledState: VFC<{ show?: boolean; disabled: boolean }> = ({
if (disabled) { if (disabled) {
return ( return (
<Tooltip <Tooltip
title='This strategy will not be taken into account when evaluating feature toggle.' title='This strategy will not be taken into account when evaluating feature flag.'
arrow arrow
sx={{ cursor: 'pointer' }} sx={{ cursor: 'pointer' }}
> >
@ -80,7 +80,7 @@ const DisabledEnabledState: VFC<{ show?: boolean; disabled: boolean }> = ({
return ( return (
<Tooltip <Tooltip
title='This was disabled before and with this change it will be taken into account when evaluating feature toggle.' title='This was disabled before and with this change it will be taken into account when evaluating feature flag.'
arrow arrow
sx={{ cursor: 'pointer' }} sx={{ cursor: 'pointer' }}
> >

View File

@ -118,8 +118,8 @@ export const ChangeRequestsTabs = ({
Cell: ChangeRequestTitleCell, Cell: ChangeRequestTitleCell,
}, },
{ {
id: 'Updated feature toggles', id: 'Updated feature flags',
Header: 'Updated feature toggles', Header: 'Updated feature flags',
canSort: false, canSort: false,
accessor: 'features', accessor: 'features',
searchable: true, searchable: true,

View File

@ -5,20 +5,20 @@ import { screen } from '@testing-library/react';
test('Show only features count when no segments', async () => { test('Show only features count when no segments', async () => {
render(<UpdateCount featuresCount={1} segmentsCount={0} />); render(<UpdateCount featuresCount={1} segmentsCount={0} />);
expect(screen.getByText('1 feature toggle')).toBeInTheDocument(); expect(screen.getByText('1 feature flag')).toBeInTheDocument();
expect(screen.queryByText('0 segments')).not.toBeInTheDocument(); expect(screen.queryByText('0 segments')).not.toBeInTheDocument();
}); });
test('Show features and segments count', async () => { test('Show features and segments count', async () => {
render(<UpdateCount featuresCount={0} segmentsCount={1} />); render(<UpdateCount featuresCount={0} segmentsCount={1} />);
expect(screen.getByText('0 feature toggles')).toBeInTheDocument(); expect(screen.getByText('0 feature flags')).toBeInTheDocument();
expect(screen.getByText('1 segment')).toBeInTheDocument(); expect(screen.getByText('1 segment')).toBeInTheDocument();
}); });
test('Show features and segments plural count', async () => { test('Show features and segments plural count', async () => {
render(<UpdateCount featuresCount={2} segmentsCount={3} />); render(<UpdateCount featuresCount={2} segmentsCount={3} />);
expect(screen.getByText('2 feature toggles')).toBeInTheDocument(); expect(screen.getByText('2 feature flags')).toBeInTheDocument();
expect(screen.getByText('3 segments')).toBeInTheDocument(); expect(screen.getByText('3 segments')).toBeInTheDocument();
}); });

View File

@ -14,7 +14,7 @@ export const UpdateCount: FC<{
display='inline' display='inline'
> >
{featuresCount}{' '} {featuresCount}{' '}
{featuresCount === 1 ? 'feature toggle' : 'feature toggles'} {featuresCount === 1 ? 'feature flag' : 'feature flags'}
</Typography> </Typography>
<ConditionallyRender <ConditionallyRender
condition={segmentsCount > 0} condition={segmentsCount > 0}

View File

@ -14,8 +14,8 @@ export const FeatureStatusChip = ({
} }
const title = stale const title = stale
? 'Feature toggle is deprecated.' ? 'Feature flag is deprecated.'
: 'Feature toggle is active.'; : 'Feature flag is active.';
const value = stale ? 'Stale' : 'Active'; const value = stale ? 'Stale' : 'Active';
return ( return (

View File

@ -14,7 +14,7 @@ export const VariantInfoAlert: FC<{ mode: 'feature' | 'strategy' }> = ({
<StyledAlert severity='info'> <StyledAlert severity='info'>
Variant allows you to return a variant object if the{' '} Variant allows you to return a variant object if the{' '}
{mode === 'feature' {mode === 'feature'
? 'feature toggle is considered enabled ' ? 'feature flag is considered enabled '
: 'this strategy is active '} : 'this strategy is active '}
for the current request. When using variants you should use the{' '} for the current request. When using variants you should use the{' '}
<code>getVariant()</code> method in the Client SDK. <code>getVariant()</code> method in the Client SDK.

View File

@ -37,7 +37,7 @@ const ENVIRONMENT = 'dev';
export const TOPICS: ITutorialTopic[] = [ export const TOPICS: ITutorialTopic[] = [
{ {
title: 'Enable/disable a feature toggle', title: 'Enable/disable a feature flag',
steps: [ steps: [
{ {
href: `/projects/${PROJECT}?sort=name`, href: `/projects/${PROJECT}?sort=name`,
@ -51,12 +51,12 @@ export const TOPICS: ITutorialTopic[] = [
target='_blank' target='_blank'
rel='noreferrer' rel='noreferrer'
> >
Feature toggles Feature flags
</a>{' '} </a>{' '}
are the central concept of Unleash. are the central concept of Unleash.
</Description> </Description>
<Description sx={{ mt: 1 }}> <Description sx={{ mt: 1 }}>
Feature toggles are organized within{' '} Feature flags are organized within{' '}
<a <a
href='https://docs.getunleash.io/reference/projects' href='https://docs.getunleash.io/reference/projects'
target='_blank' target='_blank'
@ -110,7 +110,7 @@ export const TOPICS: ITutorialTopic[] = [
enabled. enabled.
</Description> </Description>
<Description sx={{ mt: 1 }}> <Description sx={{ mt: 1 }}>
Let's try enabling a feature toggle only for a Let's try enabling a feature flag only for a
specific user. specific user.
</Description> </Description>
</> </>
@ -122,7 +122,7 @@ export const TOPICS: ITutorialTopic[] = [
target: `a[href="${basePath}/projects/${PROJECT}/features/demoApp.step2"]`, target: `a[href="${basePath}/projects/${PROJECT}/features/demoApp.step2"]`,
content: ( content: (
<Description> <Description>
First, open the feature toggle configuration for{' '} First, open the feature flag configuration for{' '}
<Badge as='span'>demoApp.step2</Badge> by using this <Badge as='span'>demoApp.step2</Badge> by using this
link. link.
</Description> </Description>
@ -182,7 +182,7 @@ export const TOPICS: ITutorialTopic[] = [
> >
activation strategy activation strategy
</a>{' '} </a>{' '}
to be evaluated for a feature toggle. to be evaluated for a feature flag.
</Description> </Description>
<Description sx={{ mt: 1 }}> <Description sx={{ mt: 1 }}>
Add a constraint by using this button. Add a constraint by using this button.
@ -204,7 +204,7 @@ export const TOPICS: ITutorialTopic[] = [
Unleash context Unleash context
</a>{' '} </a>{' '}
contains information relating to the current feature contains information relating to the current feature
toggle request. flag request.
</Description> </Description>
<Description sx={{ mt: 1 }}> <Description sx={{ mt: 1 }}>
Select the context field by using this dropdown. Select the context field by using this dropdown.
@ -335,8 +335,8 @@ export const TOPICS: ITutorialTopic[] = [
. .
</Description> </Description>
<Description sx={{ mt: 1 }}> <Description sx={{ mt: 1 }}>
Let's try enabling a feature toggle only for a Let's try enabling a feature flag only for a certain
certain percentage of users. percentage of users.
</Description> </Description>
</> </>
), ),
@ -347,7 +347,7 @@ export const TOPICS: ITutorialTopic[] = [
target: `a[href="${basePath}/projects/${PROJECT}/features/demoApp.step3"]`, target: `a[href="${basePath}/projects/${PROJECT}/features/demoApp.step3"]`,
content: ( content: (
<Description> <Description>
First, open the feature toggle configuration for{' '} First, open the feature flag configuration for{' '}
<Badge as='span'>demoApp.step3</Badge> by using this <Badge as='span'>demoApp.step3</Badge> by using this
link. link.
</Description> </Description>
@ -447,8 +447,8 @@ export const TOPICS: ITutorialTopic[] = [
Strategy variants Strategy variants
</a>{' '} </a>{' '}
allow you to define different values for a feature allow you to define different values for a feature
toggle. They can be used for A/B testing or flag. They can be used for A/B testing or segmenting
segmenting your users. your users.
</Description> </Description>
<Description sx={{ mt: 1 }}> <Description sx={{ mt: 1 }}>
Let's try adding a variant to a strategy. 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"]`, target: `a[href="${basePath}/projects/${PROJECT}/features/demoApp.step4"]`,
content: ( content: (
<Description> <Description>
First, open the feature toggle configuration for{' '} First, open the feature flag configuration for{' '}
<Badge as='span'>demoApp.step4</Badge> by using this <Badge as='span'>demoApp.step4</Badge> by using this
link. link.
</Description> </Description>
@ -510,7 +510,7 @@ export const TOPICS: ITutorialTopic[] = [
> >
activation strategy activation strategy
</a>{' '} </a>{' '}
to be evaluated for a feature toggle. to be evaluated for a feature flag.
</Description> </Description>
<Description sx={{ mt: 1 }}> <Description sx={{ mt: 1 }}>
Add a constraint by using this button. Add a constraint by using this button.
@ -532,7 +532,7 @@ export const TOPICS: ITutorialTopic[] = [
Unleash context Unleash context
</a>{' '} </a>{' '}
contains information relating to the current feature contains information relating to the current feature
toggle request. flag request.
</Description> </Description>
<Description sx={{ mt: 1 }}> <Description sx={{ mt: 1 }}>
Select the context field by using this dropdown. Select the context field by using this dropdown.

View File

@ -79,12 +79,12 @@ const CreateEnvironment = () => {
description='Environments allow you to manage your description='Environments allow you to manage your
product lifecycle from local development product lifecycle from local development
through production. Your projects and 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 environments, but they can take different
configurations per environment. This means configurations per environment. This means
that you can enable a feature toggle in a that you can enable a feature toggle in a
development or test environment without development or test environment without
enabling the feature toggle in the enabling the feature flag in the
production environment.' production environment.'
documentationLink='https://docs.getunleash.io/reference/environments' documentationLink='https://docs.getunleash.io/reference/environments'
documentationLinkLabel='Environments documentation' documentationLinkLabel='Environments documentation'

View File

@ -66,12 +66,12 @@ const EditEnvironment = () => {
description='Environments allow you to manage your description='Environments allow you to manage your
product lifecycle from local development product lifecycle from local development
through production. Your projects and 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 environments, but they can take different
configurations per environment. This means 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 development or test environment without
enabling the feature toggle in the enabling the feature flag in the
production environment.' production environment.'
documentationLink='https://docs.getunleash.io/reference/environments' documentationLink='https://docs.getunleash.io/reference/environments'
documentationLinkLabel='Environments documentation' documentationLinkLabel='Environments documentation'

View File

@ -237,7 +237,7 @@ export const EnvironmentCloneModal = ({
loading={loading} loading={loading}
modal modal
title={`Clone ${environment.name} environment`} 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' documentationLink='https://docs.getunleash.io/reference/environments#cloning-environments'
documentationLinkLabel='Cloning environments documentation' documentationLinkLabel='Cloning environments documentation'
formatApiCode={formatApiCode} formatApiCode={formatApiCode}
@ -267,7 +267,7 @@ export const EnvironmentCloneModal = ({
<StyledInputDescription> <StyledInputDescription>
Select which projects you want to clone the Select which projects you want to clone the
environment configuration in? environment configuration in?
<HelpIcon tooltip='The cloned environment will keep the feature toggle state for the selected projects, where it will be enabled by default.' /> <HelpIcon tooltip='The cloned environment will keep the feature flag state for the selected projects, where it will be enabled by default.' />
</StyledInputDescription> </StyledInputDescription>
<EnvironmentProjectSelect <EnvironmentProjectSelect
projects={projects} projects={projects}
@ -278,7 +278,7 @@ export const EnvironmentCloneModal = ({
</StyledInputDescription> </StyledInputDescription>
<StyledInputSecondaryDescription> <StyledInputSecondaryDescription>
If you turn it off, the permission for this 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. will remain only for admin and editor roles.
</StyledInputSecondaryDescription> </StyledInputSecondaryDescription>
<FormControlLabel <FormControlLabel

View File

@ -105,21 +105,21 @@ const CreateFeature = () => {
return ( return (
<FormTemplate <FormTemplate
loading={loading} loading={loading}
title='Create feature toggle' title='Create feature flag'
description='Feature toggles support different use cases, each with their own specific needs such as simple static routing or more complex routing. description='Feature flags support different use cases, each with their own specific needs such as simple static routing or more complex routing.
The feature toggle is disabled when created and you decide when to enable' The feature flag is disabled when created and you decide when to enable'
documentationLink='https://docs.getunleash.io/reference/feature-toggle-types' documentationLink='https://docs.getunleash.io/reference/feature-toggle-types'
documentationLinkLabel='Feature toggle types documentation' documentationLinkLabel='Feature flag types documentation'
formatApiCode={formatApiCode} formatApiCode={formatApiCode}
> >
<ConditionallyRender <ConditionallyRender
condition={featureLimitReached} condition={featureLimitReached}
show={ show={
<StyledAlert severity='error'> <StyledAlert severity='error'>
<strong>Feature toggle project limit reached. </strong>{' '} <strong>Feature flag project limit reached. </strong> To
To be able to create more feature toggles in this be able to create more feature flags in this project
project please increase the feature toggle upper limit please increase the feature flag upper limit in the
in the project settings. project settings.
</StyledAlert> </StyledAlert>
} }
/> />
@ -144,7 +144,7 @@ const CreateFeature = () => {
featureNaming={projectInfo.featureNaming} featureNaming={projectInfo.featureNaming}
> >
<CreateButton <CreateButton
name='feature toggle' name='feature flag'
disabled={featureLimitReached} disabled={featureLimitReached}
permission={CREATE_FEATURE} permission={CREATE_FEATURE}
projectId={project} projectId={project}

View File

@ -40,7 +40,7 @@ export const CreateFeatureButton = ({
to={createFeature.path} to={createFeature.path}
size='large' size='large'
tooltipProps={{ tooltipProps={{
title: 'Create feature toggle', title: 'Create feature flag',
}} }}
> >
<Add /> <Add />
@ -58,7 +58,7 @@ export const CreateFeatureButton = ({
data-testid={NAVIGATE_TO_CREATE_FEATURE} data-testid={NAVIGATE_TO_CREATE_FEATURE}
className={classnames({ skeleton: loading })} className={classnames({ skeleton: loading })}
> >
New feature toggle New feature flag
</PermissionButton> </PermissionButton>
} }
/> />

View File

@ -19,7 +19,7 @@ const EditFeature = () => {
const { setToastData, setToastApiError } = useToast(); const { setToastData, setToastApiError } = useToast();
const { uiConfig } = useUiConfig(); const { uiConfig } = useUiConfig();
const navigate = useNavigate(); const navigate = useNavigate();
const { patchFeatureToggle, loading } = useFeatureApi(); const { patchFeatureToggle: patchFeatureFlag, loading } = useFeatureApi();
const { feature } = useFeature(projectId, featureId); const { feature } = useFeature(projectId, featureId);
const { const {
@ -54,7 +54,7 @@ const EditFeature = () => {
clearErrors(); clearErrors();
const patch = createPatch(); const patch = createPatch();
try { try {
await patchFeatureToggle(project, featureId, patch); await patchFeatureFlag(project, featureId, patch);
navigate(`/projects/${project}/features/${name}`); navigate(`/projects/${project}/features/${name}`);
setToastData({ setToastData({
title: 'Toggle updated successfully', title: 'Toggle updated successfully',
@ -81,11 +81,11 @@ const EditFeature = () => {
return ( return (
<FormTemplate <FormTemplate
loading={loading} loading={loading}
title='Edit Feature toggle' title='Edit Feature flag'
description='Feature toggles support different use cases, each with their own specific needs such as simple static routing or more complex routing. description='Feature flags support different use cases, each with their own specific needs such as simple static routing or more complex routing.
The feature toggle is disabled when created and you decide when to enable' The feature flag is disabled when created and you decide when to enable'
documentationLink='https://docs.getunleash.io/reference/feature-toggle-types' documentationLink='https://docs.getunleash.io/reference/feature-toggle-types'
documentationLinkLabel='Feature toggle types documentation' documentationLinkLabel='Feature flag types documentation'
formatApiCode={formatApiCode} formatApiCode={formatApiCode}
> >
<FeatureForm <FeatureForm

View File

@ -123,7 +123,7 @@ const FeatureForm: React.FC<IFeatureToggleForm> = ({
const editable = mode !== 'Edit'; const editable = mode !== 'Edit';
const renderToggleDescription = () => { const renderToggleDescription = () => {
return featureTypes.find((toggle) => toggle.id === type)?.description; return featureTypes.find((flag) => flag.id === type)?.description;
}; };
const displayFeatureNamingInfo = Boolean(featureNaming?.pattern); const displayFeatureNamingInfo = Boolean(featureNaming?.pattern);
@ -138,7 +138,7 @@ const FeatureForm: React.FC<IFeatureToggleForm> = ({
return ( return (
<StyledForm onSubmit={handleSubmit}> <StyledForm onSubmit={handleSubmit}>
<StyledInputDescription> <StyledInputDescription>
What would you like to call your toggle? What would you like to call your flag?
</StyledInputDescription> </StyledInputDescription>
<ConditionallyRender <ConditionallyRender
condition={displayFeatureNamingInfo} condition={displayFeatureNamingInfo}
@ -155,7 +155,7 @@ const FeatureForm: React.FC<IFeatureToggleForm> = ({
? 'feature-naming-pattern-info' ? 'feature-naming-pattern-info'
: undefined : undefined
} }
id='feature-toggle-name' id='feature-flag-name'
error={Boolean(errors.name)} error={Boolean(errors.name)}
errorText={errors.name} errorText={errors.name}
onFocus={() => clearErrors()} onFocus={() => clearErrors()}
@ -212,7 +212,7 @@ const FeatureForm: React.FC<IFeatureToggleForm> = ({
multiline multiline
rows={4} rows={4}
label='Description' label='Description'
placeholder='A short description of the feature toggle' placeholder='A short description of the feature flag'
value={description} value={description}
data-testid={CF_DESC_ID} data-testid={CF_DESC_ID}
onChange={(e) => setDescription(e.target.value)} onChange={(e) => setDescription(e.target.value)}
@ -227,9 +227,9 @@ const FeatureForm: React.FC<IFeatureToggleForm> = ({
Impression Data Impression Data
</Typography> </Typography>
<p> <p>
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 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{' '}
<Link <Link
target='_blank' target='_blank'
rel='noopener noreferrer' rel='noopener noreferrer'

View File

@ -363,8 +363,8 @@ export const formatUpdateStrategyApiCode = (
}; };
export const featureStrategyHelp = ` 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. 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 toggle's activation strategies returns true, the user will get access. If any of a feature flag's activation strategies returns true, the user will get access.
`; `;
export const featureStrategyDocsLink = export const featureStrategyDocsLink =

View File

@ -55,7 +55,7 @@ export const FeatureOverviewSidePanelEnvironmentSwitches = ({
(environment) => environment.enabled && environment.variants?.length, (environment) => environment.enabled && environment.variants?.length,
); );
return ( return (
<StyledContainer data-testid='feature-toggle-status'> <StyledContainer data-testid='feature-flag-status'>
{header} {header}
{feature.environments.map((environment) => { {feature.environments.map((environment) => {
const strategiesLabel = const strategiesLabel =

View File

@ -14,7 +14,7 @@ describe('FeatureTypeForm', () => {
render( render(
<FeatureTypeForm featureType={mockFeatureType} loading={false} />, <FeatureTypeForm featureType={mockFeatureType} loading={false} />,
); );
expect(screen.getByText('Edit toggle type: Test')).toBeInTheDocument(); expect(screen.getByText('Edit flag type: Test')).toBeInTheDocument();
expect(screen.getByText('Expected lifetime')).toBeInTheDocument(); expect(screen.getByText('Expected lifetime')).toBeInTheDocument();
}); });
@ -29,7 +29,7 @@ describe('FeatureTypeForm', () => {
); );
expect(screen.getByLabelText('Expected lifetime')).toBeDisabled(); expect(screen.getByLabelText('Expected lifetime')).toBeDisabled();
expect(screen.getByLabelText("doesn't expire")).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', () => { it('should check "doesn\'t expire" when lifetime is 0', () => {
@ -87,6 +87,6 @@ describe('FeatureTypeForm', () => {
loading={false} loading={false}
/>, />,
); );
expect(screen.getByText('Save feature toggle type')).toBeDisabled(); expect(screen.getByText('Save feature flag type')).toBeDisabled();
}); });
}); });

View File

@ -76,7 +76,7 @@ export const FeatureTypeForm: VFC<FeatureTypeFormProps> = ({
e.preventDefault(); e.preventDefault();
try { try {
if (!featureType?.id) if (!featureType?.id)
throw new Error('No feature toggle type loaded'); throw new Error('No feature flag type loaded');
const value = doesntExpire ? 0 : lifetime; const value = doesntExpire ? 0 : lifetime;
await updateFeatureTypeLifetime(featureType.id, value); await updateFeatureTypeLifetime(featureType.id, value);
@ -121,12 +121,12 @@ export const FeatureTypeForm: VFC<FeatureTypeFormProps> = ({
modal modal
title={ title={
loading loading
? 'Edit toggle type' ? 'Edit flag type'
: `Edit toggle type: ${featureType?.name}` : `Edit flag type: ${featureType?.name}`
} }
description={featureType?.description || ''} description={featureType?.description || ''}
documentationLink='https://docs.getunleash.io/reference/feature-toggle-types' documentationLink='https://docs.getunleash.io/reference/feature-toggle-types'
documentationLinkLabel='Feature toggle types documentation' documentationLinkLabel='Feature flag types documentation'
formatApiCode={formatApiCode} formatApiCode={formatApiCode}
> >
<StyledForm component='form' onSubmit={onSubmit}> <StyledForm component='form' onSubmit={onSubmit}>
@ -137,7 +137,7 @@ export const FeatureTypeForm: VFC<FeatureTypeFormProps> = ({
alignItems: 'center', alignItems: 'center',
})} })}
> >
<Box component='label' htmlFor='feature-toggle-lifetime'> <Box component='label' htmlFor='feature-flag-lifetime'>
Expected lifetime Expected lifetime
</Box> </Box>
<HelpIcon <HelpIcon
@ -145,8 +145,8 @@ export const FeatureTypeForm: VFC<FeatureTypeFormProps> = ({
tooltip={ tooltip={
<> <>
<p> <p>
If your toggle exceeds the expected lifetime If your flag exceeds the expected lifetime
of its toggle type it will be marked as of its flag type it will be marked as
potentially stale. potentially stale.
</p> </p>
<br /> <br />
@ -170,11 +170,11 @@ export const FeatureTypeForm: VFC<FeatureTypeFormProps> = ({
marginBottom: theme.spacing(1), marginBottom: theme.spacing(1),
marginRight: 'auto', marginRight: 'auto',
})} })}
htmlFor='feature-toggle-expire' htmlFor='feature-flag-expire'
> >
<Checkbox <Checkbox
checked={doesntExpire || lifetime === 0} checked={doesntExpire || lifetime === 0}
id='feature-toggle-expire' id='feature-flag-expire'
onChange={onChangeDoesntExpire} onChange={onChangeDoesntExpire}
disabled={loading} disabled={loading}
/> />
@ -185,7 +185,7 @@ export const FeatureTypeForm: VFC<FeatureTypeFormProps> = ({
disabled={doesntExpire || loading} disabled={doesntExpire || loading}
type='number' type='number'
label='Lifetime in days' label='Lifetime in days'
id='feature-toggle-lifetime' id='feature-flag-lifetime'
value={doesntExpire ? '0' : `${lifetime}`} value={doesntExpire ? '0' : `${lifetime}`}
onChange={onChangeLifetime} onChange={onChangeLifetime}
error={isIncorrect} error={isIncorrect}
@ -198,7 +198,7 @@ export const FeatureTypeForm: VFC<FeatureTypeFormProps> = ({
type='submit' type='submit'
disabled={loading || actionLoading} disabled={loading || actionLoading}
> >
Save feature toggle type Save feature flag type
</PermissionButton> </PermissionButton>
<Button <Button
type='button' type='button'

View File

@ -101,7 +101,7 @@ export const FeatureTypesList = () => {
} }
permission={ADMIN} permission={ADMIN}
tooltipProps={{ tooltipProps={{
title: `Edit ${featureType.name} feature toggle type`, title: `Edit ${featureType.name} feature flag type`,
}} }}
> >
<Edit /> <Edit />
@ -158,7 +158,7 @@ export const FeatureTypesList = () => {
fontSize: theme.fontSizes.mainHeader, fontSize: theme.fontSizes.mainHeader,
})} })}
> >
Feature toggle types Feature flag types
</Typography> </Typography>
</PageHeader> </PageHeader>
} }
@ -185,7 +185,7 @@ export const FeatureTypesList = () => {
path='edit/:featureTypeId' path='edit/:featureTypeId'
element={ element={
<SidebarModal <SidebarModal
label='Edit feature toggle type' label='Edit feature flag type'
onClose={() => navigate(basePath)} onClose={() => navigate(basePath)}
open open
> >

View File

@ -143,7 +143,7 @@ describe('useFilteredFlagTrends', () => {
}); });
}); });
it('should set health of a project without feature toggles to undefined', () => { it('should set health of a project without feature flags to undefined', () => {
const { result } = renderHook(() => const { result } = renderHook(() =>
useFilteredFlagsSummary( useFilteredFlagsSummary(
[ [

View File

@ -70,7 +70,7 @@ exports[`returns all baseRoutes 1`] = `
"menu": {}, "menu": {},
"parent": "/projects/:projectId/features", "parent": "/projects/:projectId/features",
"path": "/projects/:projectId/create-toggle", "path": "/projects/:projectId/create-toggle",
"title": "Create feature toggle", "title": "Create feature flag",
"type": "protected", "type": "protected",
}, },
{ {
@ -202,7 +202,7 @@ exports[`returns all baseRoutes 1`] = `
"mobile": true, "mobile": true,
}, },
"path": "/feature-toggle-type/*", "path": "/feature-toggle-type/*",
"title": "Feature toggle types", "title": "Feature flag types",
"type": "protected", "type": "protected",
}, },
{ {
@ -409,7 +409,7 @@ exports[`returns all baseRoutes 1`] = `
"component": [Function], "component": [Function],
"menu": {}, "menu": {},
"path": "/archive", "path": "/archive",
"title": "Archived toggles", "title": "Archived flags",
"type": "protected", "type": "protected",
}, },
{ {

View File

@ -105,7 +105,7 @@ export const routes: IRoute[] = [
{ {
path: '/projects/:projectId/create-toggle', path: '/projects/:projectId/create-toggle',
parent: '/projects/:projectId/features', parent: '/projects/:projectId/features',
title: 'Create feature toggle', title: 'Create feature flag',
component: CreateFeature, component: CreateFeature,
type: 'protected', type: 'protected',
menu: {}, menu: {},
@ -218,7 +218,7 @@ export const routes: IRoute[] = [
// Feature types // Feature types
{ {
path: '/feature-toggle-type/*', path: '/feature-toggle-type/*',
title: 'Feature toggle types', title: 'Feature flag types',
component: FeatureTypesList, component: FeatureTypesList,
type: 'protected', type: 'protected',
menu: { mobile: true, advanced: true }, menu: { mobile: true, advanced: true },
@ -427,7 +427,7 @@ export const routes: IRoute[] = [
// Archive // Archive
{ {
path: '/archive', path: '/archive',
title: 'Archived toggles', title: 'Archived flags',
component: FeaturesArchiveTable, component: FeaturesArchiveTable,
type: 'protected', type: 'protected',
menu: {}, menu: {},

View File

@ -259,7 +259,7 @@ export const AdvancedPlaygroundResultsTable = ({
show={() => ( show={() => (
<TablePlaceholder> <TablePlaceholder>
{data === undefined {data === undefined
? 'None of the feature toggles were evaluated yet.' ? 'None of the feature flags were evaluated yet.'
: 'No results found.'} : 'No results found.'}
</TablePlaceholder> </TablePlaceholder>
)} )}
@ -280,7 +280,7 @@ export const AdvancedPlaygroundResultsTable = ({
} }
show={ show={
<TablePlaceholder> <TablePlaceholder>
No feature toggles found matching &ldquo; No feature flags found matching &ldquo;
{searchValue}&rdquo; {searchValue}&rdquo;
</TablePlaceholder> </TablePlaceholder>
} }
@ -292,7 +292,7 @@ export const AdvancedPlaygroundResultsTable = ({
} }
show={ show={
<TablePlaceholder> <TablePlaceholder>
No features toggles to display No features flags to display
</TablePlaceholder> </TablePlaceholder>
} }
/> />

View File

@ -6,8 +6,8 @@ export const PlaygroundGuidance = () => {
<Box sx={{ ml: 4 }}> <Box sx={{ ml: 4 }}>
<Typography variant='body1'> <Typography variant='body1'>
Unleash playground is for helping you to understand how Unleash Unleash playground is for helping you to understand how Unleash
works, how feature toggles are evaluated and for you to easily works, how feature flags are evaluated and for you to easily
debug your feature toggles. debug your feature flags.
</Typography> </Typography>
<Divider sx={{ mt: 2, mb: 2 }} /> <Divider sx={{ mt: 2, mb: 2 }} />
@ -18,9 +18,9 @@ export const PlaygroundGuidance = () => {
<PlaygroundGuidanceSection <PlaygroundGuidanceSection
headerText='Select in which environment you want to test your headerText='Select in which environment you want to test your
feature toggle configuration' feature flag configuration'
bodyText='You can also specify specific projects, or check bodyText='You can also specify specific projects, or check
toggles in all projects.' flags in all projects.'
sectionNumber='1' sectionNumber='1'
/> />
@ -32,7 +32,7 @@ export const PlaygroundGuidance = () => {
<PlaygroundGuidanceSection <PlaygroundGuidanceSection
headerText='Submit the form to try the configuration' headerText='Submit the form to try the configuration'
bodyText='The results of evaluating your feature toggles will appear after you submit the form. Then view the results.' bodyText='The results of evaluating your feature flags will appear after you submit the form. Then view the results.'
sectionNumber='3' sectionNumber='3'
/> />
</Box> </Box>

View File

@ -10,7 +10,7 @@ const testCases = [
hasUnsatisfiedDependency: true, hasUnsatisfiedDependency: true,
isEnabledInCurrentEnvironment: false, isEnabledInCurrentEnvironment: false,
} as PlaygroundFeatureSchema, } as PlaygroundFeatureSchema,
expectedText1: 'This feature toggle is False in development because', expectedText1: 'This feature flag is False in development because',
expectedText2: expectedText2:
'parent dependency is not satisfied and the environment is disabled', 'parent dependency is not satisfied and the environment is disabled',
}, },
@ -20,7 +20,7 @@ const testCases = [
hasUnsatisfiedDependency: true, hasUnsatisfiedDependency: true,
isEnabledInCurrentEnvironment: true, isEnabledInCurrentEnvironment: true,
} as PlaygroundFeatureSchema, } as PlaygroundFeatureSchema,
expectedText1: 'This feature toggle is False in development because', expectedText1: 'This feature flag is False in development because',
expectedText2: 'parent dependency is not satisfied', expectedText2: 'parent dependency is not satisfied',
}, },
{ {
@ -29,7 +29,7 @@ const testCases = [
hasUnsatisfiedDependency: false, hasUnsatisfiedDependency: false,
isEnabledInCurrentEnvironment: false, isEnabledInCurrentEnvironment: false,
} as PlaygroundFeatureSchema, } as PlaygroundFeatureSchema,
expectedText1: 'This feature toggle is False in development because', expectedText1: 'This feature flag is False in development because',
expectedText2: 'the environment is disabled', expectedText2: 'the environment is disabled',
}, },
{ {
@ -37,7 +37,7 @@ const testCases = [
feature: { feature: {
isEnabled: true, isEnabled: true,
} as PlaygroundFeatureSchema, } as PlaygroundFeatureSchema,
expectedText1: 'This feature toggle is True in development because', expectedText1: 'This feature flag is True in development because',
expectedText2: 'at least one strategy is True', expectedText2: 'at least one strategy is True',
}, },
{ {
@ -48,7 +48,7 @@ const testCases = [
data: [{ name: 'custom' }], data: [{ name: 'custom' }],
}, },
} as PlaygroundFeatureSchema, } as PlaygroundFeatureSchema,
expectedText1: 'This feature toggle is Unknown in development because', expectedText1: 'This feature flag is Unknown in development because',
expectedText2: 'no strategies could be fully evaluated', expectedText2: 'no strategies could be fully evaluated',
}, },
{ {
@ -59,7 +59,7 @@ const testCases = [
data: [{ name: 'custom' }, { name: 'default' }], data: [{ name: 'custom' }, { name: 'default' }],
}, },
} as PlaygroundFeatureSchema, } as PlaygroundFeatureSchema,
expectedText1: 'This feature toggle is Unknown in development because', expectedText1: 'This feature flag is Unknown in development because',
expectedText2: 'not all strategies could be fully evaluated', expectedText2: 'not all strategies could be fully evaluated',
}, },
{ {
@ -70,7 +70,7 @@ const testCases = [
data: [{ name: 'default' }], data: [{ name: 'default' }],
}, },
} as PlaygroundFeatureSchema, } as PlaygroundFeatureSchema,
expectedText1: 'This feature toggle is False in development because', expectedText1: 'This feature flag is False in development because',
expectedText2: expectedText2:
'all strategies are either False or could not be fully evaluated', 'all strategies are either False or could not be fully evaluated',
}, },

View File

@ -55,7 +55,7 @@ export const FeatureDetails = ({
const [description, reason, color] = (() => { const [description, reason, color] = (() => {
if (feature.isEnabled) if (feature.isEnabled)
return [ return [
`This feature toggle is True in ${input?.environment} because `, `This feature flag is True in ${input?.environment} because `,
'at least one strategy is True', 'at least one strategy is True',
theme.palette.success.main, theme.palette.success.main,
]; ];
@ -65,7 +65,7 @@ export const FeatureDetails = ({
!feature.isEnabledInCurrentEnvironment !feature.isEnabledInCurrentEnvironment
) { ) {
return [ return [
`This feature toggle is False in ${input?.environment} because `, `This feature flag is False in ${input?.environment} because `,
'parent dependency is not satisfied and the environment is disabled', 'parent dependency is not satisfied and the environment is disabled',
theme.palette.error.main, theme.palette.error.main,
]; ];
@ -73,35 +73,35 @@ export const FeatureDetails = ({
if (!feature.isEnabledInCurrentEnvironment) if (!feature.isEnabledInCurrentEnvironment)
return [ return [
`This feature toggle is False in ${input?.environment} because `, `This feature flag is False in ${input?.environment} because `,
'the environment is disabled', 'the environment is disabled',
theme.palette.error.main, theme.palette.error.main,
]; ];
if (hasOnlyCustomStrategies(feature)) if (hasOnlyCustomStrategies(feature))
return [ return [
`This feature toggle is Unknown in ${input?.environment} because `, `This feature flag is Unknown in ${input?.environment} because `,
'no strategies could be fully evaluated', 'no strategies could be fully evaluated',
theme.palette.warning.main, theme.palette.warning.main,
]; ];
if (hasCustomStrategies(feature)) if (hasCustomStrategies(feature))
return [ return [
`This feature toggle is Unknown in ${input?.environment} because `, `This feature flag is Unknown in ${input?.environment} because `,
'not all strategies could be fully evaluated', 'not all strategies could be fully evaluated',
theme.palette.warning.main, theme.palette.warning.main,
]; ];
if (feature.hasUnsatisfiedDependency) { if (feature.hasUnsatisfiedDependency) {
return [ return [
`This feature toggle is False in ${input?.environment} because `, `This feature flag is False in ${input?.environment} because `,
'parent dependency is not satisfied', 'parent dependency is not satisfied',
theme.palette.error.main, theme.palette.error.main,
]; ];
} }
return [ return [
`This feature toggle is False in ${input?.environment} because `, `This feature flag is False in ${input?.environment} because `,
'all strategies are either False or could not be fully evaluated', 'all strategies are either False or could not be fully evaluated',
theme.palette.error.main, theme.palette.error.main,
]; ];

View File

@ -72,14 +72,14 @@ export const EnableEnvironmentDialog: FC<IEnableEnvironmentDialogProps> = ({
</> </>
} }
onClose={onClose} onClose={onClose}
title={`Enable feature toggle in ${environment}`} title={`Enable feature flag in ${environment}`}
fullWidth fullWidth
> >
<Typography sx={{ mb: (theme) => theme.spacing(3) }}> <Typography sx={{ mb: (theme) => theme.spacing(3) }}>
A feature toggle cannot be enabled without an enabled strategy. A feature flag cannot be enabled without an enabled strategy.
</Typography> </Typography>
<Typography> <Typography>
To enable this feature toggle you can choose to: To enable this feature flag you can choose to:
</Typography> </Typography>
<StyledList> <StyledList>
<li> <li>
@ -90,7 +90,7 @@ export const EnableEnvironmentDialog: FC<IEnableEnvironmentDialogProps> = ({
<li> <li>
<Typography> <Typography>
<strong>Enable all the disabled strategies</strong>{' '} <strong>Enable all the disabled strategies</strong>{' '}
(this feature toggle has {disabledStrategiesText}) (this feature flag has {disabledStrategiesText})
</Typography> </Typography>
</li> </li>
</StyledList> </StyledList>

View File

@ -206,7 +206,7 @@ export const formatUpdateStrategyApiCode = (
}; };
export const projectDefaultStrategyHelp = ` export const projectDefaultStrategyHelp = `
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. 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 toggle's activation strategies returns true, the user will get access. If any of a feature toggle's activation strategies returns true, the user will get access.
`; `;