feat(rules): implement Rule editing and copying #1620
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.
Welcome to Cryostat! 👋
Before contributing, make sure you have:
main
branch[chore, ci, docs, feat, fix, test]
To recreate commits with GPG signature
git fetch upstream && git rebase --force --gpg-sign upstream/main
Depends on cryostatio/cryostat#888
Related to #1581
Description of the change:
_copy
appended to the name, and will first a POST request to create a new rule on submission.Motivation for the change:
Eases the user experience of managing Automated Rules. Currently the only way to create new Rules is to step through the form again and fill in everything, or else download the Rule as JSON and manually edit that and re-upload it. These two new actions allow users to use existing Rules (presets or their own definitions) as a base and adjust them as needed on the fly, or use them as a base for new and more refined Rules without needing to drop into manually editing JSON.
How to manually test:
_copy
appended. Make any other adjustments you'd like, then click the Create button to submit the form. Verify that you are navigated back to the Automated Rules view and the table content reflects your new Rule._copy
from the name. Try to submit the form and verify that an HTTP conflict notification appears and you are not navigated away. Change the rule name to a non-conflicting one and verify that creation now succeeds.enabled: true
. Re-upload the Rule and ensure that the table content reflects the new content, but withenabled
overridden tofalse
. Ensure manually toggling the Rule to enable it works as expected.