diff --git a/dashboard/src/app/organizations/organization-details/organization-workspaces/list-organization-workspaces.controller.ts b/dashboard/src/app/organizations/organization-details/organization-workspaces/list-organization-workspaces.controller.ts index fd4ec0751fb..ba760a15628 100644 --- a/dashboard/src/app/organizations/organization-details/organization-workspaces/list-organization-workspaces.controller.ts +++ b/dashboard/src/app/organizations/organization-details/organization-workspaces/list-organization-workspaces.controller.ts @@ -41,7 +41,7 @@ export class ListOrganizationWorkspacesController { /** * Workspace API interaction. */ - private cheWorkspace: any; + private cheWorkspace: CheWorkspace; /** * Service for displaying notifications. */ @@ -226,7 +226,7 @@ export class ListOrganizationWorkspacesController { this.cheListHelper.itemsSelectionStatus[workspaceId] = false; let workspace = this.cheWorkspace.getWorkspaceById(workspaceId); - workspaceName = workspace.config.name; + workspaceName = this.getWorkspaceName(workspace); let stoppedStatusPromise = this.cheWorkspace.fetchStatusChange(workspaceId, 'STOPPED'); // stop workspace if it's status is RUNNING @@ -306,7 +306,7 @@ export class ListOrganizationWorkspacesController { * @param tab {string} */ redirectToWorkspaceDetails(workspace: che.IWorkspace, tab?: string): void { - this.$location.path('/workspace/' + workspace.namespace + '/' + workspace.config.name).search({tab: tab ? tab : 'Overview'}); + this.$location.path('/workspace/' + workspace.namespace + '/' + this.getWorkspaceName(workspace)).search({tab: tab ? tab : 'Overview'}); } /** @@ -315,6 +315,10 @@ export class ListOrganizationWorkspacesController { * @returns {string} */ getMemoryLimit(workspace: che.IWorkspace): string { + if (!workspace.config && workspace.devfile) { + return '-'; + } + const environment = workspace.config.environments[workspace.config.defaultEnv]; if (!environment) { return '-'; @@ -341,4 +345,7 @@ export class ListOrganizationWorkspacesController { return workspace && workspace.status ? workspace.status : 'unknown'; } + getWorkspaceName(workspace: che.IWorkspace): string { + return this.cheWorkspace.getWorkspaceDataManager().getName(workspace); + } } diff --git a/dashboard/src/app/organizations/organization-details/organization-workspaces/list-organization-workspaces.html b/dashboard/src/app/organizations/organization-details/organization-workspaces/list-organization-workspaces.html index 8f9dd8605aa..7a2f90bdca0 100644 --- a/dashboard/src/app/organizations/organization-details/organization-workspaces/list-organization-workspaces.html +++ b/dashboard/src/app/organizations/organization-details/organization-workspaces/list-organization-workspaces.html @@ -54,9 +54,9 @@ + flex ng-mouseover="hover=true" ng-mouseout="hover=false" ng-init="workspaceName = listOrganizationWorkspacesController.getWorkspaceName(workspace)">
Name
-
+
- {{workspace.namespace}}/{{workspace.config.name}} + {{workspace.namespace}}/{{workspaceName}}
@@ -122,7 +122,7 @@ ng-if="listOrganizationWorkspacesController.isSupported(workspace) === true"> -