From b3dd460d2fdf5a96fa428cad9da1fc8e13c2d8d2 Mon Sep 17 00:00:00 2001 From: Jaanus Sellin Date: Thu, 23 May 2024 13:19:49 +0300 Subject: [PATCH] chore: rename toggle to flag #7 (#7125) --- .../ArchiveTable/ArchiveTable.test.tsx | 4 ++-- .../archive/ArchiveTable/ArchiveTable.tsx | 5 ++--- .../ArchivedFeatureDeleteConfirm.tsx | 22 +++++++++---------- .../ArchivedFeatureReviveConfirm.tsx | 4 ++-- .../changeRequest/ChangeRequest.test.tsx | 2 +- .../ChangeRequest/ChangeRequest.tsx | 2 +- .../Changes/FeatureToggleChanges.tsx | 2 +- .../UpdateEnabledMessage.tsx | 2 +- .../EnvironmentDeleteDialog.tsx | 2 +- .../EnvironmentTable/EnvironmentTable.tsx | 4 ++-- .../feature/CopyFeature/CopyFeature.tsx | 10 ++++----- .../feature/FeatureForm/FeatureForm.tsx | 8 +++---- ...FeatureStrategyConstraintAccordionList.tsx | 2 +- .../FeatureStrategyEnabled.tsx | 8 +++---- .../FeatureStrategyForm.tsx | 4 ++-- .../FeatureMetricsContent.tsx | 4 ++-- .../MarkCompletedDialogue.tsx | 12 +++++----- .../EnvironmentFooter/EnvironmentFooter.tsx | 2 +- .../FeatureOverviewSidePanel.tsx | 2 +- .../FeatureSettingsProjectConfirm.tsx | 16 +++++++------- .../RolloutSlider/RolloutSlider.tsx | 2 +- .../EdgeIntegration/EdgeIntegration.tsx | 2 +- .../PlaygroundResultFeatureStrategyList.tsx | 2 +- .../project/Project/Import/ImportTimeline.tsx | 6 ++--- .../Import/configure/ImportExplanation.tsx | 6 ++--- .../TableEmptyState/TableEmptyState.tsx | 4 ++-- .../CollaborationModeTooltip.tsx | 2 +- .../FeatureTogglesLimitTooltip.tsx | 4 ++-- .../ReportTable/ReportCard/ReportCard.tsx | 18 +++++++-------- .../ProjectHealth/ReportTable/ReportTable.tsx | 2 +- .../ProjectInsightsStats.tsx | 6 ++--- .../Settings/DeleteProject.tsx | 8 +++---- .../Project/ProjectStats/ProjectStats.tsx | 8 +++---- .../SegmentDeleteUsedSegment.tsx | 2 +- frontend/src/themes/dark-theme.ts | 2 +- frontend/src/themes/theme.ts | 2 +- frontend/src/themes/themeTypes.ts | 2 +- src/lib/db/feature-tag-store.ts | 2 +- .../feature-toggle/feature-toggle-service.ts | 4 ++-- src/lib/middleware/rbac-middleware.ts | 2 +- src/lib/services/addon-service.test.ts | 2 +- 41 files changed, 101 insertions(+), 104 deletions(-) diff --git a/frontend/src/component/archive/ArchiveTable/ArchiveTable.test.tsx b/frontend/src/component/archive/ArchiveTable/ArchiveTable.test.tsx index d3c2ee387d..7e8083122e 100644 --- a/frontend/src/component/archive/ArchiveTable/ArchiveTable.test.tsx +++ b/frontend/src/component/archive/ArchiveTable/ArchiveTable.test.tsx @@ -75,7 +75,7 @@ test('should load the table', async () => { await screen.findByText('someFeature'); }); -test('should show confirm dialog when reviving toggle', async () => { +test('should show confirm dialog when reviving flag', async () => { setupApi(); render( <> @@ -100,7 +100,7 @@ test('should show confirm dialog when reviving toggle', async () => { await screen.findByText("And we're back!"); }); -test('should show confirm dialog when batch reviving toggle', async () => { +test('should show confirm dialog when batch reviving flag', async () => { setupApi(); render( <> diff --git a/frontend/src/component/archive/ArchiveTable/ArchiveTable.tsx b/frontend/src/component/archive/ArchiveTable/ArchiveTable.tsx index f0dfe0bd7f..3c9993191d 100644 --- a/frontend/src/component/archive/ArchiveTable/ArchiveTable.tsx +++ b/frontend/src/component/archive/ArchiveTable/ArchiveTable.tsx @@ -308,14 +308,13 @@ export const ArchiveTable = ({ condition={searchValue?.length > 0} show={ - No feature toggles found matching “ + No feature flags found matching “ {searchValue}” } elseShow={ - None of the feature toggles were archived - yet. + None of the feature flags were archived yet. } /> diff --git a/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureDeleteConfirm/ArchivedFeatureDeleteConfirm.tsx b/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureDeleteConfirm/ArchivedFeatureDeleteConfirm.tsx index 36cefb25d4..4ef40d918a 100644 --- a/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureDeleteConfirm/ArchivedFeatureDeleteConfirm.tsx +++ b/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureDeleteConfirm/ArchivedFeatureDeleteConfirm.tsx @@ -37,7 +37,7 @@ export const ArchivedFeatureDeleteConfirm = ({ const { setToastData, setToastApiError } = useToast(); const { deleteFeatures } = useProjectApi(); - const singularOrPluralToggles = + const singularOrPluralFlags = deletedFeatures.length > 1 ? 'toggles' : 'toggle'; const onDeleteFeatureToggle = async () => { @@ -50,8 +50,8 @@ export const ArchivedFeatureDeleteConfirm = ({ await refetch(); setToastData({ type: 'success', - title: `Feature ${singularOrPluralToggles} deleted`, - text: `You have successfully deleted the following feature ${singularOrPluralToggles}: ${deletedFeatures.join( + title: `Feature ${singularOrPluralFlags} deleted`, + text: `You have successfully deleted the following feature ${singularOrPluralFlags}: ${deletedFeatures.join( ', ', )}.`, }); @@ -71,9 +71,9 @@ export const ArchivedFeatureDeleteConfirm = ({ return ( - Warning! Before you delete a feature toggle, make sure - all in-code references to that feature toggle have been removed. - Otherwise, a new feature toggle with the same name could - activate the old code paths. + Warning! Before you delete a feature flag, make sure all + in-code references to that feature flag have been removed. + Otherwise, a new feature flag with the same name could activate + the old code paths. You are about to delete the following feature{' '} - {singularOrPluralToggles}:{' '} + {singularOrPluralFlags}:{' '} {deletedFeatures.join(', ')}. ({ marginTop: theme.spacing(2) })} > - In order to delete the feature {singularOrPluralToggles}, please + In order to delete the feature {singularOrPluralFlags}, please enter the following confirmation text in the text field below:{' '} I want to delete diff --git a/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureReviveConfirm/ArchivedFeatureReviveConfirm.tsx b/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureReviveConfirm/ArchivedFeatureReviveConfirm.tsx index f8c983de8c..52ea43757b 100644 --- a/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureReviveConfirm/ArchivedFeatureReviveConfirm.tsx +++ b/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureReviveConfirm/ArchivedFeatureReviveConfirm.tsx @@ -78,7 +78,7 @@ export const ArchivedFeatureReviveConfirm = ({ show={ <> - You are about to revive feature toggles: + You are about to revive feature flags: