Redirect Registrar.referralUrl UI actions to url field

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=196597051
This commit is contained in:
larryruili 2018-05-14 17:49:57 -07:00 committed by jianglai
parent de5645abd9
commit 6cdbde107f
23 changed files with 18 additions and 59 deletions

View file

@ -1381,13 +1381,6 @@ public final class RegistryConfig {
return CONFIG_SETTINGS.get().registryPolicy.defaultRegistrarWhoisServer;
}
/**
* Returns the default referral URL that is used unless registrars have specified otherwise.
*/
public static String getDefaultRegistrarReferralUrl() {
return CONFIG_SETTINGS.get().registryPolicy.defaultRegistrarReferralUrl;
}
/**
* Returns the number of {@code EppResourceIndex} buckets to be used.
*/

View file

@ -58,9 +58,6 @@ registryPolicy:
# Default WHOIS server used when not specified on a registrar.
defaultRegistrarWhoisServer: whois.domain-registry.example
# Default referral URL used when not changed by a registrar.
defaultRegistrarReferralUrl: https://www.domain-registry.example
# Mode TMCH should run in (PRODUCTION for production environments, PILOT for
# all others including sandbox).
tmchCaMode: PILOT

View file

@ -24,7 +24,6 @@ registryPolicy:
- placeholder
- placeholder
defaultRegistrarWhoisServer: placeholder
defaultRegistrarReferralUrl: placeholder
tmchCaMode: PRODUCTION
tmchCrlUrl: http://crl.icann.org/tmch.crl
tmchMarksDbUrl: https://ry.marksdb.org

View file

@ -6,7 +6,6 @@ registryPolicy:
- notification@test.example
- notification2@test.example
defaultRegistrarWhoisServer: whois.nic.fakewhois.example
defaultRegistrarReferralUrl: http://www.referral.example/path
datastore:
commitLogBucketsNum: 3

View file

@ -147,7 +147,7 @@ class SyncRegistrarsSheet {
builder.put("blockPremiumNames", convert(registrar.getBlockPremiumNames()));
builder.put("ipAddressWhitelist", convert(registrar.getIpAddressWhitelist()));
builder.put("url", convert(registrar.getUrl()));
builder.put("referralUrl", convert(registrar.getReferralUrl()));
builder.put("referralUrl", convert(registrar.getUrl()));
builder.put("icannReferralEmail", convert(registrar.getIcannReferralEmail()));
return builder.build();
})

View file

@ -24,7 +24,6 @@ import static com.google.common.collect.ImmutableSortedSet.toImmutableSortedSet;
import static com.google.common.collect.Ordering.natural;
import static com.google.common.collect.Sets.immutableEnumSet;
import static com.google.common.io.BaseEncoding.base64;
import static google.registry.config.RegistryConfig.getDefaultRegistrarReferralUrl;
import static google.registry.config.RegistryConfig.getDefaultRegistrarWhoisServer;
import static google.registry.model.CacheUtils.memoizeWithShortExpiration;
import static google.registry.model.common.EntityGroupRoot.getCrossTldKey;
@ -364,9 +363,6 @@ public class Registrar extends ImmutableObject implements Buildable, Jsonifiable
/** URL of registrar's website. */
String url;
/** Referral URL of registrar. */
String referralUrl;
/**
* ICANN referral email address.
*
@ -551,10 +547,6 @@ public class Registrar extends ImmutableObject implements Buildable, Jsonifiable
return url;
}
public String getReferralUrl() {
return firstNonNull(referralUrl, getDefaultRegistrarReferralUrl());
}
public String getIcannReferralEmail() {
return nullToEmpty(icannReferralEmail);
}
@ -617,7 +609,6 @@ public class Registrar extends ImmutableObject implements Buildable, Jsonifiable
.put("blockPremiumNames", blockPremiumNames)
.put("premiumPriceAckRequired", premiumPriceAckRequired)
.put("url", url)
.put("referralUrl", getReferralUrl())
.put("icannReferralEmail", getIcannReferralEmail())
.put("driveFolderId", driveFolderId)
.put("phoneNumber", phoneNumber)
@ -833,11 +824,6 @@ public class Registrar extends ImmutableObject implements Buildable, Jsonifiable
return this;
}
public Builder setReferralUrl(String referralUrl) {
getInstance().referralUrl = referralUrl;
return this;
}
public Builder setIcannReferralEmail(String icannReferralEmail) {
getInstance().icannReferralEmail = icannReferralEmail;
return this;

View file

@ -154,10 +154,6 @@ public final class RegistrarFormFields {
FormFields.MIN_TOKEN.asBuilderNamed("url")
.build();
public static final FormField<String, String> REFERRAL_URL_FIELD =
FormFields.MIN_TOKEN.asBuilderNamed("referralUrl")
.build();
public static final FormField<List<String>, List<CidrAddressBlock>> IP_ADDRESS_WHITELIST_FIELD =
FormField.named("ipAddressWhitelist")
.emptyToNull()

View file

@ -224,8 +224,7 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA
// WHOIS
builder.setWhoisServer(
RegistrarFormFields.WHOIS_SERVER_FIELD.extractUntyped(args).orElse(null));
builder.setReferralUrl(
RegistrarFormFields.REFERRAL_URL_FIELD.extractUntyped(args).orElse(null));
builder.setUrl(RegistrarFormFields.URL_FIELD.extractUntyped(args).orElse(null));
// If the email is already null / empty - we can keep it so. But if it's set - it's required to
// remain set.
@ -241,8 +240,6 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA
builder.setLocalizedAddress(
RegistrarFormFields.L10N_ADDRESS_FIELD.extractUntyped(args).orElse(null));
builder.setUrl(RegistrarFormFields.URL_FIELD.extractUntyped(args).orElse(null));
// Security
builder.setIpAddressWhitelist(
RegistrarFormFields.IP_ADDRESS_WHITELIST_FIELD

View file

@ -23,14 +23,14 @@
{@param icannReferralEmail: string}
{@param readonly: bool}
{@param? whoisServer: string}
{@param? referralUrl: string}
{@param? url: string}
// Passed to .contactInfo_
{@param? emailAddress: string}
{@param? localizedAddress: ?}
{@param? phoneNumber: string}
{@param? faxNumber: string}
{let $whoisServerNonNull: $whoisServer ?: 'None' /}
{let $referralUrlNonNull: $referralUrl ?: 'None' /}
{let $urlNonNull: $url ?: 'None' /}
<form name="item" class="{css('item')} {css('registrar')} {css('kd-settings-pane')}">
<h1>WHOIS Settings</h1>
{if $readonly}
@ -66,8 +66,8 @@
{/call}
{call registry.soy.forms.inputFieldRowWithValue}
{param label: 'Referral URL' /}
{param name: 'referralUrl' /}
{param value: $referralUrlNonNull /}
{param name: 'url' /}
{param value: $urlNonNull /}
{param readonly: $readonly /}
{/call}
</table>