Fix resolving the User Dashboard route (#15833)

* Fix resolving the User Dashboard route

Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>

* Switch on e2e java selenium tests in test suite

* Fix resolving the route for the workspace details page

Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>

Co-authored-by: Aleksandr Shmaraiev <oshmarai@redhat.com>
7.20.x
Oleksii Kurinnyi 2020-01-29 11:45:22 +02:00 committed by GitHub
parent 6e941bdd93
commit 2e3e6c68fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 18 deletions

View File

@ -35,16 +35,13 @@ export class DashboardConfig {
templateUrl: 'app/dashboard/dashboard.html',
resolve: {
check: ['$q', '$window', 'cheWorkspace', ($q: ng.IQService, $window: ng.IWindowService, cheWorkspace: CheWorkspace) => {
const defer = $q.defer();
cheWorkspace.fetchWorkspaces().then(() => {
return cheWorkspace.fetchWorkspaces().then(() => {
if (cheWorkspace.getWorkspaces().length === 0) {
$window.open(MENU_ITEM.getstarted, '_self');
defer.reject();
} else {
defer.resolve();
return $q.reject();
}
}).catch(() => {
$window.open(MENU_ITEM.getstarted, '_self');
});
return defer.promise;
}]
}
});

View File

@ -77,7 +77,7 @@ export class CheNavBarController {
private isKeycloackPresent: boolean;
private workspacesNumber: number;
private pageFactories: Array<che.IFactory>;
private pageFactories: Array<che.IFactory> = [];
/**
* Default constructor

View File

@ -87,9 +87,9 @@ export class WorkspaceDetailsConfig {
}
return workspace.devfile.metadata.name;
};
return cheWorkspace.fetchWorkspacesByNamespace(namespace).then(() => {
const workspaceDetails = cheWorkspace.getWorkspacesByNamespace(namespace).find( workspace => getName(workspace) === workspaceName);
return {namespaceId: namespace, workspaceName: workspaceName, workspaceDetails: workspaceDetails};
return cheWorkspace.fetchWorkspaceDetails(`${namespace}/${workspaceName}`).then(() => {
const workspaceDetails = cheWorkspace.getWorkspaceByName(namespace, workspaceName);
return { namespaceId: namespace, workspaceName: workspaceName, workspaceDetails: workspaceDetails };
});
}]
}

View File

@ -285,9 +285,9 @@ export class CheWorkspace {
* If there are no changes, it's not updated
*/
fetchWorkspaces(): ng.IPromise<Array<che.IWorkspace>> {
let promise = this.remoteWorkspaceAPI.query({'maxItems': 256}).$promise;
const promise = this.remoteWorkspaceAPI.query({'maxItems': 256}).$promise;
promise.then((workspaces: Array<che.IWorkspace>) => {
return promise.then((workspaces: Array<che.IWorkspace>) => {
this.workspaceIds.length = 0;
workspaces.forEach((workspace: che.IWorkspace) => {
if (!workspace.temporary) {
@ -310,7 +310,6 @@ export class CheWorkspace {
return this.$q.reject(error);
});
return promise;
}
/**

View File

@ -33,8 +33,7 @@ import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
// Known permanent failure https://github.com/eclipse/che/issues/15822
@Test(groups = {TestGroup.UNDER_REPAIR, TestGroup.MULTIUSER, TestGroup.OPENSHIFT, TestGroup.K8S})
@Test(groups = {TestGroup.MULTIUSER, TestGroup.OPENSHIFT, TestGroup.K8S})
public class AddWorkspaceToOrganizationTest {
private static final String WORKSPACE_FOR_ADMIN_1 = generate("workspace", 4);

View File

@ -43,8 +43,7 @@ import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
// Known permanent failure https://github.com/eclipse/che/issues/15822
@Test(groups = {TestGroup.UNDER_REPAIR, TestGroup.MULTIUSER, TestGroup.OPENSHIFT, TestGroup.K8S})
@Test(groups = {TestGroup.MULTIUSER, TestGroup.OPENSHIFT, TestGroup.K8S})
public class ShareWorkspaceMemberTest {
private static final String WORKSPACE_NAME = generate("workspace", 4);