forked from opensearch-project/OpenSearch-Dashboards
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Data Explorer]Fix display for index pattern without a default time f…
…ield Issue Resolve opensearch-project#4820 Signed-off-by: ananzh <ananzh@amazon.com>
- Loading branch information
Showing
6 changed files
with
109 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/plugins/discover/public/application/components/data_grid/data_grid_schema.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export enum OSD_FIELD_TYPES { | ||
_SOURCE = '_source', | ||
ATTACHMENT = 'attachment', | ||
BOOLEAN = 'boolean', | ||
DATE = 'date', | ||
GEO_POINT = 'geo_point', | ||
GEO_SHAPE = 'geo_shape', | ||
IP = 'ip', | ||
MURMUR3 = 'murmur3', | ||
NUMBER = 'number', | ||
STRING = 'string', | ||
UNKNOWN = 'unknown', | ||
CONFLICT = 'conflict', | ||
OBJECT = 'object', | ||
NESTED = 'nested', | ||
HISTOGRAM = 'histogram', | ||
} | ||
|
||
export const osdJSON = 'osd-json'; | ||
export function getSchemaByKbnType(kbnType: string | undefined) { | ||
// Default DataGrid schemas: boolean, numeric, datetime, json, currency, string | ||
switch (kbnType) { | ||
case OSD_FIELD_TYPES.IP: | ||
case OSD_FIELD_TYPES.GEO_SHAPE: | ||
case OSD_FIELD_TYPES.NUMBER: | ||
return 'numeric'; | ||
case OSD_FIELD_TYPES.BOOLEAN: | ||
return 'boolean'; | ||
case OSD_FIELD_TYPES.STRING: | ||
return 'string'; | ||
case OSD_FIELD_TYPES.DATE: | ||
return 'datetime'; | ||
default: | ||
return osdJSON; | ||
} | ||
} | ||
|
||
export function getSchemaDetectors() { | ||
return [ | ||
{ | ||
type: osdJSON, | ||
detector() { | ||
return 0; // this schema is always explicitly defined | ||
}, | ||
sortTextAsc: '', | ||
sortTextDesc: '', | ||
icon: '', | ||
color: '', | ||
}, | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters