Skip to content

Commit

Permalink
fixup! fix tests for Che Multiuser
Browse files Browse the repository at this point in the history
  • Loading branch information
akurinnoy committed Sep 13, 2019
1 parent 33806c6 commit 6fe27e3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
20 changes: 14 additions & 6 deletions dashboard/src/app/navbar/navbar.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,13 @@ export class CheNavBarController {
if (this.chePermissions.getSystemPermissions()) {
this.updateData();
} else {
this.chePermissions.fetchSystemPermissions().finally(() => {
this.updateData();
});
this.chePermissions.fetchSystemPermissions()
.catch((error: any) => {
// noop
})
.finally(() => {
this.updateData();
});
}
}
});
Expand All @@ -136,9 +140,13 @@ export class CheNavBarController {
organization.fetchOrganizations().then(() => {
this.organizations = organization.getOrganizations();
const user = this.cheAPI.getUser().getUser();
organization.fetchOrganizationByName(user.name).finally(() => {
this.hasPersonalAccount = angular.isDefined(organization.getOrganizationByName(user.name));
});
organization.fetchOrganizationByName(user.name)
.catch((error: any) => {
// noop
})
.finally(() => {
this.hasPersonalAccount = angular.isDefined(organization.getOrganizationByName(user.name));
});
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,6 @@ export class ListOrganizationsController {
* Process organization - retrieving additional data.
*/
processOrganizations(): void {
if (angular.isUndefined(this.organizations)) {
return;
}
if (this.parentName) {
const parentOrganization = this.cheOrganization.getOrganizationByName(this.parentName);
this.parentId = parentOrganization ? parentOrganization.id : null;
Expand Down
2 changes: 2 additions & 0 deletions dashboard/src/components/api/che-permissions.factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ export class ChePermissions implements che.api.IChePermissions {
promise.then((systemPermissions: che.api.ISystemPermissions) => {
this.updateUserServices(systemPermissions);
this.systemPermissions = systemPermissions;
}, (error: any) => {
// noop
});

return promise;
Expand Down

0 comments on commit 6fe27e3

Please sign in to comment.