summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaladox none <thomasmulhall410@yahoo.com>2019-03-11 19:04:21 +0000
committerDavid Pursehouse <dpursehouse@collab.net>2019-03-12 04:45:34 +0000
commitb7b5cf0067ffa6a4c54c7791e4ee67b5146f9214 (patch)
treee70f78e9beef895a9b86f8f21988a779869c98cc
parent1ad849274e5aba54486d73700f32470b505c11a8 (diff)
Fix setting groups visibility
Change I60c50a6c4 introduced a broken way of setting the visibility. This commit fixes it as setting false in a string equals true in javascript. The check was also unneeded as it will be false by default (if not set). Bug: Issue 10587 Change-Id: Ife40780f162d4eb5e3f75f4a6ed65f01aa7dc0e4
-rw-r--r--polygerrit-ui/app/elements/admin/gr-group/gr-group.js11
1 files changed, 4 insertions, 7 deletions
diff --git a/polygerrit-ui/app/elements/admin/gr-group/gr-group.js b/polygerrit-ui/app/elements/admin/gr-group/gr-group.js
index c66d86057a..e2ecfbac35 100644
--- a/polygerrit-ui/app/elements/admin/gr-group/gr-group.js
+++ b/polygerrit-ui/app/elements/admin/gr-group/gr-group.js
@@ -180,13 +180,10 @@
},
_handleSaveOptions() {
- let options;
- // The value is in string so we have to convert it to a boolean.
- if (this._groupConfig.options.visible_to_all) {
- options = {visible_to_all: true};
- } else if (!this._groupConfig.options.visible_to_all) {
- options = {visible_to_all: false};
- }
+ const visible = this._groupConfig.options.visible_to_all;
+
+ const options = {visible_to_all: visible};
+
return this.$.restAPI.saveGroupOptions(this.groupId,
options).then(config => {
this._options = false;