Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[$250] RHN throws error if tags are deleted by admin while member is selecting. #48822

Closed
1 of 6 tasks
carlosmiceli opened this issue Sep 9, 2024 · 24 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@carlosmiceli
Copy link
Contributor

carlosmiceli commented Sep 9, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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:

  • Logged into NewDot as the admin of a workspace in one window and a member in another.
  • Go to workspace settings as admin.
  • Go to the tags section
  • Make sure there are tags on the workspaces
  • As a member, open a report's tags in that workspace.
  • As an admin, delete all of the tags.

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?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

tags.error.mov

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021833231500737320464
  • Upwork Job ID: 1833231500737320464
  • Last Price Increase: 2024-09-16
  • Automatic offers:
    • FitseTLT | Contributor | 103987322
Issue OwnerCurrent Issue Owner: @parasharrajat
@carlosmiceli carlosmiceli added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 9, 2024
@carlosmiceli carlosmiceli self-assigned this Sep 9, 2024
Copy link

melvin-bot bot commented 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.

@carlosmiceli carlosmiceli added the External Added to denote the issue can be worked on by a contributor label Sep 9, 2024
@melvin-bot melvin-bot bot 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. Sep 9, 2024
Copy link

melvin-bot bot commented Sep 9, 2024

Job added to Upwork: https://www.upwork.com/jobs/~021833231500737320464

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 9, 2024
Copy link

melvin-bot bot commented Sep 9, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat (External)

@FitseTLT
Copy link
Contributor

FitseTLT commented Sep 9, 2024

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

const shouldShowTag = ReportUtils.isReportInGroupPolicy(report) && (transactionTag || OptionsListUtils.hasEnabledTags(policyTagLists));

What changes do you think we should make in order to solve the problem?

  1. We should implement empty state component as we did for category step page here
    {shouldShowEmptyState && (
    <View style={[styles.flex1]}>
    <WorkspaceEmptyStateSection
    shouldStyleAsCard={false}

    and display the empty section when shouldShowTag is false but we should remove !shouldShowTag condition from shouldShowNotFoundPage
const isLoading = !isOffline && policyTags === undefined;
const shouldShowEmptyState = !isLoading && !shouldShowTag;

(We might display not found page for non isReportInGroupPolicy instead 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 && !isLoading and show loading indicator when isLoading
We should also use a new emptyTag title and subtitle copy

  1. We should also set up edit tag button equivalent to edit category button (with the respective copy text and route to navigate to) here

    {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

  2. To allow the user to easily create tags and navigate back to money request flow, we can create a similar page to SETTINGS_CATEGORIES_ROOT with the WorkspaceTagsPage component (as we did for category by linking the same WorkspaceCategoriesPage in MoneyRequestModalStackNavigator here )

  3. We will add tag root screen to SCREENS.RIGHT_MODAL.MONEY_REQUEST and link it to a route like settings/:policyID/tags and add the screen in MoneyRequestModalStackNavigator (WorkspaceTagsPage )

  4. We will pass MONEY_REQUEST_STEP_TAG route to backTo to allow the user to come back to the money request tag edit flow ROUTES.MONEY_REQUEST_STEP_TAG

What alternative solutions did you explore? (Optional)

@cretadn22
Copy link
Contributor

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

{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:

  1. Eliminate the shouldShowTag condition from the shouldShowNotFoundPage
  2. 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)

@FitseTLT
Copy link
Contributor

FitseTLT commented Sep 10, 2024

Sorry forgot to notify Updated

But note that my last update is hours before the other proposal above

@parasharrajat
Copy link
Member

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?

@cretadn22
Copy link
Contributor

@parasharrajat How about my proposal?

@FitseTLT
Copy link
Contributor

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?

@parasharrajat I have organized my proposal as per your request 👍

@parasharrajat
Copy link
Member

@cretadn22 I will review that in sometime.

@parasharrajat
Copy link
Member

@FitseTLT's proposal looks good to me. @cretadn22 I don't see any differences in the approach. Your proposal looks identical to @FitseTLT.

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Sep 10, 2024

Current assignee @carlosmiceli is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

Copy link

melvin-bot bot commented Sep 16, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Sep 16, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 16, 2024
Copy link

melvin-bot bot commented Sep 16, 2024

📣 @FitseTLT 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot removed the Overdue label Sep 16, 2024
@carlosmiceli
Copy link
Contributor Author

Sorry to miss this, assigned to @FitseTLT !

@FitseTLT
Copy link
Contributor

@carlosmiceli
We already have a copy for Edit tag Editar etiqueta but I need the plural form for the button text Edit tags and Google translate is suggesting Editar etiquetas Can u confirm?

@melvin-bot melvin-bot bot added the Overdue label Sep 18, 2024
@carlosmiceli
Copy link
Contributor Author

@FitseTLT That's correct!

@carlosmiceli carlosmiceli added Daily KSv2 and removed Daily KSv2 labels Sep 18, 2024
@melvin-bot melvin-bot bot removed the Overdue label Sep 18, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Sep 19, 2024
@abekkala
Copy link
Contributor

PAYMENT SUMMARY OCT 11

Fix: @FitseTLT [$250] OFFER
PR Review: @parasharrajat [$250] payment via NewDot

@abekkala
Copy link
Contributor

@FitseTLT payment sent and contract ended - thank you! 🎉

@abekkala
Copy link
Contributor

abekkala commented Oct 11, 2024

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:
  • [@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:

@parasharrajat
Copy link
Member

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

  1. Log into NewDot as the admin of a workspace in two devices
  2. Go to workspace settings as admin on Device A
  3. Go to the tags section
  4. Make sure there are tags on the workspaces
  5. On Device B, start creating an expense and on confirmation page press on tag to open tag picker
  6. On Device A, delete or disable all of the tags.
  7. On Device B Verify that you haven't created any tags message with Edit tags button appear
  8. Press on the button and create or enable some tags you have disabled and navigate back to the tag picker
  9. select any tag and submit the expense
  10. Verify that the tag you selected appears in the created expense

Do you agree 👍 or 👎 ?

@abekkala
Copy link
Contributor

PAYMENT SUMMARY

@parasharrajat
Copy link
Member

Payment requested as per #48822 (comment)

@JmillsExpensify
Copy link

$250 approved for @parasharrajat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

6 participants