Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: rename toggle to flag #2 #7097

Merged
merged 2 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/cypress/integration/feature/feature.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/cypress/oss/feature/feature.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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>

Expand Down
14 changes: 7 additions & 7 deletions frontend/src/component/changeRequest/ChangeRequest.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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(
Expand All @@ -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);
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
>
Expand All @@ -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' }}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/component/changeRequest/UpdateCount.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
2 changes: 1 addition & 1 deletion frontend/src/component/changeRequest/UpdateCount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
30 changes: 15 additions & 15 deletions frontend/src/component/demo/demo-topics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand All @@ -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'
Expand Down Expand Up @@ -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>
</>
Expand All @@ -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>
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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>
</>
),
Expand All @@ -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>
Expand Down Expand Up @@ -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.
Expand All @@ -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>
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand All @@ -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
Expand Down