diff --git a/polygerrit-ui/app/elements/change/gr-related-changes-list/gr-related-changes-list.js b/polygerrit-ui/app/elements/change/gr-related-changes-list/gr-related-changes-list.js
index a11347717a..6ec04da360 100644
--- a/polygerrit-ui/app/elements/change/gr-related-changes-list/gr-related-changes-list.js
+++ b/polygerrit-ui/app/elements/change/gr-related-changes-list/gr-related-changes-list.js
@@ -121,7 +121,7 @@
if (relatedChange.change_id === currentChange.change_id) {
classes.push('thisChange');
}
- return classes.join(' ');;
+ return classes.join(' ');
},
_computeLinkClass: function(change) {
diff --git a/polygerrit-ui/app/elements/settings/gr-http-password/gr-http-password.html b/polygerrit-ui/app/elements/settings/gr-http-password/gr-http-password.html
new file mode 100644
index 0000000000..e58f1f2ed6
--- /dev/null
+++ b/polygerrit-ui/app/elements/settings/gr-http-password/gr-http-password.html
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ Username
+ [[_username]]
+
+
+ Password
+
+
+ Click to view
+
+ [[_password]]
+
+ (None)
+
+ Generate New Password
+ Clear Password
+
+
+
+
+
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
new file mode 100644
index 0000000000..9248632f13
--- /dev/null
+++ b/polygerrit-ui/app/elements/settings/gr-http-password/gr-http-password.js
@@ -0,0 +1,81 @@
+// Copyright (C) 2016 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// 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';
+
+ Polymer({
+ is: 'gr-http-password',
+
+ /**
+ * Fired when getting the password fails with non-404.
+ *
+ * @event network-error
+ */
+
+ properties: {
+ _serverConfig: Object,
+ _username: String,
+ _password: String,
+ _passwordVisible: {
+ type: Boolean,
+ value: false,
+ },
+ _hasPassword: Boolean,
+ },
+
+ loadData: function() {
+ var promises = [];
+
+ promises.push(this.$.restAPI.getAccount().then(function(account) {
+ this._username = account.username;
+ }.bind(this)));
+
+ promises.push(this.$.restAPI
+ .getAccountHttpPassword(this._handleGetPasswordError.bind(this))
+ .then(function(pass) {
+ this._password = pass;
+ this._hasPassword = !!pass;
+ }.bind(this)));
+
+ return Promise.all(promises);
+ },
+
+ _handleGetPasswordError: function(response) {
+ if (response.status === 404) {
+ this._hasPassword = false;
+ } else {
+ this.fire('network-error', {response: response});
+ }
+ },
+
+ _handleViewPasswordTap: function() {
+ this._passwordVisible = true;
+ },
+
+ _handleGenerateTap: function() {
+ this.$.restAPI.generateAccountHttpPassword().then(function(newPassword) {
+ this._hasPassword = true;
+ this._passwordVisible = true;
+ this._password = newPassword;
+ }.bind(this));
+ },
+
+ _handleClearTap: function() {
+ this.$.restAPI.deleteAccountHttpPassword().then(function() {
+ this._password = '';
+ this._hasPassword = false;
+ }.bind(this));
+ },
+ });
+})();
diff --git a/polygerrit-ui/app/elements/settings/gr-http-password/gr-http-password_test.html b/polygerrit-ui/app/elements/settings/gr-http-password/gr-http-password_test.html
new file mode 100644
index 0000000000..44bffe5b4e
--- /dev/null
+++ b/polygerrit-ui/app/elements/settings/gr-http-password/gr-http-password_test.html
@@ -0,0 +1,157 @@
+
+
+
+
+
gr-settings-view
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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 e5f8bee4ad..9e5a63b0d9 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
@@ -19,6 +19,7 @@ limitations under the License.
+
@@ -256,6 +257,10 @@ limitations under the License.
disabled="[[!_computeAddEmailButtonEnabled(_newEmail, _addingEmail)]]"
on-tap="_handleAddEmailButton">Send Verification
+ HTTP Credentials
+
Groups