From f2846fc9143923f02fd2309f3901f9b9bb8efa74 Mon Sep 17 00:00:00 2001 From: gbrodman Date: Tue, 10 Mar 2020 11:30:20 -0400 Subject: [PATCH] Gray out the password field for admins (#506) * Gray out the password field for admins We don't check it for admins since it's not necessary, so ignore it * Remove the field entirely --- .../registry/ui/js/registrar/registry_lock.js | 4 +++- .../ui/soy/registrar/RegistryLock.soy | 9 ++++++--- .../RegistrarConsoleScreenshotTest.java | 2 -- ...enshotTest_registryLock_lockModal_page.png | Bin 52956 -> 51498 bytes ...shotTest_registryLock_unlockModal_page.png | Bin 56331 -> 52961 bytes 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/core/src/main/javascript/google/registry/ui/js/registrar/registry_lock.js b/core/src/main/javascript/google/registry/ui/js/registrar/registry_lock.js index 761401be0..1eb96141c 100644 --- a/core/src/main/javascript/google/registry/ui/js/registrar/registry_lock.js +++ b/core/src/main/javascript/google/registry/ui/js/registrar/registry_lock.js @@ -45,6 +45,7 @@ registry.registrar.RegistryLock = function(console, resource) { goog.inherits(registry.registrar.RegistryLock, registry.ResourceComponent); registry.registrar.RegistryLock.prototype.runAfterRender = function(objArgs) { + this.isAdmin = objArgs.isAdmin; this.clientId = objArgs.clientId; this.xsrfToken = objArgs.xsrfToken; @@ -114,7 +115,8 @@ registry.registrar.RegistryLock.prototype.showModal_ = function(targetElement, d var parentElement = targetElement.parentElement; // attach the modal to the parent element so focus remains correct if the user closes the modal var modalElement = goog.soy.renderAsElement( - registry.soy.registrar.registrylock.confirmModal, {domain: domain, isLock: isLock}); + registry.soy.registrar.registrylock.confirmModal, + {domain: domain, isLock: isLock, isAdmin: this.isAdmin}); parentElement.prepend(modalElement); if (domain == null) { goog.dom.getRequiredElement('domain-lock-input-value').focus(); diff --git a/core/src/main/resources/google/registry/ui/soy/registrar/RegistryLock.soy b/core/src/main/resources/google/registry/ui/soy/registrar/RegistryLock.soy index 0c2f3c7c0..763060ba6 100644 --- a/core/src/main/resources/google/registry/ui/soy/registrar/RegistryLock.soy +++ b/core/src/main/resources/google/registry/ui/soy/registrar/RegistryLock.soy @@ -106,6 +106,7 @@ /** Modal that confirms that the user wishes to lock/unlock a domain. */ {template .confirmModal} {@param isLock: bool} + {@param isAdmin: bool} {@param? domain: string|null}