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

Warn AMO users when visiting wrong platform site #8797

Merged

Conversation

bobsilverberg
Copy link
Contributor

@bobsilverberg bobsilverberg commented Oct 21, 2019

Fixes mozilla/addons#13496

Screenshots:

When mistakenly on /android/

Screenshot 2019-10-21 12 19 28
Screenshot 2019-10-21 12 19 47
Screenshot 2019-10-21 12 20 03

When mistakenly on /firefox/

Screen Shot 2019-10-21 at 12 21 33
Screen Shot 2019-10-21 at 12 21 47
Screen Shot 2019-10-21 at 12 22 13

@codecov-io
Copy link

codecov-io commented Oct 21, 2019

Codecov Report

Merging #8797 into master will increase coverage by <.01%.
The diff coverage is 89.65%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    mozilla/addons-frontend#8797      +/-   ##
==========================================
+ Coverage    98.1%   98.11%   +<.01%     
==========================================
  Files         269      270       +1     
  Lines        7502     7528      +26     
  Branches     1356     1365       +9     
==========================================
+ Hits         7360     7386      +26     
  Misses        128      128              
  Partials       14       14
Impacted Files Coverage Δ
src/amo/components/ErrorPage/ServerError/index.js 100% <ø> (ø) ⬆️
src/amo/components/ErrorPage/NotFound/index.js 100% <ø> (ø) ⬆️
src/amo/pages/Addon/index.js 100% <ø> (ø) ⬆️
...rc/amo/components/ErrorPage/NotAuthorized/index.js 100% <ø> (ø) ⬆️
src/amo/components/StaticPage/index.js 100% <ø> (ø) ⬆️
src/amo/components/Page/index.js 100% <ø> (ø) ⬆️
src/amo/components/HeroRecommendation/index.js 100% <ø> (ø) ⬆️
src/amo/components/Routes/index.js 30.76% <0%> (ø) ⬆️
src/amo/components/WrongPlatformWarning/index.js 100% <100%> (ø)
src/ui/components/Notice/index.js 100% <100%> (ø) ⬆️
... and 4 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 57ecbd3...a6a659a. Read the comment docs.

Copy link
Contributor

@kumar303 kumar303 left a comment

Choose a reason for hiding this comment

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

I had some comments and suggestions.

src/ui/components/Notice/styles.scss Outdated Show resolved Hide resolved
src/core/utils/compatibility.js Outdated Show resolved Hide resolved
src/amo/components/WrongPlatformWarning/styles.scss Outdated Show resolved Hide resolved
src/amo/components/WrongPlatformWarning/styles.scss Outdated Show resolved Hide resolved
src/amo/components/Page/index.js Outdated Show resolved Hide resolved
@kumar303 kumar303 self-assigned this Oct 21, 2019
@bobsilverberg bobsilverberg force-pushed the wrong-platform-warning-8701 branch from bfa5758 to 30b49ce Compare October 22, 2019 17:57
@bobsilverberg
Copy link
Contributor Author

Thanks for the review @kumar303. This is ready for another look.

Copy link
Contributor

@kumar303 kumar303 left a comment

Choose a reason for hiding this comment

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

It's mostly looking good.

The about and review guide pages seem to always show a wrong platform banner:

Screenshots Screenshot 2019-10-22 14 46 00 Screenshot 2019-10-22 14 46 14

The mobile view has inconsistent margins around the site notice. This might have nothing to do with your patch and since it just affects the site notice, feel free to address it in a follow-up.

Screenshot Screenshot 2019-10-22 14 51 48

src/amo/components/Page/index.js Outdated Show resolved Hide resolved
src/amo/components/WrongPlatformWarning/index.js Outdated Show resolved Hide resolved
src/amo/pages/Addon/styles.scss Outdated Show resolved Hide resolved
src/core/constants.js Outdated Show resolved Hide resolved
src/core/utils/compatibility.js Outdated Show resolved Hide resolved
tests/unit/core/utils/test_compatibility.js Outdated Show resolved Hide resolved
tests/unit/core/utils/test_compatibility.js Outdated Show resolved Hide resolved
tests/unit/core/utils/test_compatibility.js Outdated Show resolved Hide resolved
tests/unit/core/utils/test_compatibility.js Outdated Show resolved Hide resolved
tests/unit/core/utils/test_compatibility.js Show resolved Hide resolved
@bobsilverberg
Copy link
Contributor Author

Thanks again for the review @kumar303. This is ready for another look.

@bobsilverberg bobsilverberg force-pushed the wrong-platform-warning-8701 branch from 68c9039 to 4328908 Compare October 24, 2019 19:06
Copy link
Contributor

@kumar303 kumar303 left a comment

Choose a reason for hiding this comment

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

r+wc

Thanks for all the fix-ups.

src/amo/pages/Home/index.js Outdated Show resolved Hide resolved
src/amo/pages/Home/index.js Outdated Show resolved Hide resolved
@bobsilverberg bobsilverberg force-pushed the wrong-platform-warning-8701 branch from 4328908 to a6a659a Compare October 28, 2019 13:40
@bobsilverberg bobsilverberg merged commit 7d21d0c into mozilla:master Oct 28, 2019
@bobsilverberg bobsilverberg deleted the wrong-platform-warning-8701 branch October 28, 2019 14:24
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.

Warn AMO users when visiting wrong platform site
3 participants