From 0e310b990f027b1057ae3887e16ecbe50ca96cf5 Mon Sep 17 00:00:00 2001 From: Victor Savkin Date: Fri, 22 Feb 2019 15:43:44 -0500 Subject: [PATCH] fix: affected-project selection (#551) --- .../src/app/tree-item/workspace-route.ts | 18 ++++++++++++------ .../src/lib/feature-workspaces.module.ts | 9 +++++---- .../src/lib/workspace/workspace.component.ts | 2 +- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/apps/vscode/src/app/tree-item/workspace-route.ts b/apps/vscode/src/app/tree-item/workspace-route.ts index 99f1b33db6..70b3167dc1 100644 --- a/apps/vscode/src/app/tree-item/workspace-route.ts +++ b/apps/vscode/src/app/tree-item/workspace-route.ts @@ -93,22 +93,28 @@ export function getWorkspaceRoute( workspaceDef: WorkspaceDefinition | undefined, workspaceRouteTitle: WorkspaceRouteTitle = 'Projects' ): string { + const workspacePath = workspaceDef + ? workspaceDef.path + : workspace.workspaceFolders && workspace.workspaceFolders[0].uri.fsPath; + switch (workspaceRouteTitle) { case 'Workspaces': return 'workspaces'; case 'Connect': return 'connect'; + case 'Affected Projects': + if (workspacePath) { + return `workspace/${encodeURIComponent( + workspacePath + )}/connect/affected-projects`; + } else { + return 'workspaces'; + } case 'Projects': case 'Extensions': case 'Tasks': - case 'Affected Projects': case 'Settings': case 'Generate': - const workspacePath = workspaceDef - ? workspaceDef.path - : workspace.workspaceFolders && - workspace.workspaceFolders[0].uri.fsPath; - if (workspacePath) { return `workspace/${encodeURIComponent( workspacePath diff --git a/libs/feature-workspaces/src/lib/feature-workspaces.module.ts b/libs/feature-workspaces/src/lib/feature-workspaces.module.ts index ac9b977829..153d92f1ea 100644 --- a/libs/feature-workspaces/src/lib/feature-workspaces.module.ts +++ b/libs/feature-workspaces/src/lib/feature-workspaces.module.ts @@ -64,10 +64,12 @@ export const workspaceRoutes: Route[] = [ path: 'extensions', children: extensionsRoutes }, - // TODO: Remove connect routes from workspace after electron redesign. { path: 'connect', - children: connectRootRoutes + children: [ + ...connectWorkspaceRoutes, + ...connectRootRoutes // TODO: Remove connect routes from workspace after electron redesign. + ] }, { data: { state: 'generate' }, @@ -76,8 +78,7 @@ export const workspaceRoutes: Route[] = [ }, { data: { state: 'tasks' }, path: 'tasks', children: runRoutes }, // TODO: Remove settings routes from workspace after electron redesign. - { path: 'settings', children: settingsRoutes }, - ...connectWorkspaceRoutes + { path: 'settings', children: settingsRoutes } ] } ]; diff --git a/libs/feature-workspaces/src/lib/workspace/workspace.component.ts b/libs/feature-workspaces/src/lib/workspace/workspace.component.ts index 8455c60ccd..931b7e05b8 100644 --- a/libs/feature-workspaces/src/lib/workspace/workspace.component.ts +++ b/libs/feature-workspaces/src/lib/workspace/workspace.component.ts @@ -212,7 +212,7 @@ export class WorkspaceComponent implements OnInit, OnDestroy { this.routes[0], { icon: 'timeline', - url: 'affected-projects', + url: 'connect/affected-projects', title: 'Affected Projects' }, ...this.routes.slice(1)