mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-17 19:05:13 +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';
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,6 @@ import { MatDialog } from '@angular/material/dialog';
|
||||
import { Router } from '@angular/router';
|
||||
import { BehaviorSubject, from, of } from 'rxjs';
|
||||
import { catchError, finalize, map } from 'rxjs/operators';
|
||||
import { User } from 'src/app/proto/generated/auth_pb';
|
||||
import {
|
||||
ProjectGrantView,
|
||||
ProjectMemberSearchResponse,
|
||||
@@ -11,6 +10,7 @@ import {
|
||||
ProjectState,
|
||||
ProjectType,
|
||||
ProjectView,
|
||||
User,
|
||||
} from 'src/app/proto/generated/management_pb';
|
||||
import { ProjectService } from 'src/app/services/project.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@@ -3,7 +3,7 @@ import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/fo
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { Gender, User, UserAddress, UserEmail, UserPhone, UserProfile } from 'src/app/proto/generated/auth_pb';
|
||||
import { Gender, UserAddress, UserEmail, UserPhone, UserProfile } from 'src/app/proto/generated/auth_pb';
|
||||
import { PasswordComplexityPolicy } from 'src/app/proto/generated/management_pb';
|
||||
import { AuthUserService } from 'src/app/services/auth-user.service';
|
||||
import { MgmtUserService } from 'src/app/services/mgmt-user.service';
|
||||
@@ -33,8 +33,6 @@ function passwordConfirmValidator(c: AbstractControl): any {
|
||||
styleUrls: ['./auth-user-detail.component.scss'],
|
||||
})
|
||||
export class AuthUserDetailComponent implements OnDestroy {
|
||||
public user!: User.AsObject;
|
||||
|
||||
public profile!: UserProfile.AsObject;
|
||||
public email: UserEmail.AsObject = { email: '' } as any;
|
||||
public phone: UserPhone.AsObject = { phone: '' } as any;
|
||||
@@ -267,12 +265,6 @@ export class AuthUserDetailComponent implements OnDestroy {
|
||||
}
|
||||
|
||||
private async getData(): Promise<void> {
|
||||
// this.mgmtUserService.GetUserByID(id).then(user => {
|
||||
// console.log(user.toObject());
|
||||
// this.user = user.toObject();
|
||||
// }).catch(err => {
|
||||
// console.error(err);
|
||||
// });
|
||||
this.profile = (await this.userService.GetMyUserProfile()).toObject();
|
||||
this.email = (await this.userService.GetMyUserEmail()).toObject();
|
||||
this.phone = (await this.userService.GetMyUserPhone()).toObject();
|
||||
|
||||
@@ -188,6 +188,14 @@
|
||||
</div>
|
||||
|
||||
<metainfo *ngIf="user" class="side">
|
||||
<div class="details">
|
||||
<div class="row" *ngIf="user?.loginNamesList">
|
||||
<span class="first">Login Names:</span>
|
||||
<span class="second"><span style="display: block;"
|
||||
*ngFor="let login of user?.loginNamesList">{{login}}</span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="side-section">{{ 'CHANGES.USER.TITLE' | translate }}</p>
|
||||
<app-changes [changeType]="ChangeType.USER" [id]="user.id"></app-changes>
|
||||
</metainfo>
|
||||
|
||||
@@ -126,6 +126,63 @@
|
||||
// display: flex;
|
||||
// flex-direction: column;
|
||||
|
||||
.details {
|
||||
margin-bottom: 1rem;
|
||||
border-bottom: 1px solid #81868a40;
|
||||
padding-bottom: 1rem;
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
margin-bottom: 0.5rem;
|
||||
align-items: center;
|
||||
|
||||
button {
|
||||
display: none;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
button {
|
||||
display: inline-block;
|
||||
visibility: visible;
|
||||
mat-icon {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.first {
|
||||
flex: 1;
|
||||
font-size: 0.8rem;
|
||||
margin-right: 0.5rem;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.fill-space {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.second {
|
||||
font-size: 0.8rem;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
margin-left: 1rem;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
a {
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.side-section {
|
||||
color: #81868a;
|
||||
}
|
||||
}
|
||||
|
||||
.details {
|
||||
margin-bottom: 1rem;
|
||||
border-bottom: 1px solid #81868a40;
|
||||
|
||||
@@ -10,12 +10,12 @@ import {
|
||||
Gender,
|
||||
NotificationType,
|
||||
PasswordComplexityPolicy,
|
||||
User,
|
||||
UserAddress,
|
||||
UserEmail,
|
||||
UserPhone,
|
||||
UserProfile,
|
||||
UserState,
|
||||
UserView,
|
||||
} from 'src/app/proto/generated/management_pb';
|
||||
import { AuthUserService } from 'src/app/services/auth-user.service';
|
||||
import { MgmtUserService } from 'src/app/services/mgmt-user.service';
|
||||
@@ -45,7 +45,7 @@ function passwordConfirmValidator(c: AbstractControl): any {
|
||||
styleUrls: ['./user-detail.component.scss'],
|
||||
})
|
||||
export class UserDetailComponent implements OnInit, OnDestroy {
|
||||
public user!: User.AsObject;
|
||||
public user!: UserView.AsObject;
|
||||
// public email: UserEmail.AsObject = { email: '' } as any;
|
||||
// public phone: UserPhone.AsObject = { phone: '' } as any;
|
||||
public address: UserAddress.AsObject = { id: '' } as any;
|
||||
|
||||
Reference in New Issue
Block a user