beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame^] | 1 | <div class="row column"> |
| 2 | <button type="button" ng-class="{'disabled' : roleGroupType === '' }" ng-disabled="roleGroupType === ''" |
| 3 | class="btn btn-tertiary" ng-click="addGroupFn(); $parent.newGroup={}"> |
| 4 | <icon aria-hidden="true" file="icon-plus.svg"></icon> |
| 5 | <span>Add role group</span> |
| 6 | </button> |
| 7 | <button type="button" ng-disabled="roleGroupType === '' || !hasSelectedGroup" class="btn btn-tertiary" |
| 8 | ng-click="removeMultipleRoleGroupsFn() "> |
| 9 | <icon aria-hidden="true" file="icon-trashcan.svg"></icon> |
| 10 | <span>Remove role groups</span> |
| 11 | </button> |
| 12 | </div> |
| 13 | <div class="ldap__table"> |
| 14 | <div class="table__row-header row column" ng-class="{'disabled' : !enabled }"> |
| 15 | <div class="row column"> |
| 16 | <div class="table__cell-select"> |
| 17 | <label class="control-check" aria-label="select or deselect all groups"> |
| 18 | <input type="checkbox" ng-disabled="!enabled || roleGroups.length < 1 " name="events__check" |
| 19 | ng-click="toggleAll()" ng-checked="roleGroupIsSelectedChanged()" ng-model="all" /> |
| 20 | <span class="control__indicator"></span> |
| 21 | </label> |
| 22 | </div> |
| 23 | <div class="table__cell-sort"> |
| 24 | <div class="column small-2 sort_button_wrapper"> |
| 25 | <button class="sort-ascending" ng-click="sortBy('RemoteGroup', false)"></button> |
| 26 | <button class="sort-descending" ng-click="sortBy('RemoteGroup', true)"></button> |
| 27 | </div> |
| 28 | </div> |
| 29 | <div class="table__cell-ldap-group"> |
| 30 | Group name |
| 31 | </div> |
| 32 | <div class="table__cell-sort"> |
| 33 | <div class="column small-2 sort_button_wrapper"> |
| 34 | <button class="sort-ascending" ng-click="sortBy('LocalRole', false)"></button> |
| 35 | <button class="sort-descending" ng-click="sortBy('LocalRole', true)"></button> |
| 36 | </div> |
| 37 | </div> |
| 38 | <div class="table__cell-ldap-role"> |
| 39 | Group privilege |
| 40 | </div> |
| 41 | </div> |
| 42 | </div> |
| 43 | <div class="empty__logs" ng-if="roleGroups.length < 1 || !enabled"> |
| 44 | <p ng-if="roleGroups.length < 1 && roleGroupType === 'ad' || roleGroupType === 'ldap'"> |
| 45 | No role groups have been created yet. |
| 46 | </p> |
| 47 | <p ng-if=" roleGroupType === '' " ng-class="{'disabled' : !enabled }"> |
| 48 | LDAP authentication must be enabled before creating role groups. |
| 49 | </p> |
| 50 | </div> |
| 51 | <div ng-repeat="group in roleGroups | orderBy:sortPropertyName:reverse track by $index "> |
| 52 | <div class="row column table__row-value" ng-if="enabled"> |
| 53 | <div class="table__cell-select select-header"> |
| 54 | <label class="control-check" aria-label="select or deselect group"> |
| 55 | <input type="checkbox" name="events__check" ng-model="group.isSelected" |
| 56 | ng-change="roleGroupIsSelectedChanged(); optionToggled()" /> |
| 57 | <span class="control__indicator"></span> |
| 58 | </label> |
| 59 | </div> |
| 60 | <div class="table__cell-ldap"> |
| 61 | {{ group.RemoteGroup }} |
| 62 | </div> |
| 63 | <div class="table__cell-ldap"> |
| 64 | {{ group.LocalRole }} |
| 65 | </div> |
| 66 | <div class="table__cell-buttons"> |
| 67 | <button class="btn btn-tertiary" type="button" aria-label="edit selected role group" |
| 68 | ng-click="editGroupFn(group.RemoteGroup, group.LocalRole, $index); newGroup.RemoteGroup = group.RemoteGroup; newGroup.LocalRole = group.LocalRole; selectedGroupIndex = $index"> |
| 69 | <icon aria-hidden="true" file="icon-edit.svg"></icon> |
| 70 | </button> |
| 71 | <button class="btn btn-tertiary" type="button" aria-label="delete selected role group" |
| 72 | ng-class="{'disabled' : roleGroups.length < 1}" |
| 73 | ng-click="removeGroupFn($index); newGroup.RemoteGroup = group.RemoteGroup; newGroup.LocalRole = group.LocalRole; selectedGroupIndex = $index"> |
| 74 | <icon aria-hidden="true" file="icon-trashcan.svg"></icon> |
| 75 | </button> |
| 76 | </div> |
| 77 | </div> |
| 78 | </div> |
| 79 | </div> |
| 80 | <section class="modal" aria-hidden="true" role="dialog" ng-class="{'active': addGroup || editGroup}"> |
| 81 | <h3 class="subhead">{{ addGroup ? "Add new role group" : "Edit group privilege" }}</h3> |
| 82 | <div class="modal__content-ldap"> |
| 83 | <div ng-if="addGroup"> |
| 84 | <form name="add__group__form" id="add__group__form" novalidate> |
| 85 | <div class="small-9"> |
| 86 | <label for="group_name">Role group name</label> |
| 87 | <input type="text" name="group_name" id="group_name" ng-model="newGroup.RemoteGroup" required /> |
| 88 | <div ng-messages="add__group__form.group_name.$error" class="form-error" |
| 89 | ng-class="{'visible' : add__group__form.group_name.$touched}"> |
| 90 | <p ng-message="required">Field is required</p> |
| 91 | </div> |
| 92 | </div> |
| 93 | <div class="small-9"> |
| 94 | <label for="group__role">Privilege</label> |
| 95 | <select id="group__role" class="select__group-role" name="group__role" ng-model="newGroup.LocalRole" required> |
| 96 | <option class="courier-bold" ng-value="">Select an option</option> |
| 97 | <option class="courier-bold" ng-repeat="privilege in privileges">{{ |
| 98 | privilege |
| 99 | }}</option> |
| 100 | </select> |
| 101 | <div ng-messages="add__group__form.group__role.$error" class="form-error" |
| 102 | ng-class="{'visible' : add__group__form.group__role.$touched}"> |
| 103 | <p ng-message="required">Field is required</p> |
| 104 | </div> |
| 105 | </div> |
| 106 | </form> |
| 107 | <div class="form-actions"> |
| 108 | <button type="button" class="btn btn-primary" ng-class="{'disabled' : add__group__form.$invalid}" |
| 109 | ng-click="addRoleGroup(); $parent.addGroup=false; $parent.newGroup={}"> |
| 110 | Save |
| 111 | </button> |
| 112 | <button type="button" class="btn btn-secondary" ng-click="$parent.addGroup=false; $parent.newGroup={}"> |
| 113 | Cancel |
| 114 | </button> |
| 115 | </div> |
| 116 | </div> |
| 117 | <div ng-if="editGroup"> |
| 118 | <form name="edit__group__form" id="edit__group__form" novalidate> |
| 119 | <label>Role group name</label> |
| 120 | <div class="small-9 edit-group-name" ng-model="newGroup.RemoteGroup"> |
| 121 | {{ newGroup.RemoteGroup }} |
| 122 | </div> |
| 123 | <div class="small-9"> |
| 124 | <label for="group__role__edit">Privilege</label> |
| 125 | <select id="group__role__edit" name="group__role__edit" ng-model="newGroup.LocalRole" required> |
| 126 | <option class="courier-bold" ng-repeat="privilege in privileges">{{ |
| 127 | privilege |
| 128 | }}</option> |
| 129 | </select> |
| 130 | <div ng-messages="edit__group__form.group__role__edit.$error" class="form-error" |
| 131 | ng-class="{'visible' : edit__group__form.group__role__edit.$touched}"> |
| 132 | <p ng-message="required">Field is required</p> |
| 133 | </div> |
| 134 | </div> |
| 135 | </form> |
| 136 | <div class="form-actions"> |
| 137 | <button type="button" class="btn btn-primary" |
| 138 | ng-click="editRoleGroup();$parent.editGroup=false; $parent.newGroup={}"> |
| 139 | Save |
| 140 | </button> |
| 141 | <button type="button" class="btn btn-secondary" ng-click="$parent.editGroup=false; $parent.newGroup={}"> |
| 142 | Cancel |
| 143 | </button> |
| 144 | </div> |
| 145 | </div> |
| 146 | </div> |
| 147 | </section> |
| 148 | <section class="modal" aria-hidden="true" role="dialog" ng-class="{'active': removeGroup}"> |
| 149 | <h3 class="subhead">Remove role group</h3> |
| 150 | <div class="modal__content-ldap"> |
| 151 | <p>Are you sure you want to remove "{{ newGroup.RemoteGroup }}"?</p> |
| 152 | </div> |
| 153 | <div class="form-actions"> |
| 154 | <button type="button" class="btn btn-primary" ng-click="removeRoleGroup(); $parent.removeGroup=false; newGroup={}"> |
| 155 | Remove |
| 156 | </button> |
| 157 | <button type="button" class="btn btn-secondary" |
| 158 | ng-click="removeGroup=false; $parent.removeGroup=false; newGroup={}"> |
| 159 | Cancel |
| 160 | </button> |
| 161 | </div> |
| 162 | </section> |
| 163 | <section class="modal" aria-hidden="true" role="dialog" ng-class="{'active': removeMultipleGroups}"> |
| 164 | <div class="page-header"> |
| 165 | <h3>Remove role group</h3> |
| 166 | </div> |
| 167 | <div class="modal__content-ldap"> |
| 168 | <p> |
| 169 | Are you sure you want to remove |
| 170 | <span ng-repeat="groups in roleGroups | filter:{isSelected:true}">{{ $last && !$first ? " and " : $first ? "" : ", " |
| 171 | }}{{ "'" + groups.RemoteGroup + "'" }}?</span> |
| 172 | </p> |
| 173 | </div> |
| 174 | <div class="form-actions"> |
| 175 | <button type="button" class="btn btn-primary" |
| 176 | ng-click="removeMultipleRoleGroups();$parent.removeMultipleGroups=false; $parent.newGroup={}"> |
| 177 | Remove |
| 178 | </button> |
| 179 | <button type="button" class="btn btn-secondary" ng-click="removeMultipleGroups = false"> |
| 180 | Cancel |
| 181 | </button> |
| 182 | </div> |
| 183 | </section> |
| 184 | <div class="modal-overlay" tabindex="-1" |
| 185 | ng-class="{'active': addGroup || editGroup || removeGroup || removeMultipleGroups}"></div> |