mirror of
https://github.com/google/nomulus.git
synced 2025-08-13 04:59:51 +02:00
Add console registrars paging, fix empty registrars mobile (#2162)
This commit is contained in:
parent
cc1777af0c
commit
e07f25000d
13 changed files with 139 additions and 38 deletions
|
@ -1,24 +1,30 @@
|
||||||
<p>
|
<p class="console-app__header">
|
||||||
<mat-toolbar color="primary">
|
<mat-toolbar color="primary">
|
||||||
<button mat-icon-button aria-label="Open menu" (click)="toggleNavPane()">
|
<button mat-icon-button aria-label="Open menu" (click)="toggleNavPane()">
|
||||||
<mat-icon>menu</mat-icon>
|
<mat-icon>menu</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<span>
|
<a
|
||||||
<a
|
[routerLink]="'/home'"
|
||||||
[routerLink]="'/home'"
|
routerLinkActive="active"
|
||||||
routerLinkActive="active"
|
class="console-app__logo"
|
||||||
class="console-app__logo"
|
>
|
||||||
>
|
Google Registry
|
||||||
Google Registry
|
</a>
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
<span class="spacer"></span>
|
<span class="spacer"></span>
|
||||||
<app-registrar-selector />
|
<app-registrar-selector />
|
||||||
<button mat-icon-button aria-label="Open FAQ">
|
<button mat-icon-button aria-label="Open FAQ">
|
||||||
<mat-icon>question_mark</mat-icon>
|
<mat-icon>question_mark</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button mat-icon-button aria-label="Open user info">
|
<button
|
||||||
|
mat-icon-button
|
||||||
|
[matMenuTriggerFor]="menu"
|
||||||
|
#menuTrigger
|
||||||
|
aria-label="Open user info"
|
||||||
|
>
|
||||||
<mat-icon>person</mat-icon>
|
<mat-icon>person</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
<mat-menu #menu="matMenu">
|
||||||
|
<button mat-menu-item (click)="logOut()">Log out</button>
|
||||||
|
</mat-menu>
|
||||||
</mat-toolbar>
|
</mat-toolbar>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -17,6 +17,21 @@
|
||||||
color: inherit;
|
color: inherit;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
&__header {
|
||||||
|
@media (max-width: 599px) {
|
||||||
|
.mat-toolbar {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.console-app__logo {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
button {
|
||||||
|
padding-left: 0;
|
||||||
|
padding-right: 0;
|
||||||
|
width: 30px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.spacer {
|
.spacer {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
|
@ -28,4 +28,8 @@ export class HeaderComponent {
|
||||||
this.isNavOpen = !this.isNavOpen;
|
this.isNavOpen = !this.isNavOpen;
|
||||||
this.toggleNavOpen.emit(this.isNavOpen);
|
this.toggleNavOpen.emit(this.isNavOpen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logOut() {
|
||||||
|
window.open('/console?gcp-iap-mode=CLEAR_LOGIN_COOKIE', '_self');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,4 +29,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@media (max-width: 510px) {
|
||||||
|
.console-app__widget-wrapper__wide {
|
||||||
|
grid-column: initial;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
left: 50%;
|
left: 50%;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
&-icon {
|
&-icon {
|
||||||
transform: scale(3);
|
transform: scale(3);
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
<div class="console-app__registrar">
|
<div class="console-app__registrar">
|
||||||
<div>
|
<button
|
||||||
|
mat-button
|
||||||
|
[routerLink]="'/settings/registrars'"
|
||||||
|
routerLinkActive="active"
|
||||||
|
*ngIf="isMobile; else desktop"
|
||||||
|
>
|
||||||
|
{{ registrarService.activeRegistrarId || "Select registrar" }}
|
||||||
|
<mat-icon>open_in_new</mat-icon>
|
||||||
|
</button>
|
||||||
|
<ng-template #desktop>
|
||||||
<mat-form-field class="mat-form-field-density-5" appearance="fill">
|
<mat-form-field class="mat-form-field-density-5" appearance="fill">
|
||||||
<mat-label>Registrar</mat-label>
|
<mat-label>Registrar</mat-label>
|
||||||
<mat-select
|
<mat-select
|
||||||
|
@ -14,5 +23,5 @@
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</ng-template>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -12,14 +12,35 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { Component } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { RegistrarService } from './registrar.service';
|
import { RegistrarService } from './registrar.service';
|
||||||
|
import { BreakpointObserver } from '@angular/cdk/layout';
|
||||||
|
import { distinctUntilChanged } from 'rxjs';
|
||||||
|
|
||||||
|
const MOBILE_LAYOUT_BREAKPOINT = '(max-width: 599px)';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-registrar-selector',
|
selector: 'app-registrar-selector',
|
||||||
templateUrl: './registrar-selector.component.html',
|
templateUrl: './registrar-selector.component.html',
|
||||||
styleUrls: ['./registrar-selector.component.scss'],
|
styleUrls: ['./registrar-selector.component.scss'],
|
||||||
})
|
})
|
||||||
export class RegistrarSelectorComponent {
|
export class RegistrarSelectorComponent implements OnInit {
|
||||||
constructor(protected registrarService: RegistrarService) {}
|
protected isMobile: boolean = false;
|
||||||
|
|
||||||
|
readonly breakpoint$ = this.breakpointObserver
|
||||||
|
.observe([MOBILE_LAYOUT_BREAKPOINT])
|
||||||
|
.pipe(distinctUntilChanged());
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
protected registrarService: RegistrarService,
|
||||||
|
protected breakpointObserver: BreakpointObserver
|
||||||
|
) {}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.breakpoint$.subscribe(() => this.breakpointChanged());
|
||||||
|
}
|
||||||
|
|
||||||
|
private breakpointChanged() {
|
||||||
|
this.isMobile = this.breakpointObserver.isMatched(MOBILE_LAYOUT_BREAKPOINT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,22 +1,21 @@
|
||||||
<div class="console-app__registrars">
|
<div class="console-app__registrars">
|
||||||
<table
|
<mat-table
|
||||||
mat-table
|
[dataSource]="dataSource"
|
||||||
[dataSource]="registrarService.registrars"
|
|
||||||
class="mat-elevation-z8"
|
class="mat-elevation-z8"
|
||||||
|
class="console-app__registrars-table"
|
||||||
|
matSort
|
||||||
>
|
>
|
||||||
<ng-container
|
<ng-container
|
||||||
*ngFor="let column of columns"
|
*ngFor="let column of columns"
|
||||||
[matColumnDef]="column.columnDef"
|
[matColumnDef]="column.columnDef"
|
||||||
>
|
>
|
||||||
<th mat-header-cell *matHeaderCellDef>
|
<mat-header-cell *matHeaderCellDef> {{ column.header }} </mat-header-cell>
|
||||||
{{ column.header }}
|
<mat-cell *matCellDef="let row" [innerHTML]="column.cell(row)"></mat-cell>
|
||||||
</th>
|
|
||||||
<td mat-cell *matCellDef="let row" [innerHTML]="column.cell(row)"></td>
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||||
|
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
|
||||||
|
</mat-table>
|
||||||
|
|
||||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
|
||||||
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
|
|
||||||
</table>
|
|
||||||
<mat-paginator
|
<mat-paginator
|
||||||
class="mat-elevation-z8"
|
class="mat-elevation-z8"
|
||||||
[pageSizeOptions]="[5, 10, 20]"
|
[pageSizeOptions]="[5, 10, 20]"
|
||||||
|
|
|
@ -1,5 +1,27 @@
|
||||||
.console-app {
|
.console-app {
|
||||||
|
$min-width: 756px;
|
||||||
|
|
||||||
&__registrars {
|
&__registrars {
|
||||||
margin-top: 1.5rem;
|
margin-top: 1.5rem;
|
||||||
|
width: 100%;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__registrars-table {
|
||||||
|
min-width: $min-width !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mat-mdc-paginator {
|
||||||
|
min-width: $min-width !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mat-column {
|
||||||
|
&-driveId {
|
||||||
|
min-width: 200px;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
&-registryLockAllowed {
|
||||||
|
max-width: 80px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,16 +12,21 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { Component } from '@angular/core';
|
import { Component, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||||
import { Registrar, RegistrarService } from './registrar.service';
|
import { Registrar, RegistrarService } from './registrar.service';
|
||||||
|
import { MatPaginator } from '@angular/material/paginator';
|
||||||
|
import { MatSort } from '@angular/material/sort';
|
||||||
|
import { MatTableDataSource } from '@angular/material/table';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-registrar',
|
selector: 'app-registrar',
|
||||||
templateUrl: './registrarsTable.component.html',
|
templateUrl: './registrarsTable.component.html',
|
||||||
styleUrls: ['./registrarsTable.component.scss'],
|
styleUrls: ['./registrarsTable.component.scss'],
|
||||||
|
encapsulation: ViewEncapsulation.None,
|
||||||
})
|
})
|
||||||
export class RegistrarComponent {
|
export class RegistrarComponent {
|
||||||
public static PATH = 'registrars';
|
public static PATH = 'registrars';
|
||||||
|
dataSource: MatTableDataSource<Registrar>;
|
||||||
columns = [
|
columns = [
|
||||||
{
|
{
|
||||||
columnDef: 'registrarId',
|
columnDef: 'registrarId',
|
||||||
|
@ -72,5 +77,18 @@ export class RegistrarComponent {
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
displayedColumns = this.columns.map((c) => c.columnDef);
|
displayedColumns = this.columns.map((c) => c.columnDef);
|
||||||
constructor(protected registrarService: RegistrarService) {}
|
|
||||||
|
@ViewChild(MatPaginator) paginator!: MatPaginator;
|
||||||
|
@ViewChild(MatSort) sort!: MatSort;
|
||||||
|
|
||||||
|
constructor(protected registrarService: RegistrarService) {
|
||||||
|
this.dataSource = new MatTableDataSource<Registrar>(
|
||||||
|
registrarService.registrars
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
ngAfterViewInit() {
|
||||||
|
this.dataSource.paginator = this.paginator;
|
||||||
|
this.dataSource.sort = this.sort;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<h3 mat-dialog-title>Contact details</h3>
|
<h3 mat-dialog-title>Contact details</h3>
|
||||||
<div mat-dialog-content>
|
<div mat-dialog-content>
|
||||||
<form (ngSubmit)="saveAndClose($event)">
|
<form (ngSubmit)="saveAndClose($event)">
|
||||||
<div>
|
<p>
|
||||||
<mat-form-field class="contact-details__input">
|
<mat-form-field class="contact-details__input">
|
||||||
<mat-label>Name: </mat-label>
|
<mat-label>Name: </mat-label>
|
||||||
<input
|
<input
|
||||||
|
@ -11,9 +11,9 @@
|
||||||
[ngModelOptions]="{ standalone: true }"
|
[ngModelOptions]="{ standalone: true }"
|
||||||
/>
|
/>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</p>
|
||||||
|
|
||||||
<div>
|
<p>
|
||||||
<mat-form-field class="contact-details__input">
|
<mat-form-field class="contact-details__input">
|
||||||
<mat-label>Primary account email: </mat-label>
|
<mat-label>Primary account email: </mat-label>
|
||||||
<input
|
<input
|
||||||
|
@ -25,9 +25,9 @@
|
||||||
[ngModelOptions]="{ standalone: true }"
|
[ngModelOptions]="{ standalone: true }"
|
||||||
/>
|
/>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</p>
|
||||||
|
|
||||||
<div>
|
<p>
|
||||||
<mat-form-field class="contact-details__input">
|
<mat-form-field class="contact-details__input">
|
||||||
<mat-label>Phone: </mat-label>
|
<mat-label>Phone: </mat-label>
|
||||||
<input
|
<input
|
||||||
|
@ -36,9 +36,9 @@
|
||||||
[ngModelOptions]="{ standalone: true }"
|
[ngModelOptions]="{ standalone: true }"
|
||||||
/>
|
/>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</p>
|
||||||
|
|
||||||
<div>
|
<p>
|
||||||
<mat-form-field class="contact-details__input">
|
<mat-form-field class="contact-details__input">
|
||||||
<mat-label>Fax: </mat-label>
|
<mat-label>Fax: </mat-label>
|
||||||
<input
|
<input
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
[ngModelOptions]="{ standalone: true }"
|
[ngModelOptions]="{ standalone: true }"
|
||||||
/>
|
/>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</p>
|
||||||
|
|
||||||
<div class="contact-details__group">
|
<div class="contact-details__group">
|
||||||
<label>Contact type:</label>
|
<label>Contact type:</label>
|
||||||
|
|
|
@ -95,7 +95,7 @@ export class BackendService {
|
||||||
|
|
||||||
getUserData(): Observable<UserData> {
|
getUserData(): Observable<UserData> {
|
||||||
return this.http
|
return this.http
|
||||||
.get<UserData>(`/console-api/userdata`)
|
.get<UserData>('/console-api/userdata')
|
||||||
.pipe(catchError((err) => this.errorCatcher<UserData>(err)));
|
.pipe(catchError((err) => this.errorCatcher<UserData>(err)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,11 +44,12 @@ body {
|
||||||
&-link {
|
&-link {
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
height: 20px !important;
|
|
||||||
min-width: auto !important;
|
min-width: auto !important;
|
||||||
|
height: min-content !important;
|
||||||
}
|
}
|
||||||
&-title {
|
&-title {
|
||||||
color: var(--primary) !important;
|
color: var(--primary) !important;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
&-icon {
|
&-icon {
|
||||||
font-size: 5rem;
|
font-size: 5rem;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue