Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 1 | <!-- Add & Remove Role Groups Buttons --> |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 2 | <div class="row column"> |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 3 | <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 | > |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 10 | <icon aria-hidden="true" file="icon-plus.svg"></icon> |
| 11 | <span>Add role group</span> |
| 12 | </button> |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 13 | <button |
| 14 | type="button" |
| 15 | ng-disabled="roleGroupType === '' || !hasSelectedGroup" |
| 16 | class="btn btn-tertiary" |
| 17 | ng-click="removeMultipleRoleGroupsFn() " |
| 18 | > |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 19 | <icon aria-hidden="true" file="icon-trashcan.svg"></icon> |
| 20 | <span>Remove role groups</span> |
| 21 | </button> |
| 22 | </div> |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 23 | <!-- LDAP Role Groups Table --> |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 24 | <div class="ldap__table"> |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 25 | <!-- LDAP Role Groups Table Header --> |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 26 | <div class="table__row-header row column" ng-class="{'disabled' : !enabled }"> |
| 27 | <div class="row column"> |
| 28 | <div class="table__cell-select"> |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 29 | <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 | /> |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 41 | <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 Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 46 | <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> |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 58 | </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 Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 65 | <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> |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 77 | </div> |
| 78 | </div> |
| 79 | <div class="table__cell-ldap-role"> |
| 80 | Group privilege |
| 81 | </div> |
| 82 | </div> |
| 83 | </div> |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 84 | <!-- LDAP Disabled Role Groups Table Row --> |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 85 | <div class="empty__logs" ng-if="roleGroups.length < 1 || !enabled"> |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 86 | <p |
| 87 | ng-if="roleGroups.length < 1 && roleGroupType === 'ad' || roleGroupType === 'ldap'" |
| 88 | > |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 89 | 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 Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 95 | <div |
| 96 | ng-repeat="group in roleGroups | orderBy:sortPropertyName:reverse track by $index " |
| 97 | > |
| 98 | <!-- Enabled LDAP Role Groups Table Rows --> |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 99 | <div class="row column table__row-value" ng-if="enabled"> |
| 100 | <div class="table__cell-select select-header"> |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 101 | <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 | /> |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 111 | <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 Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 121 | <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 | > |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 127 | <icon aria-hidden="true" file="icon-edit.svg"></icon> |
| 128 | </button> |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 129 | <button |
| 130 | class="btn btn-tertiary" |
| 131 | type="button" |
| 132 | aria-label="delete group {{ group.RemoteGroup }}" |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 133 | ng-class="{'disabled' : roleGroups.length < 1}" |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 134 | ng-click="removeGroupFn($index); newGroup.RemoteGroup = group.RemoteGroup; newGroup.LocalRole = group.LocalRole; selectedGroupIndex = $index" |
| 135 | > |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 136 | <icon aria-hidden="true" file="icon-trashcan.svg"></icon> |
| 137 | </button> |
| 138 | </div> |
| 139 | </div> |
| 140 | </div> |
| 141 | </div> |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 142 | <!-- 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> |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 152 | <div class="modal__content-ldap"> |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 153 | <!-- Add Role Group Modal Content --> |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 154 | <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 Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 158 | <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 | > |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 170 | <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 Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 175 | <select |
| 176 | id="group__role" |
| 177 | class="select__group-role" |
| 178 | name="group__role" |
| 179 | ng-model="newGroup.LocalRole" |
| 180 | required |
| 181 | > |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 182 | <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 Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 187 | <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 | > |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 192 | <p ng-message="required">Field is required</p> |
| 193 | </div> |
| 194 | </div> |
| 195 | </form> |
| 196 | <div class="form-actions"> |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 197 | <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 | > |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 203 | Save |
| 204 | </button> |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 205 | <button |
| 206 | type="button" |
| 207 | class="btn btn-secondary" |
| 208 | ng-click="$parent.addGroup=false; $parent.newGroup={}" |
| 209 | > |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 210 | Cancel |
| 211 | </button> |
| 212 | </div> |
| 213 | </div> |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 214 | <!-- Edit Role Group Modal Content --> |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 215 | <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 Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 223 | <select |
| 224 | id="group__role__edit" |
| 225 | name="group__role__edit" |
| 226 | ng-model="newGroup.LocalRole" |
| 227 | required |
| 228 | > |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 229 | <option class="courier-bold" ng-repeat="privilege in privileges">{{ |
| 230 | privilege |
| 231 | }}</option> |
| 232 | </select> |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 233 | <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 | > |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 238 | <p ng-message="required">Field is required</p> |
| 239 | </div> |
| 240 | </div> |
| 241 | </form> |
| 242 | <div class="form-actions"> |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 243 | <button |
| 244 | type="button" |
| 245 | class="btn btn-primary" |
| 246 | ng-click="editRoleGroup();$parent.editGroup=false; $parent.newGroup={}" |
| 247 | > |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 248 | Save |
| 249 | </button> |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 250 | <button |
| 251 | type="button" |
| 252 | class="btn btn-secondary" |
| 253 | ng-click="$parent.editGroup=false; $parent.newGroup={}" |
| 254 | > |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 255 | Cancel |
| 256 | </button> |
| 257 | </div> |
| 258 | </div> |
| 259 | </div> |
| 260 | </section> |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 261 | <!-- 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> |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 269 | <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 Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 273 | <button |
| 274 | type="button" |
| 275 | class="btn btn-primary" |
| 276 | ng-click="removeRoleGroup(); $parent.removeGroup=false; newGroup={}" |
| 277 | > |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 278 | Remove |
| 279 | </button> |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 280 | <button |
| 281 | type="button" |
| 282 | class="btn btn-secondary" |
| 283 | ng-click="removeGroup=false; $parent.removeGroup=false; newGroup={}" |
| 284 | > |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 285 | Cancel |
| 286 | </button> |
| 287 | </div> |
| 288 | </section> |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 289 | <!-- Remove Multiple Role Groups Modal --> |
| 290 | <section |
| 291 | class="modal" |
| 292 | role="dialog" |
| 293 | ng-class="{'active': removeMultipleGroups}" |
| 294 | > |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 295 | <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 Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 301 | <span ng-repeat="groups in roleGroups | filter:{isSelected:true}" |
| 302 | >{{ $last && !$first ? " and " : $first ? "" : ", " |
| 303 | }}{{ "'" + groups.RemoteGroup + "'" }}?</span |
| 304 | > |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 305 | </p> |
| 306 | </div> |
| 307 | <div class="form-actions"> |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 308 | <button |
| 309 | type="button" |
| 310 | class="btn btn-primary" |
| 311 | ng-click="removeMultipleRoleGroups();$parent.removeMultipleGroups=false; $parent.newGroup={}" |
| 312 | > |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 313 | Remove |
| 314 | </button> |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 315 | <button |
| 316 | type="button" |
| 317 | class="btn btn-secondary" |
| 318 | ng-click="removeMultipleGroups = false" |
| 319 | > |
beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame] | 320 | Cancel |
| 321 | </button> |
| 322 | </div> |
| 323 | </section> |
Dixsie Wolmers | 28e9ed8 | 2019-07-11 13:46:08 -0500 | [diff] [blame^] | 324 | <div |
| 325 | class="modal-overlay" |
| 326 | tabindex="-1" |
| 327 | ng-class="{'active': addGroup || editGroup || removeGroup || removeMultipleGroups}" |
| 328 | ></div> |