Repository navigation
[$250] RHN throws error if tags are deleted by admin while member is selecting. #48822
Description
Activity
- addedDailyKSv2KSv2BugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.
on Sep 9, 2024 Triggered auto assignment to @abekkala (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.- addedExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributor
on Sep 9, 2024 - changed the title
[-]RHN throws error if tags are deleted by admin while member is selecting.[/-][+][$250] RHN throws error if tags are deleted by admin while member is selecting.[/+]on Sep 9, 2024 Job added to Upwork: https://www.upwork.com/jobs/~021833231500737320464
- addedHelp WantedApply this label when an issue is open to proposals by contributorsApply this label when an issue is open to proposals by contributors
on Sep 9, 2024 Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat (
External)Edited by proposal-police: This proposal was edited at 2024-09-09 19:59:01 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
RHN throws error if tags are deleted by admin while member is selecting.
What is the root cause of that problem?
We show not found page when there are non enabled options here
App/src/pages/iou/request/step/IOURequestStepTag.tsx
Lines 80 to 81 in 1b479b0
const shouldShowTag = ReportUtils.isReportInGroupPolicy(report) && (transactionTag || OptionsListUtils.hasEnabledTags(policyTagLists)); What changes do you think we should make in order to solve the problem?
- We should implement empty state component as we did for category step page here
App/src/pages/iou/request/step/IOURequestStepCategory.tsx
Lines 171 to 174 in 1b479b0
{shouldShowEmptyState && ( <View style={[styles.flex1]}> <WorkspaceEmptyStateSection shouldStyleAsCard={false}
and display the empty section whenshouldShowTagis false but we should remove!shouldShowTagcondition fromshouldShowNotFoundPage
const isLoading = !isOffline && policyTags === undefined; const shouldShowEmptyState = !isLoading && !shouldShowTag;(We might display not found page for non
isReportInGroupPolicyinstead of empty section as it might make more sense, we can apply the same change in category page too)
and display tag picker only when!shouldShowEmptyState && !isLoadingand show loading indicator when isLoading
We should also use a newemptyTagtitle and subtitle copy-
We should also set up edit tag button equivalent to edit category button (with the respective copy text and route to navigate to) here
App/src/pages/iou/request/step/IOURequestStepCategory.tsx
Lines 180 to 197 in 1b479b0
{PolicyUtils.isPolicyAdmin(policy) && ( <FixedFooter style={[styles.mtAuto, styles.pt5]}> <Button large success style={[styles.w100]} onPress={() => Navigation.navigate( ROUTES.SETTINGS_CATEGORIES_ROOT.getRoute( policy?.id ?? '-1', ROUTES.MONEY_REQUEST_STEP_CATEGORY.getRoute(action, iouType, transactionID, report?.reportID ?? '-1', backTo, reportActionID), ), ) } text={translate('workspace.categories.editCategories')} pressOnEnter /> </FixedFooter>
The button will appear if the user is an admin -
To allow the user to easily create tags and navigate back to money request flow, we can create a similar page to
SETTINGS_CATEGORIES_ROOTwith theWorkspaceTagsPagecomponent (as we did for category by linking the same WorkspaceCategoriesPage inMoneyRequestModalStackNavigatorhere ) -
We will add tag root screen to
SCREENS.RIGHT_MODAL.MONEY_REQUESTand link it to a route likesettings/:policyID/tagsand add the screen inMoneyRequestModalStackNavigator(WorkspaceTagsPage) -
We will pass
MONEY_REQUEST_STEP_TAGroute tobackToto allow the user to come back to the money request tag edit flowROUTES.MONEY_REQUEST_STEP_TAG
What alternative solutions did you explore? (Optional)
- We should implement empty state component as we did for category step page here
I provided a simple and correct proposal
Proposal
Please re-state the problem that we are trying to solve in this issue.
RHN throws error if tags are deleted by admin while member is selecting
What is the root cause of that problem?
We haven't added Empty View to IOURequestStepTag
What changes do you think we should make in order to solve the problem?
Idea: We should show the empty view with the Edit button exclusively for admins, following the same approach we used for the category page
App/src/pages/iou/request/step/IOURequestStepCategory.tsx
Lines 171 to 199 in 968b610
{shouldShowEmptyState && ( <View style={[styles.flex1]}> <WorkspaceEmptyStateSection shouldStyleAsCard={false} icon={Illustrations.EmptyStateExpenses} title={translate('workspace.categories.emptyCategories.title')} subtitle={translate('workspace.categories.emptyCategories.subtitle')} containerStyle={[styles.flex1, styles.justifyContentCenter]} /> {PolicyUtils.isPolicyAdmin(policy) && ( <FixedFooter style={[styles.mtAuto, styles.pt5]}> <Button large success style={[styles.w100]} onPress={() => Navigation.navigate( ROUTES.SETTINGS_CATEGORIES_ROOT.getRoute( policy?.id ?? '-1', ROUTES.MONEY_REQUEST_STEP_CATEGORY.getRoute(action, iouType, transactionID, report?.reportID ?? '-1', backTo, reportActionID), ), ) } text={translate('workspace.categories.editCategories')} pressOnEnter /> </FixedFooter> )} </View> Note: In IOURequestStepTag, the isLoading variable is unnecessary because we don't fetchData as we do in IOURequestStepCategory
Step to Implement:
- Eliminate the shouldShowTag condition from the shouldShowNotFoundPage
- Incorporate the following code into IOURequestStepTagStep
{!shouldShowTag && ( <View style={[styles.flex1]}> <WorkspaceEmptyStateSection ...... /> {PolicyUtils.isPolicyAdmin(policy) && ( <FixedFooter style={[styles.mtAuto, styles.pt5]}> ..... </FixedFooter> )} </View> )} {shouldShowTag && ( Current Code )}What alternative solutions did you explore? (Optional)
Sorry forgot to notify Updated
But note that my last update is hours before the other proposal above
Ok. thanks everyone for the proposal and suggestions. I am inclined to implement a similar page like category selection.
@FitseTLT Looks like you are suggesting a couple more changes and some of them are enhancements.
Could you please structure your proposal in parts and clean it a bit?
14 remaining items
@FitseTLT That's correct!
Reacted by Fitsum Abebe- addedReviewingHas a PR in reviewHas a PR in reviewWeeklyKSv2KSv2and removedDailyKSv2KSv2
on Sep 18, 2024 PAYMENT SUMMARY OCT 11
Fix: @FitseTLT [$250] OFFER
PR Review: @parasharrajat [$250] payment via NewDot@FitseTLT payment sent and contract ended - thank you! 🎉
Reacted by Fitsum AbebeBugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
- [@parasharrajat] The PR that introduced the bug has been identified. Link to the PR:
- [@parasharrajat] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
- [@parasharrajat] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
- [@parasharrajat] Determine if we should create a regression test for this bug.
- [@parasharrajat] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
- [@abekkala] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
- [@parasharrajat] The PR that introduced the bug has been identified. Link to the PR: New feature
- [@parasharrajat] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: New Feature
- [@parasharrajat] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: Not needed
- [@parasharrajat] Determine if we should create a regression test for this bug. Yes
- [@parasharrajat] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
Regression Test Steps
- Log into NewDot as the admin of a workspace in two devices
- Go to workspace settings as admin on Device A
- Go to the tags section
- Make sure there are tags on the workspaces
- On Device B, start creating an expense and on confirmation page press on tag to open tag picker
- On Device A, delete or disable all of the tags.
- On Device B Verify that you haven't created any tags message with Edit tags button appear
- Press on the button and create or enable some tags you have disabled and navigate back to the tag picker
- select any tag and submit the expense
- Verify that the tag you selected appears in the created expense
Do you agree 👍 or 👎 ?
Reacted by April BekkalaPAYMENT SUMMARY
- Fix: @FitseTLT [$250] Paid!
- PR Review: @parasharrajat [$250] payment via NewDot
Payment requested as per #48822 (comment)
$250 approved for @parasharrajat
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
**Version Number:v9.0.30-19
**Reproducible in staging?:Y
**Reproducible in production?:Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
**Issue reported by:Carlos Miceli
Slack conversation:
Action Performed:
Expected Result:
There should be an "there are no tags yet" message.
Actual Result:
Workspace member sees an error view in the RHN instead.
Workaround:
Unknown.
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
tags.error.mov
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @parasharrajat