Skip to content

[No QA] Add Form guidelines for on change validation#14246

Merged
AndrewGable merged 1 commit into
mainfrom
cmartins-updateFormGuidelines
Jan 16, 2023
Merged

[No QA] Add Form guidelines for on change validation#14246
AndrewGable merged 1 commit into
mainfrom
cmartins-updateFormGuidelines

Conversation

@luacmartins

Copy link
Copy Markdown
Contributor

Details

Coming from this comment, we were missing on change validation guidelines in FORMS.md

Fixed Issues

$ #14245

Tests

N/A changes readme only

  • Verify that no errors appear in the JS console

Offline tests

N/A

QA Steps

N/A

  • 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

N/A changes to readme documentation only!

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

@luacmartins luacmartins self-assigned this Jan 12, 2023
@luacmartins luacmartins marked this pull request as ready for review January 12, 2023 16:23
@luacmartins luacmartins requested a review from a team as a code owner January 12, 2023 16:23
@melvin-bot melvin-bot Bot requested review from AndrewGable and sobitneupane and removed request for a team January 12, 2023 16:23
@melvin-bot

melvin-bot Bot commented Jan 12, 2023

Copy link
Copy Markdown

@sobitneupane @AndrewGable One of you needs to 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]

@sobitneupane

Copy link
Copy Markdown
Contributor

It is a simple change in Readme. So, I don't think I am supposed to review this PR.

@AndrewGable AndrewGable removed the request for review from sobitneupane January 16, 2023 22:46
@AndrewGable

AndrewGable commented Jan 16, 2023

Copy link
Copy Markdown
Contributor

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

N/A - No source code changes

@AndrewGable AndrewGable merged commit b2a4149 into main Jan 16, 2023
@AndrewGable AndrewGable deleted the cmartins-updateFormGuidelines branch January 16, 2023 22:55
@github-actions

Copy link
Copy Markdown
Contributor

Performance Comparison Report 📊

Significant Changes To Duration

There are no entries

Meaningless Changes To Duration

Show entries
Name Duration
App start TTI 690.588 ms → 720.439 ms (+29.851 ms, +4.3%)
App start runJsBundle 188.548 ms → 202.438 ms (+13.889 ms, +7.4%)
App start regularAppStart 0.014 ms → 0.016 ms (+0.002 ms, +11.9%)
App start nativeLaunch 21.655 ms → 20.500 ms (-1.155 ms, -5.3%)
Open Search Page TTI 597.967 ms → 596.069 ms (-1.898 ms, ±0.0%)
Show details
Name Duration
App start TTI Baseline
Mean: 690.588 ms
Stdev: 37.795 ms (5.5%)
Runs: 632.8312940001488 642.4820210002363 646.7173940017819 648.1258979998529 649.4310499988496 658.7334109991789 658.7609630003572 660.0399839989841 660.1645179986954 664.2391319982708 672.1376340016723 672.9100590012968 673.4468800015748 674.4227619990706 675.885869000107 678.7291469983757 682.0940169990063 682.9488640017807 688.4055749997497 692.8947650007904 699.5278889983892 699.6086519993842 700.0048439987004 707.9523050002754 722.9377669990063 727.9721679985523 732.4520040005445 747.5213509984314 748.3561029992998 759.0291489996016 764.9248029999435 773.1420749984682

Current
Mean: 720.439 ms
Stdev: 24.655 ms (3.4%)
Runs: 675.3696709983051 681.6793170012534 688.0883489996195 688.9413749985397 690.4844059981406 693.3801099993289 693.7490769997239 696.9921119995415 701.2536889985204 702.6875689998269 704.8768239989877 708.4804119989276 709.1965820007026 710.0040530003607 710.7526260018349 717.3007600009441 730.9526670016348 731.0945230014622 731.681492999196 732.4300430007279 733.2877020016313 733.5109030008316 735.7318399995565 736.2558129988611 743.8348199985921 744.9976040013134 746.4496829994023 750.9344809986651 752.7943429984152 757.0043400004506 758.0262070000172 761.8332699984312
App start runJsBundle Baseline
Mean: 188.548 ms
Stdev: 15.707 ms (8.3%)
Runs: 168 171 172 172 173 175 175 176 177 177 179 179 182 182 183 184 185 185 186 188 191 191 197 199 205 207 210 218 218 218 222

Current
Mean: 202.438 ms
Stdev: 14.374 ms (7.1%)
Runs: 172 173 177 181 186 188 190 191 194 197 199 199 202 203 204 205 205 206 207 207 207 209 211 211 213 213 215 217 218 221 227 230
App start regularAppStart Baseline
Mean: 0.014 ms
Stdev: 0.001 ms (5.1%)
Runs: 0.013020999729633331 0.013346001505851746 0.013387002050876617 0.013467997312545776 0.01354999840259552 0.013712000101804733 0.01371300220489502 0.013794001191854477 0.013794001191854477 0.013835001736879349 0.01399800181388855 0.01399800181388855 0.014038000255823135 0.014201000332832336 0.014242000877857208 0.014281999319791794 0.014322999864816666 0.014403998851776123 0.01440500095486641 0.014445003122091293 0.01448499783873558 0.014607999473810196 0.01464800164103508 0.01464800164103508 0.014688998460769653 0.014729000627994537 0.014893002808094025 0.015461999922990799 0.01550300046801567 0.015543997287750244 0.015990998595952988 0.015990998595952988

Current
Mean: 0.016 ms
Stdev: 0.001 ms (7.1%)
Runs: 0.014201000332832336 0.014364000409841537 0.01469000056385994 0.014729999005794525 0.01505500078201294 0.015096001327037811 0.015136998146772385 0.015217997133731842 0.015299998223781586 0.015422001481056213 0.015544001013040543 0.015583999454975128 0.015666000545024872 0.015707001090049744 0.015990998595952988 0.016032002866268158 0.016113001853227615 0.016276001930236816 0.01631699874997139 0.01643899828195572 0.016561001539230347 0.01684499904513359 0.016885999590158463 0.01712999865412712 0.017170999199151993 0.017253000289201736 0.017700999975204468 0.018147997558116913 0.01912499964237213
App start nativeLaunch Baseline
Mean: 21.655 ms
Stdev: 1.767 ms (8.2%)
Runs: 19 19 19 19 20 20 20 20 20 21 21 21 21 22 22 22 22 22 22 23 23 23 23 23 23 24 24 24 26

Current
Mean: 20.500 ms
Stdev: 0.945 ms (4.6%)
Runs: 19 19 19 19 20 20 20 20 20 20 20 20 20 20 21 21 21 21 21 21 21 21 21 21 21 22 22 23
Open Search Page TTI Baseline
Mean: 597.967 ms
Stdev: 17.727 ms (3.0%)
Runs: 557.1746420003474 571.6385099999607 576.9710289984941 578.0603029988706 578.5326739996672 582.7395839989185 583.2115480005741 585.3696289993823 587.5779629983008 588.9651699997485 589.4554450027645 589.9812010005116 592.0604250021279 592.360473997891 593.6357830017805 594.2174479998648 594.625650998205 596.3644610010087 597.2445890009403 599.0303549990058 599.4565839990973 603.3195389993489 603.4160160012543 605.3493649996817 608.5841070003808 612.8396409973502 613.2085369974375 615.6829829998314 621.8164879977703 624.3112800009549 627.5885419994593 631.8029789999127 636.3112390004098

Current
Mean: 596.069 ms
Stdev: 17.015 ms (2.9%)
Runs: 564.7215170003474 574.6886800006032 577.6648770011961 578.4197590015829 578.8336189985275 578.8432619981468 581.5431719981134 581.5909839980304 582.4019370004535 584.8536380007863 585.7620449997485 587.3898929990828 588.459432002157 590.5043540000916 592.2473549991846 593.3233239986002 594.6920170001686 595.6136889979243 596.375569999218 596.4478350020945 598.115967001766 598.7143549993634 599.3057050034404 599.5089519992471 606.7581380009651 607.0300699993968 608.484864000231 616.110473997891 616.6391599997878 622.3159590028226 622.5096030011773 626.7142340019345 643.6884360015392

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by @AndrewGable in version: 1.2.56-0 🚀

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

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/AndrewGable in version: 1.2.56-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