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

Support create / provision / deprovision from editor page #123

Merged
merged 5 commits into from
Apr 5, 2024

Conversation

ohltyler
Copy link
Member

@ohltyler ohltyler commented Apr 4, 2024

Description

Improves the creation, and adds provision & deprovision functionality on the editor page with new buttons. Note these buttons are placeholders and nothing is finalized regarding where they will live or the exact flow. But this proves out the capability.

More details:

  • onboards provision/deprovision APIs and integrates with redux store
  • finalizes get state API and integrates with redux store
  • removes provision option from create API to simplify state management
  • improves the Create/Save button: now kicks off create, and if successful, reloads the page with the newly-created ID in the url
  • adds a "Provision" button to kick off provisioning, waits a few seconds, then kicks off a get state API call to auto-update the stored state. This is just a temporary utility as nothing is finalized around this part
  • state management: shows "Create" or "Save" in the button depending on if this is a new/unsaved workflow, or an existing/indexed workflow
  • state management: fine-grained loading state for create/save/provision/deprovision, and disables buttons and/or sets loading state for the buttons depending on actions taken
  • shows workflow state in the base header
  • pulls out common validation logic into a validateFormAndFlow() helper fn. Currently only used in save flow, but will likely be used in other places for adhoc provisioning/deprovisioning and realtime validation is needed.

Misc fixes

  • fixes bug of querying all workflows defaulting to size: 10 => size: 1000
  • changes from useDispatch() to useAppDispatch(), which is a more specific dispatch that's hooked up to our specific redux store / middleware with determined return types, which are async thunks. see here for details: https://redux-toolkit.js.org/usage/usage-with-typescript#getting-the-dispatch-type
  • minor formatting improvements for consistency

Demo video:

  • creating a brand new workflow
  • page auto-refreshing with the newly-created workflow ID
  • provisioning workflow and seeing state auto-update
  • deprovisioning workflow and seeing state auto-update
  • guardrails and fine-grained state for all of the buttons
lifecycle.flows.webm

Issues Resolved

Makes progress on #75

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

ohltyler added 5 commits April 3, 2024 17:07
… to include size 1000

Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
…kflow state API

Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
Copy link

codecov bot commented Apr 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 21.86%. Comparing base (d5ba601) to head (bee9c8a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #123      +/-   ##
==========================================
- Coverage   22.18%   21.86%   -0.32%     
==========================================
  Files          57       57              
  Lines         870      974     +104     
  Branches       92      106      +14     
==========================================
+ Hits          193      213      +20     
- Misses        673      757      +84     
  Partials        4        4              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ohltyler ohltyler merged commit 37bbbfa into opensearch-project:main Apr 5, 2024
12 of 13 checks passed
@ohltyler ohltyler deleted the improve-save branch April 5, 2024 00:09
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 5, 2024
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
(cherry picked from commit 37bbbfa)
ohltyler added a commit that referenced this pull request Apr 5, 2024
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
(cherry picked from commit 37bbbfa)

Co-authored-by: Tyler Ohlsen <ohltyler@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants