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

Event rule config enhancement #159

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

raviks789
Copy link
Contributor

@raviks789 raviks789 commented Feb 21, 2024

Use a single form for event rule configuration.

Blocked by Icinga/icingaweb2#5190

@cla-bot cla-bot bot added the cla/signed CLA is signed by all contributors of a PR label Feb 21, 2024
@raviks789 raviks789 force-pushed the event-rule-config-enhancement branch 4 times, most recently from c40476a to 8e16e7e Compare February 28, 2024 09:14
@raviks789 raviks789 force-pushed the event-rule-config-enhancement branch 13 times, most recently from 1c9054f to 7ab548f Compare March 6, 2024 12:35
@raviks789 raviks789 force-pushed the event-rule-config-enhancement branch 9 times, most recently from 25b4a12 to 163112c Compare March 13, 2024 09:32
@raviks789 raviks789 force-pushed the event-rule-config-enhancement branch 3 times, most recently from 97018d5 to 4b1380c Compare March 18, 2024 13:08
@raviks789 raviks789 force-pushed the event-rule-config-enhancement branch 5 times, most recently from 3516123 to babd436 Compare April 25, 2024 12:00
@raviks789 raviks789 force-pushed the event-rule-config-enhancement branch 3 times, most recently from 3981ff8 to dbc97ac Compare April 25, 2024 15:12
@raviks789 raviks789 force-pushed the event-rule-config-enhancement branch 2 times, most recently from 04d545c to 4101ce6 Compare April 26, 2024 15:21
$buttonsWrapper->add(
[$eventRuleConfigSubmitButton, $discardChangesButton, $deleteButton]
);
$buttonsWrapper->add([$eventRuleConfigSubmitButton, $discardChangesButton, $deleteButton]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use addHtml wherever possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use add() here as $discardChangesButton could be null. But addHtml could be use in PR #170, as you do not need that button.

@@ -283,7 +281,7 @@ public static function createFilterString(Filter\Rule $filters): string

$filterStr = QueryString::render($filters);

return ! empty($filterStr) ? $filterStr : '';
return ! empty($filterStr) ? rawurldecode($filterStr) : '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change required now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to store and display certain special characters like '/' as it is instead of in its url encoded form. This was earlier done in setObjectString method in EventRuleObjectFilter.

Comment on lines 296 to 301
$config = iterator_to_array(
Rule::on(Database::get())
->withColumns(['id'])
->filter(Filter::equal('id', $ruleId))
->first()
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The iterator_to_array method is not required here, and please fetch only the required columns. You can use Connection::FetchOne() to get the result as an array.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do not need to mention the columns, as by default only the columns from rule table will be fetched.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but you don't want all rule columns.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is true as well

application/forms/EventRuleConfigForm.php Outdated Show resolved Hide resolved
application/forms/EventRuleConfigForm.php Show resolved Hide resolved
@raviks789 raviks789 force-pushed the event-rule-config-enhancement branch 6 times, most recently from bfcbbcf to 6c81474 Compare April 29, 2024 11:46
@raviks789 raviks789 force-pushed the event-rule-config-enhancement branch 6 times, most recently from 513d3a4 to 6243671 Compare May 10, 2024 14:18
@raviks789 raviks789 force-pushed the event-rule-config-enhancement branch from 6243671 to c2dc61d Compare May 10, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/view Affects an entire view cla/signed CLA is signed by all contributors of a PR enhancement New feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rewrite Event Rule Configuration
3 participants