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

Change to disabled cursor when hovering disabled checkbox #13669

Merged
merged 3 commits into from
Dec 20, 2022

Conversation

luacmartins
Copy link
Contributor

@luacmartins luacmartins commented Dec 16, 2022

Details

Changes the cursor to the disabled state when the Workspace member can't be selected

Fixed Issues

$ #13627

Tests

  1. Select any workspace
  2. Go to manage members page
  3. Invite a few members
  4. Hover the cursor over the Workspace owner's checkbox
  5. Verify that the disabled cursor is shown

On Web only:

  1. Resize your browser window to be less than 800 pixels wide
  2. Verify that the checkbox is still disabled.
  • Verify that no errors appear in the JS console

Offline tests

N/A

QA Steps

Same as test steps

  • 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:
    • 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 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
web.mov
Mobile Web - Chrome
chrome.mov
Mobile Web - Safari
safari.mov
Desktop
desktop.mov
iOS
ios.mov
Android
android.mov

@luacmartins luacmartins self-assigned this Dec 16, 2022
@luacmartins luacmartins marked this pull request as ready for review December 16, 2022 20:26
@luacmartins luacmartins requested a review from a team as a code owner December 16, 2022 20:26
@luacmartins luacmartins changed the title Disable checkbox and change cursor Change to disabled cursor when hovering disabled checkbox Dec 16, 2022
@melvin-bot melvin-bot bot requested review from grgia and rushatgabhane and removed request for a team December 16, 2022 20:27
@melvin-bot
Copy link

melvin-bot bot commented Dec 16, 2022

@rushatgabhane @grgia 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]

@Pujan92
Copy link
Contributor

Pujan92 commented Dec 16, 2022

I think for web resize(medium/small) and mobile web we need to apply the change to other place CheckboxWithTooltipForMobileWebAndNative too.

diff --git a/src/components/CheckboxWithTooltip/CheckboxWithTooltipForMobileWebAndNative.js b/src/components/CheckboxWithTooltip/
CheckboxWithTooltipForMobileWebAndNative.js
index ac58d030e..43d3c0626 100644
--- a/src/components/CheckboxWithTooltip/CheckboxWithTooltipForMobileWebAndNative.js
+++ b/src/components/CheckboxWithTooltip/CheckboxWithTooltipForMobileWebAndNative.js
@@ -38,6 +38,7 @@ class CheckboxWithTooltipForMobileWebAndNative extends React.Component {
                 <Checkbox
                     isChecked={this.props.isChecked}
                     onPress={this.showGrowlOrTriggerOnPress}
+                    disabled={this.props.disabled}
                 />
             </View>
         );
diff --git a/src/components/CheckboxWithTooltip/index.js b/src/components/CheckboxWithTooltip/index.js
index 83756feb0..ced15a589 100644
--- a/src/components/CheckboxWithTooltip/index.js
+++ b/src/components/CheckboxWithTooltip/index.js
@@ -15,6 +15,7 @@ const CheckboxWithTooltip = (props) => {
                 onPress={props.onPress}
                 text={props.text}
                 toggleTooltip={props.toggleTooltip}
+                disabled={props.disabled}
             />
         );
     }
@@ -22,7 +23,7 @@ const CheckboxWithTooltip = (props) => {
         <Checkbox
             isChecked={props.isChecked}
             onPress={props.onPress}
-            disabled={props.toggleTooltip}
+            disabled={props.disabled}
         />
     );

@luacmartins
Copy link
Contributor Author

@Pujan92 good point on resize! Thanks!

@luacmartins
Copy link
Contributor Author

Updated!

Copy link
Contributor

@grgia grgia left a comment

Choose a reason for hiding this comment

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

LGTM, could you add QA steps for resizing?

@luacmartins
Copy link
Contributor Author

Added resizing steps

@rushatgabhane
Copy link
Member

rushatgabhane commented Dec 20, 2022

@grgia @luacmartins sorry that I won't be able to review this PR anytime soon. Please reassign / @grgia could complete the checklist

@luacmartins
Copy link
Contributor Author

@grgia would you mind filling the checklist? I think this PR is simple enough that we don't need more reviewers.

@grgia
Copy link
Contributor

grgia commented Dec 20, 2022

No problem!

@grgia
Copy link
Contributor

grgia commented Dec 20, 2022

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
Screen.Recording.2022-12-20.at.10.03.34.AM.mov
Screen.Recording.2022-12-20.at.10.02.31.AM.mov
Mobile Web - Chrome image
Mobile Web - Safari image
Desktop
Screen.Recording.2022-12-20.at.10.05.06.AM.mov
iOS image
Android image

@grgia grgia removed the request for review from rushatgabhane December 20, 2022 18:09
@grgia grgia merged commit eec9bf6 into main Dec 20, 2022
@grgia grgia deleted the cmartins-disableCheckbox branch December 20, 2022 18:10
@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
runJsBundle 184.625 ms → 190.742 ms (+6.117 ms, +3.3%)
regularAppStart 0.014 ms → 0.014 ms (+0.000 ms, +1.6%)
nativeLaunch 10.138 ms → 9.581 ms (-0.557 ms, -5.5%)
TTI 792.672 ms → 790.493 ms (-2.179 ms, ±0.0%)
Show details
Name Duration
runJsBundle Baseline
Mean: 184.625 ms
Stdev: 19.838 ms (10.7%)
Runs: 154 160 160 160 163 163 164 167 167 171 175 176 178 180 180 183 184 186 186 187 193 193 195 199 199 200 204 206 206 206 218 245

Current
Mean: 190.742 ms
Stdev: 20.500 ms (10.7%)
Runs: 155 159 168 170 170 171 172 175 175 175 176 181 181 181 182 186 191 195 195 200 201 203 204 206 206 212 218 223 225 228 229
regularAppStart Baseline
Mean: 0.014 ms
Stdev: 0.001 ms (4.3%)
Runs: 0.012695001438260078 0.012735998257994652 0.012816999107599258 0.01285799965262413 0.012940000742673874 0.013020999729633331 0.013102000579237938 0.013142000883817673 0.013182999566197395 0.013225000351667404 0.013225000351667404 0.01326499879360199 0.013345999643206596 0.013468999415636063 0.013508999720215797 0.01355000026524067 0.013589998707175255 0.013590000569820404 0.01371300034224987 0.013794001191854477 0.0138349998742342 0.013875000178813934 0.013916000723838806 0.013996999710798264 0.014038000255823135 0.014118999242782593 0.0143630001693964 0.01440499909222126 0.014485999941825867 0.015298999845981598

Current
Mean: 0.014 ms
Stdev: 0.001 ms (5.2%)
Runs: 0.011881999671459198 0.012532999739050865 0.012818001210689545 0.01285799965262413 0.013182999566197395 0.01326499879360199 0.013345999643206596 0.013345999643206596 0.013387000188231468 0.01342799887061119 0.013631001114845276 0.013672001659870148 0.013753000646829605 0.0138349998742342 0.0138349998742342 0.013835001736879349 0.013996999710798264 0.014038000255823135 0.014078998938202858 0.014118999242782593 0.01411999948322773 0.014201000332832336 0.01428300142288208 0.014404000714421272 0.014485999941825867 0.014566998928785324 0.014689000323414803 0.014893000945448875 0.015300000086426735
nativeLaunch Baseline
Mean: 10.138 ms
Stdev: 1.252 ms (12.3%)
Runs: 8 8 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 11 11 11 11 11 11 11 11 12 13 13

Current
Mean: 9.581 ms
Stdev: 1.914 ms (20.0%)
Runs: 7 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 11 11 11 11 12 13 13 13 15
TTI Baseline
Mean: 792.672 ms
Stdev: 30.830 ms (3.9%)
Runs: 739.166588999331 739.6226950008422 750.2170059997588 760.0533900000155 765.2145729996264 765.7603210005909 771.6529319994152 771.8590859994292 772.7786270007491 776.2371399998665 776.2804240006953 778.6179440002888 781.4935359992087 782.6002699993551 784.8298870008439 788.8876440003514 790.2474770005792 794.583715999499 795.2356119994074 797.0410239994526 797.4811540003866 802.4634620007128 808.4281130004674 813.0990779995918 824.7525709997863 825.7378250006586 830.6062620002776 831.9565939996392 832.4142680000514 855.1954929996282 868.309244999662

Current
Mean: 790.493 ms
Stdev: 37.301 ms (4.7%)
Runs: 712.9441149998456 744.0247070007026 745.4065480008721 746.6546250004321 747.5007719993591 753.6668960005045 756.6634519994259 756.8721450008452 757.9539490006864 761.1349400002509 772.0455740001053 772.2740919999778 777.1121159996837 783.1962759997696 787.5966279990971 790.6853909995407 795.5834940001369 810.1255869995803 812.0211239997298 812.3568130005151 816.4223539996892 816.4553009998053 820.1856249999255 824.7896529994905 825.534068999812 829.1443729996681 832.4025790002197 835.3840280007571 842.3949059993029 876.263748999685

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @grgia in version: 1.2.43-0 🚀

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

@jayeshmangwani
Copy link
Contributor

I am commenting on PR, as issue #13627 is locked, I raised the same issue 2 months back here https://expensify.slack.com/archives/C01GTK53T8Q/p1668096360414929

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @chiragsalian in version: 1.2.43-1 🚀

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

@Pujan92
Copy link
Contributor

Pujan92 commented Jan 4, 2023

@luacmartins can I ask for the reporting bonus for this now?

@jayeshmangwani
Copy link
Contributor

I am commenting on PR, as issue #13627 is locked, I raised the same issue 2 months back here https://expensify.slack.com/archives/C01GTK53T8Q/p1668096360414929

@luacmartins

@luacmartins
Copy link
Contributor Author

Left a comment in the issue! Sorry we missed that!

@jayeshmangwani
Copy link
Contributor

Left a comment in the issue! Sorry we missed that!

Thankyou 😀

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.

6 participants