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] Select date in Submission frequency modal gets dismissed modal after reload page #47178

Closed
1 of 6 tasks
m-natarajan opened this issue Aug 9, 2024 · 21 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

@m-natarajan
Copy link

m-natarajan commented Aug 9, 2024

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: 9.0.18-7
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: @dukenv0307
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1723191970067539

Action Performed:

  1. Open account settings
  2. Open workspaces and choose any workspace
  3. In more features turn on Workflows and open it
  4. Turn on Delay submissions and open Submission frequency
  5. Choose monthly
  6. Open date of month
  7. Reload this page
  8. Select any date

Expected Result:

Back to the Submission frequency modal

Actual Result:

Submission frequency modal gets dismissed

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

web.mov
Recording.432.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01b7f48f34dee22a4a
  • Upwork Job ID: 1821971631028523622
  • Last Price Increase: 2024-08-09
  • Automatic offers:
    • dukenv0307 | Reviewer | 103496370
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @dukenv0307
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 9, 2024
Copy link

melvin-bot bot commented Aug 9, 2024

Triggered auto assignment to @isabelastisser (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.

@daledah
Copy link
Contributor

daledah commented Aug 9, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

Submission frequency modal gets dismissed

What is the root cause of that problem?

When the user reloads the page, the navigation stack is cleared
And the function onSelectDayOfMonth we just call the function Navigation.goBack()

const onSelectDayOfMonth = (item: WorkspaceAutoReportingMonthlyOffsetPageItem) => {
Policy.setWorkspaceAutoReportingMonthlyOffset(policy?.id ?? '-1', item.isNumber ? parseInt(item.keyForList, 10) : (item.keyForList as AutoReportingOffsetKeys));
Navigation.goBack();
};

So it will close that modal

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

  1. Add fallback route as a param to function Navigation.goBack();
Navigation.goBack(ROUTES.WORKSPACE_WORKFLOWS_AUTOREPORTING_FREQUENCY.getRoute(policy?.id ?? ''));

const onSelectDayOfMonth = (item: WorkspaceAutoReportingMonthlyOffsetPageItem) => {
Policy.setWorkspaceAutoReportingMonthlyOffset(policy?.id ?? '-1', item.isNumber ? parseInt(item.keyForList, 10) : (item.keyForList as AutoReportingOffsetKeys));
Navigation.goBack();
};

  1. Do the same with the function Navigation.goBack in the header back button

What alternative solutions did you explore? (Optional)

@dukenv0307
Copy link
Contributor

@isabelastisser I'm reporter, so I can take this as C+

@BhuvaneshPatil
Copy link
Contributor

that was quick @daledah 🚀

@isabelastisser isabelastisser added External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors labels Aug 9, 2024
Copy link

melvin-bot bot commented Aug 9, 2024

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

@melvin-bot melvin-bot bot changed the title Select date in Submission frequency modal gets dismissed modal after reload page [$250] Select date in Submission frequency modal gets dismissed modal after reload page Aug 9, 2024
Copy link

melvin-bot bot commented Aug 9, 2024

Current assignee @dukenv0307 is eligible for the External assigner, not assigning anyone new.

@wildan-m
Copy link
Contributor

wildan-m commented Aug 10, 2024

Edited by proposal-police: This proposal was edited at 2024-08-10 10:17:38 UTC.

Proposal

Please re-state the problem that we are trying to solve in this issue.

Select date in Submission frequency modal gets dismissed modal after reload page

What is the root cause of that problem?

We don't send backTo param when navigate to WORKFLOWS_AUTO_REPORTING_MONTHLY_OFFSET

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

Key difference with prev proposal:

  • Submit backTo to the url

In src/ROUTES.ts add backTo param

    WORKSPACE_WORKFLOWS_AUTOREPORTING_MONTHLY_OFFSET: {
        route: 'settings/workspaces/:policyID/workflows/auto-reporting-frequency/monthly-offset',
        getRoute: (policyID: string, backTo?: string) => getUrlWithBackToParam(`settings/workspaces/${policyID}/workflows/auto-reporting-frequency/monthly-offset`, backTo),
    },

In src/pages/workspace/workflows/WorkspaceAutoReportingFrequencyPage.tsx call navigate with backTo param value

            <MenuItem
                title={translate('workflowsPage.submissionFrequencyDateOfMonth')}
                titleStyle={styles.textLabelSupportingNormal}
                description={getDescriptionText()}
                descriptionTextStyle={styles.textNormalThemeText}
                wrapperStyle={styles.pr3}
                onPress={() => Navigation.navigate(ROUTES.WORKSPACE_WORKFLOWS_AUTOREPORTING_MONTHLY_OFFSET.getRoute(policy?.id ?? '', ROUTES.WORKSPACE_WORKFLOWS_AUTOREPORTING_FREQUENCY.getRoute(policy?.id ?? '')))}

In src/pages/workspace/workflows/WorkspaceAutoReportingMonthlyOffsetPage.tsx read navigateBackTo from route

...
   const onSelectDayOfMonth = (item: WorkspaceAutoReportingMonthlyOffsetPageItem) => {
        Policy.setWorkspaceAutoReportingMonthlyOffset(policy?.id ?? '-1', item.isNumber ? parseInt(item.keyForList, 10) : (item.keyForList as AutoReportingOffsetKeys));
        Navigation.goBack(navigateBackTo);
    };
...

                   <HeaderWithBackButton
                        title={translate('workflowsPage.submissionFrequency')}
                        onBackButtonPress={() => Navigation.goBack(navigateBackTo)}
                    />

Branch for this solution

What alternative solutions did you explore? (Optional)

@dukenv0307
Copy link
Contributor

Thanks for your solutions, both of them are to add fallbackUrl to Navigation.goBack, so I prefer the first one

Let's go with @daledah's proposal

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Aug 12, 2024

Triggered auto assignment to @MonilBhavsar, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

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

melvin-bot bot commented Aug 12, 2024

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

Offer link
Upwork job

Copy link

melvin-bot bot commented Aug 12, 2024

📣 @daledah You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Aug 13, 2024
@daledah
Copy link
Contributor

daledah commented Aug 13, 2024

@dukenv0307 This PR is ready for review.

@isabelastisser
Copy link
Contributor

any updates here? @dukenv0307 @daledah

thanks!

@dukenv0307
Copy link
Contributor

The PR was merged 1 week ago @isabelastisser

@isabelastisser
Copy link
Contributor

Thanks for the heads up @dukenv0307! It looks like the payment automation failed.

@isabelastisser
Copy link
Contributor

@daledah, can you please apply for this job in Uprwork or share your Upwork profile here? Thanks!

@daledah
Copy link
Contributor

daledah commented Sep 4, 2024

@isabelastisser My profile is https://www.upwork.com/freelancers/~0138d999529f34d33f thx

@isabelastisser
Copy link
Contributor

Thanks @daledah, I sent you the offer in Upwork now.

@isabelastisser
Copy link
Contributor

@dukenv0307, I processed your payment in Upwork yesterday.
@daledah, please accept the offer and I will process the payment.

All set!

@daledah
Copy link
Contributor

daledah commented Sep 4, 2024

@isabelastisser I accepted it

@isabelastisser
Copy link
Contributor

@daledah, payment approved in Upwork. Thanks!

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

7 participants