Add link to old UI to edit project access If a user is an admin, show them the GWT link. If not an admin, don't display. Bug: Issue 7309 Change-Id: I63ce2e0ab22c68ebc6dbf0744fab06e9299329f3
diff --git a/polygerrit-ui/app/elements/admin/gr-project-access/gr-project-access.js b/polygerrit-ui/app/elements/admin/gr-project-access/gr-project-access.js index 8e1b1f5..470cf70 100644 --- a/polygerrit-ui/app/elements/admin/gr-project-access/gr-project-access.js +++ b/polygerrit-ui/app/elements/admin/gr-project-access/gr-project-access.js
@@ -22,7 +22,13 @@ type: String, observer: '_projectChanged', }, + // The current path + path: String, + _isAdmin: { + type: Boolean, + value: false, + }, _capabilities: Object, _groups: Object, /** @type {?} */ @@ -67,6 +73,10 @@ return res.labels; })); + promises.push(this.$.restAPI.getIsAdmin().then(isAdmin => { + this._isAdmin = isAdmin; + })); + return Promise.all(promises).then(value => { this._capabilities = value[1]; this._labels = value[2]; @@ -79,6 +89,10 @@ }); }, + _computeAdminClass(isAdmin) { + return isAdmin ? 'admin' : ''; + }, + _computeParentHref(projectName) { return this.getBaseUrl() + `/admin/projects/${this.encodeURL(projectName, true)},access`;