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

Opt-in API error code and platform user permissions #277

Merged
merged 4 commits into from
May 8, 2020

Conversation

cdcabrera
Copy link
Member

@cdcabrera cdcabrera commented May 7, 2020

What's included

  • fix(platformServices): issues/260 confirm user permissions
    • userReducer, map user permissions
    • platformServices, remove user permissions async/await, name param
    • platformApiTypes, user permission types
  • fix(reduxHelpers,middleware): issues/260 expose error data
    • reduxHelpers, expose error data correctly, expand test checks
    • statusMiddleware, add data to dispatch
  • feat(userReducer,rhsmApiTypes): issues/260 error codes
    • userReducer, expose API error codes
    • rhsmApiTypes, add API error response types
    • rhsmServices, mock for 403 and error code
  • fix(authentication): issues/260 apply optin code
    • authentication, optin error code check
    • i18n test

How to test

Local run check

  1. update the NPM packages with $ yarn
  2. $ yarn start and the browser should open
  3. change line 49 in ./src/services/rhsmServices from
        * @apiMock {ForceStatus} 200
    
    to
        * @apiMock {ForceStatus} 403
    
  4. the browser page should refresh, if not, refresh it and the opt in redirect should fire.
  5. confirm the "opt in" view is being displayed.
    • If you have Redux logging setup, you can also confirm by opening the developer browser console and checking the last Redux state update. You should be able to expand the user object and see the errorCode for opt in, SUBSCRIPTIONS1004

      Screen Shot 2020-05-08 at 5 24 23 PM

Example

...

Updates issue/story

#260

@codecov-io
Copy link

Codecov Report

Merging #277 into ci will decrease coverage by 0.05%.
The diff coverage is 94.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##               ci     #277      +/-   ##
==========================================
- Coverage   92.36%   92.31%   -0.06%     
==========================================
  Files          47       47              
  Lines        1022     1028       +6     
  Branches      240      245       +5     
==========================================
+ Hits          944      949       +5     
- Misses         72       73       +1     
  Partials        6        6              
Impacted Files Coverage Δ
src/redux/reducers/userReducer.js 94.44% <66.66%> (-5.56%) ⬇️
src/redux/common/reduxHelpers.js 91.39% <100.00%> (ø)
src/services/platformServices.js 100.00% <100.00%> (ø)
src/services/userServices.js 100.00% <100.00%> (ø)
src/types/platformApiTypes.js 100.00% <100.00%> (ø)
src/types/rhsmApiTypes.js 100.00% <100.00%> (ø)

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 2ee78de...bec3364. Read the comment docs.

cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request May 8, 2020
…s#277)

* userReducer, expose API error codes
* rhsmApiTypes, add API error response types
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request May 8, 2020
…s#277)

* userReducer, expose API error codes
* rhsmApiTypes, add API error response types
* rhsmServices, mock for 403 and error code
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request May 8, 2020

* authentication, optin error code check
* i18n test
@cdcabrera cdcabrera force-pushed the issues/260 branch 2 times, most recently from f9da761 to 850d88d Compare May 8, 2020 04:21
@cdcabrera cdcabrera changed the title WIP Opt-in API error code and platform user permissions Opt-in API error code and platform user permissions May 8, 2020
@cdcabrera cdcabrera force-pushed the ci branch 2 times, most recently from 7e13684 to 0cf1afc Compare May 8, 2020 20:52
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request May 8, 2020
…s#277)

* userReducer, expose API error codes
* rhsmApiTypes, add API error response types
* rhsmServices, mock for 403 and error code
cdcabrera added 4 commits May 8, 2020 17:25
* userReducer, map user permissions
* platformServices, remove user permissions async/await, name param
* platformApiTypes, user permission types
* reduxHelpers, expose error data correctly, expand test checks
* statusMiddleware, payload restructure, add data to dispatch
* userReducer, reduxHelper http status check
…s#277)

* userReducer, expose API error codes
* rhsmApiTypes, add API error response types
* rhsmServices, mock for 403 and error code
* authentication, optin error code check
* i18n test
@cdcabrera cdcabrera merged commit 1404ad1 into RedHatInsights:ci May 8, 2020
cdcabrera added a commit that referenced this pull request May 8, 2020
* userReducer, expose API error codes
* rhsmApiTypes, add API error response types
* rhsmServices, mock for 403 and error code
@cdcabrera cdcabrera mentioned this pull request May 19, 2020
cdcabrera added a commit that referenced this pull request May 19, 2020
* userReducer, expose API error codes
* rhsmApiTypes, add API error response types
* rhsmServices, mock for 403 and error code
@cdcabrera cdcabrera mentioned this pull request May 20, 2020
cdcabrera added a commit that referenced this pull request May 20, 2020
* userReducer, expose API error codes
* rhsmApiTypes, add API error response types
* rhsmServices, mock for 403 and error code
cdcabrera added a commit that referenced this pull request May 20, 2020
* userReducer, expose API error codes
* rhsmApiTypes, add API error response types
* rhsmServices, mock for 403 and error code
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.

2 participants