fix(console): changes, project grant create, member add, org setup, project search autocomplete, grpc header url decoding (#303)

* mobile max-width container

* fix project search autocomplete

* remove changes error, add bottom label

* fix project grant, contributor add
This commit is contained in:
Max Peintner
2020-06-26 16:45:18 +02:00
committed by GitHub
parent 63ccdb1147
commit 5fc250f046
27 changed files with 167 additions and 101 deletions

View File

@@ -164,7 +164,7 @@
</div>
<div class="btn-container">
<button color="accent" class="continue-button" [disabled]="orgForm.invalid || userForm.invalid"
<button color="primary" class="continue-button" [disabled]="orgForm.invalid || userForm.invalid"
type="submit" mat-raised-button>{{ 'ACTIONS.FINISH' | translate }}</button>
</div>
</form>

View File

@@ -68,7 +68,7 @@ export class OrgCreateComponent {
this.orgForm = this.fb.group({
name: ['', [Validators.required]],
domain: ['', [Validators.required]],
domain: [''],
});
this.orgService.GetPasswordComplexityPolicy().then(data => {
this.policy = data.toObject();

View File

@@ -37,7 +37,7 @@
</div>
<ng-template appHasRole [appHasRole]="['iam.write']">
<div class="card add-org-button" [routerLink]="[ '/orgs/create' ]">
<div class="card add-org-button" [routerLink]="[ '/org/create' ]">
<mat-icon class="icon">add</mat-icon>
<span>Add new organization</span>
</div>

View File

@@ -11,7 +11,7 @@
<ng-container *ngIf="currentCreateStep === 1">
<h1>{{'PROJECT.GRANT.CREATE.SEL_ORG' | translate}}</h1>
<form (ngSubmit)="searchOrg(domain)">
<form (ngSubmit)="searchOrg(domain.value)">
<mat-form-field class="org-domain">
<mat-label>{{'PROJECT.GRANT.CREATE.SEL_ORG' | translate}}</mat-label>
<input #domain matInput />

View File

@@ -42,15 +42,19 @@ export class ProjectGrantCreateComponent implements OnInit, OnDestroy {
this.routeSubscription.unsubscribe();
}
public searchOrg(domain: any): void {
this.orgService.getOrgByDomainGlobal(domain.value).then((ret) => {
public searchOrg(domain: string): void {
console.log(domain);
this.orgService.getOrgByDomainGlobal(domain).then((ret) => {
const tmp = ret.toObject();
console.log(ret.toObject());
this.authService.GetActiveOrg().then((org) => {
console.log(org);
if (tmp !== org) {
this.org = tmp;
}
});
this.org = ret.toObject();
console.log(this.org);
}).catch(error => {
this.toast.showError(error.message);
});

View File

@@ -90,7 +90,7 @@
{{ 'USER.VALIDATION.REQUIRED' | translate }}
</mat-error>
</mat-form-field>
<mat-form-field class="formfield">
<!-- <mat-form-field class="formfield">
<mat-label>{{ 'USER.ADDRESS.STREET' | translate }}</mat-label>
<input matInput formControlName="streetAddress" />
<mat-error *ngIf="streetAddress?.invalid && streetAddress?.errors?.required">
@@ -124,7 +124,7 @@
<mat-error *ngIf="country?.invalid && country?.errors?.required">
{{ 'USER.VALIDATION.REQUIRED' | translate }}
</mat-error>
</mat-form-field>
</mat-form-field> -->
</div>
<div class="btn-container">
<button color="accent" [disabled]="userForm.invalid" type="submit"

View File

@@ -3,7 +3,7 @@ import { Component, OnDestroy } from '@angular/core';
import { ActivatedRoute, Params } from '@angular/router';
import { Subscription } from 'rxjs';
import { Org } from 'src/app/proto/generated/auth_pb';
import { Project, ProjectRole, UserGrant } from 'src/app/proto/generated/management_pb';
import { ProjectGrantView, ProjectRole, ProjectView, UserGrant } from 'src/app/proto/generated/management_pb';
import { AuthService } from 'src/app/services/auth.service';
import { MgmtUserService } from 'src/app/services/mgmt-user.service';
import { ToastService } from 'src/app/services/toast.service';
@@ -56,8 +56,8 @@ export class UserGrantCreateComponent implements OnDestroy {
});
}
public selectProject(project: Project.AsObject): void {
this.projectId = project.id;
public selectProject(project: ProjectView.AsObject | ProjectGrantView.AsObject | any): void {
this.projectId = project.id ? project.id : project.projectId ? project.projectId : undefined;
}
public selectRoles(roles: ProjectRole.AsObject[]): void {