Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MH-12976, custom role patterns not working #389

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -171,7 +171,8 @@
}]);
}
scroller.bind('scroll', getMoreElements);
var search = angular.element(angular.element(element).parent().children(".chosen-container").children('.chosen-drop').children('.chosen-search')[0].childNodes["0"]);
var search = angular.element(angular.element(element).parent().children(".chosen-container")
.children('.chosen-drop').children('.chosen-search').children('input.chosen-search-input')["0"]);
search.bind('keyup.chosen paste.chosen', getMoreElements);
});
if (attr.ngOptions && ngModel) {
Expand Down
20 changes: 20 additions & 0 deletions modules/admin-ui/src/main/webapp/scripts/lib/chosen.jquery.js
Expand Up @@ -767,7 +767,27 @@ This file is generated by `grunt build`, do not edit it by hand.
})(this));
this.form_field_jq.on("chosen:updated.chosen", (function(_this) {
return function(evt) {
var searchValue = _this.search_field[0].value;
if (null != _this.result_highlight) {
text_check = searchValue || _this.result_highlight[0].innerHTML;
_this.current_highlighted = _this.result_highlight[0].getAttribute("data-option-array-index");
Array.prototype.some.call(_this.search_results[0].children, function(child, i) {
if (child.innerHTML === searchValue) {
_this.current_highlighted = i;
return true;
}
});
}
_this.results_update_field(evt);
if (null != _this.current_highlighted) {
raw_element = _this.search_results[0].children[_this.current_highlighted];
if (text_check == raw_element.innerHTML) {
//The update_field call recreates all of the elements, so we need to reselect the correct one
new_search_result_element = $(raw_element);
_this.result_do_highlight(new_search_result_element);
}
}
_this.search_field[0].value = searchValue;
};
})(this));
this.form_field_jq.on("chosen:activate.chosen", (function(_this) {
Expand Down
Expand Up @@ -29,7 +29,7 @@ <h4 class="video-details"><span class="video-details-date">{{ video.date | local
<select chosen pre-select-from="video.workflows" class="workflow"
ng-disabled="!video.workflows || video.workflows.length === 0"
data-width="'175px'"
data-disable-search-threshold="8"
data-disable-search-threshold="0"
ng-model="video.workflow"
ng-options="workflow.id as workflow.name for workflow in video.workflows" />

Expand Down Expand Up @@ -156,7 +156,7 @@ <h4>{{ reply.author.name }}</h4>
<div class="reasons">
<select chosen pre-select-from="components.eventCommentReasons"
data-width="'200px'"
data-disable-search-threshold="8"
data-disable-search-threshold="0"
ng-model="myComment.reason"
ng-options="value | translate for (id, value) in components.eventCommentReasons"
data-placeholder="{{ 'EVENTS.EVENTS.DETAILS.COMMENTS.SELECTPLACEHOLDER' | translate }}"
Expand Down Expand Up @@ -232,7 +232,7 @@ <h4>{{ reply.author.name }}</h4>
<select chosen pre-select-from="video.workflows" class="workflow"
ng-disabled="!video.workflows || video.workflows.length === 0"
data-width="'175px'"
data-disable-search-threshold="8"
data-disable-search-threshold="0"
ng-model="video.workflow"
ng-options="workflow.id as workflow.name for workflow in video.workflows" />

Expand Down
Expand Up @@ -21,7 +21,7 @@
ng-keyup="keyUp($event)"
tabindex="{{ params.tabindex }}"
data-width="'100px'"
data-disable-search-threshold="8"
data-disable-search-threshold="0"
ng-model="params.hours"
ng-disabled="!editMode && params.type === 'time'" ng-required="params.required" name="hours"
data-placeholder="{{ 'EVENTS.EVENTS.NEW.SOURCE.PLACEHOLDER.HOUR' | translate}}"
Expand All @@ -33,7 +33,7 @@
ng-keyup="keyUp($event)"
tabindex="{{ params.tabindex }}"
data-width="'100px'"
data-disable-search-threshold="8"
data-disable-search-threshold="0"
ng-model="params.minutes"
ng-disabled="!editMode && params.type === 'time'" ng-required="params.required" name="minutes"
data-placeholder="{{ 'EVENTS.EVENTS.NEW.SOURCE.PLACEHOLDER.MINUTE' | translate}}"
Expand Down
Expand Up @@ -80,7 +80,7 @@ <h2 translate="USERS.ACLS.DETAILS.HEADER" translate-values="{ resourceId: '{{ re
</p>
<select chosen pre-select-from="acls"
data-width="'200px'"
data-disable-search-threshold="8"
data-disable-search-threshold="0"
data-search_contains="true"
ng-change="changeBaseAcl()"
ng-model="baseAclId"
Expand Down Expand Up @@ -129,7 +129,7 @@ <h2 translate="USERS.ACLS.DETAILS.HEADER" translate-values="{ resourceId: '{{ re
<select chosen pre-select-from="roles"
ng-disabled="!$root.userIs('ROLE_UI_SERIES_DETAILS_ACL_EDIT')"
data-width="'360px'"
data-disable-search-threshold="8"
data-disable-search-threshold="0"
data-search_contains="true"
ng-model="policy.role"
ng-change="save(policy)"
Expand Down
Expand Up @@ -53,7 +53,7 @@
</p>
<select chosen pre-select-from="wizard.step.acls"
data-width="'200px'"
data-disable-search-threshold="8"
data-disable-search-threshold="0"
data-search_contains="true"
ng-change="wizard.step.changeBaseAcl()"
ng-model="wizard.step.ud.id"
Expand Down Expand Up @@ -97,7 +97,7 @@
<td>
<select chosen pre-select-from="wizard.step.roles"
data-width="'200px'"
data-disable-search-threshold="8"
data-disable-search-threshold="0"
data-search_contains="true"
ng-model="policy.role"
ng-options="id as id for (id, type) in wizard.step.roles"
Expand Down
Expand Up @@ -119,7 +119,7 @@ <h2 translate="BULK_ACTIONS.DELETE.EVENTS.CAPTION"><!-- Delete Events --></h2>
<select chosen pre-select-from="processing.workflows"
data-width="'100%'"
ng-change="processing.changeWorkflow()"
data-disable-search-threshold="8"
data-disable-search-threshold="0"
not-empty-selection
ng-model="processing.ud.workflow"
ng-model-options="{ allowInvalid: true }"
Expand Down
Expand Up @@ -237,15 +237,15 @@ <h2 translate="EVENTS.EVENTS.DETAILS.HEADER" translate-values="{{titleParams}}">
<select chosen
ng-disabled="checkingConflicts"
data-width="'100px'"
data-disable-search-threshold="8"
data-disable-search-threshold="0"
ng-model="source.start.hour" ng-change="onTemporalValueChange('start')"
data-placeholder="{{ 'EVENTS.EVENTS.DETAILS.SOURCE.PLACEHOLDER.HOUR' | translate}}"
ng-options="h.index as h.value for h in hours"
/>
<select chosen
ng-disabled="checkingConflicts"
data-width="'100px'"
data-disable-search-threshold="8"
data-disable-search-threshold="0"
ng-model="source.start.minute" ng-change="onTemporalValueChange('start')"
data-placeholder="{{ 'EVENTS.EVENTS.DETAILS.SOURCE.PLACEHOLDER.MINUTE' | translate}}"
ng-options="m.index as m.value for m in minutes"
Expand All @@ -261,7 +261,7 @@ <h2 translate="EVENTS.EVENTS.DETAILS.HEADER" translate-values="{{titleParams}}">
<select chosen
ng-disabled="checkingConflicts"
data-width="'100px'"
data-disable-search-threshold="8"
data-disable-search-threshold="0"
ng-model="source.duration.hour" ng-change="onTemporalValueChange('duration')"
data-placeholder="{{ 'WIZARD.DURATION.HOURS' | translate }}"
ng-options="h.index as h.value for h in hours"
Expand All @@ -270,7 +270,7 @@ <h2 translate="EVENTS.EVENTS.DETAILS.HEADER" translate-values="{{titleParams}}">
<select chosen
ng-disabled="checkingConflicts"
data-width="'100px'"
data-disable-search-threshold="8"
data-disable-search-threshold="0"
ng-model="source.duration.minute" ng-change="onTemporalValueChange('duration')"
data-placeholder="{{ 'WIZARD.DURATION.MINUTES' | translate }}"
ng-options="m.index as m.value for m in minutes"
Expand All @@ -286,15 +286,15 @@ <h2 translate="EVENTS.EVENTS.DETAILS.HEADER" translate-values="{{titleParams}}">
<select chosen
ng-disabled="checkingConflicts"
data-width="'100px'"
data-disable-search-threshold="8"
data-disable-search-threshold="0"
ng-model="source.end.hour" ng-change="onTemporalValueChange('end')"
data-placeholder="{{ 'EVENTS.EVENTS.DETAILS.SOURCE.PLACEHOLDER.HOUR' | translate}}"
ng-options="h.index as h.value for h in hours"
/>
<select chosen
ng-disabled="checkingConflicts"
data-width="'100px'"
data-disable-search-threshold="8"
data-disable-search-threshold="0"
ng-model="source.end.minute" ng-change="onTemporalValueChange('end')"
data-placeholder="{{ 'EVENTS.EVENTS.DETAILS.SOURCE.PLACEHOLDER.MINUTE' | translate}}"
ng-options="m.index as m.value for m in minutes"
Expand All @@ -317,7 +317,7 @@ <h2 translate="EVENTS.EVENTS.DETAILS.HEADER" translate-values="{{titleParams}}">
ng-disabled="checkingConflicts"
data-width="'200px'"
ng-change="roomChanged(); saveScheduling()"
data-disable-search-threshold="8"
data-disable-search-threshold="0"
ng-model="source.device"
ng-options="value.name for (id, value) in captureAgents"
data-placeholder="{{ 'EVENTS.EVENTS.DETAILS.SOURCE.PLACEHOLDER.LOCATION' | translate }}"
Expand Down Expand Up @@ -463,7 +463,7 @@ <h2 translate="EVENTS.EVENTS.DETAILS.HEADER" translate-values="{{titleParams}}">
data-width="'100%'"
ng-model="workflow.id"
ng-change="changeWorkflow(false)"
data-disable-search-threshold="8"
data-disable-search-threshold="0"
data-search_contains="true"
ng-disabled="!$root.userIs('ROLE_UI_EVENTS_DETAILS_WORKFLOWS_EDIT')"
ng-options="w.id as w.title for w in workflowDefinitions"
Expand Down Expand Up @@ -551,7 +551,7 @@ <h2 translate="EVENTS.EVENTS.DETAILS.HEADER" translate-values="{{titleParams}}">
<div ng-show="!transactions.read_only">
<select chosen pre-select-from="acls"
data-width="'200px'"
data-disable-search-threshold="8"
data-disable-search-threshold="0"
data-search_contains="true"
ng-disabled="((tab == 'access') && !$root.userIs('ROLE_UI_EVENTS_DETAILS_ACL_EDIT'))"
ng-change="changeBaseAcl()"
Expand Down Expand Up @@ -603,7 +603,7 @@ <h2 translate="EVENTS.EVENTS.DETAILS.HEADER" translate-values="{{titleParams}}">
<select chosen pre-select-from="roles"
ng-disabled="((tab == 'access') && !$root.userIs('ROLE_UI_EVENTS_DETAILS_ACL_EDIT'))"
data-width="'360px'"
data-disable-search-threshold="8"
data-disable-search-threshold="0"
data-search_contains="true"
ng-model="policy.role"
ng-change="accessChanged(policy.role)"
Expand Down Expand Up @@ -709,7 +709,7 @@ <h4>{{ reply.author.name }}</h4>
<div>
<select chosen pre-select-from="components.eventCommentReasons"
data-width="'200px'"
data-disable-search-threshold="8"
data-disable-search-threshold="0"
ng-model="myComment.reason"
ng-options="value | translate for (id, value) in components.eventCommentReasons"
data-placeholder="{{ 'EVENTS.EVENTS.DETAILS.COMMENTS.SELECTPLACEHOLDER' | translate }}"
Expand Down
Expand Up @@ -22,7 +22,7 @@ <h2 translate="EVENTS.RETRACT.CAPTION"><!-- Template --></h2>
<select chosen pre-select-from="processing.workflows"
data-width="'100%'"
ng-change="processing.changeWorkflow(); valid();"
data-disable-search-threshold="8"
data-disable-search-threshold="0"
not-empty-selection
ng-model="processing.ud.workflow"
ng-model-options="{ allowInvalid: true }"
Expand Down
Expand Up @@ -79,7 +79,7 @@ <h2 translate="BULK_ACTIONS.SCHEDULE_TASK.CAPTION"><!-- Template --></h2>
<select chosen
data-width="'100%'"
ng-change="processing.changeWorkflow()"
data-disable-search-threshold="8"
data-disable-search-threshold="0"
not-empty-selection
ng-model="processing.ud.workflow"
ng-model-options="{ allowInvalid: true }"
Expand Down