blob: e250772e64e84925e4f5cdb1976ee4ecb0d9820d [file] [log] [blame]
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -05001<!-- Add & Remove Role Groups Buttons -->
beccabroek5e258e42018-11-07 12:22:31 -06002<div class="row column">
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -05003 <button
4 type="button"
5 ng-class="{'disabled' : roleGroupType === '' }"
6 ng-disabled="roleGroupType === ''"
7 class="btn btn-tertiary"
8 ng-click="addGroupFn(); $parent.newGroup={}"
9 >
beccabroek5e258e42018-11-07 12:22:31 -060010 <icon aria-hidden="true" file="icon-plus.svg"></icon>
11 <span>Add role group</span>
12 </button>
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -050013 <button
14 type="button"
15 ng-disabled="roleGroupType === '' || !hasSelectedGroup"
16 class="btn btn-tertiary"
17 ng-click="removeMultipleRoleGroupsFn() "
18 >
beccabroek5e258e42018-11-07 12:22:31 -060019 <icon aria-hidden="true" file="icon-trashcan.svg"></icon>
20 <span>Remove role groups</span>
21 </button>
22</div>
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -050023<!-- LDAP Role Groups Table -->
beccabroek5e258e42018-11-07 12:22:31 -060024<div class="ldap__table">
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -050025 <!-- LDAP Role Groups Table Header -->
beccabroek5e258e42018-11-07 12:22:31 -060026 <div class="table__row-header row column" ng-class="{'disabled' : !enabled }">
27 <div class="row column">
28 <div class="table__cell-select">
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -050029 <label class="control-check">
30 <span class="screen-reader-offscreen" id="select-all-groups"
31 >select or deselect all groups</span
32 >
33 <input
34 type="checkbox"
35 aria-labelledby="select-all-groups"
36 ng-disabled="!enabled || roleGroups.length < 1 "
37 ng-click="toggleAll()"
38 ng-checked="roleGroupIsSelectedChanged()"
39 ng-model="all"
40 />
beccabroek5e258e42018-11-07 12:22:31 -060041 <span class="control__indicator"></span>
42 </label>
43 </div>
44 <div class="table__cell-sort">
45 <div class="column small-2 sort_button_wrapper">
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -050046 <button
47 class="sort-ascending"
48 aria-label="sort group names in ascending order"
49 ng-click="sortBy('RemoteGroup', false)"
50 ng-disabled="!enabled || roleGroups.length < 1 "
51 ></button>
52 <button
53 class="sort-descending"
54 aria-label="sort group names in descending order"
55 ng-click="sortBy('RemoteGroup', true)"
56 ng-disabled="!enabled || roleGroups.length < 1 "
57 ></button>
beccabroek5e258e42018-11-07 12:22:31 -060058 </div>
59 </div>
60 <div class="table__cell-ldap-group">
61 Group name
62 </div>
63 <div class="table__cell-sort">
64 <div class="column small-2 sort_button_wrapper">
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -050065 <button
66 class="sort-ascending"
67 aria-label="sort group privileges in ascending order"
68 ng-click="sortBy('LocalRole', false)"
69 ng-disabled="!enabled || roleGroups.length < 1 "
70 ></button>
71 <button
72 class="sort-descending"
73 aria-label="sort group privileges in descending order"
74 ng-click="sortBy('LocalRole', true)"
75 ng-disabled="!enabled || roleGroups.length < 1 "
76 ></button>
beccabroek5e258e42018-11-07 12:22:31 -060077 </div>
78 </div>
79 <div class="table__cell-ldap-role">
80 Group privilege
81 </div>
82 </div>
83 </div>
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -050084 <!-- LDAP Disabled Role Groups Table Row -->
beccabroek5e258e42018-11-07 12:22:31 -060085 <div class="empty__logs" ng-if="roleGroups.length < 1 || !enabled">
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -050086 <p
87 ng-if="roleGroups.length < 1 && roleGroupType === 'ad' || roleGroupType === 'ldap'"
88 >
beccabroek5e258e42018-11-07 12:22:31 -060089 No role groups have been created yet.
90 </p>
91 <p ng-if=" roleGroupType === '' " ng-class="{'disabled' : !enabled }">
92 LDAP authentication must be enabled before creating role groups.
93 </p>
94 </div>
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -050095 <div
96 ng-repeat="group in roleGroups | orderBy:sortPropertyName:reverse track by $index "
97 >
98 <!-- Enabled LDAP Role Groups Table Rows -->
beccabroek5e258e42018-11-07 12:22:31 -060099 <div class="row column table__row-value" ng-if="enabled">
100 <div class="table__cell-select select-header">
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500101 <label class="control-check">
102 <span class="screen-reader-offscreen" id="select-group"
103 >select or deselect {{ group.RemoteGroup }}</span
104 >
105 <input
106 type="checkbox"
107 aria-labelledby="select-group"
108 ng-model="group.isSelected"
109 ng-change="roleGroupIsSelectedChanged(); optionToggled()"
110 />
beccabroek5e258e42018-11-07 12:22:31 -0600111 <span class="control__indicator"></span>
112 </label>
113 </div>
114 <div class="table__cell-ldap">
115 {{ group.RemoteGroup }}
116 </div>
117 <div class="table__cell-ldap">
118 {{ group.LocalRole }}
119 </div>
120 <div class="table__cell-buttons">
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500121 <button
122 class="btn btn-tertiary"
123 type="button"
124 aria-label="edit group {{ group.RemoteGroup }}"
125 ng-click="editGroupFn(group.RemoteGroup, group.LocalRole, $index); newGroup.RemoteGroup = group.RemoteGroup; newGroup.LocalRole = group.LocalRole; selectedGroupIndex = $index"
126 >
beccabroek5e258e42018-11-07 12:22:31 -0600127 <icon aria-hidden="true" file="icon-edit.svg"></icon>
128 </button>
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500129 <button
130 class="btn btn-tertiary"
131 type="button"
132 aria-label="delete group {{ group.RemoteGroup }}"
beccabroek5e258e42018-11-07 12:22:31 -0600133 ng-class="{'disabled' : roleGroups.length < 1}"
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500134 ng-click="removeGroupFn($index); newGroup.RemoteGroup = group.RemoteGroup; newGroup.LocalRole = group.LocalRole; selectedGroupIndex = $index"
135 >
beccabroek5e258e42018-11-07 12:22:31 -0600136 <icon aria-hidden="true" file="icon-trashcan.svg"></icon>
137 </button>
138 </div>
139 </div>
140 </div>
141</div>
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500142<!-- Add/Edit Role Group Modal -->
143<section
144 class="modal"
145 aria-labelledby="add-or-edit-group"
146 role="dialog"
147 ng-class="{'active': addGroup || editGroup}"
148>
149 <h3 id="add-or-edit-group" class="subhead">
150 {{ addGroup ? "Add new role group" : "Edit group privilege" }}
151 </h3>
beccabroek5e258e42018-11-07 12:22:31 -0600152 <div class="modal__content-ldap">
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500153 <!-- Add Role Group Modal Content -->
beccabroek5e258e42018-11-07 12:22:31 -0600154 <div ng-if="addGroup">
155 <form name="add__group__form" id="add__group__form" novalidate>
156 <div class="small-9">
157 <label for="group_name">Role group name</label>
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500158 <input
159 type="text"
160 name="group_name"
161 id="group_name"
162 ng-model="newGroup.RemoteGroup"
163 required
164 />
165 <div
166 ng-messages="add__group__form.group_name.$error"
167 class="form-error"
168 ng-class="{'visible' : add__group__form.group_name.$touched}"
169 >
beccabroek5e258e42018-11-07 12:22:31 -0600170 <p ng-message="required">Field is required</p>
171 </div>
172 </div>
173 <div class="small-9">
174 <label for="group__role">Privilege</label>
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500175 <select
176 id="group__role"
177 class="select__group-role"
178 name="group__role"
179 ng-model="newGroup.LocalRole"
180 required
181 >
beccabroek5e258e42018-11-07 12:22:31 -0600182 <option class="courier-bold" ng-value="">Select an option</option>
183 <option class="courier-bold" ng-repeat="privilege in privileges">{{
184 privilege
185 }}</option>
186 </select>
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500187 <div
188 ng-messages="add__group__form.group__role.$error"
189 class="form-error"
190 ng-class="{'visible' : add__group__form.group__role.$touched}"
191 >
beccabroek5e258e42018-11-07 12:22:31 -0600192 <p ng-message="required">Field is required</p>
193 </div>
194 </div>
195 </form>
196 <div class="form-actions">
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500197 <button
198 type="button"
199 class="btn btn-primary"
200 ng-class="{'disabled' : add__group__form.$invalid}"
201 ng-click="addRoleGroup(); $parent.addGroup=false; $parent.newGroup={}"
202 >
beccabroek5e258e42018-11-07 12:22:31 -0600203 Save
204 </button>
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500205 <button
206 type="button"
207 class="btn btn-secondary"
208 ng-click="$parent.addGroup=false; $parent.newGroup={}"
209 >
beccabroek5e258e42018-11-07 12:22:31 -0600210 Cancel
211 </button>
212 </div>
213 </div>
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500214 <!-- Edit Role Group Modal Content -->
beccabroek5e258e42018-11-07 12:22:31 -0600215 <div ng-if="editGroup">
216 <form name="edit__group__form" id="edit__group__form" novalidate>
217 <label>Role group name</label>
218 <div class="small-9 edit-group-name" ng-model="newGroup.RemoteGroup">
219 {{ newGroup.RemoteGroup }}
220 </div>
221 <div class="small-9">
222 <label for="group__role__edit">Privilege</label>
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500223 <select
224 id="group__role__edit"
225 name="group__role__edit"
226 ng-model="newGroup.LocalRole"
227 required
228 >
beccabroek5e258e42018-11-07 12:22:31 -0600229 <option class="courier-bold" ng-repeat="privilege in privileges">{{
230 privilege
231 }}</option>
232 </select>
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500233 <div
234 ng-messages="edit__group__form.group__role__edit.$error"
235 class="form-error"
236 ng-class="{'visible' : edit__group__form.group__role__edit.$touched}"
237 >
beccabroek5e258e42018-11-07 12:22:31 -0600238 <p ng-message="required">Field is required</p>
239 </div>
240 </div>
241 </form>
242 <div class="form-actions">
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500243 <button
244 type="button"
245 class="btn btn-primary"
246 ng-click="editRoleGroup();$parent.editGroup=false; $parent.newGroup={}"
247 >
beccabroek5e258e42018-11-07 12:22:31 -0600248 Save
249 </button>
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500250 <button
251 type="button"
252 class="btn btn-secondary"
253 ng-click="$parent.editGroup=false; $parent.newGroup={}"
254 >
beccabroek5e258e42018-11-07 12:22:31 -0600255 Cancel
256 </button>
257 </div>
258 </div>
259 </div>
260</section>
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500261<!-- Remove Role Groups Modal -->
262<section
263 class="modal"
264 role="dialog"
265 aria-labelledby="remove-role-group"
266 ng-class="{'active': removeGroup}"
267>
268 <h3 id="remove-role-group" class="subhead">Remove role group</h3>
beccabroek5e258e42018-11-07 12:22:31 -0600269 <div class="modal__content-ldap">
270 <p>Are you sure you want to remove "{{ newGroup.RemoteGroup }}"?</p>
271 </div>
272 <div class="form-actions">
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500273 <button
274 type="button"
275 class="btn btn-primary"
276 ng-click="removeRoleGroup(); $parent.removeGroup=false; newGroup={}"
277 >
beccabroek5e258e42018-11-07 12:22:31 -0600278 Remove
279 </button>
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500280 <button
281 type="button"
282 class="btn btn-secondary"
283 ng-click="removeGroup=false; $parent.removeGroup=false; newGroup={}"
284 >
beccabroek5e258e42018-11-07 12:22:31 -0600285 Cancel
286 </button>
287 </div>
288</section>
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500289<!-- Remove Multiple Role Groups Modal -->
290<section
291 class="modal"
292 role="dialog"
293 ng-class="{'active': removeMultipleGroups}"
294>
beccabroek5e258e42018-11-07 12:22:31 -0600295 <div class="page-header">
296 <h3>Remove role group</h3>
297 </div>
298 <div class="modal__content-ldap">
299 <p>
300 Are you sure you want to remove
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500301 <span ng-repeat="groups in roleGroups | filter:{isSelected:true}"
302 >{{ $last && !$first ? " and " : $first ? "" : ", "
303 }}{{ "'" + groups.RemoteGroup + "'" }}?</span
304 >
beccabroek5e258e42018-11-07 12:22:31 -0600305 </p>
306 </div>
307 <div class="form-actions">
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500308 <button
309 type="button"
310 class="btn btn-primary"
311 ng-click="removeMultipleRoleGroups();$parent.removeMultipleGroups=false; $parent.newGroup={}"
312 >
beccabroek5e258e42018-11-07 12:22:31 -0600313 Remove
314 </button>
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500315 <button
316 type="button"
317 class="btn btn-secondary"
318 ng-click="removeMultipleGroups = false"
319 >
beccabroek5e258e42018-11-07 12:22:31 -0600320 Cancel
321 </button>
322 </div>
323</section>
Dixsie Wolmers28e9ed82019-07-11 13:46:08 -0500324<div
325 class="modal-overlay"
326 tabindex="-1"
327 ng-class="{'active': addGroup || editGroup || removeGroup || removeMultipleGroups}"
328></div>