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

[$500] Request money - App displays Full message in search for description change request money #28185

Closed
4 of 6 tasks
izarutskaya opened this issue Sep 25, 2023 · 19 comments
Closed
4 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 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

Comments

@izarutskaya
Copy link

izarutskaya commented Sep 25, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Open the app
  2. Open a request money report or raise new report and open it
  3. Click on description
  4. Enter multiline report and save it
  5. Open search and observe that app displays full description change message in search in place of small preview with 3 dots as it does for other big messages.

Expected Result:

App should display multiline description change messages with small preview and 3 dots in search

Actual Result:

App displays multiline description change messages fully in search

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: v1.3.74-0

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

Notes/Photos/Videos: Any additional supporting documentation

full.message.displayed.in.search.for.description.change.windows.chrome.mp4
Recording.1635.mp4
android.chrome.displays.description.change.fully.in.search.mp4
description.displayed.fully.in.search.mac.desktop.mac.chrome.ios.safari.mov

Expensify/Expensify Issue URL:

Issue reported by: @dhanashree-sawant

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695464156823429

View all open jobs on GitHub
App displays Full message in search for description change request money

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d694f13e5dde7a66
  • Upwork Job ID: 1706390155446837248
  • Last Price Increase: 2023-10-02
@izarutskaya izarutskaya added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 25, 2023
@melvin-bot melvin-bot bot changed the title Web - Request money - App displays Full message in search for description change request money [$500] Web - Request money - App displays Full message in search for description change request money Sep 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

Triggered auto assignment to @jliexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

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

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

melvin-bot bot commented Sep 25, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

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

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Sep 25, 2023

Proposal

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

Search list displays multiline description change messages fully

What is the root cause of that problem?

We pass alternative text
Without formatting it at all

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

Before displaying the elements, it would be a good idea to add a formatter for alternative text that will remove the beginning of new lines so that the message is displayed on one line

This will allow 3 dots to be displayed

We can update this sections.push

if (this.state.recentReports.length > 0) {
sections.push({
data: this.state.recentReports,
shouldShow: true,
indexOffset,
});
indexOffset += this.state.recentReports.length;
}

Like

        if (this.state.recentReports.length > 0) {
            sections.push({
                data: _.map(this.state.recentReports, (report) => {
                    if (lodashGet(report, 'alternateText', '')) {
                        return {
                            ...report,
                            alternateText: report.alternateText.replace(/\r\n/g, ' '),
                        };
                    }
                    return report;
                }),
                shouldShow: true,
                indexOffset,
            });
            indexOffset += this.state.recentReports.length;
        }

What alternative solutions did you explore? (Optional)

NA

@jliexpensify
Copy link
Contributor

Removing Mitch as I am the first b0 person assigned

@talha-programmer
Copy link

talha-programmer commented Sep 27, 2023

Proposal

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

The search bar shows detailed message in case the description of Money Request is changed and contains new line characters

What is the root cause of that problem?

Due to new line characters, the text is not automatically reduced to a single line

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

In order solve the problem, we have to remove new line characters from the message text displayed in the search bar. In my opinion, the most appropriate way to do that is through a utility function defined in StringUtils.ts file like this:

function replaceNewLineChars(str: string, replaceWith = '') :string {
    return str.replaceAll(CONST.REGEX.NEW_LINE_CHARS, replaceWith);
}

Also, a new constant added in the CONST.ts file like this NEW_LINE_CHARS: /\r\n/g, inside the REGEX object.

After that we will use the utility function in the OptionsListUtils.js file in the createOption() function:

        if(removeNewLineChars) {
            result.alternateText = StringUtils.replaceNewLineChars(result.alternateText, ' ');
        }

The removeNewLineChars is passed to the last parameter of createOption function:

function createOption(accountIDs, personalDetails, report, reportActions = {}, {showChatPreviewLine = false, forcePolicyNamePreview = false, removeNewLineChars = false}) 

The parameter 'removeNewLineChars' is used to have the ability to remove new line characters only when required. So that it won't conflict with any other functionality.

This parameter will be set to true when called from the getSearchOptions function and passed all the way down to the createOption function.

I haven't posted the complete code to make the proposal to the point. Please let me know if anything is not clear!

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot
Copy link

melvin-bot bot commented Sep 27, 2023

📣 @talha-programmer! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@talha-programmer
Copy link

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~01d2a31eb1ae210807

@melvin-bot
Copy link

melvin-bot bot commented Sep 27, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@shubham1206agra
Copy link
Contributor

Proposal

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

Web - Request money - App displays Full message in search for description change request money

What is the root cause of that problem?

During the description transition from single line to multiline, the whiteSpace style was also switched from styles.pre to styles.noWrap for this exact issue in the sidebar.

They just forgot to do the same here.

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

Just replace styles.pre with styles.noWrap here.

lodashGet(this.props.option, 'alternateTextMaxLines', 1) === 1 ? styles.pre : styles.preWrap,

What alternative solutions did you explore? (Optional)

NA

@kbecciv kbecciv changed the title [$500] Web - Request money - App displays Full message in search for description change request money [$500] Request money - App displays Full message in search for description change request money Sep 27, 2023
@shubham1206agra
Copy link
Contributor

This is fixed by #27822
cc @eVoloshchak @jliexpensify

@melvin-bot melvin-bot bot added the Overdue label Sep 28, 2023
@jliexpensify
Copy link
Contributor

@eVoloshchak Tested and I think it's fixed? Could youy verify too?

If so, I will pay out the reporter and close this!

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Sep 29, 2023
@eVoloshchak
Copy link
Contributor

@jliexpensify, this is resolved for me too!

@melvin-bot melvin-bot bot removed the Overdue label Oct 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

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

@jliexpensify
Copy link
Contributor

Great thanks!

Payment summary:

Could you apply here? Sorry, having issues inviting you to this specific job.

@dhanashree-sawant
Copy link

That's okay, I have applied to the job

@jliexpensify
Copy link
Contributor

Paid and job closed, 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. Daily KSv2 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
Projects
None yet
Development

No branches or pull requests

8 participants