feat(console): set primary domain, fix org create permission (#688)

* feat: set primary domain, fix org perm

* lint
This commit is contained in:
Max Peintner
2020-09-02 12:35:06 +02:00
committed by GitHub
parent 4b183633ab
commit 779879f6ae
9 changed files with 44 additions and 4 deletions
@@ -13,6 +13,8 @@
<i matTooltip="verified" *ngIf="domain.verified" class="verified las la-check-circle"></i>
<i matTooltip="primary" *ngIf="domain.primary" class="primary las la-star"></i>
<a *ngIf="!domain.primary" class="primaryset"
(click)="setPrimary(domain)">{{'ORG.DOMAINS.SETPRIMARY' | translate}}</a>
<span class="fill-space"></span>
<button [disabled]="(canwrite$ | async) == false" matTooltip="Remove domain" color="warn"
@@ -25,6 +25,15 @@
}
}
.primaryset {
font-size: 13px;
cursor: pointer;
&:hover {
text-decoration: underline;
}
}
.verified,
.primary {
color: #5282c1;
@@ -84,6 +84,15 @@ export class OrgDetailComponent implements OnInit, OnDestroy {
});
}
public setPrimary(domain: OrgDomainView.AsObject): void {
this.mgmtService.setMyPrimaryOrgDomain(domain.domain).then(() => {
this.toast.showInfo('ORG.TOAST.SETPRIMARY', true);
this.getData();
}).catch((error) => {
this.toast.showError(error);
});
}
public changeState(event: MatButtonToggleChange | any): void {
if (event.value === OrgState.ORGSTATE_ACTIVE) {
this.mgmtService.ReactivateMyOrg().then(() => {