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

Update Form dangerous submit action prop #13981

Merged
merged 6 commits into from
Jan 19, 2023

Conversation

Beamanator
Copy link
Contributor

@Beamanator Beamanator commented Jan 4, 2023

Details

Just updating some prop names

Related issue / comment

$ #12534 (comment)

Tests

  1. View a few Forms, make sure there's no bugs or console errors
  2. Ex: Display name page (non red submit button) and close account page (red submit button)
  • Verify that no errors appear in the JS console

Offline tests

  1. View a few Forms, make sure there's no bugs or console errors
  2. Ex: Display name page (non red submit button) and close account page (red submit button)

QA Steps

  1. View a few Forms, make sure there's no bugs or console errors
  2. Ex: Display name page (non red submit button) and close account page (red submit button)
  • 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 the expected offline behavior in the Offline steps 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 tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • 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 is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • 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 any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • 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.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web Screenshot 2023-01-04 at 10 34 34 AM
Mobile Web - Chrome Screenshot 2023-01-04 at 10 41 32 AM
Mobile Web - Safari Screenshot 2023-01-04 at 10 43 33 AM
Desktop Screenshot 2023-01-04 at 10 44 25 AM
iOS Screenshot 2023-01-04 at 10 42 59 AM
Android Screenshot 2023-01-04 at 10 40 23 AM

@Beamanator Beamanator requested a review from a team as a code owner January 4, 2023 08:19
@Beamanator Beamanator self-assigned this Jan 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jan 4, 2023

Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers!

@melvin-bot melvin-bot bot requested review from joelbettner and removed request for a team January 4, 2023 08:19
@melvin-bot
Copy link

melvin-bot bot commented Jan 4, 2023

@joelbettner Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@Beamanator
Copy link
Contributor Author

Ready for review 👍

@Beamanator
Copy link
Contributor Author

Ok cool did some research:

Looks like we introduced the isDangerousAction prop in this PR: https://github.com/Expensify/App/pull/4437/files

As you can see in that PR:

  1. The prop was passed to PasswordPopover in src/pages/settings/Payments/PaymentsPage.js
  2. The PasswordPopover component never defined isDangerousAction in its propTypes, and it doesn't do anything with that prop

Conclusion: Ready to be deleted 👍

@joelbettner
Copy link
Contributor

joelbettner commented Jan 18, 2023

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:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • 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 is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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 any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • 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.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Web image
Mobile Web - Chrome image
Mobile Web - Safari image
Desktop image
iOS image
Android image

@Beamanator
Copy link
Contributor Author

I think this had to do with this broken test: https://expensify.slack.com/archives/C01GTK53T8Q/p1673916481148719

Passing now, feel free to merge when you're online 👍

@joelbettner joelbettner merged commit abccb27 into main Jan 19, 2023
@joelbettner joelbettner deleted the beaman-updateDangerousSubmitProp branch January 19, 2023 19:04
@OSBotify
Copy link
Contributor

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

@github-actions
Copy link
Contributor

Performance Comparison Report 📊

Significant Changes To Duration

There are no entries

Meaningless Changes To Duration

Show entries
Name Duration
App start TTI 679.737 ms → 713.085 ms (+33.348 ms, +4.9%)
App start runJsBundle 182.667 ms → 199.844 ms (+17.177 ms, +9.4%)
App start nativeLaunch 19.900 ms → 20.219 ms (+0.319 ms, +1.6%)
App start regularAppStart 0.016 ms → 0.016 ms (-0.001 ms, -3.5%)
Open Search Page TTI 611.360 ms → 602.314 ms (-9.046 ms, -1.5%)
Show details
Name Duration
App start TTI Baseline
Mean: 679.737 ms
Stdev: 23.114 ms (3.4%)
Runs: 632.5961429998279 648.5723289996386 648.5750259999186 651.2136019999161 652.2175569999963 654.1608199998736 659.6621759999543 659.8326559998095 662.9138829996809 664.641346000135 665.3901549996808 665.7603390002623 671.2565280003473 672.2817200003192 676.6718330001459 680.4492380004376 682.3332629995421 686.8980270000175 690.2915989998728 690.4720120001584 693.1452379999682 694.6228029998019 694.6440099999309 696.0234420001507 702.8130099996924 703.9481969997287 706.8173590004444 711.0549820000306 713.1756899999455 718.2993740001693 721.1178400004283

Current
Mean: 713.085 ms
Stdev: 33.667 ms (4.7%)
Runs: 660.0511870002374 666.5307750003412 667.4448210000992 678.7522170003504 679.2857149997726 680.0177830001339 680.9785369997844 684.7085450002924 685.694240000099 690.4361230004579 696.3769859997556 697.3185090003535 699.4240070004016 700.3581450004131 700.7793429996818 702.4335479997098 708.575930999592 714.5421669995412 719.0344430003315 728.8940580002964 729.265895999968 731.4295020001009 731.956159000285 738.0555990003049 741.4713949998841 746.9316750001162 755.7566020004451 757.2051400002092 760.3740069996566 783.6053290003911 787.9609219999984
App start runJsBundle Baseline
Mean: 182.667 ms
Stdev: 12.831 ms (7.0%)
Runs: 161 161 165 168 169 171 173 175 176 177 178 178 180 180 181 181 184 184 185 185 187 188 190 190 192 192 199 209 209 212

Current
Mean: 199.844 ms
Stdev: 23.751 ms (11.9%)
Runs: 163 170 170 173 174 176 182 182 182 183 183 183 188 195 197 199 200 200 200 201 202 203 205 211 217 221 223 231 236 237 252 256
App start nativeLaunch Baseline
Mean: 19.900 ms
Stdev: 2.039 ms (10.2%)
Runs: 17 18 18 18 18 18 18 18 18 19 19 19 19 19 19 19 20 20 20 21 21 21 21 22 22 22 22 22 22 27

Current
Mean: 20.219 ms
Stdev: 2.368 ms (11.7%)
Runs: 18 18 18 18 18 18 18 18 18 19 19 19 19 19 19 19 19 20 20 20 20 21 21 21 22 22 22 23 24 25 26 26
App start regularAppStart Baseline
Mean: 0.016 ms
Stdev: 0.001 ms (6.3%)
Runs: 0.014649000018835068 0.015015000477433205 0.015095999464392662 0.015137000009417534 0.015299000777304173 0.015381000004708767 0.015461999922990799 0.015544000081717968 0.015625 0.0157880000770092 0.015829000622034073 0.01603199914097786 0.016071999445557594 0.016153999604284763 0.016234999522566795 0.016235999763011932 0.01643799990415573 0.016439000144600868 0.016560999676585197 0.01660200022161007 0.0166830001398921 0.016723000444471836 0.016927000135183334 0.017090000212192535 0.01733400020748377 0.017456000670790672 0.018066000193357468 0.018311000429093838 0.019164999946951866

Current
Mean: 0.016 ms
Stdev: 0.001 ms (8.4%)
Runs: 0.014119000174105167 0.014159999787807465 0.014283000491559505 0.01444500032812357 0.01444500032812357 0.014566999860107899 0.014607999473810196 0.01460800040513277 0.0147299999371171 0.0147299999371171 0.014810999855399132 0.014891999773681164 0.014973999932408333 0.015095999464392662 0.015217999927699566 0.015217999927699566 0.015217999927699566 0.01534000039100647 0.0159919997677207 0.016479999758303165 0.01648000068962574 0.0165200000628829 0.016682999208569527 0.01680499967187643 0.016927999444305897 0.017009000293910503 0.017211999744176865 0.017253000289201736 0.0174150001257658 0.018472999334335327 0.019368000328540802
Open Search Page TTI Baseline
Mean: 611.360 ms
Stdev: 18.887 ms (3.1%)
Runs: 571.2389730000868 577.7325440002605 582.5487069999799 590.4096280001104 591.9495449997485 594.7934580007568 596.3735760003328 596.8590910006315 597.5271410001442 598.1575929997489 598.8597409995273 601.6912850001827 602.8729249993339 603.3737800000235 606.5271410001442 608.4807139998302 611.4881600001827 612.8448490006849 613.6077070003375 615.7972009992227 618.559081999585 618.5932210003957 619.3518070001155 621.3385819997638 630.5418299995363 632.1460370002314 633.4382729995996 634.1394039997831 635.7642410006374 636.7947179991752 637.3767499998212 639.3422039998695 644.3749190000817

Current
Mean: 602.314 ms
Stdev: 19.858 ms (3.3%)
Runs: 580.4823399996385 580.8076179996133 583.1569819999859 586.7191169997677 586.8191330004483 587.3893639994785 587.5759279998019 587.6889649992809 588.1359059996903 588.2310379995033 588.5736489994451 589.7843429995701 590.109375 591.7047129999846 592.3052980005741 592.6949469996616 596.5611979998648 596.7520749997348 597.7974450001493 601.1927490001544 605.2473959997296 606.2178549999371 607.0260009998456 610.0667730001733 614.6577970003709 615.6372879995033 619.3615319998935 623.0792240006849 627.278157999739 639.0415440006182 655.844239000231 656.1180010000244

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/joelbettner in version: 1.2.57-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/luacmartins in version: 1.2.57-3 🚀

platform result
🤖 android 🤖 failure ❌
🖥 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.

3 participants