1
0
mirror of https://github.com/google/nomulus synced 2026-01-07 22:15:30 +00:00

Add phone and fax number to console whois endpoint (#2447)

This commit is contained in:
Pavlo Tkach
2024-05-20 16:32:23 -04:00
committed by GitHub
parent d96a5547ce
commit 8e22ce7c70
3 changed files with 16 additions and 5 deletions

View File

@@ -51,10 +51,12 @@ export const columns = [
columnDef: 'billingAccountMap',
header: 'Billing Accounts',
cell: (record: Registrar) =>
// @ts-ignore - completely legit line, but TS keeps complaining
`${Object.entries(record.billingAccountMap).reduce((acc, [key, val]) => {
return `${acc}${key}=${val}<br/>`;
}, '')}`,
`${Object.entries(record.billingAccountMap || {}).reduce(
(acc, [key, val]) => {
return `${acc}${key}=${val}<br/>`;
},
''
)}`,
},
{
columnDef: 'registryLockAllowed',

View File

@@ -81,6 +81,8 @@ public class WhoisRegistrarFieldsAction extends ConsoleApiAction {
newRegistrar.setWhoisServer(providedRegistrar.getWhoisServer());
newRegistrar.setUrl(providedRegistrar.getUrl());
newRegistrar.setLocalizedAddress(providedRegistrar.getLocalizedAddress());
newRegistrar.setPhoneNumber(providedRegistrar.getPhoneNumber());
newRegistrar.setFaxNumber(providedRegistrar.getFaxNumber());
tm().put(newRegistrar.build());
consoleApiParams.response().setStatus(HttpStatusCodes.STATUS_CODE_OK);
}

View File

@@ -105,6 +105,10 @@ public class WhoisRegistrarFieldsActionTest {
ImmutableMap.of(
"whoisServer",
"whois.nic.google",
"phoneNumber",
"+1.4155552671",
"faxNumber",
"+1.4155552672",
"url",
"\"https://newurl.example\"",
"localizedAddress",
@@ -118,10 +122,13 @@ public class WhoisRegistrarFieldsActionTest {
assertThat(newRegistrar.getWhoisServer()).isEqualTo("whois.nic.google");
assertThat(newRegistrar.getUrl()).isEqualTo("https://newurl.example");
assertThat(newRegistrar.getLocalizedAddress().toJsonMap()).isEqualTo(addressMap);
assertThat(newRegistrar.getPhoneNumber()).isEqualTo("+1.4155552671");
assertThat(newRegistrar.getFaxNumber()).isEqualTo("+1.4155552672");
// the non-changed fields should be the same
assertAboutImmutableObjects()
.that(newRegistrar)
.isEqualExceptFields(oldRegistrar, "whoisServer", "url", "localizedAddress");
.isEqualExceptFields(
oldRegistrar, "whoisServer", "url", "localizedAddress", "phoneNumber", "faxNumber");
}
@Test