Skip to content

Commit 6a173eb

Browse files
committed
feedback on pr review
1 parent 5fb93a1 commit 6a173eb

6 files changed

Lines changed: 11 additions & 9 deletions

File tree

x-pack/plugins/alerting/server/rules_client/lib/validate_actions.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ describe('validateActions', () => {
164164
false
165165
)
166166
).rejects.toThrowErrorMatchingInlineSnapshot(
167-
'"Failed to validate actions due to the following error: Action throttle cannot be shorter than the schedule interval of 1m: default (1s)"'
167+
'"Failed to validate actions due to the following error: Action frequency cannot be shorter than the schedule interval of 1m: default (1s)"'
168168
);
169169
});
170170

x-pack/plugins/alerting/server/rules_client/lib/validate_actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export async function validateActions(
175175
errors.push(
176176
i18n.translate('xpack.alerting.rulesClient.validateActions.actionsWithInvalidThrottles', {
177177
defaultMessage:
178-
'Action throttle cannot be shorter than the schedule interval of {scheduleIntervalText}: {groups}',
178+
'Action frequency cannot be shorter than the schedule interval of {scheduleIntervalText}: {groups}',
179179
values: {
180180
scheduleIntervalText: data.schedule.interval,
181181
groups: actionsWithInvalidThrottles

x-pack/plugins/alerting/server/rules_client/tests/create.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3045,7 +3045,7 @@ describe('create()', () => {
30453045
],
30463046
});
30473047
await expect(rulesClient.create({ data })).rejects.toThrowErrorMatchingInlineSnapshot(
3048-
`"Failed to validate actions due to the following error: Action throttle cannot be shorter than the schedule interval of 3h: default (1h), group2 (3m)"`
3048+
`"Failed to validate actions due to the following error: Action frequency cannot be shorter than the schedule interval of 3h: default (1h), group2 (3m)"`
30493049
);
30503050
expect(unsecuredSavedObjectsClient.create).not.toHaveBeenCalled();
30513051
expect(taskManager.schedule).not.toHaveBeenCalled();
@@ -3122,7 +3122,7 @@ describe('create()', () => {
31223122
await expect(rulesClient.create({ data })).rejects.toThrowErrorMatchingInlineSnapshot(`
31233123
"Failed to validate actions due to the following 2 errors:
31243124
- Actions missing frequency parameters: group3
3125-
- Action throttle cannot be shorter than the schedule interval of 3h: default (1h), group2 (3m)"
3125+
- Action frequency cannot be shorter than the schedule interval of 3h: default (1h), group2 (3m)"
31263126
`);
31273127
expect(unsecuredSavedObjectsClient.create).not.toHaveBeenCalled();
31283128
expect(taskManager.schedule).not.toHaveBeenCalled();

x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_alerts_filter_query.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const ActionAlertsFilterQuery: React.FC<ActionAlertsFilterQueryProps> = (
6161
label={i18n.translate(
6262
'xpack.triggersActionsUI.sections.actionTypeForm.ActionAlertsFilterQueryToggleLabel',
6363
{
64-
defaultMessage: 'Send alert notification only if alert fields match a query',
64+
defaultMessage: 'if alert matches a query',
6565
}
6666
)}
6767
checked={queryEnabled}

x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_alerts_filter_timeframe.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const useDefaultTimezone = () => {
4949
const useTimeframe = (initialTimeframe?: AlertsFilterTimeframe) => {
5050
const timezone = useDefaultTimezone();
5151
const DEFAULT_TIMEFRAME = {
52-
days: [],
52+
days: ISO_WEEKDAYS,
5353
timezone,
5454
hours: {
5555
start: '00:00',
@@ -114,7 +114,9 @@ export const ActionAlertsFilterTimeframe: React.FC<ActionAlertsFilterTimeframePr
114114
const newDays = previouslyHasDay
115115
? timeframe.days.filter((d) => d !== day)
116116
: [...timeframe.days, day];
117-
updateTimeframe({ days: newDays });
117+
if (newDays.length !== 0) {
118+
updateTimeframe({ days: newDays });
119+
}
118120
},
119121
[timeframe, updateTimeframe]
120122
);
@@ -144,7 +146,7 @@ export const ActionAlertsFilterTimeframe: React.FC<ActionAlertsFilterTimeframePr
144146
label={i18n.translate(
145147
'xpack.triggersActionsUI.sections.actionTypeForm.ActionAlertsFilterTimeframeToggleLabel',
146148
{
147-
defaultMessage: 'Send alert notification within the selected time frame only',
149+
defaultMessage: 'if alert is generated during timeframe',
148150
}
149151
)}
150152
checked={timeframeEnabled}

x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_notify_when.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ export const ActionNotifyWhen = ({
330330
prepend={i18n.translate(
331331
'xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.label',
332332
{
333-
defaultMessage: 'Every',
333+
defaultMessage: 'Run action every',
334334
}
335335
)}
336336
onChange={(e) => {

0 commit comments

Comments
 (0)