Skip to content

Commit

Permalink
feat: allow date_nanos dates in timestamp selection
Browse files Browse the repository at this point in the history
Signed-off-by: Babacar Diasse <[email protected]>
  • Loading branch information
jehuty0shift committed Jun 14, 2024
1 parent 6588710 commit a7b220e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions public/pages/DefineDetector/components/Timestamp/Timestamp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,15 @@ export function Timestamp(props: TimestampProps) {
get(opensearchState, 'dataTypes.date', []) as string[]
);

const timeStampFieldOptions = isEmpty(dateFields)
const dateNanoFields = Array.from(
get(opensearchState, 'dataTypes.date_nanos', []) as string[]
);

const allDateFields = dateFields.concat(dateNanoFields);

const timeStampFieldOptions = isEmpty(allDateFields)
? []
: dateFields.map((dateField) => ({ label: dateField }));
: allDateFields.map((dateField) => ({ label: dateField }));

return (
<ContentPanel
Expand Down
1 change: 1 addition & 0 deletions public/redux/reducers/opensearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export interface DataTypes {
half_float?: string[];
boolean?: string[];
date?: string[];
date_nanos?: string[];
keyword?: string[];
text?: string[];
integer_range?: string[];
Expand Down

0 comments on commit a7b220e

Please sign in to comment.