Use dom-if instead of css when hiding gr-http-password
This is to prevent users from using css to reshow the
gr-http-password screen.
Change-Id: I42ca3b5285064b3f9475563927521396b928b7b8
diff --git a/polygerrit-ui/app/elements/settings/gr-http-password/gr-http-password.js b/polygerrit-ui/app/elements/settings/gr-http-password/gr-http-password.js
index 3dc92d1..abb5cc0 100644
--- a/polygerrit-ui/app/elements/settings/gr-http-password/gr-http-password.js
+++ b/polygerrit-ui/app/elements/settings/gr-http-password/gr-http-password.js
@@ -11,6 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
+
(function() {
'use strict';
@@ -23,6 +24,10 @@
_passwordUrl: String,
},
+ attached() {
+ this.loadData();
+ },
+
loadData() {
const promises = [];
diff --git a/polygerrit-ui/app/elements/settings/gr-settings-view/gr-settings-view.html b/polygerrit-ui/app/elements/settings/gr-settings-view/gr-settings-view.html
index aaf1006..20fe151 100644
--- a/polygerrit-ui/app/elements/settings/gr-settings-view/gr-settings-view.html
+++ b/polygerrit-ui/app/elements/settings/gr-settings-view/gr-settings-view.html
@@ -398,12 +398,14 @@
disabled="[[!_computeAddEmailButtonEnabled(_newEmail, _addingEmail)]]"
on-tap="_handleAddEmailButton">Send verification</gr-button>
</fieldset>
- <div hidden$="[[!_showHttpAuth(_serverConfig)]]">
- <h2 id="HTTPCredentials">HTTP Credentials</h2>
- <fieldset>
- <gr-http-password id="httpPass"></gr-http-password>
- </fieldset>
- </div>
+ <template is="dom-if" if="[[_showHttpAuth(_serverConfig)]]">
+ <div>
+ <h2 id="HTTPCredentials">HTTP Credentials</h2>
+ <fieldset>
+ <gr-http-password id="httpPass"></gr-http-password>
+ </fieldset>
+ </div>
+ </template>
<div hidden$="[[!_serverConfig.sshd]]">
<h2
id="SSHKeys"
diff --git a/polygerrit-ui/app/elements/settings/gr-settings-view/gr-settings-view.js b/polygerrit-ui/app/elements/settings/gr-settings-view/gr-settings-view.js
index d63798b..5bb4061 100644
--- a/polygerrit-ui/app/elements/settings/gr-settings-view/gr-settings-view.js
+++ b/polygerrit-ui/app/elements/settings/gr-settings-view/gr-settings-view.js
@@ -150,7 +150,6 @@
this.$.accountInfo.loadData(),
this.$.watchedProjectsEditor.loadData(),
this.$.groupList.loadData(),
- this.$.httpPass.loadData(),
];
promises.push(this.$.restAPI.getPreferences().then(prefs => {