LP1879769 Cannot Edit Carousels from Action Menu
authorTerran McCanna <tmccanna@georgialibraries.org>
Tue, 27 Oct 2020 22:39:09 +0000 (18:39 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 2 Apr 2021 21:46:26 +0000 (17:46 -0400)
The Edit Carousels action was appearing in the action menu and
right-click menu, but wasn't wired up. This adds in the missing
piece.

Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Signed-off-by: Gina Monti <gmonti@biblio.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>

Open-ILS/src/eg2/src/app/staff/admin/local/admin-carousel.component.ts

index 3d048d6..2de2d8e 100644 (file)
@@ -11,6 +11,7 @@ import {PermService} from '@eg/core/perm.service';
 import {AuthService} from '@eg/core/auth.service';
 import {NetService} from '@eg/core/net.service';
 import {StringComponent} from '@eg/share/string/string.component';
+import {FmRecordEditorComponent} from '@eg/share/fm-editor/fm-editor.component';
 
 @Component({
     templateUrl: './admin-carousel.component.html'
@@ -72,6 +73,18 @@ export class AdminCarouselComponent extends AdminPageComponent implements OnInit
                 }
             });
         };
+
+        this.editSelected = (carouselFields: IdlObject[]) => {
+            // Edit each IDL thing one at a time
+            const editOneThing = (carousel: IdlObject) => {
+            if (!carousel) { return; }
+
+            this.showEditDialog(carousel).then(
+                () => editOneThing(carouselFields.shift()));
+            };
+
+            editOneThing(carouselFields.shift());
+        };
     }
 
     mungeCarousel(editMode: string, rec: IdlObject) {