Repository navigation
Description
Tracking GH: https://github.com/Expensify/Expensify/issues/418655
Design Doc: https://docs.google.com/document/d/1_p8qZXVKG-s32i9GKqVjCLEcEREBUEgYcxk3KYHXMVg/edit?usp=sharing
Admin: Editing Tag Levels
- Rearrange toggle position for multi-level tags
We already Disallow "Required" for a tag level when no tags in the level are enabled on NewDot, so we don’t need to make changes here, according to design mocks, we need to move the toggle below the custom tag name field so to update that, we should edit WorkspaceViewTagsPage and rearrange the components as follows:
<OfflineWithFeedback
...props
>
<MenuItemWithTopDescription
...props
description={translate(`workspace.tags.customTagName`)}
/>
</OfflineWithFeedback>;
{
!hasDependentTags && (
<View style={[styles.pv4, styles.ph5]}>
<ToggleSettingOptionRow
...props />
</View>
);
}
Note that we hide the Toggle for dependent tags as we can only mark Independent multi-level tags as not required: \
- Add functionality to mark tags as Required/Not Required
On WorkspaceTagsPage, we want to give the ability to mark independent tags as not required, to do that:
- Update condition to show selector component
Update condition canSelectMultiple to hide the selector options only when the tags are dependent:
const hasDependentTags = useMemo(() => PolicyUtils.hasDependentTags(policy, policyTags), [policy, policyTags]);
const canSelectMultiple = !hasDependentTags && (shouldUseNarrowLayout ? selectionMode?.isEnabled : true);
- Hide existing delete and enable/disable options for multi-level tags
We need to hide the Delete and Disable tag options for multi-level tags. To do that we should update the options const. We should not push both these buttons if we have multi-level tags here, here and here:
if (!hasAccountingConnections && !isUsingMultiLevelTags) {
options.push({
text: translate(
selectedTagsArray.length === 1
? "workspace.tags.deleteTag"
: "workspace.tags.deleteTags"
),
...props
});
}
if (enabledTagCount > 0 && !isUsingMultiLevelTags) {
options.push({
text: translate(
enabledTagCount === 1
? "workspace.tags.disableTag"
: "workspace.tags.disableTags"
),
...props
});
}
if (disabledTagCount > 0 && !isUsingMultiLevelTags) {
options.push({
text: translate(
disabledTagCount === 1
? "workspace.tags.enableTag"
: "workspace.tags.enableTags"
),
value: CONST.POLICY.BULK_ACTION_TYPES.ENABLE,
...props,
});
}
- Introduce new options Require/Don’t Require for multi-level tags
We need to introduce option to mark multi-level Independent tags as required/not required for that first we need to update the en.ts and es.ts files to include new params, the text would be
1. “Require Tag/Tags” with `Expensicons.Document `icon.
2. “Don’t require” with `Expensicons.DocumentSlash `icon.
SPANISH TRANSLATION
| English | Spanish |
| Require Tag | Etiqueta obligatoria |
| Require Tags | Etiquetas obligatorias |
| Don’t require | No requerir. |
Then we have to count the required and not required selected Independent tags:
let requiredTagCount = 0;
const tagListIndexesToMarkNotRequired: number[] = [];
let notRequiredTagCount = 0;
const tagListIndexesToMarkRequired: number[] = [];
for (const tagName of selectedTagsArray) {
if (tagListKeyedByName[tagName]?.required) {
requiredTagCount++;
tagListIndexesToMarkNotRequired.push(
tagListKeyedByName[tagName]?.orderWeight ?? 0
);
} else {
notRequiredTagCount++;
tagListIndexesToMarkRequired.push(
tagListKeyedByName[tagName]?.orderWeight ?? 0
);
}
The above implementation is done similar to the way we do when we calculate the enable/disable tags [count](https://github.com/Expensify/App/blob/0288c7ab0cb779387b642c339bcf4513678e9073/src/pages/workspace/tags/WorkspaceTagsPage.tsx#L234).
- Introduce new util to mark independent multi-level tags as required/not required
We will create new setPolicyTagListsRequired Util which calls the SetPolicyTagListsRequired API command:
\
function setPolicyTagListsRequired(
policyID: string,
tagListIndexes: number[],
requireTagList: boolean
);
We will create 3 Onyx data: Optimistic, Success and Failure. And send it to the API SetPolicyTagListsRequired along with the parameters.
- Then we have to add the required options to the dropdown along with the action to perform: \
if (requiredTagCount > 0) {
options.push({
icon: Expensicons.DocumentSlash,
text: translate("workspace.tags.markNotRequired"),
value: CONST.POLICY.BULK_ACTION_TYPES.DISABLE,
onSelected: () => {
setSelectedTags({});
Tag.setPolicyTagListsRequired(policyID, tagListIndexesToMarkNotRequired, false);
},
});
}
if (notRequiredTagCount > 0) {
options.push({
icon: Expensicons.Document,
text: translate("workspace.tags.markRequired"),
value: CONST.POLICY.BULK_ACTION_TYPES.ENABLE,
onSelected: () => {
setSelectedTags({});
Tag.setPolicyTagListsRequired(policyID, tagListIndexesToMarkRequired, true);
},
});
}
Issue Owner
Current Issue Owner: @abekkalaMetadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
melvin-bot commentedon May 9, 2025
Triggered auto assignment to @abekkala (
NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.allgandalf commentedon May 12, 2025
Will start to work on it this week
abekkala commentedon May 16, 2025
@allgandalf can you link the PR here please?
allgandalf commentedon May 19, 2025
will link one by EOD, combining this issue with other issue for importing tags, hence the delay! thanks for the patience
19 remaining items
melvin-bot commentedon Jun 9, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.62-0 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2025-06-16. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jun 9, 2025
BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
akinwale commentedon Jun 13, 2025
@abekkala This is part of an ongoing project / new feature, so the checklist isn't required here. I would need to be assigned as C+ since I reviewed the PR. Thanks.
melvin-bot commentedon Jun 16, 2025
Payment Summary
Upwork Job
BugZero Checklist (@abekkala)
akinwale commentedon Jun 16, 2025
@abekkala Bump for payment summary. Thanks.
abekkala commentedon Jun 16, 2025
PAYMENT SUMMARY FOR JUN 16
allgandalf commentedon Jun 17, 2025
Yes @abekkala
JmillsExpensify commentedon Jun 26, 2025
$250 approved for @akinwale