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
parent
6e941bdd93
commit
2e3e6c68fe
|
|
@ -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;
|
||||
}]
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 };
|
||||
});
|
||||
}]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue