Sfoglia il codice sorgente

Merge pull request #470 from pwm-project/ie11-fix

Fixed advanced search in IE11
James Albright 6 anni fa
parent
commit
028a48c4e0

+ 1 - 0
client/src/i18n/translations_en.json

@@ -40,6 +40,7 @@
   "Display_Random": "Random",
   "Display_SearchResultsExceeded": "Search results exceeded maximum search size",
   "Display_SearchResultsNone": "No results",
+  "Display_SearchAttrsUnique": "Search attributes must be unique",
   "Display_SelectAttribute": "Select attribute...",
   "Display_SetRandomPasswordPrompt": "Set a new random password for this user?",
   "Display_StrengthMeter": "Password Strength",

+ 2 - 1
client/src/modules/helpdesk/helpdesk-search-base.component.ts

@@ -165,7 +165,8 @@ export default abstract class HelpDeskSearchBaseComponent {
                 keys.add(searchQuery.key);
             }
 
-            if (keys.size < this.queries.length) {
+            const duplicateSearchAttrsFound = keys.size < this.queries.length;
+            if (duplicateSearchAttrsFound) {
                 this.$translate('Display_SearchAttrsUnique')
                     .then((translation: string) => {
                         this.searchMessage = translation;

+ 3 - 0
client/src/modules/helpdesk/main.ts

@@ -25,6 +25,9 @@ import 'angular-translate';
 import 'angular-sanitize';
 import '@microfocus/ng-ias/dist/ng-ias';
 
+// Add a polyfill for Set() for IE11, since it's used in peoplesearch-base.component.ts
+import 'core-js/es6/set';
+
 import { bootstrap, module } from 'angular';
 import helpDeskModule from './helpdesk.module';
 import PeopleService from '../../services/people.service';

+ 3 - 0
client/src/modules/peoplesearch/main.ts

@@ -24,6 +24,9 @@ import 'angular';
 import 'angular-translate';
 import '@microfocus/ng-ias/dist/ng-ias';
 
+// Add a polyfill for Set() for IE11, since it's used in peoplesearch-base.component.ts
+import 'core-js/es6/set';
+
 import { bootstrap, module } from 'angular';
 import ConfigService from '../../services/peoplesearch-config.service';
 import peopleSearchModule from './peoplesearch.module';

+ 2 - 1
client/src/modules/peoplesearch/peoplesearch-base.component.ts

@@ -222,7 +222,8 @@ abstract class PeopleSearchBaseComponent {
                 keys.add(searchQuery.key);
             }
 
-            if (keys.size < this.queries.length) {
+            const duplicateSearchAttrsFound = keys.size < this.queries.length;
+            if (duplicateSearchAttrsFound) {
                 this.$translate('Display_SearchAttrsUnique')
                     .then((translation: string) => {
                         this.searchMessage = translation;

+ 1 - 0
server/src/main/java/password/pwm/i18n/Display.java

@@ -152,6 +152,7 @@ public enum Display implements PwmDisplayBundle
     Display_SearchCompleted,
     Display_SearchResultsInfo,
     Display_SearchResultsExceeded,
+    Display_SearchAttrsUnique,
     Display_SetRandomPasswordPrompt,
     Display_SearchResultsNone,
     Display_Second,