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

[HOLD for payment 2022-03-22] Searching non existing currency results in a blank page with active Confirm button - reported by @Tushu17 #7966

Closed
mvtglobally opened this issue Mar 2, 2022 · 28 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Improvement Item broken or needs improvement. Reviewing Has a PR in review

Comments

@mvtglobally
Copy link

mvtglobally commented Mar 2, 2022

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. In NewDot, click the green "+" button and select Send Money or Request Money
  2. Click on Currency symbol
  3. Enter something that returns no results (i.e. enter "bug" into the search field)
  4. Click continue on a empty box.

Expected Result:

It should show something like "no results found" and Confirm button should be disabled.

Actual Result:

It shows a blank results page with an active continue button.

Workaround:

unknown

Platform:

Where is this issue occurring?

  • Web
  • iOS
  • Android
  • Desktop App
  • Mobile Web

Version Number: 1.1.41-0
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

screen-rec.2.mp4

Expensify/Expensify Issue URL:
Issue reported by: @Tushu17
Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1644878029333329

View all open jobs on GitHub

@mvtglobally mvtglobally added AutoAssignerTriage Auto assign issues for triage to an available triage team member Daily KSv2 labels Mar 2, 2022
@MelvinBot
Copy link

Triggered auto assignment to @sakluger (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

@MelvinBot MelvinBot removed the AutoAssignerTriage Auto assign issues for triage to an available triage team member label Mar 2, 2022
@sakluger
Copy link
Contributor

sakluger commented Mar 2, 2022

Reproduced this issue, and clarified the action steps in the original GH issue. Ready for engineering. 👌

@sakluger sakluger removed their assignment Mar 2, 2022
@sakluger sakluger added Engineering Improvement Item broken or needs improvement. labels Mar 2, 2022
@MelvinBot
Copy link

Triggered auto assignment to @timszot (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@timszot timszot removed their assignment Mar 2, 2022
@timszot timszot added the External Added to denote the issue can be worked on by a contributor label Mar 2, 2022
@MelvinBot
Copy link

Triggered auto assignment to @NicMendonca (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@timszot
Copy link
Contributor

timszot commented Mar 2, 2022

Looks good to me, sending to external for better handling of this case in the app.

@NicMendonca
Copy link
Contributor

Upwork job posting: https://www.upwork.com/jobs/~0117a680819923466f

@MelvinBot
Copy link

Triggered auto assignment to Contributor-plus team member for initial proposal review - @Santhosh-Sellavel (Exported)

@MelvinBot MelvinBot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 3, 2022
@MelvinBot
Copy link

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

@luacmartins
Copy link
Contributor

Issue looks good. I'd just change the expected behaviour to:

  1. Show No results found.
  2. As per the new Form guidelines, we should not disable the submit button. Instead, when submit is clicked we should show a form error, maybe something like You must select a currency.

@yousaffsdev
Copy link

I suggest to update IOUCurrencySelection.js so that sectionlist has listemptycomponent set to show No results found when data is empty, and a state to hold sectionlist's data

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Mar 3, 2022

@laravue1118 You should be new here. Check out our contributing guidelines first.

And go through these closed issues here for reference.

And make a proper proposal with all the changes you would make to solve this issue.

@thesahindia
Copy link
Member

Proposal

 {this.state.currencyData.length === 0 ? (
                                <View style={[styles.ph5, styles.pb5]}>
                                    <Text style={[styles.textLabel, styles.colorMuted]}>
                                        {this.props.translate('common.noResultsFound')}
                                    </Text>
                                </View>
                            )
                            : null }

we can add the code given above after line 181. By this we can show the no results found message below the search input

<TextInput
ref={el => this.textInput = el}
value={this.state.searchValue}
onChangeText={this.changeSearchValue}
placeholder={this.props.translate('common.search')}
/>

And to remove the ALL CURRENCIES header when no result is there we can just add a if statement like below -

    getSections() {
        const sections = [];

        if (this.state.currencyData.length > 0) {
            sections.push({
                title: this.props.translate('iOUCurrencySelection.allCurrencies'),
                data: this.state.currencyData,
                shouldShow: true,
                indexOffset: 0,
            });
        }
        return sections;
    }

@yousaffsdev
Copy link

Proposal

I will update getSections function.
`

getSections() {
    const sections = [];

    if (this.state.currencyData.length > 0) {
        sections.push({
            title: this.props.translate('iOUCurrencySelection.allCurrencies'),
            data: this.state.currencyData,
            shouldShow: true,
            indexOffset: 0,
        });
    }

    return sections;
}

`

I will update rendering of sectionlist.

`

                        <SectionList
                              ...
                              ListEmptyComponent={ <Text>No results found</Text>}
                              ...
                              renderSectionHeader={({section: {title}}) => (
                                  this.state.sections.length > 0 ? <View>
                                      <Text style={[styles.p5, styles.textMicroBold, styles.colorHeading]}>
                                          {title}
                                      </Text>
                                  </View> : null
                              )}
                          />

`

And in the confirmCurrencySelection, I will check if the data is empty and show error.

`

confirmCurrencySelection() {
    if (this.state.currencyData.length === 0) {
        // show error
       return;
    }
    IOU.setIOUSelectedCurrency(this.state.toggledCurrencyCode);
    Navigation.goBack();
}

`

@Santhosh-Sellavel
Copy link
Collaborator

I will check on this by Wednesday.

@luacmartins
Copy link
Contributor

Hmm I actually think it would be ok to keep the All currencies header and display No results found underneath it. @laravue1118 can you expand on how you will show the error?

@thesahindia
Copy link
Member

@luacmartins, This is how it will look if we keep the All currencies header -
Screenshot 2022-03-08 at 2 51 00 AM

@luacmartins
Copy link
Contributor

I like that better, but I'll ask for @Expensify/design input here.

@thesahindia
Copy link
Member

I had proposed a solution here in case it got missed. I have a better approach for both the options -

                               {this.state.currencyData.length === 0 && (
                                            <Text style={[styles.ph5, styles.textLabel, styles.colorMuted]}>
                                                {this.props.translate('common.noResultsFound')}
                                            </Text>
                                          )}

If we wanna keep the All currencies header we need to add the code written above after line 209

renderSectionHeader={({section: {title}}) => (
<View>
<Text style={[styles.p5, styles.textMicroBold, styles.colorHeading]}>
{title}
</Text>
</View>
)}
/>

If we don't want the All currencies header then we can just render the header based on this.state.currencyData.length

renderSectionHeader={({section: {title}}) => (

                                        <View>
                                            {this.state.currencyData.length === 0 ? (
                                                <Text style={[styles.ph5, styles.textLabel, styles.colorMuted]}>
                                                    {this.props.translate('common.noResultsFound')}
                                                </Text>
                                            ) : (
                                                <Text style={[styles.p5, styles.textMicroBold, styles.colorHeading]}>
                                                    {title}
                                                </Text>
                                            )}
                                        </View>
                                    )}

cc: @luacmartins

@shawnborton
Copy link
Contributor

When there are no results based on your search, I think I prefer it without the "ALL CURRENCIES" header.

@luacmartins
Copy link
Contributor

Thanks @shawnborton! @thesahindia I like your updated approach, but can you elaborate on how you'll display the error when the user taps Confirm with no selected currency?

@thesahindia
Copy link
Member

@luacmartins, I think we don't need an error here as one option always stays selected, so when the user taps confirm the currency that was already selected will be used.

@luacmartins
Copy link
Contributor

Hmm that makes sense. Alright then, let's move forward with your updated approach and removing the All currencies header.

@MelvinBot MelvinBot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 7, 2022
@MelvinBot
Copy link

📣 @thesahindia You have been assigned to this job by @luacmartins!
Please apply to this job in Upwork 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 📖

@luacmartins luacmartins added the Reviewing Has a PR in review label Mar 8, 2022
@botify botify added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Mar 15, 2022
@botify botify changed the title Searching non existing currency results in a blank page with active Confirm button - reported by @Tushu17 [HOLD for payment 2022-03-22] Searching non existing currency results in a blank page with active Confirm button - reported by @Tushu17 Mar 15, 2022
@botify
Copy link

botify commented Mar 15, 2022

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.1.42-6 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 2022-03-22. 🎊

@NicMendonca
Copy link
Contributor

@thesahindia Can you please apply to the job in Upwork so I can issue payment? - https://www.upwork.com/jobs/~0117a680819923466f

@thesahindia
Copy link
Member

@thesahindia Can you please apply to the job in Upwork so I can issue payment? - https://www.upwork.com/jobs/~0117a680819923466f

Done ✅

@botify botify removed the Weekly KSv2 label Mar 22, 2022
@MelvinBot MelvinBot added the Daily KSv2 label Mar 22, 2022
@NicMendonca
Copy link
Contributor

@Santhosh-Sellavel @Tushu17 @thesahindia paid - thank you!

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Mar 23, 2022

@NicMendonca When you have time please end the contract on the Upwork, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Improvement Item broken or needs improvement. Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests