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.
[2.x] Refactor Saved objects and add visualization embeddable (opense…
…arch-project#341) (opensearch-project#352) Signed-off-by: Joshua Li <[email protected]> Co-authored-by: Eric Wei <[email protected]> Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Co-authored-by: Derek Ho <[email protected]> (cherry picked from commit 6047bff)
- Loading branch information
1 parent
a2cadf2
commit 6adf60c
Showing
110 changed files
with
5,976 additions
and
1,468 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"last_github_commit": "4ddf822d3450cb5ce1d9fd3671670c84a0acd6cc", | ||
"last_gitfarm_commit": "b095641c9270cae3d835a525f593e5cb6b21608b" | ||
"last_github_commit": "6047bff9e3575edc75398640e845cab73bd6c32d", | ||
"last_gitfarm_commit": "3dba7edb78f37032252e40aa1e005587ffc8bf96" | ||
} |
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.