diff --git a/java/google/registry/config/ConfigModule.java b/java/google/registry/config/ConfigModule.java
index a9186b2fb..478b9ecca 100644
--- a/java/google/registry/config/ConfigModule.java
+++ b/java/google/registry/config/ConfigModule.java
@@ -99,14 +99,46 @@ public final class ConfigModule {
@Provides
@Config("productName")
public static String provideProductName(RegistryEnvironment environment) {
- switch (environment) {
- case UNITTEST:
- case LOCAL:
- return "Nomulus";
- default:
- // Change this to the name of your product.
- return "Google Registry";
- }
+ return "Nomulus";
+ }
+
+ /**
+ * The e-mail address for questions about integrating with the registry. Used in the
+ * "contact-us" section of the registrar console.
+ */
+ @Provides
+ @Config("integrationEmail")
+ public static String provideIntegrationEmail(RegistryEnvironment environment) {
+ return "integration@example.com";
+ }
+
+ /**
+ * The e-mail address for general support. Used in the "contact-us" section of the registrar
+ * console.
+ */
+ @Provides
+ @Config("supportEmail")
+ public static String provideSupportEmail(RegistryEnvironment environment) {
+ return "support@example.com";
+ }
+
+ /**
+ * The "From" e-mail address for announcements. Used in the "contact-us" section of the
+ * registrar console.
+ */
+ @Provides
+ @Config("announcementsEmail")
+ public static String provideAnnouncementsEmail(RegistryEnvironment environment) {
+ return "announcements@example.com";
+ }
+
+ /**
+ * The contact phone number. Used in the "contact-us" section of the registrar console.
+ */
+ @Provides
+ @Config("supportPhoneNumber")
+ public static String provideSupportPhoneNumber(RegistryEnvironment environment) {
+ return "+1 (888) 555 0123";
}
/** @see RegistryConfig#getZoneFilesBucket() */
diff --git a/java/google/registry/ui/js/registrar/console.js b/java/google/registry/ui/js/registrar/console.js
index c9f54a576..d0d8e27ac 100644
--- a/java/google/registry/ui/js/registrar/console.js
+++ b/java/google/registry/ui/js/registrar/console.js
@@ -38,17 +38,19 @@ goog.forwardDeclare('registry.Component');
/**
* The Registrar Console.
- * @param {string} xsrfToken Populated by server-side soy template.
- * @param {string} clientId The logged in GAE user.
- * @param {string} productName The software name displayed on the UI.
+ * @param {!Object} params Parameters to be passed into templates. These are
+ * a combination of configurable parameters (e.g. phone number) and
+ * user/session/registrar specific parameters. See
+ * registrar/Console.soy#.main for expected contents.
* @constructor
* @extends {registry.Console}
* @final
*/
-registry.registrar.Console = function(xsrfToken, clientId, productName) {
+registry.registrar.Console = function(params) {
registry.registrar.Console.base(
this, 'constructor',
- new registry.registrar.EppSession(this, xsrfToken, clientId));
+ new registry.registrar.EppSession(this, params.xsrfToken,
+ params.clientId));
/**
* Component that's currently embedded in the page.
@@ -62,15 +64,9 @@ registry.registrar.Console = function(xsrfToken, clientId, productName) {
this.history.setEnabled(true);
/**
- * @type {!string}
- * @private
+ * @type {!Object}
*/
- this.xsrfToken_ = xsrfToken;
-
- /**
- * @type {string}
- */
- this.productName = productName;
+ this.params = params;
/**
* Last active nav element.
@@ -142,7 +138,7 @@ registry.registrar.Console.prototype.handleHashChange = function() {
componentCtor = this.pageMap[''];
}
var oldComponent = this.component_;
- this.component_ = new componentCtor(this, this.xsrfToken_);
+ this.component_ = new componentCtor(this, this.params.xsrfToken);
this.registerDisposable(this.component_);
this.component_.basePath = type;
this.component_.bindToDom(id);
diff --git a/java/google/registry/ui/js/registrar/contact_us.js b/java/google/registry/ui/js/registrar/contact_us.js
index 317b5925f..95db547f3 100644
--- a/java/google/registry/ui/js/registrar/contact_us.js
+++ b/java/google/registry/ui/js/registrar/contact_us.js
@@ -16,6 +16,7 @@ goog.provide('registry.registrar.ContactUs');
goog.require('goog.Uri');
goog.require('goog.dom');
+goog.require('goog.object');
goog.require('registry.Resource');
goog.require('registry.ResourceComponent');
goog.require('registry.soy.registrar.console');
@@ -44,6 +45,15 @@ registry.registrar.ContactUs = function(console, xsrfToken) {
goog.inherits(registry.registrar.ContactUs, registry.ResourceComponent);
+/** @override */
+registry.registrar.ContactUs.prototype.renderItem = function(rspObj) {
+ // Augment the static parameters with the response object, we'll need both.
+ var params = goog.object.clone(this.console.params);
+ goog.object.extend(params, rspObj);
+ registry.registrar.ContactUs.base(this, 'renderItem', params);
+};
+
+
/** @override */
registry.registrar.ContactUs.prototype.bindToDom = function(id) {
registry.registrar.ContactUs.base(this, 'bindToDom', '');
diff --git a/java/google/registry/ui/js/registrar/dashboard.js b/java/google/registry/ui/js/registrar/dashboard.js
index 77a588eb1..0d3c56f02 100644
--- a/java/google/registry/ui/js/registrar/dashboard.js
+++ b/java/google/registry/ui/js/registrar/dashboard.js
@@ -55,9 +55,7 @@ registry.registrar.Dashboard.prototype.bindToDom = function(id) {
goog.dom.removeChildren(goog.dom.getRequiredElement('reg-appbar'));
goog.soy.renderElement(goog.dom.getElement('reg-content'),
registry.soy.registrar.console.dashboard,
- {
- productName: this.console.productName
- });
+ this.console.params);
goog.events.listen(goog.dom.getElement('rotate'),
goog.events.EventType.CLICK,
goog.bind(this.rotate_, this));
diff --git a/java/google/registry/ui/js/registrar/main.js b/java/google/registry/ui/js/registrar/main.js
index 4e8d5ae7b..c3b85a7fb 100644
--- a/java/google/registry/ui/js/registrar/main.js
+++ b/java/google/registry/ui/js/registrar/main.js
@@ -29,8 +29,22 @@ goog.require('registry.registrar.Console');
* @param {string} xsrfToken populated by server-side soy template.
* @param {string} clientId The registrar clientId.
* @param {string} productName the product name displayed by the UI.
+ * @param {string} integrationEmail
+ * @param {string} supportEmail
+ * @param {string} announcementsEmail
+ * @param {string} supportPhoneNumber
* @export
*/
-registry.registrar.main = function(xsrfToken, clientId, productName) {
- new registry.registrar.Console(xsrfToken, clientId, productName);
+registry.registrar.main = function(xsrfToken, clientId, productName,
+ integrationEmail, supportEmail,
+ announcementsEmail, supportPhoneNumber) {
+ new registry.registrar.Console({
+ xsrfToken: xsrfToken,
+ clientId: clientId,
+ productName: productName,
+ integrationEmail: integrationEmail,
+ supportEmail: supportEmail,
+ announcementsEmail: announcementsEmail,
+ supportPhoneNumber: supportPhoneNumber
+ });
};
diff --git a/java/google/registry/ui/server/registrar/ConsoleUiAction.java b/java/google/registry/ui/server/registrar/ConsoleUiAction.java
index 0d592fa6f..527963570 100644
--- a/java/google/registry/ui/server/registrar/ConsoleUiAction.java
+++ b/java/google/registry/ui/server/registrar/ConsoleUiAction.java
@@ -60,6 +60,10 @@ public final class ConsoleUiAction implements Runnable {
@Inject UserService userService;
@Inject @Config("logoFilename") String logoFilename;
@Inject @Config("productName") String productName;
+ @Inject @Config("integrationEmail") String integrationEmail;
+ @Inject @Config("supportEmail") String supportEmail;
+ @Inject @Config("announcementsEmail") String announcementsEmail;
+ @Inject @Config("supportPhoneNumber") String supportPhoneNumber;
@Inject @Config("registrarConsoleEnabled") boolean enabled;
@Inject ConsoleUiAction() {}
@@ -71,6 +75,10 @@ public final class ConsoleUiAction implements Runnable {
SoyMapData data = new SoyMapData();
data.put("logoFilename", logoFilename);
data.put("productName", productName);
+ data.put("integrationEmail", integrationEmail);
+ data.put("supportEmail", supportEmail);
+ data.put("announcementsEmail", announcementsEmail);
+ data.put("supportPhoneNumber", supportPhoneNumber);
if (!enabled) {
response.setStatus(SC_SERVICE_UNAVAILABLE);
response.setPayload(
@@ -98,11 +106,12 @@ public final class ConsoleUiAction implements Runnable {
data.put("clientId", registrar.getClientId());
data.put("isAdmin", userService.isUserAdmin());
data.put("showPaymentLink", registrar.getBillingMethod() == Registrar.BillingMethod.BRAINTREE);
- response.setPayload(
- TOFU_SUPPLIER.get()
+
+ String payload = TOFU_SUPPLIER.get()
.newRenderer(ConsoleSoyInfo.MAIN)
.setCssRenamingMap(CSS_RENAMING_MAP_SUPPLIER.get())
.setData(data)
- .render());
+ .render();
+ response.setPayload(payload);
}
}
diff --git a/java/google/registry/ui/soy/registrar/Console.soy b/java/google/registry/ui/soy/registrar/Console.soy
index 6a1e3dff8..60b7060df 100644
--- a/java/google/registry/ui/soy/registrar/Console.soy
+++ b/java/google/registry/ui/soy/registrar/Console.soy
@@ -28,6 +28,11 @@
{@param logoutUrl: string} /** Generated URL for logging out of Google. */
{@param showPaymentLink: bool}
{@param productName: string} /** Name to display for this software product. */
+ {@param integrationEmail: string}
+ {@param supportEmail: string}
+ {@param announcementsEmail: string}
+ {@param supportPhoneNumber: string}
+
{call registry.soy.console.header}
{param app: 'registrar' /}
{param subtitle: 'Registrar Console' /}
@@ -61,7 +66,13 @@
{/switch}
{if isNonnull(DEBUG)}
{/if}
{/template}
@@ -197,6 +208,10 @@
/** Contact us. */
{template .contactUs}
{@param? phonePasscode: string}
+ {@param integrationEmail: string}
+ {@param supportEmail: string}
+ {@param announcementsEmail: string}
+ {@param supportPhoneNumber: string}
Contact us
Our support team can assist you with any technical or operational
@@ -209,21 +224,19 @@
-
- registry-integration@google.com
+ {$integrationEmail}
For help with OT&E sandbox and certification, or new
technical requirements for any of our new TLD launches.
-
- registry-support@google.com
+ {$supportEmail}
For general purpose questions once you are integrated
with our registry system. If the issue is urgent, please put
"Urgent" in the email title.
Note: You may receive occasional service
announcements
- via registrar-announcement@google.com. You
+ via {$announcementsEmail}. You
will not be able to reply to those messages.
|
@@ -246,7 +259,7 @@
Call us at:
- +1 (404) 978 8419
+ {$supportPhoneNumber}
|
diff --git a/javatests/google/registry/ui/js/registrar/console_test.js b/javatests/google/registry/ui/js/registrar/console_test.js
index 0c98b16ee..7aab3899d 100644
--- a/javatests/google/registry/ui/js/registrar/console_test.js
+++ b/javatests/google/registry/ui/js/registrar/console_test.js
@@ -53,7 +53,11 @@ function setUp() {
clientId: test.testClientId,
showPaymentLink: false,
logoFilename: 'logo.png',
- productName: 'Nomulus'
+ productName: 'Nomulus',
+ integrationEmail: 'integration@example.com',
+ supportEmail: 'support@example.com',
+ announcementsEmail: 'announcement@example.com',
+ supportPhoneNumber: '+1 (888) 555 0123'
});
registry.registrar.ConsoleTestUtil.setup(test);
var regNavlist = $('reg-navlist');
@@ -91,8 +95,8 @@ function testEppLogin() {
registry.registrar.ConsoleTestUtil.visit(
test, {
isEppLoggedIn: true,
- testClientId: test.testClientId,
- testXsrfToken: test.testXsrfToken,
+ clientId: test.testClientId,
+ xsrfToken: test.testXsrfToken,
productName: 'Foo Registry'
}, function() {
test.sessionMock.login(
@@ -122,7 +126,7 @@ function testShowLoginOrDash() {
function testNavToResources() {
registry.registrar.ConsoleTestUtil.visit(test, {
path: 'resources',
- testXsrfToken: test.testXsrfToken
+ xsrfToken: test.testXsrfToken
});
var xhr = goog.testing.net.XhrIo.getSendInstances().pop();
assertTrue(xhr.isActive());
@@ -143,7 +147,12 @@ function testNavToResources() {
function testNavToContactUs() {
registry.registrar.ConsoleTestUtil.visit(test, {
path: 'contact-us',
- testXsrfToken: test.testXsrfToken
+ xsrfToken: test.testXsrfToken,
+ productName: 'Domain Registry',
+ integrationEmail: 'integration@example.com',
+ supportEmail: 'support@example.com',
+ announcementsEmail: 'announcement@example.com',
+ supportPhoneNumber: '+1 (888) 555 0123'
});
var xhr = goog.testing.net.XhrIo.getSendInstances().pop();
assertTrue(xhr.isActive());
diff --git a/javatests/google/registry/ui/js/registrar/console_test_util.js b/javatests/google/registry/ui/js/registrar/console_test_util.js
index c24b67d96..b2a07ea24 100644
--- a/javatests/google/registry/ui/js/registrar/console_test_util.js
+++ b/javatests/google/registry/ui/js/registrar/console_test_util.js
@@ -59,8 +59,8 @@ registry.registrar.ConsoleTestUtil.visit = function(
test, opt_args, opt_moar) {
opt_args = opt_args || {};
opt_args.path = opt_args.path || '';
- opt_args.testClientId = opt_args.testClientId || 'dummyRegistrarId';
- opt_args.testXsrfToken = opt_args.testXsrfToken || 'dummyXsrfToken';
+ opt_args.clientId = opt_args.clientId || 'dummyRegistrarId';
+ opt_args.xsrfToken = opt_args.xsrfToken || 'dummyXsrfToken';
if (opt_args.isEppLoggedIn === undefined) {
opt_args.isEppLoggedIn = true;
}
@@ -69,7 +69,7 @@ registry.registrar.ConsoleTestUtil.visit = function(
test.historyMock.getToken().$returns(opt_args.path).$anyTimes();
test.sessionMock.isEppLoggedIn().$returns(opt_args.isEppLoggedIn).$anyTimes();
test.sessionMock.getClientId().$returns(opt_args.isEppLoggedIn ?
- opt_args.testClientId : null).$anyTimes();
+ opt_args.clientId : null).$anyTimes();
if (opt_args.rspXml) {
test.sessionMock
.send(goog.testing.mockmatchers.isString,
@@ -86,10 +86,7 @@ registry.registrar.ConsoleTestUtil.visit = function(
}
test.mockControl.$replayAll();
/** @type {!registry.registrar.Console} */
- test.console = new registry.registrar.Console(
- opt_args.testXsrfToken,
- opt_args.testClientId,
- opt_args.productName);
+ test.console = new registry.registrar.Console(opt_args);
// XXX: Should be triggered via event passing.
test.console.handleHashChange();
test.mockControl.$verifyAll();
diff --git a/javatests/google/registry/ui/js/registrar/contact_settings_test.js b/javatests/google/registry/ui/js/registrar/contact_settings_test.js
index b9a2d4249..a9b4b27a5 100644
--- a/javatests/google/registry/ui/js/registrar/contact_settings_test.js
+++ b/javatests/google/registry/ui/js/registrar/contact_settings_test.js
@@ -52,7 +52,11 @@ function setUp() {
clientId: test.testClientId,
showPaymentLink: false,
logoFilename: 'logo.png',
- productName: 'Nomulus'
+ productName: 'Nomulus',
+ integrationEmail: 'integration@google.com',
+ supportEmail: 'support@google.com',
+ announcementsEmail: 'announcements@google.com',
+ supportPhoneNumber: '123 456 7890',
});
stubs.setPath('goog.net.XhrIo', goog.testing.net.XhrIo);
registry.registrar.ConsoleTestUtil.setup(test);
@@ -70,8 +74,8 @@ function tearDown() {
function testCollectionView() {
registry.registrar.ConsoleTestUtil.visit(test, {
path: 'contact-settings',
- testXsrfToken: test.testXsrfToken,
- testClientId: test.testClientId
+ xsrfToken: test.testXsrfToken,
+ clientId: test.testClientId
});
registry.testing.assertReqMockRsp(
test.testXsrfToken,
@@ -93,8 +97,8 @@ function testCollectionView() {
function testItemView() {
registry.registrar.ConsoleTestUtil.visit(test, {
path: 'contact-settings/test@example.com',
- testXsrfToken: test.testXsrfToken,
- testClientId: test.testClientId
+ xsrfToken: test.testXsrfToken,
+ clientId: test.testClientId
});
registry.testing.assertReqMockRsp(
test.testXsrfToken,
@@ -196,7 +200,7 @@ function testChangeContactTypes() {
function testOneOfManyUpdate() {
registry.registrar.ConsoleTestUtil.visit(test, {
path: 'contact-settings/test@example.com',
- testXsrfToken: test.testXsrfToken,
+ xsrfToken: test.testXsrfToken,
testClientId: test.testClientId
});
var testContacts = [
@@ -243,7 +247,7 @@ function testOneOfManyUpdate() {
function testDelete() {
registry.registrar.ConsoleTestUtil.visit(test, {
path: 'contact-settings/test@example.com',
- testXsrfToken: test.testXsrfToken,
+ xsrfToken: test.testXsrfToken,
testClientId: test.testClientId
});
var testContacts = [
diff --git a/javatests/google/registry/ui/js/registrar/contact_test.js b/javatests/google/registry/ui/js/registrar/contact_test.js
index 9cfa49c40..334cef498 100644
--- a/javatests/google/registry/ui/js/registrar/contact_test.js
+++ b/javatests/google/registry/ui/js/registrar/contact_test.js
@@ -43,7 +43,11 @@ function setUp() {
clientId: 'daddy',
showPaymentLink: false,
logoFilename: 'logo.png',
- productName: 'Nomulus'
+ productName: 'Nomulus',
+ integrationEmail: 'integration@example.com',
+ supportEmail: 'support@example.com',
+ announcementsEmail: 'announcement@example.com',
+ supportPhoneNumber: '+1 (888) 555 0123'
});
registry.registrar.ConsoleTestUtil.setup(test);
}
diff --git a/javatests/google/registry/ui/js/registrar/domain_test.js b/javatests/google/registry/ui/js/registrar/domain_test.js
index 7002df41f..41de39dce 100644
--- a/javatests/google/registry/ui/js/registrar/domain_test.js
+++ b/javatests/google/registry/ui/js/registrar/domain_test.js
@@ -49,7 +49,11 @@ function setUp() {
clientId: 'ignore',
showPaymentLink: false,
logoFilename: 'logo.png',
- productName: 'Nomulus'
+ productName: 'Nomulus',
+ integrationEmail: 'integration@example.com',
+ supportEmail: 'support@example.com',
+ announcementsEmail: 'announcement@example.com',
+ supportPhoneNumber: '+1 (888) 555 0123'
});
stubs.setPath('goog.net.XhrIo', goog.testing.net.XhrIo);
@@ -59,7 +63,10 @@ function setUp() {
historyMock.setEnabled(true);
mocks.$replayAll();
- registrarConsole = new registry.registrar.Console('☢', 'jartine');
+ registrarConsole = new registry.registrar.Console({
+ xsrfToken: '☢',
+ clientId: 'jartine'
+ });
mocks.$verifyAll();
}
diff --git a/javatests/google/registry/ui/js/registrar/host_test.js b/javatests/google/registry/ui/js/registrar/host_test.js
index ac139f917..08ac98867 100644
--- a/javatests/google/registry/ui/js/registrar/host_test.js
+++ b/javatests/google/registry/ui/js/registrar/host_test.js
@@ -49,7 +49,11 @@ function setUp() {
clientId: 'ignore',
showPaymentLink: false,
logoFilename: 'logo.png',
- productName: 'Nomulus'
+ productName: 'Nomulus',
+ integrationEmail: 'integration@example.com',
+ supportEmail: 'support@example.com',
+ announcementsEmail: 'announcement@example.com',
+ supportPhoneNumber: '+1 (888) 555 0123'
});
stubs.setPath('goog.net.XhrIo', goog.testing.net.XhrIo);
@@ -59,7 +63,10 @@ function setUp() {
historyMock.setEnabled(true);
mocks.$replayAll();
- registrarConsole = new registry.registrar.Console('☢', 'jartine');
+ registrarConsole = new registry.registrar.Console({
+ xsrfToken: '☢',
+ clientId: 'jartine'
+ });
mocks.$verifyAll();
}
diff --git a/javatests/google/registry/ui/js/registrar/security_settings_test.js b/javatests/google/registry/ui/js/registrar/security_settings_test.js
index d14d5c3a6..a165140fe 100644
--- a/javatests/google/registry/ui/js/registrar/security_settings_test.js
+++ b/javatests/google/registry/ui/js/registrar/security_settings_test.js
@@ -57,7 +57,11 @@ function setUp() {
clientId: test.testClientId,
showPaymentLink: false,
logoFilename: 'logo.png',
- productName: 'Nomulus'
+ productName: 'Nomulus',
+ integrationEmail: 'integration@example.com',
+ supportEmail: 'support@example.com',
+ announcementsEmail: 'announcement@example.com',
+ supportPhoneNumber: '+1 (888) 555 0123'
});
stubs.setPath('goog.net.XhrIo', goog.testing.net.XhrIo);
registry.registrar.ConsoleTestUtil.setup(test);
@@ -75,7 +79,7 @@ function tearDown() {
function testView() {
registry.registrar.ConsoleTestUtil.visit(test, {
path: 'security-settings',
- testXsrfToken: test.testXsrfToken,
+ xsrfToken: test.testXsrfToken,
testClientId: test.testClientId
});
registry.testing.assertReqMockRsp(
diff --git a/javatests/google/registry/ui/js/registrar/whois_settings_test.js b/javatests/google/registry/ui/js/registrar/whois_settings_test.js
index 6fc9fa5a9..4a095bebe 100644
--- a/javatests/google/registry/ui/js/registrar/whois_settings_test.js
+++ b/javatests/google/registry/ui/js/registrar/whois_settings_test.js
@@ -51,7 +51,11 @@ function setUp() {
clientId: test.testClientId,
showPaymentLink: false,
logoFilename: 'logo.png',
- productName: 'Nomulus'
+ productName: 'Nomulus',
+ integrationEmail: 'integration@example.com',
+ supportEmail: 'support@example.com',
+ announcementsEmail: 'announcement@example.com',
+ supportPhoneNumber: '+1 (888) 555 0123'
});
stubs.setPath('goog.net.XhrIo', goog.testing.net.XhrIo);
registry.registrar.ConsoleTestUtil.setup(test);
@@ -93,7 +97,7 @@ function createTestRegistrar() {
function testView() {
registry.registrar.ConsoleTestUtil.visit(test, {
path: 'whois-settings',
- testXsrfToken: test.testXsrfToken,
+ xsrfToken: test.testXsrfToken,
testClientId: test.testClientId
});
var testRegistrar = createTestRegistrar();
diff --git a/javatests/google/registry/ui/server/registrar/ConsoleUiActionTest.java b/javatests/google/registry/ui/server/registrar/ConsoleUiActionTest.java
index 7a8175fd4..a465da75c 100644
--- a/javatests/google/registry/ui/server/registrar/ConsoleUiActionTest.java
+++ b/javatests/google/registry/ui/server/registrar/ConsoleUiActionTest.java
@@ -52,6 +52,10 @@ public class ConsoleUiActionTest {
action.enabled = true;
action.logoFilename = "logo.png";
action.productName = "Nomulus";
+ action.integrationEmail = "integration@example.com";
+ action.supportEmail = "support@example.com";
+ action.announcementsEmail = "announcements@example.com";
+ action.supportPhoneNumber = "1 (888) 555 0123";
action.response = response;
action.sessionUtils = sessionUtils;
action.userService = UserServiceFactory.getUserService();