Skip to content

Commit e766c7f

Browse files
authored
Merge pull request Expensify#65908 from Expensify/yuwen-removeMLT
Remove multiLevelTags beta
2 parents 56ab1e0 + 68dae06 commit e766c7f

3 files changed

Lines changed: 31 additions & 43 deletions

File tree

src/CONST/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,6 @@ const CONST = {
642642
CUSTOM_RULES: 'customRules',
643643
GLOBAL_REIMBURSEMENTS_ON_ND: 'globalReimbursementsOnND',
644644
IS_TRAVEL_VERIFIED: 'isTravelVerified',
645-
MULTI_LEVEL_TAGS: 'multiLevelTags',
646645
NEWDOT_MULTI_FILES_DRAG_AND_DROP: 'newDotMultiFilesDragAndDrop',
647646
NEWDOT_MULTI_SCAN: 'newDotMultiScan',
648647
PLAID_COMPANY_CARDS: 'plaidCompanyCards',

src/pages/workspace/tags/WorkspaceTagsPage.tsx

Lines changed: 31 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import useLocalize from '@hooks/useLocalize';
2828
import useMobileSelectionMode from '@hooks/useMobileSelectionMode';
2929
import useNetwork from '@hooks/useNetwork';
3030
import useOnyx from '@hooks/useOnyx';
31-
import usePermissions from '@hooks/usePermissions';
3231
import usePolicy from '@hooks/usePolicy';
3332
import useResponsiveLayout from '@hooks/useResponsiveLayout';
3433
import useSearchBackPress from '@hooks/useSearchBackPress';
@@ -112,7 +111,6 @@ function WorkspaceTagsPage({route}: WorkspaceTagsPageProps) {
112111
openPolicyTagsPage(policyID);
113112
}, [policyID]);
114113
const isQuickSettingsFlow = route.name === SCREENS.SETTINGS_TAGS.SETTINGS_TAGS_ROOT;
115-
const {isBetaEnabled} = usePermissions();
116114

117115
const tagsList = useMemo(() => {
118116
if (isMultiLevelTags) {
@@ -191,28 +189,27 @@ function WorkspaceTagsPage({route}: WorkspaceTagsPageProps) {
191189
enabled: true,
192190
required: policyTagList.required,
193191
isDisabledCheckbox: isSwitchDisabled,
194-
rightElement:
195-
isBetaEnabled(CONST.BETAS.MULTI_LEVEL_TAGS) && hasDependentTags ? (
196-
<ListItemRightCaretWithLabel
197-
labelText={translate('workspace.tags.tagCount', {count: Object.keys(policyTagList?.tags ?? {}).length})}
198-
shouldShowCaret
199-
/>
200-
) : (
201-
<Switch
202-
isOn={isSwitchEnabled}
203-
accessibilityLabel={translate('workspace.tags.requiresTag')}
204-
onToggle={(newValue: boolean) => {
205-
if (isMakingLastRequiredTagListOptional(policy, policyTags, [policyTagList])) {
206-
setIsCannotMakeLastTagOptionalModalVisible(true);
207-
return;
208-
}
209-
210-
updateWorkspaceRequiresTag(newValue, policyTagList.orderWeight);
211-
}}
212-
disabled={isSwitchDisabled}
213-
showLockIcon={isMakingLastRequiredTagListOptional(policy, policyTags, [policyTagList])}
214-
/>
215-
),
192+
rightElement: hasDependentTags ? (
193+
<ListItemRightCaretWithLabel
194+
labelText={translate('workspace.tags.tagCount', {count: Object.keys(policyTagList?.tags ?? {}).length})}
195+
shouldShowCaret
196+
/>
197+
) : (
198+
<Switch
199+
isOn={isSwitchEnabled}
200+
accessibilityLabel={translate('workspace.tags.requiresTag')}
201+
onToggle={(newValue: boolean) => {
202+
if (isMakingLastRequiredTagListOptional(policy, policyTags, [policyTagList])) {
203+
setIsCannotMakeLastTagOptionalModalVisible(true);
204+
return;
205+
}
206+
207+
updateWorkspaceRequiresTag(newValue, policyTagList.orderWeight);
208+
}}
209+
disabled={isSwitchDisabled}
210+
showLockIcon={isMakingLastRequiredTagListOptional(policy, policyTags, [policyTagList])}
211+
/>
212+
),
216213
};
217214
});
218215
}
@@ -241,7 +238,7 @@ function WorkspaceTagsPage({route}: WorkspaceTagsPageProps) {
241238
/>
242239
),
243240
}));
244-
}, [isMultiLevelTags, policyTagLists, isBetaEnabled, hasDependentTags, translate, policy, policyTags, updateWorkspaceRequiresTag, updateWorkspaceTagEnabled]);
241+
}, [isMultiLevelTags, policyTagLists, hasDependentTags, translate, policy, policyTags, updateWorkspaceRequiresTag, updateWorkspaceTagEnabled]);
245242

246243
const filterTag = useCallback((tag: TagListItem, searchInput: string) => {
247244
const tagText = StringUtils.normalize(tag.text?.toLowerCase() ?? '');
@@ -286,7 +283,7 @@ function WorkspaceTagsPage({route}: WorkspaceTagsPageProps) {
286283
};
287284

288285
const getCustomListHeader = () => {
289-
if (isBetaEnabled(CONST.BETAS.MULTI_LEVEL_TAGS) && hasDependentTags) {
286+
if (hasDependentTags) {
290287
return (
291288
<CustomListHeader
292289
canSelectMultiple={false}
@@ -345,18 +342,12 @@ function WorkspaceTagsPage({route}: WorkspaceTagsPageProps) {
345342
close(() => setIsOfflineModalVisible(true));
346343
return;
347344
}
348-
if (isBetaEnabled(CONST.BETAS.MULTI_LEVEL_TAGS)) {
349-
Navigation.navigate(
350-
isQuickSettingsFlow
351-
? ROUTES.SETTINGS_TAGS_IMPORT.getRoute(policyID, ROUTES.SETTINGS_TAGS_ROOT.getRoute(policyID, backTo))
352-
: ROUTES.WORKSPACE_TAGS_IMPORT_OPTIONS.getRoute(policyID),
353-
);
354-
} else {
355-
Navigation.navigate(
356-
isQuickSettingsFlow ? ROUTES.SETTINGS_TAGS_IMPORT.getRoute(policyID, ROUTES.SETTINGS_TAGS_ROOT.getRoute(policyID, backTo)) : ROUTES.WORKSPACE_TAGS_IMPORT.getRoute(policyID),
357-
);
358-
}
359-
}, [backTo, isOffline, isQuickSettingsFlow, policyID, isBetaEnabled]);
345+
Navigation.navigate(
346+
isQuickSettingsFlow
347+
? ROUTES.SETTINGS_TAGS_IMPORT.getRoute(policyID, ROUTES.SETTINGS_TAGS_ROOT.getRoute(policyID, backTo))
348+
: ROUTES.WORKSPACE_TAGS_IMPORT_OPTIONS.getRoute(policyID),
349+
);
350+
}, [backTo, isOffline, isQuickSettingsFlow, policyID]);
360351

361352
const hasAccountingConnections = hasAccountingConnectionsPolicyUtils(policy);
362353
const secondaryActions = useMemo(() => {
@@ -387,7 +378,7 @@ function WorkspaceTagsPage({route}: WorkspaceTagsPageProps) {
387378
return;
388379
}
389380
close(() => {
390-
if (hasIndependentTags && isBetaEnabled(CONST.BETAS.MULTI_LEVEL_TAGS)) {
381+
if (hasIndependentTags) {
391382
downloadMultiLevelIndependentTagsCSV(policyID, () => {
392383
setIsDownloadFailureModalVisible(true);
393384
});
@@ -403,7 +394,7 @@ function WorkspaceTagsPage({route}: WorkspaceTagsPageProps) {
403394
}
404395

405396
return menuItems;
406-
}, [translate, navigateToTagsSettings, isBetaEnabled, hasDependentTags, hasVisibleTags, isOffline, policyID, hasIndependentTags, hasAccountingConnections, navigateToImportSpreadsheet]);
397+
}, [translate, navigateToTagsSettings, hasDependentTags, hasVisibleTags, isOffline, policyID, hasIndependentTags, hasAccountingConnections, navigateToImportSpreadsheet]);
407398

408399
const getHeaderButtons = () => {
409400
const selectedTagsObject = selectedTags.map((key) => policyTagLists.at(0)?.tags?.[key]);

tests/unit/usePermissionsTest.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ describe('usePermissions', () => {
6565
// Initially, check the value for the initial betas
6666
expect(result.current.isBetaEnabled(CONST.BETAS.DEFAULT_ROOMS)).toBe(true);
6767
expect(result.current.isBlockedFromSpotnanaTravel).toBe(true);
68-
expect(result.current.isBetaEnabled(CONST.BETAS.MULTI_LEVEL_TAGS)).toBe(false);
6968
expect(result.current.isBetaEnabled(CONST.BETAS.ALL)).toBe(false);
7069

7170
Onyx.merge(ONYXKEYS.BETAS, updatedBetas);
@@ -75,6 +74,5 @@ describe('usePermissions', () => {
7574
// After update, check the value for the updated betas
7675
expect(result.current.isBlockedFromSpotnanaTravel).toBe(false);
7776
expect(result.current.isBetaEnabled(CONST.BETAS.ALL)).toBe(true);
78-
expect(result.current.isBetaEnabled(CONST.BETAS.MULTI_LEVEL_TAGS)).toBe(true);
7977
});
8078
});

0 commit comments

Comments
 (0)