-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a function to register all plugin Nav groups and categories (#406)
Signed-off-by: Adam Tackett <[email protected]> Co-authored-by: Adam Tackett <[email protected]>
- Loading branch information
Showing
2 changed files
with
31 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { CoreSetup } from '../../../src/core/public'; | ||
import { SearchRelevancePluginSetup } from './types'; | ||
import { PLUGIN_ID } from '../common'; | ||
import { DEFAULT_NAV_GROUPS, DEFAULT_APP_CATEGORIES, AppCategory } from '../../../src/core/public'; | ||
import { i18n } from "@osd/i18n"; | ||
|
||
const searchRelevance_category: Record<string, AppCategory & { group?: AppCategory }> = { | ||
evaluateSearch: { | ||
id: "evaluateSearch", | ||
label: i18n.translate("core.ui.indexesNavList.label", { | ||
defaultMessage: "Evaluate search", | ||
}), | ||
order: 3000, | ||
}, | ||
}; | ||
|
||
export function registerAllPluginNavGroups(core: CoreSetup<SearchRelevancePluginSetup>) { | ||
core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.search, [ | ||
{ | ||
id: PLUGIN_ID, | ||
category: searchRelevance_category.evaluateSearch,//change to Evaluate Search | ||
}, | ||
]); | ||
} |