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

Fix IOU Options bug #8839

Merged
merged 8 commits into from
May 5, 2022
Merged

Conversation

sobitneupane
Copy link
Contributor

@sobitneupane sobitneupane commented Apr 30, 2022

Show Request and Send Money options when there are two participants, Splitbill option when there are more than two participants and no option if there is only one participant

Details

Fixed Issues

$ #8357

Tests

  1. Open one-to-one chats, group chats and chat rooms with single participant, two participants and multiple participants
  2. Click on Action (+) Button in ReportAction Compose box to see various options.
  3. Verify that
    • there are "Request money", "Send money" and "Add attachment" options in one-to-one chats and chat rooms with two participants.
    • there are "Split bill" and "Add attachment" options in group chats and chat rooms with more than two participants.
    • there is only "Add attachment" option in chat room with single participant.
  • Verify that no errors appear in the JS console

PR Review Checklist

Contributor (PR Author) Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • MacOS / Desktop
  • I verified there are no console errors (if there’s a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained “why” the code was doing something instead of only explaining “what” the code was doing.
    • I verified any copy / text shown in the product was added in all src/languages/* files
    • I verified any copy / text that was added to the app is correct English and approved by marketing by tagging the marketing team on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named “index.js”. All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • Any functional components have the displayName property
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose and it is
  • If a new CSS style is added I verified that:
    • A similar style doesn’t already exist
    • The style can’t be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.

PR Reviewer Checklist

  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • MacOS / Desktop
  • I verified there are no console errors (if there’s a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained “why” the code was doing something instead of only explaining “what” the code was doing.
    • I verified any copy / text shown in the product was added in all src/languages/* files
    • I verified any copy / text that was added to the app is correct English and approved by marketing by tagging the marketing team on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named “index.js”. All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • Any functional components have the displayName property
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn’t already exist
    • The style can’t be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.

QA Steps

  1. Open one-to-one chats, group chats and chat rooms with single participant, two participants and multiple participants
  2. Click on Action (+) Button in ReportAction Compose box to see various options.
  3. Verify that
    • there are "Request money", "Send money" and "Add attachment" options in one-to-one chats and chat rooms with two participants.
    • there are "Split bill" and "Add attachment" options in group chats and chat rooms with more than two participants.
    • there is only "Add attachment" option in chat room with single participant.
  • Verify that no errors appear in the JS console

Screenshots

Web

Chat Room With only 1 member Chat Room With 2 members Chat Room With more than 2 members
One-to-One Chat Group Chat

Mobile Web

Chat Room With only 1 member Chat Room With 2 members Chat Room With more than 2 members
Screenshot_1651500869 Screenshot_1651500838 Screenshot_1651500800
One-to-One Chat Group Chat
Screenshot_1651500815 Screenshot_1651500825

Desktop

Chat Room With only 1 member Chat Room With 2 members Chat Room With more than 2 members
One-to-One Chat Group Chat

iOS

Chat Room With only 1 member Chat Room With 2 members Chat Room With more than 2 members
Simulator Screen Shot - iPhone 13 - 2022-05-02 at 20 05 21 Simulator Screen Shot - iPhone 13 - 2022-05-02 at 20 05 06 Simulator Screen Shot - iPhone 13 - 2022-05-02 at 20 04 56
One-to-One Chat Group Chat
Simulator Screen Shot - iPhone 13 - 2022-05-02 at 20 04 36 Simulator Screen Shot - iPhone 13 - 2022-05-02 at 20 04 45

Android

Chat Room With only 1 member Chat Room With 2 members Chat Room With more than 2 members
Screenshot_1651500423] Screenshot_1651500186 Screenshot_1651500296
One-to-One Chat Group Chat
Screenshot_1651500118 Screenshot_1651500144

Show Request and Send Money options when there are two participants, Splitbill option when there are more than two participants and no option if there is only one participant
@sobitneupane sobitneupane marked this pull request as ready for review May 2, 2022 14:25
@sobitneupane sobitneupane requested a review from a team as a code owner May 2, 2022 14:25
@melvin-bot melvin-bot bot requested review from iwiznia and Santhosh-Sellavel and removed request for a team May 2, 2022 14:25
Copy link
Collaborator

@Santhosh-Sellavel Santhosh-Sellavel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check out this #8357 (comment)

I've asked to move the logic to a new method!

@sobitneupane
Copy link
Contributor Author

sobitneupane commented May 2, 2022

Can you check out this #8357 (comment)

I've asked to move the logic to a new method!

Done.

@iwiznia @Santhosh-Sellavel I have found another existing bug. While splitting bill, the logged in user(Chaudary Dai in this case) is counted twice.
Screen Shot 2022-05-02 at 23 01 11

I think changing

participants={this.props.hasMultipleParticipants
                                                    ? this.state.participants
                                                    : _.filter(this.state.participants, email => this.props.myPersonalDetails.login !== email.login)}

to

participants={_.filter(this.state.participants, email => this.props.myPersonalDetails.login !== email.login)}

in IOUModal.js solves the issue.

Should I go through whole process of reporting? Or will I be compensated if I solved it here?

Comment on lines 234 to 245
/**
* Returns the list of report compose actions
*
* @param {Boolean} showSplitBill
* @param {Boolean} showSendRequestMoney
* @param {Boolean} hasExcludedIOUEmails
* @param {Function} openPicker
* @param {Function} displayFileInModal
* @returns {Array<object>}
*/
getReportComposeActions(showSplitBill, showSendRequestMoney, hasExcludedIOUEmails, openPicker, displayFileInModal) {
return [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need to compute and pass everything to this function it does not make any sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved.

Comment on lines 246 to 300
...(!hasExcludedIOUEmails
&& Permissions.canUseIOU(this.props.betas)
&& showSplitBill ? [
{
icon: Expensicons.Receipt,
text: this.props.translate('iou.splitBill'),
onSelected: () => {
Navigation.navigate(
ROUTES.getIouSplitRoute(
this.props.reportID,
),
);
},
},
] : []),
...(!hasExcludedIOUEmails
&& Permissions.canUseIOU(this.props.betas)
&& showSendRequestMoney ? [
{
icon: Expensicons.MoneyCircle,
text: this.props.translate('iou.requestMoney'),
onSelected: () => {
Navigation.navigate(
ROUTES.getIouRequestRoute(
this.props.reportID,
),
);
},
},
] : []),
...(!hasExcludedIOUEmails && Permissions.canUseIOUSend(this.props.betas) && showSendRequestMoney ? [
{
icon: Expensicons.Send,
text: this.props.translate('iou.sendMoney'),
onSelected: () => {
Navigation.navigate(
ROUTES.getIOUSendRoute(
this.props.reportID,
),
);
},
},
] : []),
{
icon: Expensicons.Paperclip,
text: this.props.translate('reportActionCompose.addAttachment'),
onSelected: () => {
openPicker({
onPicked: (file) => {
displayFileInModal({file});
},
});
},
},
];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code is not DRY, we have redundant checks here. Can you refactor this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactoring this might result into nested ternary operators. I was discouraged to use nested ternary operators in previous PRs. Any suggestion?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use simple if/else no need for ternary here.

Copy link
Contributor Author

@sobitneupane sobitneupane May 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will look something like this. Any suggestion?

        const actions = [];
        if (!hasExcludedIOUEmails) {
            if (Permissions.canUseIOU(this.props.betas)) {
                if (showSplitBill) {
                    actions.push(
                        {
                            icon: Expensicons.Receipt,
                            text: this.props.translate('iou.splitBill'),
                            onSelected: () => {
                                Navigation.navigate(
                                    ROUTES.getIouSplitRoute(
                                        this.props.reportID,
                                    ),
                                );
                            },
                        },
                    );
                }
                if (showSendRequestMoney) {
                    actions.push({
                        icon: Expensicons.MoneyCircle,
                        text: this.props.translate('iou.requestMoney'),
                        onSelected: () => {
                            Navigation.navigate(
                                ROUTES.getIouRequestRoute(
                                    this.props.reportID,
                                ),
                            );
                        },
                    });
                }
            }
            if (Permissions.canUseIOUSend(this.props.betas) && showSendRequestMoney) {
                actions.push({
                    icon: Expensicons.Send,
                    text: this.props.translate('iou.sendMoney'),
                    onSelected: () => {
                        Navigation.navigate(
                            ROUTES.getIOUSendRoute(
                                this.props.reportID,
                            ),
                        );
                    },
                });
            }
        }

        actions.push({
            icon: Expensicons.Paperclip,
            text: this.props.translate('reportActionCompose.addAttachment'),
            onSelected: () => {
                openPicker({
                    onPicked: (file) => {
                        displayFileInModal({file});
                    },
                });
            },
        });
        return actions;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just move IOU options computation alone to a new method, leave Add Attachment untouched thanks!

 getIOUOptions(reportParticipants) {
        const iouOptions = [];
        const participants = _.filter(reportParticipants, email => this.props.myPersonalDetails.login !== email).length > 1;
        const hasExcludedIOUEmails = lodashIntersection(reportParticipants, CONST.EXPENSIFY_EMAILS).length > 0;
        const hasMultipleParticipants = participants.length > 1;

        if (hasExcludedIOUEmails || participants.length === 0 || Permissions.canUseIOU(this.props.betas)) {
            return iouOptions;
        }

        if (hasMultipleParticipants) {
            // append split
        }
        else {
            if (Permissions.canUseIOUSend(this.props.betas)) {
                // append send
            }
            // append request
        }

        return iouOptions;
    }

cc: @iwiznia

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment on lines 432 to 434
participants={this.props.hasMultipleParticipants
? this.state.participants
: _.filter(this.state.participants, email => this.props.myPersonalDetails.login !== email.login)}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be done here, I think it could be moved along the lines here

const participants = lodashGet(props, 'report.participants', []);
const participantsWithDetails = _.map(OptionsListUtils.getPersonalDetailsForLogins(participants, props.personalDetails), personalDetails => ({

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Participants are updated during IOUParicipantsPage step. So, it cannot be moved here. We need to make use of updated participants list.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IOUParicipantsPage will not be used for Room or group flow. So no issues there.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check and let me know!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's a good idea. It adds more complication.

@Santhosh-Sellavel
Copy link
Collaborator

@sobitneupane I believe this is well within the scope of this issue.
If it's going to get compensated then it's for reporting only. It was evidently reported by someone else before you in this #8357 (comment)

cc @iwiznia

@sobitneupane
Copy link
Contributor Author

sobitneupane commented May 2, 2022

@sobitneupane I believe this is well within the scope of this issue. If it's going to get compensated then it's for reporting only. It was evidently reported by someone else before you in this #8357 (comment)

I have already solved the issue mentioned in this comment while solving this issue as it is part of this issue. It would have been an issue introduced while solving this issue. But while testing I found that the issue I mentioned also occurs. If it is believed to be part of this issue I will solve it here. It was an existing issue.

@Santhosh-Sellavel
Copy link
Collaborator

@sobitneupane I believe this is well within the scope of this issue. If it's going to get compensated then it's for reporting only. It was evidently reported by someone else before you in this #8357 (comment)

I have already solved the issue mentioned in this comment while solving this issue as it is part of this issue. It would have been an issue introduced while solving this issue. But while testing I found that the issue I mentioned also occurs. If it is believed to be part of this issue I will solve it here. It was an existing issue.

Thanks, I would let @iwiznia take the final call!

@sobitneupane
Copy link
Contributor Author

@sobitneupane I believe this is well within the scope of this issue. If it's going to get compensated then it's for reporting only. It was evidently reported by someone else before you in this #8357 (comment)

I have already solved the issue mentioned in this comment while solving this issue as it is part of this issue. It would have been an issue introduced while solving this issue. But while testing I found that the issue I mentioned also occurs. If it is believed to be part of this issue I will solve it here. It was an existing issue.

Thanks, I would let @iwiznia take the final call!

Solved this issue as well. I am okay either way.

@iwiznia
Copy link
Contributor

iwiznia commented May 3, 2022

I think it's basically the same issue or very closely related, so original amount should apply. If you disagree, please let me know and we can discuss.

Comment on lines 280 to 286
onSelected: () => {
Navigation.navigate(
ROUTES.getIOUSendRoute(
this.props.reportID,
),
);
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given it's only one param per method and line is not too long, I think this is more readable

Suggested change
onSelected: () => {
Navigation.navigate(
ROUTES.getIOUSendRoute(
this.props.reportID,
),
);
},
onSelected: () => Navigation.navigate(ROUTES.getIOUSendRoute(this.props.reportID)),

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made the requested change

* @returns {Array<object>}
*/
getIOUOptions(reportParticipants) {
const iouOptions = [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this (see other comments)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made the requested change

const hasMultipleParticipants = participants.length > 1;

if (hasExcludedIOUEmails || participants.length === 0 || !Permissions.canUseIOU(this.props.betas)) {
return iouOptions;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return iouOptions;
return [];

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made the requested change

Comment on lines 251 to 264
iouOptions.push(
{
icon: Expensicons.Receipt,
text: this.props.translate('iou.splitBill'),
onSelected: () => {
Navigation.navigate(
ROUTES.getIouSplitRoute(
this.props.reportID,
),
);
},
},
);
} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Early return here

Suggested change
iouOptions.push(
{
icon: Expensicons.Receipt,
text: this.props.translate('iou.splitBill'),
onSelected: () => {
Navigation.navigate(
ROUTES.getIouSplitRoute(
this.props.reportID,
),
);
},
},
);
} else {
return [{
icon: Expensicons.Receipt,
text: this.props.translate('iou.splitBill'),
onSelected: () => Navigation.navigate(ROUTES.getIouSplitRoute(this.props.reportID)),
}];
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made the requested change

},
);
} else {
iouOptions.push({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
iouOptions.push({
const iouOptions = [];
iouOptions.push({

Copy link
Contributor Author

@sobitneupane sobitneupane May 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else statement is removed as it is no longer needed and variable is declared at the top of the function.

Comment on lines 268 to 274
onSelected: () => {
Navigation.navigate(
ROUTES.getIouRequestRoute(
this.props.reportID,
),
);
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
onSelected: () => {
Navigation.navigate(
ROUTES.getIouRequestRoute(
this.props.reportID,
),
);
},
onSelected: () => Navigation.navigate(ROUTES.getIOUSendRoute(this.props.reportID)),

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made the requested change

iwiznia
iwiznia previously approved these changes May 4, 2022
@iwiznia
Copy link
Contributor

iwiznia commented May 4, 2022

@Santhosh-Sellavel if everything looks good, please approve the PR.

Comment on lines +637 to +639
myPersonalDetails: {
key: ONYXKEYS.MY_PERSONAL_DETAILS,
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prop type is defined for myPersonalDetails can you add that, thanks!

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented May 4, 2022

PR Reviewer Checklist

  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • MacOS / Desktop
  • I verified there are no console errors (if there’s a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained “why” the code was doing something instead of only explaining “what” the code was doing.
    • I verified any copy / text shown in the product was added in all src/languages/* files
    • I verified any copy / text that was added to the app is correct English and approved by marketing by tagging the marketing team on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named “index.js”. All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • Any functional components have the displayName property
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn’t already exist
    • The style can’t be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.

@Santhosh-Sellavel
Copy link
Collaborator

@sobitneupane
Add what to verify as result step with options to show based on different chat types. Add it to the Tests & QA Test sections.

Example:
In 1:1 verify that only request, send, attachment options are shown ..

Copy link
Collaborator

@Santhosh-Sellavel Santhosh-Sellavel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iwiznia
I have left a comment here to update the test steps.

Everything else looks good, tests well!

@iwiznia
Copy link
Contributor

iwiznia commented May 5, 2022

Waiting till the comment above is addressed before merging

@sobitneupane
Copy link
Contributor Author

@sobitneupane Add what to verify as result step with options to show based on different chat types. Add it to the Tests & QA Test sections.

Added.

@Santhosh-Sellavel
Copy link
Collaborator

@iwiznia We are good to go here!

@iwiznia iwiznia merged commit ec828a2 into Expensify:main May 5, 2022
@OSBotify
Copy link
Contributor

OSBotify commented May 9, 2022

🚀 Cherry-picked to staging by @sketchydroide in version: 1.1.57-8 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes.

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @chiragsalian in version: 1.1.57-17 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants