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

Simplify export flow; improve form state #284

Merged
merged 7 commits into from
Aug 15, 2024

Conversation

ohltyler
Copy link
Member

@ohltyler ohltyler commented Aug 15, 2024

Description

This PR accomplishes 2 things:
1/ moves the export flow to a static button at the top instead of a standalone step in the form flow. This lets users generate the current template at any point
2/ improves the form button state. Now, buttons are enabled/disabled based on if the current form would produce a different final template or not (for both ingest and search). Before, it was just based on form values being changed or not. The issue was that after reverting the form to original values from the last template update, it would still show as outdated. (example: provision a workflow with index name "abc", provision button is disabled. After changing to "abcd", button is enabled to update. But, if changing back to "abc", button is still enabled to update, even though the underlying template would not actually be changed). Note we can't use comparison to the form's initial values, since we have autosave that is already updating that behind the scenes.

Other details:

  • cleans up some of the typing and template conversion logic to be consistent with what is persisted in the backend actual template. This needs to be identical in order to do proper template comparison.
  • changes default from KnnIndexer to just Indexer. May have more detailed defaults later on
  • minor change to ExportOptions to have some helper text at the top. May be tuned later on.

Demo video, showing:

  • new export flow moved into standalone button
  • buttons dynamically being enabled/disabled based on the form values and its underlying produced template
screen-capture.23.webm

Note: due to the multiple layers of form validation, I've created a tracking issue to audit everything at a later time: #286

Issues Resolved

Makes progress on #23
Resolves #272

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 ohltyler merged commit ad86b00 into opensearch-project:main Aug 15, 2024
8 checks passed
@ohltyler ohltyler deleted the update-export-flow branch August 15, 2024 21:39
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 15, 2024
Signed-off-by: Tyler Ohlsen <[email protected]>
(cherry picked from commit ad86b00)
ohltyler added a commit that referenced this pull request Aug 15, 2024
Signed-off-by: Tyler Ohlsen <[email protected]>
(cherry picked from commit ad86b00)

Co-authored-by: Tyler Ohlsen <[email protected]>
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.

Make form state more granular
2 participants