From 0929620a085027f4a4f6a60bcc172d7f3fe6a430 Mon Sep 17 00:00:00 2001 From: Sergii Leschenko Date: Mon, 6 Feb 2017 15:03:43 +0200 Subject: [PATCH] CHE-4061 Adapt dashboard to work with workspace key in new format According to new workspace key format changes URL to dashboard workspace details team looks like {HOST}/dashboard/#/workspace/namespace/namespace_part_2/workspaceName --- dashboard/src/app/ide/ide-config.ts | 2 +- dashboard/src/app/projects/projects-config.ts | 2 +- .../workspace-details/workspace-details.controller.ts | 2 +- .../workspace-details-projects.controller.ts | 2 +- dashboard/src/app/workspaces/workspaces-config.ts | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dashboard/src/app/ide/ide-config.ts b/dashboard/src/app/ide/ide-config.ts index 26436b00cacc..6d9334d5b025 100644 --- a/dashboard/src/app/ide/ide-config.ts +++ b/dashboard/src/app/ide/ide-config.ts @@ -45,7 +45,7 @@ export class IdeConfig { // config routes register.app.config(function ($routeProvider) { $routeProvider.accessWhen('/ide', ideProvider) - .accessWhen('/ide/:namespace/:workspaceName', ideProvider); + .accessWhen('/ide/:namespace*/:workspaceName', ideProvider); }); } diff --git a/dashboard/src/app/projects/projects-config.ts b/dashboard/src/app/projects/projects-config.ts index 37789a1ed49a..bd5cb6da7e16 100644 --- a/dashboard/src/app/projects/projects-config.ts +++ b/dashboard/src/app/projects/projects-config.ts @@ -81,7 +81,7 @@ export class ProjectsConfig { // config routes register.app.config(function ($routeProvider) { - $routeProvider.accessWhen('/project/:namespace/:workspaceName/:projectName', { + $routeProvider.accessWhen('/project/:namespace*/:workspaceName/:projectName', { title: (params) => {return params.workspaceName + ' | ' + params.projectName}, templateUrl: 'app/projects/project-details/project-details.html', controller: 'ProjectDetailsController', diff --git a/dashboard/src/app/workspaces/workspace-details/workspace-details.controller.ts b/dashboard/src/app/workspaces/workspace-details/workspace-details.controller.ts index 218d2207e0de..738cc99ed23d 100644 --- a/dashboard/src/app/workspaces/workspace-details/workspace-details.controller.ts +++ b/dashboard/src/app/workspaces/workspace-details/workspace-details.controller.ts @@ -204,7 +204,7 @@ export class WorkspaceDetailsController { if (this.cheWorkspace.getWorkspaceByName(this.namespace, this.workspaceName)) { defer.resolve(); } else { - this.cheWorkspace.fetchWorkspaceDetails(this.namespace + ':' + this.workspaceName).then(() => { + this.cheWorkspace.fetchWorkspaceDetails(this.namespace + '/' + this.workspaceName).then(() => { defer.resolve(); }, (error: any) => { if (error.status === 304) { diff --git a/dashboard/src/app/workspaces/workspace-details/workspace-projects/workspace-details-projects.controller.ts b/dashboard/src/app/workspaces/workspace-details/workspace-projects/workspace-details-projects.controller.ts index c4a0d51c6e66..36559ea522fa 100644 --- a/dashboard/src/app/workspaces/workspace-details/workspace-projects/workspace-details-projects.controller.ts +++ b/dashboard/src/app/workspaces/workspace-details/workspace-projects/workspace-details-projects.controller.ts @@ -57,7 +57,7 @@ export class WorkspaceDetailsProjectsCtrl { this.namespace = $route.current.params.namespace; this.workspaceName = $route.current.params.workspaceName; - this.workspaceKey = this.namespace + ':' + this.workspaceName; + this.workspaceKey = this.namespace + '/' + this.workspaceName; let preferences = cheAPI.getPreferences().getPreferences(); diff --git a/dashboard/src/app/workspaces/workspaces-config.ts b/dashboard/src/app/workspaces/workspaces-config.ts index 61e9bb29ad76..4dcd1c41199c 100644 --- a/dashboard/src/app/workspaces/workspaces-config.ts +++ b/dashboard/src/app/workspaces/workspaces-config.ts @@ -175,8 +175,8 @@ export class WorkspacesConfig { controller: 'ListWorkspacesCtrl', controllerAs: 'listWorkspacesCtrl' }) - .accessWhen('/workspace/:namespace/:workspaceName', locationProvider) - .accessWhen('/workspace/:namespace/:workspaceName/:page', locationProvider) + .accessWhen('/workspace/:namespace*/:workspaceName', locationProvider) + .accessWhen('/workspace/:namespace*/:workspaceName/:page', locationProvider) .accessWhen('/create-workspace', { title: 'New Workspace', templateUrl: 'app/workspaces/workspace-details/workspace-details.html',