mirror of
https://github.com/google/nomulus
synced 2026-01-03 19:54:18 +00:00
108 lines
2.9 KiB
HTML
108 lines
2.9 KiB
HTML
<app-selected-registrar-wrapper cdkTrapFocus [cdkTrapFocusAutoCapture]="true">
|
|
@if(isLoading) {
|
|
<div class="console-app__users-spinner">
|
|
<mat-spinner />
|
|
</div>
|
|
} @else if(selectingExistingUser) {
|
|
<div class="console-app__users">
|
|
<h1 class="mat-headline-4">Add existing user</h1>
|
|
<p>
|
|
<button
|
|
mat-icon-button
|
|
aria-label="Back to users list"
|
|
(click)="selectingExistingUser = false"
|
|
>
|
|
<mat-icon>arrow_back</mat-icon>
|
|
</button>
|
|
</p>
|
|
<h1>Select registrar from which to add a new user</h1>
|
|
<p>
|
|
<mat-form-field appearance="outline">
|
|
<mat-label>Registrar</mat-label>
|
|
<mat-select
|
|
[(ngModel)]="selectedRegistrarId"
|
|
name="selectedRegistrarId"
|
|
(selectionChange)="onRegistrarSelectionChange($event)"
|
|
>
|
|
@for (registrar of registrarService.registrars(); track registrar) {
|
|
<mat-option [value]="registrar.registrarId">{{
|
|
registrar.registrarId
|
|
}}</mat-option>
|
|
}
|
|
</mat-select>
|
|
</mat-form-field>
|
|
</p>
|
|
@if(usersSelection.length) {
|
|
<app-users-list
|
|
[users]="usersSelection"
|
|
(onSelect)="existingUserSelected($event)"
|
|
/>
|
|
<p class="console-app__users-add-existing">
|
|
<button
|
|
mat-flat-button
|
|
color="primary"
|
|
aria-label="Add user"
|
|
(click)="submitExistingUser()"
|
|
[disabled]="!selectedExistingUser"
|
|
>
|
|
Add user
|
|
</button>
|
|
<button
|
|
mat-stroked-button
|
|
aria-label="Cancel adding existing user"
|
|
(click)="selectingExistingUser = false"
|
|
>
|
|
Cancel
|
|
</button>
|
|
</p>
|
|
}
|
|
</div>
|
|
} @else if(usersService.currentlyOpenUserEmail()) {
|
|
<app-user-edit></app-user-edit>
|
|
} @else if(isNew) {
|
|
<h1 class="mat-headline-4">New User Form</h1>
|
|
<div class="spacer"></div>
|
|
<p>
|
|
<button
|
|
mat-icon-button
|
|
aria-label="Back to users list"
|
|
(click)="isNew = false"
|
|
>
|
|
<mat-icon>arrow_back</mat-icon>
|
|
</button>
|
|
</p>
|
|
<app-user-edit-form [isNew]="true" (onEditComplete)="createNewUser($event)" />
|
|
} @else {
|
|
<div class="console-app__users">
|
|
<div class="console-app__users-header">
|
|
<h1 class="mat-headline-4">Users</h1>
|
|
<div class="spacer"></div>
|
|
<div class="console-app__users-header-buttons">
|
|
<button
|
|
class="console-app__users-header-add"
|
|
mat-stroked-button
|
|
(click)="addExistingUser()"
|
|
aria-label="Create new user"
|
|
color="primary"
|
|
>
|
|
<mat-icon>add</mat-icon>
|
|
Add existing user
|
|
</button>
|
|
<button
|
|
mat-flat-button
|
|
(click)="isNew = true"
|
|
aria-label="Create new user"
|
|
color="primary"
|
|
>
|
|
Create New User
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<app-users-list
|
|
[users]="usersService.users()"
|
|
(onSelect)="openDetails($event)"
|
|
/>
|
|
</div>
|
|
}
|
|
</app-selected-registrar-wrapper>
|