Skip to content

Commit

Permalink
edit correlation Alert Trigger fix (#1180) (#1183)
Browse files Browse the repository at this point in the history
* edit correlation Alert Trigger fix



* delete correlation alert trigger fix



* delete correlation alert trigger fix



* edit correlation rule trigger fix



* edit correlation rule trigger fix



* edit correlation rule trigger fix



* extra spacing removed



---------


(cherry picked from commit 8220c38)

Signed-off-by: Riya Saxena <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent bfadcf2 commit e302a70
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ export const CreateCorrelationRule: React.FC<CreateCorrelationRuleProps> = (
setInitialValues(ruleRes);
}
};

setAction('Edit');
setInitialRuleValues();
}
Expand Down Expand Up @@ -1064,7 +1063,11 @@ export const CreateCorrelationRule: React.FC<CreateCorrelationRuleProps> = (
data-test-subj="delete-alert-trigger-icon"
iconType="trash"
color="danger"
onClick={() => setShowForm(false)}
onClick={() => {
// Clear the trigger values by setting them to an empty object or your initial state
props.setFieldValue('trigger', {});
setShowForm(false);
}}
/>
</EuiFormRow>
</EuiFlexItem>
Expand Down
2 changes: 2 additions & 0 deletions public/store/CorrelationsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export class CorrelationsStore implements ICorrelationsStore {
name: hit._source.name,
time_window: hit._source.time_window || 300000,
queries,
trigger: hit._source?.trigger
};
}

Expand All @@ -173,6 +174,7 @@ export class CorrelationsStore implements ICorrelationsStore {
name: hit._source.name,
time_window: hit._source.time_window || 300000,
queries,
trigger: hit._source?.trigger
};
});
}
Expand Down
4 changes: 2 additions & 2 deletions types/Correlations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export interface CorrelationRuleModel {
name: string;
time_window: number; // Time in milliseconds
queries: CorrelationRuleQuery[];
trigger: CorrelationRuleTrigger | undefined;
trigger?: CorrelationRuleTrigger;
}

export interface CorrelationRule extends CorrelationRuleModel {
Expand All @@ -76,7 +76,7 @@ export interface CorrelationRuleSource {
name: string;
time_window: number;
correlate: CorrelationRuleSourceQueries[];
trigger?: CorrelationRuleTrigger | undefined;
trigger?: CorrelationRuleTrigger;
}

export interface CorrelationRuleHit {
Expand Down

0 comments on commit e302a70

Please sign in to comment.