Skip to content

Commit

Permalink
Fixed a bug that was causing the action execution policy to be config…
Browse files Browse the repository at this point in the history
…urable for query and cluster metrics monitors. (#261) (#263)

* Fixed a bug that was causing the action execution policy to be configurable for query and cluster metrics monitors.

Signed-off-by: AWSHurneyt <[email protected]>

* Updated snapshots.

Signed-off-by: AWSHurneyt <[email protected]>
(cherry picked from commit fdd52fe)

Co-authored-by: AWSHurneyt <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and AWSHurneyt authored Jun 7, 2022
1 parent d90b131 commit 6e65e49
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 265 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -397,101 +397,24 @@ exports[`Action renders with Notifications plugin installed 1`] = `
<div
class="euiSpacer euiSpacer--m"
/>
<div
class="euiFormRow"
id="generated-id-row"
style="max-width:100%"
>
<div
class="euiFormRow__labelWrapper"
>
<label
class="euiFormLabel euiFormRow__label"
for="generated-id"
>
<span
style="color:#343741"
>
Perform action
</span>
</label>
</div>
<div>
<div
class="euiFormRow__fieldWrapper"
class="euiFlexItem"
>
<div
class="euiFlexGroup euiFlexGroup--gutterExtraSmall euiFlexGroup--directionColumn euiFlexGroup--responsive"
id="generated-id"
class="euiText euiText--extraSmall"
>
<div
class="euiFlexItem"
>
<div
class="euiFormRow"
id="testPathactions.0.action_execution_policy.action_execution_scope-form-row-row"
>
<div
class="euiFormRow__fieldWrapper"
>
<div
class="euiRadio"
>
<input
class="euiRadio__input"
id="testPathactions.0.action_execution_policy.per_execution"
name="testPathactions.0.action_execution_policy.action_execution_scope"
type="radio"
value="per_execution"
/>
<div
class="euiRadio__circle"
/>
<label
class="euiRadio__label"
for="testPathactions.0.action_execution_policy.per_execution"
>
Per execution
</label>
</div>
</div>
</div>
</div>
<div
class="euiFlexItem"
>
<div
class="euiFormRow"
id="testPathactions.0.action_execution_policy.action_execution_scope-form-row-row"
>
<div
class="euiFormRow__fieldWrapper"
>
<div
class="euiRadio"
>
<input
checked=""
class="euiRadio__input"
id="testPathactions.0.action_execution_policy.per_alert"
name="testPathactions.0.action_execution_policy.action_execution_scope"
type="radio"
value="per_alert"
/>
<div
class="euiRadio__circle"
/>
<label
class="euiRadio__label"
for="testPathactions.0.action_execution_policy.per_alert"
>
Per alert
</label>
</div>
</div>
</div>
<strong>
Perform action
</strong>
<div>
Per monitor execution
</div>
</div>
</div>
<div
class="euiSpacer euiSpacer--s"
/>
</div>
<div
class="euiFormRow"
Expand Down Expand Up @@ -1069,101 +992,24 @@ exports[`Action renders without Notifications plugin installed 1`] = `
<div
class="euiSpacer euiSpacer--m"
/>
<div
class="euiFormRow"
id="generated-id-row"
style="max-width:100%"
>
<div
class="euiFormRow__labelWrapper"
>
<label
class="euiFormLabel euiFormRow__label"
for="generated-id"
>
<span
style="color:#343741"
>
Perform action
</span>
</label>
</div>
<div>
<div
class="euiFormRow__fieldWrapper"
class="euiFlexItem"
>
<div
class="euiFlexGroup euiFlexGroup--gutterExtraSmall euiFlexGroup--directionColumn euiFlexGroup--responsive"
id="generated-id"
class="euiText euiText--extraSmall"
>
<div
class="euiFlexItem"
>
<div
class="euiFormRow"
id="testPathactions.0.action_execution_policy.action_execution_scope-form-row-row"
>
<div
class="euiFormRow__fieldWrapper"
>
<div
class="euiRadio"
>
<input
class="euiRadio__input"
id="testPathactions.0.action_execution_policy.per_execution"
name="testPathactions.0.action_execution_policy.action_execution_scope"
type="radio"
value="per_execution"
/>
<div
class="euiRadio__circle"
/>
<label
class="euiRadio__label"
for="testPathactions.0.action_execution_policy.per_execution"
>
Per execution
</label>
</div>
</div>
</div>
</div>
<div
class="euiFlexItem"
>
<div
class="euiFormRow"
id="testPathactions.0.action_execution_policy.action_execution_scope-form-row-row"
>
<div
class="euiFormRow__fieldWrapper"
>
<div
class="euiRadio"
>
<input
checked=""
class="euiRadio__input"
id="testPathactions.0.action_execution_policy.per_alert"
name="testPathactions.0.action_execution_policy.action_execution_scope"
type="radio"
value="per_alert"
/>
<div
class="euiRadio__circle"
/>
<label
class="euiRadio__label"
for="testPathactions.0.action_execution_policy.per_alert"
>
Per alert
</label>
</div>
</div>
</div>
<strong>
Perform action
</strong>
<div>
Per monitor execution
</div>
</div>
</div>
<div
class="euiSpacer euiSpacer--s"
/>
</div>
<div
class="euiFormRow"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export default function Message(
const onDisplayPreviewChange = (e) => setDisplayPreview(e.target.checked);
const monitorType = _.get(context, 'ctx.monitor.monitor_type', MONITOR_TYPE.QUERY_LEVEL);
const editableActionExecutionPolicy =
monitorType === MONITOR_TYPE.BUCKET_LEVEL || MONITOR_TYPE.DOC_LEVEL;
monitorType === MONITOR_TYPE.BUCKET_LEVEL || monitorType === MONITOR_TYPE.DOC_LEVEL;

const actionPath = `${fieldPath}actions.${index}`;
const actionExecutionPolicyPath = editableActionExecutionPolicy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,101 +170,24 @@ exports[`Message renders 1`] = `
<div
class="euiSpacer euiSpacer--m"
/>
<div
class="euiFormRow"
id="generated-id-row"
style="max-width:100%"
>
<div>
<div
class="euiFormRow__labelWrapper"
>
<label
class="euiFormLabel euiFormRow__label"
for="generated-id"
>
<span
style="color:#343741"
>
Perform action
</span>
</label>
</div>
<div
class="euiFormRow__fieldWrapper"
class="euiFlexItem"
>
<div
class="euiFlexGroup euiFlexGroup--gutterExtraSmall euiFlexGroup--directionColumn euiFlexGroup--responsive"
id="generated-id"
class="euiText euiText--extraSmall"
>
<div
class="euiFlexItem"
>
<div
class="euiFormRow"
id="undefinedactions.0.action_execution_policy.action_execution_scope-form-row-row"
>
<div
class="euiFormRow__fieldWrapper"
>
<div
class="euiRadio"
>
<input
class="euiRadio__input"
id="undefinedactions.0.action_execution_policy.per_execution"
name="undefinedactions.0.action_execution_policy.action_execution_scope"
type="radio"
value="per_execution"
/>
<div
class="euiRadio__circle"
/>
<label
class="euiRadio__label"
for="undefinedactions.0.action_execution_policy.per_execution"
>
Per execution
</label>
</div>
</div>
</div>
</div>
<div
class="euiFlexItem"
>
<div
class="euiFormRow"
id="undefinedactions.0.action_execution_policy.action_execution_scope-form-row-row"
>
<div
class="euiFormRow__fieldWrapper"
>
<div
class="euiRadio"
>
<input
checked=""
class="euiRadio__input"
id="undefinedactions.0.action_execution_policy.per_alert"
name="undefinedactions.0.action_execution_policy.action_execution_scope"
type="radio"
value="per_alert"
/>
<div
class="euiRadio__circle"
/>
<label
class="euiRadio__label"
for="undefinedactions.0.action_execution_policy.per_alert"
>
Per alert
</label>
</div>
</div>
</div>
<strong>
Perform action
</strong>
<div>
Per monitor execution
</div>
</div>
</div>
<div
class="euiSpacer euiSpacer--s"
/>
</div>
<div
class="euiFormRow"
Expand Down

0 comments on commit 6e65e49

Please sign in to comment.