Skip to content

Commit

Permalink
move default filtered nav link value setting from core to workspace p…
Browse files Browse the repository at this point in the history
…lugin

Signed-off-by: yuye-aws <yuyezhu@amazon.com>
  • Loading branch information
yuye-aws committed Jul 21, 2023
1 parent b1cec66 commit 3f3f94a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/core/public/core_system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,17 +235,6 @@ export class CoreSystem {
uiSettings,
});

// set default value for filtered nav links
const navLinksService = chrome.navLinks;
const chromeNavLinks$ = navLinksService.getNavLinks$();
chromeNavLinks$.subscribe((chromeNavLinks) => {
const filteredNavLinks = new Map<string, ChromeNavLink>();
chromeNavLinks.forEach((chromeNavLink) =>
filteredNavLinks.set(chromeNavLink.id, chromeNavLink)
);
navLinksService.setFilteredNavLinks(filteredNavLinks);
});

this.coreApp.start({ application, http, notifications, uiSettings });

application.registerMountContext(this.coreContext.coreId, 'core', () => ({
Expand Down
10 changes: 10 additions & 0 deletions src/plugins/workspace/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,16 @@ export class WorkspacesPlugin implements Plugin<{}, {}, WorkspacesPluginSetupDep
public start(core: CoreStart) {
// If workspace feature is disabled, it will not load the workspace plugin
if (core.uiSettings.get('workspace:enabled') === false) {
// set default value for filtered nav links
const navLinksService = core.chrome.navLinks;
const chromeNavLinks$ = navLinksService.getNavLinks$();
chromeNavLinks$.subscribe((chromeNavLinks) => {
const filteredNavLinks = new Map<string, ChromeNavLink>();
chromeNavLinks.forEach((chromeNavLink) =>
filteredNavLinks.set(chromeNavLink.id, chromeNavLink)
);
navLinksService.setFilteredNavLinks(filteredNavLinks);
});
return {};
}

Expand Down

0 comments on commit 3f3f94a

Please sign in to comment.