From f9174911dedc88d1d14c7f65ec92074ce07c1432 Mon Sep 17 00:00:00 2001 From: Lin Wang Date: Thu, 11 Jul 2024 16:01:42 +0800 Subject: [PATCH] Register admin UI as AI models in data administration use case (#337) * Register admin UI as ai models in data administration use case Signed-off-by: Lin Wang * Fix addNavLinksToGroup not found in chrome service Signed-off-by: Lin Wang * Update nav link text Signed-off-by: Lin Wang * Change text to AI models Signed-off-by: Lin Wang --------- Signed-off-by: Lin Wang (cherry picked from commit 83b3a2dc7c900f3809af971daf1ae73cbace9737) --- public/plugin.ts | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/public/plugin.ts b/public/plugin.ts index 20069db0..264e9030 100644 --- a/public/plugin.ts +++ b/public/plugin.ts @@ -3,7 +3,14 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { AppMountParameters, CoreSetup, CoreStart, Plugin } from '../../../src/core/public'; +import { i18n } from '@osd/i18n'; +import { + AppMountParameters, + CoreSetup, + CoreStart, + DEFAULT_NAV_GROUPS, + Plugin, +} from '../../../src/core/public'; import { MlCommonsPluginPluginSetup, MlCommonsPluginPluginStart, @@ -48,6 +55,21 @@ export class MlCommonsPluginPlugin }, }); + core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.dataAdministration, [ + { + id: PLUGIN_ID, + title: i18n.translate('MLCommonsDashboards.NavLink.AIModels.title', { + defaultMessage: 'AI models', + }), + category: { + id: 'ai-models', + label: i18n.translate('MLCommonsDashboards.Category.AIModels.label', { + defaultMessage: 'AI models', + }), + }, + }, + ]); + // Return methods that should be available to other plugins return {}; }