Skip to content

Commit

Permalink
fix edit rule for detections (elastic#56333)
Browse files Browse the repository at this point in the history
fix duplicates rules

allow no filter on detail rule
  • Loading branch information
XavierM committed Jan 30, 2020
1 parent 1d315e8 commit c6ff9fb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ export const RedirectToEditRulePage = ({
location: { search },
}: DetectionEngineComponentProps) => {
return (
<RedirectWrapper
to={`/${DETECTION_ENGINE_PAGE_NAME}/rules/rule-details/${detailName}${search}/edit`}
/>
<RedirectWrapper to={`/${DETECTION_ENGINE_PAGE_NAME}/rules/id/${detailName}/edit${search}`} />
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ export const duplicateRules = async ({ rules }: DuplicateRulesProps): Promise<Ru
immutable: undefined,
last_success_at: undefined,
last_success_message: undefined,
last_failure_at: undefined,
last_failure_message: undefined,
status: undefined,
status_date: undefined,
}))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const getDescriptionItem = (
indexPatterns?: IIndexPattern
): ListItems[] => {
if (field === 'queryBar') {
const filters = addFilterStateIfNotThere(get('queryBar.filters', value));
const filters = addFilterStateIfNotThere(get('queryBar.filters', value) ?? []);
const query = get('queryBar.query', value) as Query;
const savedId = get('queryBar.saved_id', value);
return buildQueryBarDescription({
Expand Down

0 comments on commit c6ff9fb

Please sign in to comment.