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

Provide a user opt-in form for org-admins #247

Merged
merged 1 commit into from
Apr 10, 2020

Conversation

cdcabrera
Copy link
Member

@cdcabrera cdcabrera commented Apr 7, 2020

What's included

  • feat(optinView): issues/240 add opt-in form
    • build, proxy run path adjusted
    • i18n, locales, strings for opt-in
    • authentication, add in admin checks
    • optinView, add component
    • routerTypes, add and apply error routing for opt-in
    • userActions, notifications for opt-in success/fail
    • userReducer, carry admin and entitled through error state
    • userServices, add in opt-in put force status for mock testing
    • styling, added images, minor adjustments

Notes

  • @mbpierce @bclarhk @rblackbu
  • In the event you are logged in you can navigate directly to the "optinView" via, /subscriptions/optin
    • A check that determines if a 403 is NOT thrown and you're an admin should probably disabled the button, currently it does not. Regular users aren't a concern, they receive the opt in view sans button.

Process for "opt-in" breakdown

  • User must be an org-admin to receive the "opt-in" form. If they are not they see the basic opt-in form without the button to proceed.
  • If an org-admin successfully "opts in" they will see a green toast notification that requires manual dismissal.
    • Refreshing this screen should then bring the graph display up. We currently do not automatically refresh
  • If an org-admin fails to "opt in", i.e. the API fails, they will see a red toast notification, and a Contact us link indicating they can not proceed.
    • Hitting refresh on this page will allow the user to resubmit. We currently do not automatically refresh

How to test

Local run check

  1. update the NPM packages with $ yarn
  2. Add a file called .env.local to the root of the project
  3. Add the following line to .env.local, REACT_APP_DEBUG_ORG_ADMIN=true
  4. then, in terminal run $ yarn start
  5. navigate towards http://localhost:3000/optin
  6. next, submit the form a confirmation screen similar to the below screenshot should appear
  7. If you want to experience what a "non-org-admin" sees ...
    1. stop the project,
    2. then either remove REACT_APP_DEBUG_ORG_ADMIN=true or change it to REACT_APP_DEBUG_ORG_ADMIN=false,
    3. then restart the project with $ yarn start.
    4. You should see a screen similar to the last screenshot.

Example

Screen Shot 2020-04-09 at 7 32 16 PM

Screen Shot 2020-04-09 at 7 32 25 PM

Screen Shot 2020-04-09 at 7 31 57 PM

Screen Shot 2020-04-09 at 7 32 53 PM

Recordings

Apr-09-2020 19-30-24

Apr-09-2020 19-31-17

Updates issue/story

#240

@cdcabrera cdcabrera force-pushed the issues/240-optin branch 2 times, most recently from 3152662 to 8790cf6 Compare April 8, 2020 20:48
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Apr 9, 2020
* build, proxy run path adjusted
* i18n, locales, strings for opt-in
* authentication, add in admin checks
* optinView, add component
* routerTypes, add and apply error routing for opt-in
* userActions, notifications for opt-in success/fail
* userReducer, carry admin and entitled through error state
* userServices, add in opt-in put force status for mock testing
* styling, added images, minor adjustments
@cdcabrera cdcabrera changed the title WIP Provide a user opt-in form Provide a user opt-in form for org-admins Apr 9, 2020
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Apr 9, 2020
* build, proxy run path adjusted
* i18n, locales, strings for opt-in
* authentication, add in admin checks
* optinView, add component
* routerTypes, add and apply error routing for opt-in
* userActions, notifications for opt-in success/fail
* userReducer, carry admin and entitled through error state
* userServices, add in opt-in put force status for mock testing
* styling, added images, minor adjustments
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Apr 10, 2020
* build, proxy run path adjusted
* i18n, locales, strings for opt-in
* authentication, add in admin checks
* optinView, add component
* routerTypes, add and apply error routing for opt-in
* userActions, notifications for opt-in success/fail
* userReducer, carry admin and entitled through error state
* userServices, add in opt-in put force status for mock testing
* styling, added images, minor adjustments
* build, proxy run path adjusted
* build, dist test updated to avoid including platform config
* i18n, locales, strings for opt-in
* authentication, add in admin checks
* optinView, add component
* routerTypes, add and apply error routing for opt-in
* userActions, notifications for opt-in success/fail
* userReducer, carry admin and entitled through error state
* userServices, add in opt-in put force status for mock testing
* styling, added images, minor adjustments
@cdcabrera
Copy link
Member Author

cdcabrera commented Apr 10, 2020

  • Unit tests need to be expanded on "optinView". We'll iterate on the test in order to get this pushed through to CI/dev
  • Iterating on ... being able to navigate directly to /subscriptions/optin and still receiving the button if you're an org-admin and a 2XX level status has been thrown from Tally and Capacity

@cdcabrera cdcabrera merged commit 3de8b02 into RedHatInsights:ci Apr 10, 2020
@cdcabrera cdcabrera mentioned this pull request Apr 10, 2020
cdcabrera added a commit that referenced this pull request Apr 10, 2020
* build, proxy run path adjusted
* build, dist test updated to avoid including platform config
* i18n, locales, strings for opt-in
* authentication, add in admin checks
* optinView, add component
* routerTypes, add and apply error routing for opt-in
* userActions, notifications for opt-in success/fail
* userReducer, carry admin and entitled through error state
* userServices, add in opt-in put force status for mock testing
* styling, added images, minor adjustments
cdcabrera added a commit that referenced this pull request Apr 17, 2020
* build, proxy run path adjusted
* build, dist test updated to avoid including platform config
* i18n, locales, strings for opt-in
* authentication, add in admin checks
* optinView, add component
* routerTypes, add and apply error routing for opt-in
* userActions, notifications for opt-in success/fail
* userReducer, carry admin and entitled through error state
* userServices, add in opt-in put force status for mock testing
* styling, added images, minor adjustments
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.

1 participant