Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: affected-project selection #551

Merged
merged 1 commit into from
Feb 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -207,7 +207,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