This is an automated email from the ASF dual-hosted git repository. andreapatricelli pushed a commit to branch 2_1_X in repository https://gitbox.apache.org/repos/asf/syncope.git
The following commit(s) were added to refs/heads/2_1_X by this push: new cb31787 improved group search in enduser now the filter is really a filter cb31787 is described below commit cb31787159260636184f608d59d661c0d82bef57 Author: Andrea Patricelli <andreapatrice...@apache.org> AuthorDate: Fri Mar 20 16:11:30 2020 +0100 improved group search in enduser now the filter is really a filter --- .../resources/META-INF/resources/app/index.html | 2 - .../resources/app/js/filters/propsFilter.js | 52 ---------------------- .../META-INF/resources/app/views/groups.html | 2 +- 3 files changed, 1 insertion(+), 55 deletions(-) diff --git a/client/enduser/src/main/resources/META-INF/resources/app/index.html b/client/enduser/src/main/resources/META-INF/resources/app/index.html index 7f124f5..486d6ca 100644 --- a/client/enduser/src/main/resources/META-INF/resources/app/index.html +++ b/client/enduser/src/main/resources/META-INF/resources/app/index.html @@ -161,8 +161,6 @@ under the License. <!--validator--> <script src="js/validator/validationRules.js"></script> <script src="js/validator/validationExecutor.js"></script> - <!--filters--> - <script src="js/filters/propsFilter.js"></script> <!--util--> <script src="js/util/userUtil.js"></script> <script src="js/util/genericUtil.js"></script> diff --git a/client/enduser/src/main/resources/META-INF/resources/app/js/filters/propsFilter.js b/client/enduser/src/main/resources/META-INF/resources/app/js/filters/propsFilter.js deleted file mode 100644 index 51e0159..0000000 --- a/client/enduser/src/main/resources/META-INF/resources/app/js/filters/propsFilter.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * This filter has been defined in order to have a workaround for this bug: - * https://github.com/angular-ui/ui-select/issues/665 - * - * When the bug is fixed, we can remove it. - */ - -'use strict' - -angular.module("self") - .filter('propsFilter', function () { - return function (items, props) { - var out = []; - if (items && items.length && props.selected && props.selected.length) { - var selected = props.selected; - for (var i = 0; i < items.length; i++) { - var item = items[i], itemMisses = true; - for (var j = 0; j < selected.length; j++) { - if (item.groupKey == selected[j].groupKey) { - itemMisses = false; - break; - } - } - if (itemMisses) { - out.push(item); - } - } - } else { - out = items; - } - return out; - }; - }); diff --git a/client/enduser/src/main/resources/META-INF/resources/app/views/groups.html b/client/enduser/src/main/resources/META-INF/resources/app/views/groups.html index 0d23a54..70c1c2b 100644 --- a/client/enduser/src/main/resources/META-INF/resources/app/views/groups.html +++ b/client/enduser/src/main/resources/META-INF/resources/app/views/groups.html @@ -24,7 +24,7 @@ under the License. <ui-select-match placeholder="{{'GROUPS_PLACEHOLDER'| translate}}" class="ui-select-match"> {{$item.groupName}} </ui-select-match> - <ui-select-choices repeat="group in dynamicForm.groups | propsFilter: {selected: dynamicForm.selectedGroups} + <ui-select-choices repeat="group in dynamicForm.groups | filter: { groupName: $select.search } track by group.groupKey" class="ui-select-choices"> <div id="{{group.groupName}}" ng-bind-html="group.groupName | highlight: $select.search"></div> </ui-select-choices>