Show group memberships in the PolyGerrit settings screen

Introduces gr-group-list for the user-group display, which is added to
the gr-settings-view. Also refactors some table styles.

Bug: Issue 3911
Change-Id: I41748e16a98f437c6931caa1e43b69f01d801ea5
This commit is contained in:
Wyatt Allen
2016-06-16 14:53:01 -07:00
parent 767b76015b
commit 6405650742
12 changed files with 365 additions and 172 deletions

View File

@@ -17,14 +17,11 @@ limitations under the License.
<link rel="import" href="../../shared/gr-autocomplete/gr-autocomplete.html">
<link rel="import" href="../../shared/gr-button/gr-button.html">
<link rel="import" href="../../shared/gr-rest-api-interface/gr-rest-api-interface.html">
<link rel="import" href="../../../styles/gr-settings-styles.html">
<dom-module id="gr-watched-projects-editor">
<template>
<style>
th {
color: #666;
text-align: left;
}
th.projectHeader {
width: 11em;
}
@@ -35,9 +32,6 @@ limitations under the License.
text-align: center;
padding: 0 0.4em;
}
tbody tr:nth-child(even) {
background-color: #f4f4f4;
}
td.notifControl {
cursor: pointer;
text-align: center;
@@ -60,74 +54,77 @@ limitations under the License.
width: 26em;
}
</style>
<table>
<thead>
<tr>
<th class="projectHeader">Project</th>
<template is="dom-repeat" items="[[_getTypes()]]">
<th class="notifType">[[item.name]]</th>
</template>
<th></th>
</tr>
</thead>
<tbody>
<template
is="dom-repeat"
items="[[_projects]]"
as="project"
index-as="projectIndex">
<style include="gr-settings-styles"></style>
<div class="gr-settings-styles">
<table>
<thead>
<tr>
<td>
[[project.project]]
<template is="dom-if" if="[[project.filter]]">
<div class="projectFilter">[[project.filter]]</div>
</template>
</td>
<template
is="dom-repeat"
items="[[_getTypes()]]"
as="type">
<td class="notifControl" on-tap="_handleNotifCellTap">
<input
type="checkbox"
data-index$="[[projectIndex]]"
data-key$="[[type.key]]"
on-change="_handleCheckboxChange"
checked$="[[_computeCheckboxChecked(project, type.key)]]">
</td>
<th class="projectHeader">Project</th>
<template is="dom-repeat" items="[[_getTypes()]]">
<th class="notifType">[[item.name]]</th>
</template>
<td class="delete-column">
<gr-button
data-index$="[[projectIndex]]"
on-tap="_handleRemoveProject">Delete</gr-button>
</td>
<th></th>
</tr>
</template>
</tbody>
<tfoot>
<tr>
<th>
<gr-autocomplete
id="newProject"
class="newProjectInput"
is="iron-input"
query="[[_query]]"
threshold="3"
placeholder="Project"></gr-autocomplete>
</th>
<th colspan$="[[_getTypeCount()]]">
<input
id="newFilter"
class="newFilterInput"
is="iron-input"
placeholder="branch:name, or other search expression">
</th>
<th>
<gr-button on-tap="_handleAddProject">Add</gr-button>
</th>
</tr>
</tfoot>
</table>
</thead>
<tbody>
<template
is="dom-repeat"
items="[[_projects]]"
as="project"
index-as="projectIndex">
<tr>
<td>
[[project.project]]
<template is="dom-if" if="[[project.filter]]">
<div class="projectFilter">[[project.filter]]</div>
</template>
</td>
<template
is="dom-repeat"
items="[[_getTypes()]]"
as="type">
<td class="notifControl" on-tap="_handleNotifCellTap">
<input
type="checkbox"
data-index$="[[projectIndex]]"
data-key$="[[type.key]]"
on-change="_handleCheckboxChange"
checked$="[[_computeCheckboxChecked(project, type.key)]]">
</td>
</template>
<td class="delete-column">
<gr-button
data-index$="[[projectIndex]]"
on-tap="_handleRemoveProject">Delete</gr-button>
</td>
</tr>
</template>
</tbody>
<tfoot>
<tr>
<th>
<gr-autocomplete
id="newProject"
class="newProjectInput"
is="iron-input"
query="[[_query]]"
threshold="3"
placeholder="Project"></gr-autocomplete>
</th>
<th colspan$="[[_getTypeCount()]]">
<input
id="newFilter"
class="newFilterInput"
is="iron-input"
placeholder="branch:name, or other search expression">
</th>
<th>
<gr-button on-tap="_handleAddProject">Add</gr-button>
</th>
</tr>
</tfoot>
</table>
</div>
<gr-rest-api-interface id="restAPI"></gr-rest-api-interface>
</template>
<script src="gr-watched-projects-editor.js"></script>