Skip to content

Commit

Permalink
update filter for timeline savedObject
Browse files Browse the repository at this point in the history
  • Loading branch information
angorayc committed May 5, 2020
1 parent 0090d22 commit 929ad24
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions x-pack/plugins/siem/server/lib/timeline/saved_object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,12 @@ export const getTimelineByTemplateTimelineId = async (
/** The filter here is able to handle the legacy data,
* which has no timelineType exists in the savedObject */
const getTimelineTypeFilter = (timelineType: string | null) => {
if (timelineType === TimelineType.template) {
/** Show only whose timelineType is "template" */
return `siem-ui-timeline.attributes.timelineType: ${TimelineType.template}`;
}

if (timelineType === TimelineType.default) {
/** Show me every timeline whose timelineType is not "template".
* which includes timelineType === 'default' and
* those timelineType doesn't exists */
return `not siem-ui-timeline.attributes.timelineType: ${TimelineType.template}`;
}

return undefined;
return timelineType === TimelineType.template
? `siem-ui-timeline.attributes.timelineType: ${TimelineType.template}` /** Show only whose timelineType exists and equals to "template" */
: /** Show me every timeline whose timelineType is not "template".
* which includes timelineType === 'default' and
* those timelineType doesn't exists */
`not siem-ui-timeline.attributes.timelineType: ${TimelineType.template}`;
};

export const getAllTimeline = async (
Expand Down

0 comments on commit 929ad24

Please sign in to comment.