mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-20 20:08:46 +00:00
feat(console): add and remove org domains, show userLoginNames (#235)
* org domains, user login names * switch user to userview, regen proto
This commit is contained in:
@@ -3,6 +3,38 @@
|
||||
<h1>{{org?.name}}</h1>
|
||||
<p class="sub">{{'ORG_DETAIL.DESCRIPTION' | translate}}
|
||||
</p>
|
||||
<app-card title="{{ 'ORG.DOMAINS.TITLE' | translate }}"
|
||||
description="{{ 'ORG.DOMAINS.DESCRIPTION' | translate }}">
|
||||
<div *ngFor="let domain of domains" class="domain">
|
||||
<span class="title">{{domain.domain}}</span>
|
||||
<i matTooltip="verified" *ngIf="domain.verified" class="verified las la-check-circle"></i>
|
||||
<i matTooltip="primary" *ngIf="domain.primary" class="primary las la-chess-queen"></i>
|
||||
<span class="fill-space"></span>
|
||||
<button disabled mat-icon-button
|
||||
matTooltip="download /.well-known/caos-developer-domain-association.txt and deploy it on your domain. Then verify"><i
|
||||
class="las la-file-download"></i></button>
|
||||
<button matTooltip="Remove domain" color="warn" mat-icon-button (click)="removeDomain(domain.domain)"><i
|
||||
class="las la-trash"></i></button>
|
||||
</div>
|
||||
|
||||
<p class="new-desc">{{'ORG.PAGES.ORGDOMAIN_VERIFICATION' | translate}}</p>
|
||||
<div class="new-row">
|
||||
<mat-form-field appearance="outline">
|
||||
<mat-label>new domain</mat-label>
|
||||
<input matInput [(ngModel)]="newDomain" />
|
||||
</mat-form-field>
|
||||
|
||||
<button matTooltip="Add domain" mat-icon-button color="accent" (click)="saveNewOrgDomain()">
|
||||
<mat-icon>check</mat-icon>
|
||||
</button>
|
||||
|
||||
<button disabled mat-icon-button
|
||||
matTooltip="download /.well-known/caos-developer-domain-association.txt and deploy it on your domain. Then verify"><i
|
||||
class="las la-file-download"></i></button>
|
||||
<button disabled mat-icon-button matTooltip="Verify"><i class=" las la-check-circle"></i></button>
|
||||
</div>
|
||||
</app-card>
|
||||
|
||||
<ng-template appHasRole [appHasRole]="['policy.read']">
|
||||
<app-policy-grid></app-policy-grid>
|
||||
</ng-template>
|
||||
@@ -12,7 +44,8 @@
|
||||
<div class="details">
|
||||
<div class="row">
|
||||
<span class="first">Domains:</span>
|
||||
<span *ngFor="let domain of domains" class="second">{{domain.domain}}</span>
|
||||
<span class="second"><span style="display: block;"
|
||||
*ngFor="let domain of domains">{{domain.domain}}</span></span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span class="first">State:</span>
|
||||
|
||||
@@ -55,6 +55,43 @@ h1 {
|
||||
}
|
||||
}
|
||||
|
||||
.domain {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: .5rem 0;
|
||||
flex-wrap: wrap;
|
||||
|
||||
|
||||
.title {
|
||||
font-size: 16px;
|
||||
margin-right: 1rem;
|
||||
}
|
||||
|
||||
.verified, .primary{
|
||||
color: #5282c1;
|
||||
margin-right: 1rem;
|
||||
}
|
||||
|
||||
.fill-space {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.new-desc {
|
||||
font-size: 14px;
|
||||
color: #818a8a;
|
||||
}
|
||||
|
||||
.new-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
|
||||
mat-form-field {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.side {
|
||||
.details {
|
||||
margin-bottom: 1rem;
|
||||
@@ -96,6 +133,7 @@ h1 {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
margin-left: 1rem;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
a {
|
||||
|
||||
@@ -30,6 +30,7 @@ export class OrgDetailComponent implements OnInit, OnDestroy {
|
||||
private subscription: Subscription = new Subscription();
|
||||
|
||||
public domains: OrgDomainView.AsObject[] = [];
|
||||
public newDomain: string = '';
|
||||
|
||||
constructor(
|
||||
public translate: TranslateService,
|
||||
@@ -76,4 +77,19 @@ export class OrgDetailComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public saveNewOrgDomain(): void {
|
||||
this.orgService.AddMyOrgDomain(this.newDomain).then(domain => {
|
||||
this.domains.push(domain.toObject());
|
||||
});
|
||||
}
|
||||
|
||||
public removeDomain(domain: string): void {
|
||||
console.log(domain);
|
||||
this.orgService.RemoveMyOrgDomain(domain).then(() => {
|
||||
this.toast.showInfo('Removed');
|
||||
}).catch(error => {
|
||||
this.toast.showError(error.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,7 @@ import { MatTable } from '@angular/material/table';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { tap } from 'rxjs/operators';
|
||||
import { CreationType, MemberCreateDialogComponent } from 'src/app/modules/add-member-dialog/member-create-dialog.component';
|
||||
import { User } from 'src/app/proto/generated/auth_pb';
|
||||
import { Org, ProjectMember, ProjectType } from 'src/app/proto/generated/management_pb';
|
||||
import { Org, ProjectMember, ProjectType, User } from 'src/app/proto/generated/management_pb';
|
||||
import { OrgService } from 'src/app/services/org.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user