1
0
mirror of https://github.com/google/nomulus synced 2026-07-19 06:22:33 +00:00

Tweak a few console UI fields (#3146)

- treat password fields as passwords
- add Validators to a few places
- remove empty fields from billing maps if they exist
This commit is contained in:
gbrodman
2026-07-13 12:10:44 -04:00
committed by GitHub
parent 653da19e53
commit c2bd11c528
5 changed files with 15 additions and 10 deletions
@@ -14,7 +14,7 @@
import { HttpErrorResponse } from '@angular/common/http';
import { Component, computed } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import { RegistrarService } from '../registrar/registrar.service';
import { UserDataService } from '../shared/services/userData.service';
@@ -42,11 +42,11 @@ export class RegistryLockComponent {
];
lockDomain = new FormGroup({
password: new FormControl(''),
password: new FormControl('', [Validators.required]),
});
unlockDomain = new FormGroup({
password: new FormControl(''),
password: new FormControl('', [Validators.required]),
relockTime: new FormControl(undefined),
});
@@ -50,7 +50,10 @@ export class NewOteComponent {
createOte = new FormGroup({
registrarId: new FormControl('', [Validators.required]),
registrarEmail: new FormControl('', [Validators.required]),
registrarEmail: new FormControl('', [
Validators.required,
Validators.email,
]),
});
constructor(
@@ -67,8 +67,10 @@ export default class NewRegistrarComponent {
onBillingAccountMapChange(val: String) {
const billingAccountMap: { [key: string]: string } = {};
this.newRegistrar.billingAccountMap = val.split('\n').reduce((acc, val) => {
const [currency, billingCode] = val.split('=');
acc[currency] = billingCode;
const [currency, billingCode] = val.split('=').map((s) => s?.trim());
if (currency && billingCode) {
acc[currency] = billingCode;
}
return acc;
}, billingAccountMap);
}
@@ -9,7 +9,7 @@
<mat-label>Old password: </mat-label>
<input
matInput
type="text"
type="password"
formControlName="oldPassword"
required
autocomplete="current-password"
@@ -25,7 +25,7 @@
<mat-label>New password: </mat-label>
<input
matInput
type="text"
type="password"
formControlName="newPassword"
required
autocomplete="new-password"
@@ -40,7 +40,7 @@
<mat-label>Confirm new password: </mat-label>
<input
matInput
type="text"
type="password"
formControlName="newPasswordRepeat"
required
autocomplete="new-password"
@@ -93,7 +93,7 @@ public class RdapRegistrarFieldsAction extends ConsoleApiAction {
newRegistrarBuilder.setPhoneNumber(providedRegistrar.getPhoneNumber());
updates.add("PHONE");
}
if (!providedRegistrar.getFaxNumber().equals(savedRegistrar.getPhoneNumber())) {
if (!providedRegistrar.getFaxNumber().equals(savedRegistrar.getFaxNumber())) {
newRegistrarBuilder.setFaxNumber(providedRegistrar.getFaxNumber());
updates.add("FAX");
}