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

Improve Service Discovery Errors (AKA improve New API form) #1015

Merged
merged 13 commits into from Aug 20, 2019

Conversation

josemigallas
Copy link
Contributor

@josemigallas josemigallas commented Jul 22, 2019

What this PR does / why we need it:

  • Improves the way "error scenarios" are managed in the form, such as when projects is an empty string or when there's any error code.
  • Improves Flow typings
  • Improves the UI flow by adding a loading spinner and disabling inputs when there's an ongoing request
  • Simplifies some pieces of logic

Possible TODOs

  • Find a better way to show loading state
  • Improve the data structured received from the server
  • Reduce amount of requests by checking for service discovery before selecting the radio
  • Get projects/services data only once, not everytime the radio is selected (keep state in parent?)

Which issue(s) this PR fixes

THREESCALE-2646: Service Discovery: Improve error messages and visual feedback when ajax request fails

Verification steps

Having Service Discovery enabled and logged in in Openshift go to /apiconfig/services/new and select Import from Openshift. Mess around the form and look for any errors.

Visuals
Expected:
new-api-good

When empty:
new-api-empty

When error:
new-api-error

@josemigallas josemigallas added javascript Pull requests that update Javascript code Priority: High Closes a JIRA issue in our sprint labels Jul 22, 2019
@josemigallas josemigallas self-assigned this Jul 22, 2019
@josemigallas josemigallas force-pushed the feature/THREESCALE-2646_service_discovery_errors branch from 9c02582 to 113e14e Compare July 22, 2019 15:07
@codecov
Copy link

codecov bot commented Jul 23, 2019

Codecov Report

Merging #1015 into master will increase coverage by 0.2%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #1015     +/-   ##
=========================================
+ Coverage   92.77%   92.97%   +0.2%     
=========================================
  Files        2403     2417     +14     
  Lines       78544    79561   +1017     
=========================================
+ Hits        72866    73974   +1108     
+ Misses       5678     5587     -91
Impacted Files Coverage Δ
...n/service_discovery/cluster_projects_controller.rb 66.66% <0%> (ø) ⬆️
...n/service_discovery/cluster_services_controller.rb 50% <40%> (+7.14%) ⬆️
config/initializers/oracle.rb 1.49% <0%> (-44.78%) ⬇️
config/initializers/access_token_authentication.rb 55.55% <0%> (-22.23%) ⬇️
app/models/application_record.rb 62.5% <0%> (-18.75%) ⬇️
app/queries/new_accounts_query.rb 71.73% <0%> (-17.4%) ⬇️
lib/api_authentication/by_access_token.rb 91.52% <0%> (-5.94%) ⬇️
app/models/account/buyer_methods.rb 92.06% <0%> (-1.59%) ⬇️
app/lib/missing_model.rb 100% <0%> (ø) ⬆️
...est/workers/delete_object_hierarchy_worker_test.rb 100% <0%> (ø) ⬆️
... and 39 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 43383d8...c03f5d8. Read the comment docs.

@josemigallas josemigallas changed the title [WIP] Improve Service Discovery Errors (AKA improve New API form) Improve Service Discovery Errors (AKA improve New API form) Jul 26, 2019
@josemigallas josemigallas force-pushed the feature/THREESCALE-2646_service_discovery_errors branch 2 times, most recently from 03ded4b to 6259a45 Compare August 2, 2019 12:12
@josemigallas josemigallas force-pushed the feature/THREESCALE-2646_service_discovery_errors branch from 6259a45 to 10d4ac9 Compare August 2, 2019 12:27
Copy link
Member

@didierofrivia didierofrivia left a comment

Choose a reason for hiding this comment

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

🏅

@josemigallas josemigallas merged commit b360f37 into master Aug 20, 2019
@josemigallas josemigallas deleted the feature/THREESCALE-2646_service_discovery_errors branch August 20, 2019 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code Priority: High Closes a JIRA issue in our sprint
Projects
None yet
3 participants