fix(console): application state, add project role bulk, user grant explanations, i18n, ngsw update prompt #341

This commit is contained in:
Max Peintner
2020-07-03 15:07:43 +02:00
committed by GitHub
parent 7b67b55f4e
commit 73a4b7baef
9 changed files with 42 additions and 24 deletions
@@ -144,13 +144,13 @@ export class AppDetailComponent implements OnInit, OnDestroy {
public changeState(event: MatButtonToggleChange): void {
if (event.value === AppState.APPSTATE_ACTIVE) {
this.projectService.ReactivateApplication(this.app.id).then(() => {
this.projectService.ReactivateApplication(this.projectId, this.app.id).then(() => {
this.toast.showInfo('Reactivated Application');
}).catch((error: any) => {
this.toast.showError(error.message);
});
} else if (event.value === AppState.APPSTATE_INACTIVE) {
this.projectService.DectivateApplication(this.app.id).then(() => {
this.projectService.DeactivateApplication(this.projectId, this.app.id).then(() => {
this.toast.showInfo('Deactivated Application');
}).catch((error: any) => {
this.toast.showError(error.message);
@@ -10,10 +10,11 @@
<ng-container *ngIf="currentCreateStep === 1">
<h1>{{'PROJECT.GRANT.CREATE.SEL_ORG' | translate}}</h1>
<p>{{'PROJECT.GRANT.CREATE.SEL_ORG_DESC' | translate}}</p>
<form (ngSubmit)="searchOrg(domain.value)">
<mat-form-field class="org-domain">
<mat-label>{{'PROJECT.GRANT.CREATE.SEL_ORG' | translate}}</mat-label>
<mat-label>{{'PROJECT.GRANT.CREATE.SEL_ORG_FORMFIELD' | translate}}</mat-label>
<input #domain matInput />
</mat-form-field>
@@ -84,12 +84,15 @@ export class ProjectRoleCreateComponent implements OnInit, OnDestroy {
}
public addRole(): void {
const promises = this.formArray.value.map((role: ProjectRoleAdd.AsObject) => {
role.id = this.projectId;
return this.projectService.AddProjectRole(role);
const rolesToAdd: ProjectRoleAdd[] = this.formArray.value.map((element: any) => {
const role = new ProjectRoleAdd();
role.setKey(element.key);
role.setDisplayName(element.displayName);
role.setGroup(element.group);
return role;
});
Promise.all(promises).then(() => {
this.projectService.BulkAddProjectRole(this.projectId, rolesToAdd).then(() => {
this.router.navigate(['projects', this.projectId]);
}).catch(data => {
this.toast.showError(data.message);
@@ -25,7 +25,7 @@
</ng-container>
<ng-container *ngIf="filter && filter == UserGrantSearchKey.USERGRANTSEARCHKEY_PROJECT_ID">
<h1>{{'PROJECT.GRANT.CREATE.SEL_PROJECT' | translate}}</h1>
<h1>{{'PROJECT.GRANT.CREATE.SEL_USER' | translate}}</h1>
<app-search-user-autocomplete class="block" singleOutput="true" (selectionChanged)="selectUser($event)">
</app-search-user-autocomplete>