Skip to content

feat(app): allow app update pop-up notifications to be disabled#6715

Merged
mcous merged 2 commits intohotfix_3.21.1from
app_disable-app-update-pop-up
Oct 9, 2020
Merged

feat(app): allow app update pop-up notifications to be disabled#6715
mcous merged 2 commits intohotfix_3.21.1from
app_disable-app-update-pop-up

Conversation

@mcous
Copy link
Copy Markdown
Contributor

@mcous mcous commented Oct 9, 2020

overview

This PR adds the ability for a user to disable app update pop-up notifications either via the pop-up or via a toggle in More > App > App Software Settings.

Closes #6684

This is a draft PR blocked by #6708. Will require rebase.

changelog

  • feat(app): allow app update pop-up notifications to be disabled

review requests

The acceptance criteria are in #6684, so take a look at that. As usual, manually editing version in app-shell/package.json to a previous version is the best way to test this with make -C app-shell dev

  • App notification pops up if app is "outdated"
  • Clicking on "Turn off update notifications" shows you a warning
  • Clicking "View App Software Settings" takes you to the App settings page
  • If you close and re-open the app, the notification does not pop up
  • If you navigate to the App settings and toggle the setting back on, the notification pops up the next time you open the app
    • Note: The notification will also pop up as soon as you toggle it back on the first time you make the switch
  • If you open the app release notes outside of the notification, there's no "Turn off..." link
    • Click "View Available Update" in More > App
    • Click "Downgrade" (or whatever it says based on your fake dev version) on a Robot settings page and click "View App Update" on the warning modal that tells you to update your app before doing any robot updates

risk assessment

Medium risk. Mitigating factors:

  • We can / should smoke test actual app updates before merging / releasing
  • This PR doesn't mess with the actual plumbing of app updates at all, just the UI that hooks into it
  • Unit tests in this and previous PRs ensure the plumbing is still hooked into properly
  • I think this PR has very high test coverage, including of the UI and the user flows through the UI
    • Most, if not all of it was TDD'd

@mcous mcous added feature Ticket is a feature request / PR introduces a feature WIP blocked Ticket or PR is blocked by other work ux review required robot-svcs Falls under the purview of the Robot Services squad (formerly CPX, Core Platform Experience). labels Oct 9, 2020
Copy link
Copy Markdown
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

Tested what's in the PR mesage, LGTM

Base automatically changed from app_update-available-alert to hotfix_3.21.1 October 9, 2020 18:09
@mcous mcous force-pushed the app_disable-app-update-pop-up branch from 6715d41 to c7e8e66 Compare October 9, 2020 18:13
@mcous mcous added ready for review and removed WIP blocked Ticket or PR is blocked by other work ux review required labels Oct 9, 2020
@mcous
Copy link
Copy Markdown
Contributor Author

mcous commented Oct 9, 2020

Reviewed with product and UX and requested changes have been made:

  • Widen UpdateAppModal to match other alert modals and give the buttons more breathing room
  • Switch heading of notifications toggle section to Title Case
  • Update copy and links in downgrade app section

This PR is good to review for final approval

Copy link
Copy Markdown
Contributor Author

@mcous mcous left a comment

Choose a reason for hiding this comment

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

Some stuff to know

return { wrapper, store }
// force a re-render by returning a new state to recalculate selectors
// and sending a blank set of new props to the wrapper
const refresh = maybeNextState => {
Copy link
Copy Markdown
Contributor Author

@mcous mcous Oct 9, 2020

Choose a reason for hiding this comment

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

We do this all the time, so I figured I would add this into our mountWithStore helper. If we want to re-render a connected component to test how the UI reacts to state changes, we run into two problems:

  • Obviously, we have to tell enzyme to rerender the component
  • We have to convince any useSelector's to recalculate

This refresh helper does this by:

someSelector.mockReturnValue('foo')
const { wrapper, refresh } = mountWithStore(...)

expect(wrapper.exists(SomeComponent)).toBe(false)

someSelector.mockReturnValue('bar')
refresh()

expect(wrapper.exists(SomeComponent)).toBe(true)

export const FONT_SIZE_CAPTION = '0.625rem'
export const FONT_SIZE_TINY = '0.325rem'
export const FONT_SIZE_MICRO = '0.2rem'
export const FONT_SIZE_INHERIT = 'inherit'
Copy link
Copy Markdown
Contributor Author

@mcous mcous Oct 9, 2020

Choose a reason for hiding this comment

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

I added this just to be consistent, but I think of all the primitives stuff, these non-scale constants are the most tedious. I'd like to explore some or all of the following options:

  • Move common CSS constants to deduplicated vars rather than having a bunch of different ones depending on the property
    • e.g. we only need one const for auto, one fore inherit, etc.
  • Figure out if we can incorporate csstype into our style props
    • Might remove the need for most of our explicitly defined constants

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Incorporating csstype sounds like a great idea. Maintaining our own explicitly defined constants has never felt sound or odor-less. It also makes for massive imports at the top of component files.

export const C_BLUE = '#006fff'

// colors by usage
export const COLOR_DISABLED = '#9c9c9c'
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Was not used anywhere I could find

backgroundColor: Styles.C_WHITE,
position: Styles.POSITION_RELATIVE,
overflowY: Styles.OVERFLOW_AUTO,
maxWidth: Styles.SIZE_6,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Realized the maxWidth was inappropriate to apply on the BaseModal. BaseModal will now stretch to 100% width of relative parent by default

@mcous mcous marked this pull request as ready for review October 9, 2020 18:25
@mcous mcous requested a review from a team as a code owner October 9, 2020 18:25
@mcous mcous requested review from shlokamin and removed request for a team October 9, 2020 18:25
@codecov
Copy link
Copy Markdown

codecov bot commented Oct 9, 2020

Codecov Report

❗ No coverage uploaded for pull request base (hotfix_3.21.1@9432111). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff                @@
##             hotfix_3.21.1    #6715   +/-   ##
================================================
  Coverage                 ?   80.23%           
================================================
  Files                    ?      240           
  Lines                    ?    20813           
  Branches                 ?        0           
================================================
  Hits                     ?    16700           
  Misses                   ?     4113           
  Partials                 ?        0           
Impacted Files Coverage Δ
opentrons/legacy_api/__init__.py 100.00% <0.00%> (ø)
...ver/robot_server/service/legacy/models/pipettes.py 100.00% <0.00%> (ø)
...rver/robot_server/service/legacy/routers/motors.py 100.00% <0.00%> (ø)
opentrons/protocols/geometry/deck.py 92.44% <0.00%> (ø)
opentrons/data_storage/schema_changes.py 100.00% <0.00%> (ø)
opentrons/hardware_control/robot_calibration.py 100.00% <0.00%> (ø)
...te-server/otupdate/buildroot/ssh_key_management.py 78.40% <0.00%> (ø)
..._server/robot/calibration/pipette_offset/models.py 100.00% <0.00%> (ø)
...server/robot_server/robot/calibration/constants.py 96.77% <0.00%> (ø)
robot-server/robot_server/service/system/models.py 100.00% <0.00%> (ø)
... and 230 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9432111...8049edd. Read the comment docs.

Copy link
Copy Markdown
Contributor

@Kadee80 Kadee80 left a comment

Choose a reason for hiding this comment

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

🚫 🎶

@mcous
Copy link
Copy Markdown
Contributor Author

mcous commented Oct 9, 2020

Finished smoke testing with a "production" app and checked off the boxes in the test plan. Found one issue where "Turn off app update notifications" was showing up in the modal when it shouldn't have, and added a unit test + fix to the PR accordingly

@mcous mcous merged commit 7982d5f into hotfix_3.21.1 Oct 9, 2020
@mcous mcous deleted the app_disable-app-update-pop-up branch October 9, 2020 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Ticket is a feature request / PR introduces a feature robot-svcs Falls under the purview of the Robot Services squad (formerly CPX, Core Platform Experience).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants