forked from opensearch-project/dashboards-observability
-
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.
Refactor Saved objects and add visualization embeddable (opensearch-p…
…roject#341) Signed-off-by: Eric Wei <[email protected]> Signed-off-by: Joshua Li <[email protected]> Signed-off-by: Peter Fitzgibbons <[email protected]> Signed-off-by: Shenoy Pratik <[email protected]> Signed-off-by: Derek Ho <[email protected]> Co-authored-by: Joshua Li <[email protected]> Co-authored-by: Peter Fitzgibbons <[email protected]> Co-authored-by: Peter Fitzgibbons <[email protected]> Co-authored-by: Shenoy Pratik <[email protected]> Co-authored-by: Derek Ho <[email protected]> (cherry picked from commit 583010d)
- Loading branch information
1 parent
c9ebdde
commit 3cfee69
Showing
109 changed files
with
6,800 additions
and
1,467 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { SavedObjectAttributes } from '../../../../src/core/types'; | ||
import { SavedVisualization } from './explorer'; | ||
|
||
export const VISUALIZATION_SAVED_OBJECT = 'observability-visualization'; | ||
export const OBSERVABILTY_SAVED_OBJECTS = [VISUALIZATION_SAVED_OBJECT] as const; | ||
export const SAVED_OBJECT_VERSION = 1; | ||
|
||
export interface VisualizationSavedObjectAttributes extends SavedObjectAttributes { | ||
title: string; | ||
description: string; | ||
version: number; | ||
createdTimeMs: number; | ||
savedVisualization: SavedVisualization; | ||
} |
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,41 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { | ||
HttpStart, | ||
IUiSettingsClient, | ||
NotificationsStart, | ||
SavedObjectsClientContract, | ||
ToastInput, | ||
} from '../../../../src/core/public'; | ||
import { createGetterSetter } from '../../../../src/plugins/opensearch_dashboards_utils/common'; | ||
import PPLService from '../../public/services/requests/ppl'; | ||
import { QueryManager } from '../query_manager'; | ||
|
||
let uiSettings: IUiSettingsClient; | ||
let notifications: NotificationsStart; | ||
|
||
export const uiSettingsService = { | ||
init: (client: IUiSettingsClient, notificationsStart: NotificationsStart) => { | ||
uiSettings = client; | ||
notifications = notificationsStart; | ||
}, | ||
get: (key: string, defaultOverride?: any) => { | ||
return uiSettings?.get(key, defaultOverride) || ''; | ||
}, | ||
set: (key: string, value: any) => { | ||
return uiSettings?.set(key, value) || Promise.reject('uiSettings client not initialized.'); | ||
}, | ||
addToast: (toast: ToastInput) => { | ||
return notifications.toasts.add(toast); | ||
}, | ||
}; | ||
|
||
export const [getPPLService, setPPLService] = createGetterSetter<PPLService>('PPLService'); | ||
export const [getOSDHttp, setOSDHttp] = createGetterSetter<HttpStart>('http'); | ||
export const [getOSDSavedObjectsClient, setOSDSavedObjectsClient] = createGetterSetter< | ||
SavedObjectsClientContract | ||
>('SavedObjectsClient'); | ||
export const [getQueryManager, setQueryManager] = createGetterSetter<QueryManager>('QueryManager'); |
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.