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

Ios conversation offline save changes button is disabled when opened to edit the comment for the second time #11822 #12426

Conversation

furkanuzundev
Copy link
Contributor

@furkanuzundev furkanuzundev commented Nov 3, 2022

Details

The Save changes button is disabled when it was opened for the second time to edit the message.The screenshots in the below are includes i edit the message when i'm offline edit open the second time.

Fixed Issues

$ #11822
PROPOSAL: 11822(comment)

Tests

  1. Log in an any account
  2. Disable the internet connection in the main testing device
  3. Click/Tap on the Pencil icon to activate the edit message box
  4. Edit the message to something new and save the changes
  5. Open the message editing function again
  6. It's working as we expect that save button is disabled
  • Verify that no errors appear in the JS console

QA Steps

  1. Log in an any account
  2. Disable the internet connection in the main testing device
  3. Click/Tap on the Pencil icon to activate the edit message box
  4. Edit the message to something new and save the changes
  5. Open the message editing function again
  6. It's working as we expect that save button is disabled
  • Verify that no errors appear in the JS console

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 adding the Waiting for Copy label for a copy review 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 */
    • 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.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

PR Reviewer Checklist

The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed

  • I have verified the author checklist is complete (all boxes are checked off).
  • 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 included screenshots or videos 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
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • 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 adding the Waiting for Copy label for a copy review 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 other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • 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 */
    • 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots

Web

web.mov

Mobile Web - Chrome

mobileweb-chrome.mov

Mobile Web - Safari

mobileweb-ios.mov

Desktop

desktop.mov

iOS

ios.mov

Android

android.mov

@furkanuzundev furkanuzundev requested a review from a team as a code owner November 3, 2022 13:10
@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2022

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@melvin-bot melvin-bot bot requested review from pecanoro and removed request for a team November 3, 2022 13:11
@furkanuzundev
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@pecanoro pecanoro requested review from eVoloshchak and dangrous and removed request for pecanoro November 3, 2022 15:12
@dangrous
Copy link
Contributor

dangrous commented Nov 3, 2022

Hey @furkanuzundev (and @eVoloshchak), quick update! I'm getting one question about this issue/PR answered internally and then will be back with a review shortly - I just wanted to check in and let you know where I was.

@furkanuzundev
Copy link
Contributor Author

@dangrous Sure! I'm waiting.

@dangrous
Copy link
Contributor

dangrous commented Nov 3, 2022

Okay I'm back! So here's the deal - given that OfflineWithFeedback is used in many many places, the consensus was that we shouldn't add a prop to that for this one use case.

I figured out an alternate way of dealing with this issue, though, that's much more contained. What if we edit this line in ReportActionItem:

<OfflineWithFeedback
  onClose={() => {
    if (this.props.action.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD) {
      ReportActions.deleteOptimisticReportAction(this.props.report.reportID, this.props.action.clientID);
    } else {
      ReportActions.clearReportActionErrors(this.props.report.reportID, this.props.action.sequenceNumber);
    }
  }}
- pendingAction={this.props.action.pendingAction}
+ pendingAction={this.props.draftMessage ? null : this.props.action.pendingAction}
  errors={this.props.action.errors}
  errorRowStyles={[styles.ml10, styles.mr2]}
>

That should be all we need! This will remove any visual effects on the edit section when it's open, and otherwise make no changes to the rest of the app (that I'm aware of). this.props.draftMessage is already accessible by ReportActionItem, and is only passed in this particular case, so there shouldn't be any weirdness elsewhere.

Let me know what you think (and if you can test, that would be amazing too)! If you both are in agreement, @furkanuzundev you can go ahead and update the PR with this change and we can move forward from there.

@furkanuzundev
Copy link
Contributor Author

furkanuzundev commented Nov 4, 2022

@dangrous @eVoloshchak
Yes, I've tested and looked at it. It's a shorter and more efficient way.
We can work through that. If approved, I can update the PR with the current change.

@eVoloshchak
Copy link
Contributor

@dangrous, your change looks good to me as well, tested it working on iOS. And imo it is more self-explanatory, than having this prop inside the condition on OfflineWithFeedback.js, which is great.

@furkanuzundev, you can go ahead and update the PR

@furkanuzundev
Copy link
Contributor Author

updated

@eVoloshchak
Copy link
Contributor

eVoloshchak commented Nov 4, 2022

Screenshots

Web

Screen.Recording.2022-11-04.at.11.51.43.mov

Mobile Web - Chrome

22-11-04-12-05-25.mp4

Mobile Web - Safari

Screen.Recording.2022-11-04.at.11.54.37.mov

Desktop

Screen.Recording.2022-11-04.at.11.52.41.mov

iOS

Screen.Recording.2022-11-04.at.11.57.40.mov

Android

22-11-04-12-02-46.mp4

PR Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • 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 included screenshots or videos 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
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • 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 adding the Waiting for Copy label for a copy review 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 other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • 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 */
    • 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

@eVoloshchak
Copy link
Contributor

@furkanuzundev, the code looks good and tests well, there are a couple of small issues with the issue description

  • change the link formatting for PROPOSAL, it should look like this

Screenshot 2022-11-04 at 12 11 39

  • include videos of testing tests performed on all platforms instead of screenshots (like this or this)

@furkanuzundev
Copy link
Contributor Author

furkanuzundev commented Nov 4, 2022

@eVoloshchak
I updated the link formatting.
Do i need to record video again? I mean the records that you shared not accept?

@eVoloshchak
Copy link
Contributor

eVoloshchak commented Nov 4, 2022

@furkanuzundev I'm talking about the issue description, 'Screenshots" section. You've uploaded screenshots, but the testing steps can be best shown with a video, so please replace the screenshots with videos

Do i need to record video again?

Yes
Seems redundant, but this way we can douple/triple check ourselves

@furkanuzundev
Copy link
Contributor Author

@eVoloshchak I have changed screenshots to video records that includes test steps.

Copy link
Contributor

@dangrous dangrous left a comment

Choose a reason for hiding this comment

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

Looks good! Will merge once @eVoloshchak confirms!

@eVoloshchak
Copy link
Contributor

@dangrous, looks good to me too!

@furkanuzundev
Copy link
Contributor Author

This will be my first PR. We are witnessing a historical moment. :)

@dangrous dangrous merged commit 91acada into Expensify:main Nov 7, 2022
@dangrous
Copy link
Contributor

dangrous commented Nov 7, 2022

Congrats, @furkanuzundev , I've merged it in!

Great job getting your first Expensify/App pull request over the finish line!

I know there's a lot of information in our contributing guidelines, so some points to take note of:

  1. Once your PR is merged, you can be hired for another issue. Once you've completed a few issues, we may start hiring you for more than one issue at a time.
  2. Once your PR is deployed to our staging servers, it will undergo quality assurance (QA) testing. If we find that this doesn't work as expected or causes a regression, you'll be responsible for fixing it. Typically we would revert this PR and give you another chance to create a similar PR without causing a regression. (I don't imagine this will happen with this PR, but it's something to be aware of)
  3. Once your PR is deployed to production, we start a 7-day timer. After it has been on production for 7 days without causing any regressions, then we pay out the Upwork job.

So it might take a while before you're paid for your work, but we typically post multiple new jobs every day, so there's plenty of opportunity. I hope you've had a positive experience contributing to this repo!

@melvin-bot melvin-bot bot added the Emergency label Nov 7, 2022
@melvin-bot
Copy link

melvin-bot bot commented Nov 7, 2022

@dangrous looks like this was merged without the checklist test passing. Please add a note explaining why this was done and remove the Emergency label if this is not an emergency.

@dangrous dangrous removed the Emergency label Nov 7, 2022
@dangrous
Copy link
Contributor

dangrous commented Nov 7, 2022

Not an emergency, all checks passed.

@OSBotify
Copy link
Contributor

OSBotify commented Nov 7, 2022

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@furkanuzundev
Copy link
Contributor Author

Got it @dangrous.Thanks!

@OSBotify
Copy link
Contributor

OSBotify commented Nov 8, 2022

🚀 Deployed to staging by @dangrous in version: 1.2.25-0 🚀

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

@OSBotify
Copy link
Contributor

OSBotify commented Nov 9, 2022

🚀 Deployed to production by @yuwenmemon in version: 1.2.25-0 🚀

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