mirror of https://github.com/apache/archiva.git
fix NPE when role doesn't have any users affected
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1227644 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
dbc43a4e3c
commit
8f1ef26ead
|
@ -24,7 +24,7 @@ $(function() {
|
|||
this.assignable = ko.observable(assignable);
|
||||
this.childRoleNames = ko.observableArray(childRoleNames);//read only
|
||||
this.parentRoleNames = ko.observableArray(parentRoleNames);//read only
|
||||
this.users = ko.observableArray(users);
|
||||
this.users = ko.observableArray(users?users:new Array());
|
||||
this.parentsRolesUsers = ko.observableArray(parentsRolesUsers);//read only
|
||||
this.permissions = ko.observableArray(permissions);//read only
|
||||
// when editing a role other users not assign to this role are populated
|
||||
|
|
|
@ -129,12 +129,9 @@
|
|||
{{else}}
|
||||
${$.i18n.prop('role.edit.no.user.defined')}
|
||||
{{/if}}
|
||||
|
||||
<input class="btn" type="button" id="role-list-users-update-mode" data-bind="click: updateMode" value="${$.i18n.prop('role.update.mode')}"/>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="role-edit-users" class="clearfix ar-multiselect" style="display:none">
|
||||
<div id="role-edit-users" class="clearfix ar-multiselect">
|
||||
|
||||
<div class="ar-multiselect-column ar-multiselect-left">
|
||||
<select data-bind="options: otherUsers ,optionsText: 'username',selectedOptions:selectedOtherUsers" multiple="true" id="role-edit-available-users"></select>
|
||||
|
@ -149,8 +146,6 @@
|
|||
<select data-bind="options: users ,optionsText: 'username',selectedOptions:selectedUsers" multiple="true" id="role-edit-affected-users"></select>
|
||||
</div>
|
||||
<button class="btn" id="role-edit-users-save" data-bind="click: saveUsers">${$.i18n.prop('save')}</button>
|
||||
<br/>
|
||||
<input class="btn" id="role-edit-users-view-mode" type="button" data-bind="click: viewMode" value="${$.i18n.prop('role.view.mode')}"/>
|
||||
</div>
|
||||
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue