Skip to content

Commit

Permalink
home breadcrumb
Browse files Browse the repository at this point in the history
Signed-off-by: Hailong Cui <ihailong@amazon.com>
  • Loading branch information
Hailong-am committed Apr 19, 2024
1 parent 4142f6a commit b00bac7
Showing 1 changed file with 37 additions and 31 deletions.
68 changes: 37 additions & 31 deletions src/plugins/workspace/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,13 @@ export class WorkspacePlugin implements Plugin<{}, {}> {
core.application.navigateToApp(WORKSPACE_OVERVIEW_APP_ID);
},
};
breadCrumbs.splice(0, 0, workspaceCrumb);
const homeCrumb: ChromeBreadcrumb = {
text: 'Home',
onClick: () => {
core.application.navigateToApp('home');
},
};
breadCrumbs.splice(0, 0, homeCrumb, workspaceCrumb);

core.chrome.setBreadcrumbs(breadCrumbs);
}
Expand Down Expand Up @@ -191,36 +197,6 @@ export class WorkspacePlugin implements Plugin<{}, {}> {
});
})();
} else {
/**
* register workspace overview page only if we are in a valid workspace
*/
core.application.register({
id: WORKSPACE_OVERVIEW_APP_ID,
title: i18n.translate('workspace.settings.workspaceOverview', {
defaultMessage: 'Workspace Overview',
}),
navLinkStatus: AppNavLinkStatus.hidden,
async mount(params: AppMountParameters) {
const { renderOverviewApp } = await import('./application');
return mountWorkspaceApp(params, renderOverviewApp);
},
});

/**
* register workspace update page only if we are in a valid workspace
*/
core.application.register({
id: WORKSPACE_UPDATE_APP_ID,
title: i18n.translate('workspace.settings.workspaceUpdate', {
defaultMessage: 'Update Workspace',
}),
navLinkStatus: AppNavLinkStatus.hidden,
async mount(params: AppMountParameters) {
const { renderUpdaterApp } = await import('./application');
return mountWorkspaceApp(params, renderUpdaterApp);
},
});

/**
* If the workspace id is valid and user is currently on workspace_fatal_error page,
* we should redirect user to overview page of workspace.
Expand Down Expand Up @@ -286,6 +262,36 @@ export class WorkspacePlugin implements Plugin<{}, {}> {
},
});

/**
* register workspace overview page
*/
core.application.register({
id: WORKSPACE_OVERVIEW_APP_ID,
title: i18n.translate('workspace.settings.workspaceOverview', {
defaultMessage: 'Workspace Overview',
}),
navLinkStatus: AppNavLinkStatus.hidden,
async mount(params: AppMountParameters) {
const { renderOverviewApp } = await import('./application');
return mountWorkspaceApp(params, renderOverviewApp);
},
});

/**
* register workspace update page
*/
core.application.register({
id: WORKSPACE_UPDATE_APP_ID,
title: i18n.translate('workspace.settings.workspaceUpdate', {
defaultMessage: 'Update Workspace',
}),
navLinkStatus: AppNavLinkStatus.hidden,
async mount(params: AppMountParameters) {
const { renderUpdaterApp } = await import('./application');
return mountWorkspaceApp(params, renderUpdaterApp);
},
});

/**
* Register workspace dropdown selector on the top of left navigation menu
*/
Expand Down

0 comments on commit b00bac7

Please sign in to comment.