-
-
Notifications
You must be signed in to change notification settings - Fork 267
Add copy rule functionality #2132
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
Conversation
Signed-off-by: Dmitry P. (d51x) <dimonich110@gmail.com>
Job #1219: Bundle Size — 15.79MiB (+0.21%).Warning Bundle contains 16 duplicate packages – View duplicate packages Warning Bundle introduced 13 new packages: @jsep-plugin/regex, @jsep-plugin/arrow, @jsep-plugin/object and 10 more – View changed packages Bundle metrics
Bundle size by type
|
|
I wonder if the new rule should be created initially disabled regardless of the state of the old rule. For example, if the rule is triggered by a system runlevel/system started trigger, the new rule will immediately run as soon as it's created as a copy which could be undesirable. Simply making a copy shouldn't cause "stuff" to happen. Also, since the rule's UID cannot be changed once it's created, it would be desireable if the user could choose the UID of the newly created rule. Because one needs the UID of a rule to call it from another rule, and some error messages use the rule UID in the error, having the ability to choose our own UID on creation/copy is kind of important. Could this be used perhaps as a way to create a copy of an unmanaged rule (i.e. rule defined in a text file instead of through the UI)? I would expect not but if there is enough data there to recreate the rule as a managed rule that could be a cool way to import text file rules into the UI. |
UID of copied rule is new (unique) |
Yes but the end user should be allowed to change it before the new rule is created. |
|
Many users do not use the automatically generated random UIDs but prefer to give rules more descriptive identifiable names. If this feature is going to be useful for all users then it needs to not create the rule as a saved configuration already but open the rule in the rule creation wizard so the user can, if they want to change the UID. |
|
I listed some examples above for why a user would want to change the UID. In brief:
It's a lot easier to work with a rule with a UID of |
Signed-off-by: Dmitry P. (d51x) <dimonich110@gmail.com>
|
the implementation of the copy rule has been changed |
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
This has been on my "I want to implement it list" for a long time, thanks for doing that!
I just fixed some places you forgot to replace createMode with isNewRule.
Wrt to disabling a copied rule by default: Since a newly created rule is enabled by default, I would do the same for a copied rule. However technically it would be possible to create the new rule right after creating it, that would not solve the problem with start level trigger triggering. Seems like it is not possible to create the rule already disabled.
Sometimes it is necessary to make copies of the rule for later editing.
Added ability to copy a rule.
After "copy rule" new rule is opened
If original rule is disabled, then copied rule also disabledOriginal rule
Copied rule
Opened as New rule with pre-filled values