alphabetize the simple sort list user/lew/lp-1950518-simple-sort-angularized
authorLlewellyn Marshall <llewellyn.marshall@ncdcr.gov>
Wed, 15 Dec 2021 16:58:05 +0000 (11:58 -0500)
committerLlewellyn Marshall <llewellyn.marshall@ncdcr.gov>
Wed, 15 Dec 2021 16:58:05 +0000 (11:58 -0500)
Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.ts

index 4e01012..5f339a8 100644 (file)
@@ -318,9 +318,18 @@ export class SearchFormComponent implements OnInit, AfterViewInit {
             
            this.ccvmMap[cType].forEach(ccvm => {
               if(ccvm.is_simple() === 't'){
+                  //push the is_simple ccvms to the simple map
                   this.ccvmSimpleMap[cType].push(ccvm);
               }});
         });
+        
+        //order the simple sort list
+        Object.keys(this.ccvmSimpleMap).forEach(cType => {
+            this.ccvmSimpleMap[cType] =
+                this.ccvmSimpleMap[cType].sort((a, b) => {
+                    return a.value() < b.value() ? -1 : 1;
+                });
+        });
     }
 }