Skip to content

Commit

Permalink
fix: affected-project selection (#551)
Browse files Browse the repository at this point in the history
  • Loading branch information
vsavkin authored and mrmeku committed Feb 22, 2019
1 parent a47c438 commit 0e310b9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
18 changes: 12 additions & 6 deletions apps/vscode/src/app/tree-item/workspace-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions libs/feature-workspaces/src/lib/feature-workspaces.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand All @@ -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 }
]
}
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0e310b9

Please sign in to comment.