Support importing local workflow templates #208
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds support for importing locally saved workflow templates in JSON or YAML format. A new button is available on the base workflows page, for both the workflows list and the new workflow tabs. When clicked, opens up a modal where users can drag-and-drop or import a template from their local filesystem. The modal will validated and prevent or allow importing, depending on 3 different states:
ui_metadata
field). No warnings, and users can import. Note if this is manually done / misconfigured this may still fail; it is up to the user to not corrupt the values withinui_metadata
.ui_metadata
). Warns that the workflow can be imported, but may not be visible from the editor etc. since there is no ui metadata to parse.When a user clicks "Import", the plugin attempts to create that workflow on the selected cluster, and is then viewable the same way as any other workflow. Any failures are propagated in a toast message with details, no different than if they were to run the create workflow API directly with the contents of the file.
Demo video showing the 3 different states, and successful importing into the cluster via the modal:
screen-capture.webm
Testing:
export
step can be imported and load everything correctlyexport
step can be imported and load everything correctlyOther minor changes:
Issues Resolved
Makes progress on #66
Check List
--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.