mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-28 00:17:12 +01:00
parent
ce67c4d944
commit
8542cafc9f
@ -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);
|
||||
});
|
||||
|
@ -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);
|
||||
});
|
||||
|
@ -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}
|
||||
|
@ -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',
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -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',
|
||||
);
|
||||
});
|
||||
|
@ -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}
|
||||
>
|
||||
<Alert severity='info'>
|
||||
Revived feature toggles will be automatically disabled in all
|
||||
Revived feature flags will be automatically disabled in all
|
||||
environments
|
||||
</Alert>
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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 =
|
||||
|
@ -67,7 +67,7 @@ const DisabledEnabledState: VFC<{ show?: boolean; disabled: boolean }> = ({
|
||||
if (disabled) {
|
||||
return (
|
||||
<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
|
||||
sx={{ cursor: 'pointer' }}
|
||||
>
|
||||
@ -80,7 +80,7 @@ const DisabledEnabledState: VFC<{ show?: boolean; disabled: boolean }> = ({
|
||||
|
||||
return (
|
||||
<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
|
||||
sx={{ cursor: 'pointer' }}
|
||||
>
|
||||
|
@ -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,
|
||||
|
@ -5,20 +5,20 @@ import { screen } from '@testing-library/react';
|
||||
test('Show only features count when no segments', async () => {
|
||||
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();
|
||||
});
|
||||
|
||||
test('Show features and segments count', async () => {
|
||||
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();
|
||||
});
|
||||
|
||||
test('Show features and segments plural count', async () => {
|
||||
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();
|
||||
});
|
||||
|
@ -14,7 +14,7 @@ export const UpdateCount: FC<{
|
||||
display='inline'
|
||||
>
|
||||
{featuresCount}{' '}
|
||||
{featuresCount === 1 ? 'feature toggle' : 'feature toggles'}
|
||||
{featuresCount === 1 ? 'feature flag' : 'feature flags'}
|
||||
</Typography>
|
||||
<ConditionallyRender
|
||||
condition={segmentsCount > 0}
|
||||
|
@ -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 (
|
||||
|
@ -14,7 +14,7 @@ export const VariantInfoAlert: FC<{ mode: 'feature' | 'strategy' }> = ({
|
||||
<StyledAlert severity='info'>
|
||||
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{' '}
|
||||
<code>getVariant()</code> method in the Client SDK.
|
||||
|
@ -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
|
||||
</a>{' '}
|
||||
are the central concept of Unleash.
|
||||
</Description>
|
||||
<Description sx={{ mt: 1 }}>
|
||||
Feature toggles are organized within{' '}
|
||||
Feature flags are organized within{' '}
|
||||
<a
|
||||
href='https://docs.getunleash.io/reference/projects'
|
||||
target='_blank'
|
||||
@ -110,7 +110,7 @@ export const TOPICS: ITutorialTopic[] = [
|
||||
enabled.
|
||||
</Description>
|
||||
<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.
|
||||
</Description>
|
||||
</>
|
||||
@ -122,7 +122,7 @@ export const TOPICS: ITutorialTopic[] = [
|
||||
target: `a[href="${basePath}/projects/${PROJECT}/features/demoApp.step2"]`,
|
||||
content: (
|
||||
<Description>
|
||||
First, open the feature toggle configuration for{' '}
|
||||
First, open the feature flag configuration for{' '}
|
||||
<Badge as='span'>demoApp.step2</Badge> by using this
|
||||
link.
|
||||
</Description>
|
||||
@ -182,7 +182,7 @@ export const TOPICS: ITutorialTopic[] = [
|
||||
>
|
||||
activation strategy
|
||||
</a>{' '}
|
||||
to be evaluated for a feature toggle.
|
||||
to be evaluated for a feature flag.
|
||||
</Description>
|
||||
<Description sx={{ mt: 1 }}>
|
||||
Add a constraint by using this button.
|
||||
@ -204,7 +204,7 @@ export const TOPICS: ITutorialTopic[] = [
|
||||
Unleash context
|
||||
</a>{' '}
|
||||
contains information relating to the current feature
|
||||
toggle request.
|
||||
flag request.
|
||||
</Description>
|
||||
<Description sx={{ mt: 1 }}>
|
||||
Select the context field by using this dropdown.
|
||||
@ -335,8 +335,8 @@ export const TOPICS: ITutorialTopic[] = [
|
||||
.
|
||||
</Description>
|
||||
<Description sx={{ mt: 1 }}>
|
||||
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.
|
||||
</Description>
|
||||
</>
|
||||
),
|
||||
@ -347,7 +347,7 @@ export const TOPICS: ITutorialTopic[] = [
|
||||
target: `a[href="${basePath}/projects/${PROJECT}/features/demoApp.step3"]`,
|
||||
content: (
|
||||
<Description>
|
||||
First, open the feature toggle configuration for{' '}
|
||||
First, open the feature flag configuration for{' '}
|
||||
<Badge as='span'>demoApp.step3</Badge> by using this
|
||||
link.
|
||||
</Description>
|
||||
@ -447,8 +447,8 @@ export const TOPICS: ITutorialTopic[] = [
|
||||
Strategy variants
|
||||
</a>{' '}
|
||||
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.
|
||||
</Description>
|
||||
<Description sx={{ mt: 1 }}>
|
||||
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: (
|
||||
<Description>
|
||||
First, open the feature toggle configuration for{' '}
|
||||
First, open the feature flag configuration for{' '}
|
||||
<Badge as='span'>demoApp.step4</Badge> by using this
|
||||
link.
|
||||
</Description>
|
||||
@ -510,7 +510,7 @@ export const TOPICS: ITutorialTopic[] = [
|
||||
>
|
||||
activation strategy
|
||||
</a>{' '}
|
||||
to be evaluated for a feature toggle.
|
||||
to be evaluated for a feature flag.
|
||||
</Description>
|
||||
<Description sx={{ mt: 1 }}>
|
||||
Add a constraint by using this button.
|
||||
@ -532,7 +532,7 @@ export const TOPICS: ITutorialTopic[] = [
|
||||
Unleash context
|
||||
</a>{' '}
|
||||
contains information relating to the current feature
|
||||
toggle request.
|
||||
flag request.
|
||||
</Description>
|
||||
<Description sx={{ mt: 1 }}>
|
||||
Select the context field by using this dropdown.
|
||||
|
@ -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'
|
||||
|
@ -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'
|
||||
|
@ -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 = ({
|
||||
<StyledInputDescription>
|
||||
Select which projects you want to clone the
|
||||
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>
|
||||
<EnvironmentProjectSelect
|
||||
projects={projects}
|
||||
@ -278,7 +278,7 @@ export const EnvironmentCloneModal = ({
|
||||
</StyledInputDescription>
|
||||
<StyledInputSecondaryDescription>
|
||||
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.
|
||||
</StyledInputSecondaryDescription>
|
||||
<FormControlLabel
|
||||
|
@ -105,21 +105,21 @@ const CreateFeature = () => {
|
||||
return (
|
||||
<FormTemplate
|
||||
loading={loading}
|
||||
title='Create feature toggle'
|
||||
description='Feature toggles 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'
|
||||
title='Create feature flag'
|
||||
description='Feature flags support different use cases, each with their own specific needs such as simple static routing or more complex routing.
|
||||
The feature flag is disabled when created and you decide when to enable'
|
||||
documentationLink='https://docs.getunleash.io/reference/feature-toggle-types'
|
||||
documentationLinkLabel='Feature toggle types documentation'
|
||||
documentationLinkLabel='Feature flag types documentation'
|
||||
formatApiCode={formatApiCode}
|
||||
>
|
||||
<ConditionallyRender
|
||||
condition={featureLimitReached}
|
||||
show={
|
||||
<StyledAlert severity='error'>
|
||||
<strong>Feature toggle project limit reached. </strong>{' '}
|
||||
To be able to create more feature toggles in this
|
||||
project please increase the feature toggle upper limit
|
||||
in the project settings.
|
||||
<strong>Feature flag project limit reached. </strong> To
|
||||
be able to create more feature flags in this project
|
||||
please increase the feature flag upper limit in the
|
||||
project settings.
|
||||
</StyledAlert>
|
||||
}
|
||||
/>
|
||||
@ -144,7 +144,7 @@ const CreateFeature = () => {
|
||||
featureNaming={projectInfo.featureNaming}
|
||||
>
|
||||
<CreateButton
|
||||
name='feature toggle'
|
||||
name='feature flag'
|
||||
disabled={featureLimitReached}
|
||||
permission={CREATE_FEATURE}
|
||||
projectId={project}
|
||||
|
@ -40,7 +40,7 @@ export const CreateFeatureButton = ({
|
||||
to={createFeature.path}
|
||||
size='large'
|
||||
tooltipProps={{
|
||||
title: 'Create feature toggle',
|
||||
title: 'Create feature flag',
|
||||
}}
|
||||
>
|
||||
<Add />
|
||||
@ -58,7 +58,7 @@ export const CreateFeatureButton = ({
|
||||
data-testid={NAVIGATE_TO_CREATE_FEATURE}
|
||||
className={classnames({ skeleton: loading })}
|
||||
>
|
||||
New feature toggle
|
||||
New feature flag
|
||||
</PermissionButton>
|
||||
}
|
||||
/>
|
||||
|
@ -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 (
|
||||
<FormTemplate
|
||||
loading={loading}
|
||||
title='Edit Feature toggle'
|
||||
description='Feature toggles 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'
|
||||
title='Edit Feature flag'
|
||||
description='Feature flags support different use cases, each with their own specific needs such as simple static routing or more complex routing.
|
||||
The feature flag is disabled when created and you decide when to enable'
|
||||
documentationLink='https://docs.getunleash.io/reference/feature-toggle-types'
|
||||
documentationLinkLabel='Feature toggle types documentation'
|
||||
documentationLinkLabel='Feature flag types documentation'
|
||||
formatApiCode={formatApiCode}
|
||||
>
|
||||
<FeatureForm
|
||||
|
@ -123,7 +123,7 @@ const FeatureForm: React.FC<IFeatureToggleForm> = ({
|
||||
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<IFeatureToggleForm> = ({
|
||||
return (
|
||||
<StyledForm onSubmit={handleSubmit}>
|
||||
<StyledInputDescription>
|
||||
What would you like to call your toggle?
|
||||
What would you like to call your flag?
|
||||
</StyledInputDescription>
|
||||
<ConditionallyRender
|
||||
condition={displayFeatureNamingInfo}
|
||||
@ -155,7 +155,7 @@ const FeatureForm: React.FC<IFeatureToggleForm> = ({
|
||||
? '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<IFeatureToggleForm> = ({
|
||||
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<IFeatureToggleForm> = ({
|
||||
Impression Data
|
||||
</Typography>
|
||||
<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
|
||||
this toggle gets triggered. Learn more in{' '}
|
||||
this flag gets triggered. Learn more in{' '}
|
||||
<Link
|
||||
target='_blank'
|
||||
rel='noopener noreferrer'
|
||||
|
@ -363,8 +363,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 =
|
||||
|
@ -55,7 +55,7 @@ export const FeatureOverviewSidePanelEnvironmentSwitches = ({
|
||||
(environment) => environment.enabled && environment.variants?.length,
|
||||
);
|
||||
return (
|
||||
<StyledContainer data-testid='feature-toggle-status'>
|
||||
<StyledContainer data-testid='feature-flag-status'>
|
||||
{header}
|
||||
{feature.environments.map((environment) => {
|
||||
const strategiesLabel =
|
||||
|
@ -14,7 +14,7 @@ describe('FeatureTypeForm', () => {
|
||||
render(
|
||||
<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();
|
||||
});
|
||||
|
||||
@ -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();
|
||||
});
|
||||
});
|
||||
|
@ -76,7 +76,7 @@ export const FeatureTypeForm: VFC<FeatureTypeFormProps> = ({
|
||||
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<FeatureTypeFormProps> = ({
|
||||
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}
|
||||
>
|
||||
<StyledForm component='form' onSubmit={onSubmit}>
|
||||
@ -137,7 +137,7 @@ export const FeatureTypeForm: VFC<FeatureTypeFormProps> = ({
|
||||
alignItems: 'center',
|
||||
})}
|
||||
>
|
||||
<Box component='label' htmlFor='feature-toggle-lifetime'>
|
||||
<Box component='label' htmlFor='feature-flag-lifetime'>
|
||||
Expected lifetime
|
||||
</Box>
|
||||
<HelpIcon
|
||||
@ -145,8 +145,8 @@ export const FeatureTypeForm: VFC<FeatureTypeFormProps> = ({
|
||||
tooltip={
|
||||
<>
|
||||
<p>
|
||||
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.
|
||||
</p>
|
||||
<br />
|
||||
@ -170,11 +170,11 @@ export const FeatureTypeForm: VFC<FeatureTypeFormProps> = ({
|
||||
marginBottom: theme.spacing(1),
|
||||
marginRight: 'auto',
|
||||
})}
|
||||
htmlFor='feature-toggle-expire'
|
||||
htmlFor='feature-flag-expire'
|
||||
>
|
||||
<Checkbox
|
||||
checked={doesntExpire || lifetime === 0}
|
||||
id='feature-toggle-expire'
|
||||
id='feature-flag-expire'
|
||||
onChange={onChangeDoesntExpire}
|
||||
disabled={loading}
|
||||
/>
|
||||
@ -185,7 +185,7 @@ export const FeatureTypeForm: VFC<FeatureTypeFormProps> = ({
|
||||
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<FeatureTypeFormProps> = ({
|
||||
type='submit'
|
||||
disabled={loading || actionLoading}
|
||||
>
|
||||
Save feature toggle type
|
||||
Save feature flag type
|
||||
</PermissionButton>
|
||||
<Button
|
||||
type='button'
|
||||
|
@ -101,7 +101,7 @@ export const FeatureTypesList = () => {
|
||||
}
|
||||
permission={ADMIN}
|
||||
tooltipProps={{
|
||||
title: `Edit ${featureType.name} feature toggle type`,
|
||||
title: `Edit ${featureType.name} feature flag type`,
|
||||
}}
|
||||
>
|
||||
<Edit />
|
||||
@ -158,7 +158,7 @@ export const FeatureTypesList = () => {
|
||||
fontSize: theme.fontSizes.mainHeader,
|
||||
})}
|
||||
>
|
||||
Feature toggle types
|
||||
Feature flag types
|
||||
</Typography>
|
||||
</PageHeader>
|
||||
}
|
||||
@ -185,7 +185,7 @@ export const FeatureTypesList = () => {
|
||||
path='edit/:featureTypeId'
|
||||
element={
|
||||
<SidebarModal
|
||||
label='Edit feature toggle type'
|
||||
label='Edit feature flag type'
|
||||
onClose={() => navigate(basePath)}
|
||||
open
|
||||
>
|
||||
|
@ -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(() =>
|
||||
useFilteredFlagsSummary(
|
||||
[
|
||||
|
@ -70,7 +70,7 @@ exports[`returns all baseRoutes 1`] = `
|
||||
"menu": {},
|
||||
"parent": "/projects/:projectId/features",
|
||||
"path": "/projects/:projectId/create-toggle",
|
||||
"title": "Create feature toggle",
|
||||
"title": "Create feature flag",
|
||||
"type": "protected",
|
||||
},
|
||||
{
|
||||
@ -202,7 +202,7 @@ exports[`returns all baseRoutes 1`] = `
|
||||
"mobile": true,
|
||||
},
|
||||
"path": "/feature-toggle-type/*",
|
||||
"title": "Feature toggle types",
|
||||
"title": "Feature flag types",
|
||||
"type": "protected",
|
||||
},
|
||||
{
|
||||
@ -409,7 +409,7 @@ exports[`returns all baseRoutes 1`] = `
|
||||
"component": [Function],
|
||||
"menu": {},
|
||||
"path": "/archive",
|
||||
"title": "Archived toggles",
|
||||
"title": "Archived flags",
|
||||
"type": "protected",
|
||||
},
|
||||
{
|
||||
|
@ -105,7 +105,7 @@ export const routes: IRoute[] = [
|
||||
{
|
||||
path: '/projects/:projectId/create-toggle',
|
||||
parent: '/projects/:projectId/features',
|
||||
title: 'Create feature toggle',
|
||||
title: 'Create feature flag',
|
||||
component: CreateFeature,
|
||||
type: 'protected',
|
||||
menu: {},
|
||||
@ -218,7 +218,7 @@ export const routes: IRoute[] = [
|
||||
// Feature types
|
||||
{
|
||||
path: '/feature-toggle-type/*',
|
||||
title: 'Feature toggle types',
|
||||
title: 'Feature flag types',
|
||||
component: FeatureTypesList,
|
||||
type: 'protected',
|
||||
menu: { mobile: true, advanced: true },
|
||||
@ -427,7 +427,7 @@ export const routes: IRoute[] = [
|
||||
// Archive
|
||||
{
|
||||
path: '/archive',
|
||||
title: 'Archived toggles',
|
||||
title: 'Archived flags',
|
||||
component: FeaturesArchiveTable,
|
||||
type: 'protected',
|
||||
menu: {},
|
||||
|
@ -259,7 +259,7 @@ export const AdvancedPlaygroundResultsTable = ({
|
||||
show={() => (
|
||||
<TablePlaceholder>
|
||||
{data === undefined
|
||||
? 'None of the feature toggles were evaluated yet.'
|
||||
? 'None of the feature flags were evaluated yet.'
|
||||
: 'No results found.'}
|
||||
</TablePlaceholder>
|
||||
)}
|
||||
@ -280,7 +280,7 @@ export const AdvancedPlaygroundResultsTable = ({
|
||||
}
|
||||
show={
|
||||
<TablePlaceholder>
|
||||
No feature toggles found matching “
|
||||
No feature flags found matching “
|
||||
{searchValue}”
|
||||
</TablePlaceholder>
|
||||
}
|
||||
@ -292,7 +292,7 @@ export const AdvancedPlaygroundResultsTable = ({
|
||||
}
|
||||
show={
|
||||
<TablePlaceholder>
|
||||
No features toggles to display
|
||||
No features flags to display
|
||||
</TablePlaceholder>
|
||||
}
|
||||
/>
|
||||
|
@ -6,8 +6,8 @@ export const PlaygroundGuidance = () => {
|
||||
<Box sx={{ ml: 4 }}>
|
||||
<Typography variant='body1'>
|
||||
Unleash playground is for helping you to understand how Unleash
|
||||
works, how feature toggles are evaluated and for you to easily
|
||||
debug your feature toggles.
|
||||
works, how feature flags are evaluated and for you to easily
|
||||
debug your feature flags.
|
||||
</Typography>
|
||||
|
||||
<Divider sx={{ mt: 2, mb: 2 }} />
|
||||
@ -18,9 +18,9 @@ export const PlaygroundGuidance = () => {
|
||||
|
||||
<PlaygroundGuidanceSection
|
||||
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
|
||||
toggles in all projects.'
|
||||
flags in all projects.'
|
||||
sectionNumber='1'
|
||||
/>
|
||||
|
||||
@ -32,7 +32,7 @@ export const PlaygroundGuidance = () => {
|
||||
|
||||
<PlaygroundGuidanceSection
|
||||
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'
|
||||
/>
|
||||
</Box>
|
||||
|
@ -10,7 +10,7 @@ const testCases = [
|
||||
hasUnsatisfiedDependency: true,
|
||||
isEnabledInCurrentEnvironment: false,
|
||||
} 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 and the environment is disabled',
|
||||
},
|
||||
@ -20,7 +20,7 @@ const testCases = [
|
||||
hasUnsatisfiedDependency: true,
|
||||
isEnabledInCurrentEnvironment: true,
|
||||
} 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',
|
||||
},
|
||||
{
|
||||
@ -29,7 +29,7 @@ const testCases = [
|
||||
hasUnsatisfiedDependency: false,
|
||||
isEnabledInCurrentEnvironment: false,
|
||||
} 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',
|
||||
},
|
||||
{
|
||||
@ -37,7 +37,7 @@ const testCases = [
|
||||
feature: {
|
||||
isEnabled: true,
|
||||
} 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',
|
||||
},
|
||||
{
|
||||
@ -48,7 +48,7 @@ const testCases = [
|
||||
data: [{ name: 'custom' }],
|
||||
},
|
||||
} 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',
|
||||
},
|
||||
{
|
||||
@ -59,7 +59,7 @@ const testCases = [
|
||||
data: [{ name: 'custom' }, { name: 'default' }],
|
||||
},
|
||||
} 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',
|
||||
},
|
||||
{
|
||||
@ -70,7 +70,7 @@ const testCases = [
|
||||
data: [{ name: 'default' }],
|
||||
},
|
||||
} as PlaygroundFeatureSchema,
|
||||
expectedText1: 'This feature toggle is False in development because',
|
||||
expectedText1: 'This feature flag is False in development because',
|
||||
expectedText2:
|
||||
'all strategies are either False or could not be fully evaluated',
|
||||
},
|
||||
|
@ -55,7 +55,7 @@ export const FeatureDetails = ({
|
||||
const [description, reason, color] = (() => {
|
||||
if (feature.isEnabled)
|
||||
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',
|
||||
theme.palette.success.main,
|
||||
];
|
||||
@ -65,7 +65,7 @@ export const FeatureDetails = ({
|
||||
!feature.isEnabledInCurrentEnvironment
|
||||
) {
|
||||
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',
|
||||
theme.palette.error.main,
|
||||
];
|
||||
@ -73,35 +73,35 @@ export const FeatureDetails = ({
|
||||
|
||||
if (!feature.isEnabledInCurrentEnvironment)
|
||||
return [
|
||||
`This feature toggle is False in ${input?.environment} because `,
|
||||
`This feature flag is False in ${input?.environment} because `,
|
||||
'the environment is disabled',
|
||||
theme.palette.error.main,
|
||||
];
|
||||
|
||||
if (hasOnlyCustomStrategies(feature))
|
||||
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',
|
||||
theme.palette.warning.main,
|
||||
];
|
||||
|
||||
if (hasCustomStrategies(feature))
|
||||
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',
|
||||
theme.palette.warning.main,
|
||||
];
|
||||
|
||||
if (feature.hasUnsatisfiedDependency) {
|
||||
return [
|
||||
`This feature toggle is False in ${input?.environment} because `,
|
||||
`This feature flag is False in ${input?.environment} because `,
|
||||
'parent dependency is not satisfied',
|
||||
theme.palette.error.main,
|
||||
];
|
||||
}
|
||||
|
||||
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',
|
||||
theme.palette.error.main,
|
||||
];
|
||||
|
@ -72,14 +72,14 @@ export const EnableEnvironmentDialog: FC<IEnableEnvironmentDialogProps> = ({
|
||||
</>
|
||||
}
|
||||
onClose={onClose}
|
||||
title={`Enable feature toggle in ${environment}`}
|
||||
title={`Enable feature flag in ${environment}`}
|
||||
fullWidth
|
||||
>
|
||||
<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>
|
||||
To enable this feature toggle you can choose to:
|
||||
To enable this feature flag you can choose to:
|
||||
</Typography>
|
||||
<StyledList>
|
||||
<li>
|
||||
@ -90,7 +90,7 @@ export const EnableEnvironmentDialog: FC<IEnableEnvironmentDialogProps> = ({
|
||||
<li>
|
||||
<Typography>
|
||||
<strong>Enable all the disabled strategies</strong>{' '}
|
||||
(this feature toggle has {disabledStrategiesText})
|
||||
(this feature flag has {disabledStrategiesText})
|
||||
</Typography>
|
||||
</li>
|
||||
</StyledList>
|
||||
|
@ -206,7 +206,7 @@ export const formatUpdateStrategyApiCode = (
|
||||
};
|
||||
|
||||
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.
|
||||
`;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user