You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2024-04-30][$500] Tag - Tag in Parent: Child format is displayed as Parent/: Child in Tag list #37847
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
* Cleans up escaping of colons (used to create multi-level tags, e.g. "Parent: Child") in the tag name we receive from the backend
*/
functiongetCleanedTagName(tag: string){
returntag?.replace(/\\{1,2}:/g,CONST.COLON);
}
Optional
Implement one of the above solutions in the PolicyUtils.getTagLists function and create an argument called shouldExcudeMultiTags, defaulted to false, to exclude the policy's multi-level tags from the result array.
Additional
To handle possible regressions, in this line, let's check the tagList.length instead of policyTags.
What changes do you think we should make in order to solve the problem?
We should not do this, we should follow similar pattern as we do with categories and remove the flat() funciton
Considering that both tags and categories are on the same option menu, it would be good to remove flat() function to maintain consistency in codebase.
What alternative solutions did you explore? (Optional)
Considering the comments, the updated solution is as follows:
As this is a temporary fix, i suggest that we shouldn't update the util function, instead we should modify the FE as follows, we should update the mapping:
We've discussed this internally and the solution we're going with is to just hide any tags that are on level 2 or above, so we only want to display the root level for now.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
changed the title [-][$500] Tag - Tag in Parent: Child format is displayed as Parent/: Child in Tag list[/-][+][HOLD for payment 2024-04-30][$500] Tag - Tag in Parent: Child format is displayed as Parent/: Child in Tag list[/+]on Apr 23, 2024
Activity
github-actions commentedon Mar 6, 2024
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
melvin-bot commentedon Mar 6, 2024
Triggered auto assignment to @marcaaron (
Engineering), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.kbecciv commentedon Mar 6, 2024
We think that this bug might be related to #wave8-collect-admins
@zanyrenney
Tony-MK commentedon Mar 6, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Tag - Tag in Parent: Child format is displayed as Parent/: Child in the Tag list
What is the root cause of that problem?
We are showing all types of policy tags even if they are multiple tags.
App/src/pages/workspace/tags/WorkspaceTagsPage.tsx
Lines 53 to 54 in 98129e6
What changes do you think we should make in order to solve the problem?
We should filter out the policy multi-level tags from the
policyTagList.tagsby checking if thevalue.nameequals the string result from thePolicyUtils.getCleanTagNamefunction.What alternative solutions did you explore? (Optional)
Create a regex to test if the tag is multi-level by checking if the
Parent: Childformat exits in thevalue.namestring.The regex will be similar to the regex the
PolicyUtils.getCleanTagNamefunction uses.App/src/libs/PolicyUtils.ts
Lines 208 to 213 in 13f8bc0
Optional
Implement one of the above solutions in the
PolicyUtils.getTagListsfunction and create an argument calledshouldExcudeMultiTags, defaulted tofalse, to exclude the policy's multi-level tags from the result array.Additional
To handle possible regressions, in this line, let's check the
tagList.lengthinstead ofpolicyTags.allgandalf commentedon Mar 6, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Child format is displayed as Parent/: Child in Tag list
What is the root cause of that problem?
We flatten out the array of tags:
App/src/pages/workspace/tags/WorkspaceTagsPage.tsx
Lines 51 to 73 in 98129e6
See at the end of the code above
What changes do you think we should make in order to solve the problem?
We should not do this, we should follow similar pattern as we do with categories and remove the
flat()funcitonConsidering that both tags and categories are on the same option menu, it would be good to remove
flat()function to maintain consistency in codebase.What alternative solutions did you explore? (Optional)
Considering the comments, the updated solution is as follows:
As this is a temporary fix, i suggest that we shouldn't update the util function, instead we should modify the FE as follows, we should update the mapping:
const tagList = useMemo<PolicyForList[]>( () => policyTagLists .map((policyTagList) => Object.values(policyTagList.tags || []).map((value) => { + let cleanValue = value.name; + const colonIndex = cleanValue.indexOf('\\:'); + if (colonIndex !== -1 && colonIndex > 0) { + cleanValue = cleanValue.substring(0, colonIndex); + } return { + value: cleanValue, + text: cleanValue, + keyForList: cleanValue, isSelected: !!selectedTags[value.name], rightElement: ( <View style={styles.flexRow}> <Text style={[styles.textSupporting, styles.alignSelfCenter, styles.pl2, styles.label]}> {value.enabled ? translate('workspace.common.enabled') : translate('workspace.common.disabled')} </Text> <View style={[styles.p1, styles.pl2]}> <Icon src={Expensicons.ArrowRight} fill={theme.icon} /> </View> </View> ), }; }) ) .flat(), [policyTagLists, selectedTags, styles.alignSelfCenter, styles.flexRow, styles.label, styles.p1, styles.pl2, styles.textSupporting, theme.icon, translate], );marcaaron commentedon Mar 6, 2024
cc @luacmartins @waterim might be able to triage this faster than me. Will take a look soon if not.
luacmartins commentedon Mar 6, 2024
we're discussing this internally since multi-level tags were out of scope for the doc
luacmartins commentedon Mar 7, 2024
We've discussed this internally and the solution we're going with is to just hide any tags that are on level 2 or above, so we only want to display the root level for now.
luacmartins commentedon Mar 7, 2024
We're still discussing some nuances for this case. I'll circle back once we made a decision on the expected behavior
49 remaining items
melvin-bot commentedon Apr 22, 2024
This issue has not been updated in over 15 days. @hoangzinh, @luacmartins, @Tony-MK, @adelekennedy eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
hoangzinh commentedon Apr 23, 2024
The fix has been landed in Prod #38759 (comment)
[-][$500] Tag - Tag in Parent: Child format is displayed as Parent/: Child in Tag list[/-][+][HOLD for payment 2024-04-30][$500] Tag - Tag in Parent: Child format is displayed as Parent/: Child in Tag list[/+]adelekennedy commentedon Apr 30, 2024
payments made - @luacmartins are we good to close?
luacmartins commentedon Apr 30, 2024
Yes, should be good to close. Thanks!