LP#1855780: adding the go-back button from Mike Risher's code
authorRogan Hamby <rogan.hamby@gmail.com>
Fri, 24 Sep 2021 19:21:47 +0000 (19:21 +0000)
committerJane Sandberg <sandbergja@gmail.com>
Wed, 17 Nov 2021 19:55:11 +0000 (11:55 -0800)
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Signed-off-by: Jane Sandberg <sandbergja@gmail.com>
Open-ILS/src/eg2/src/app/staff/admin/local/triggers/trigger-edit.component.html
Open-ILS/src/eg2/src/app/staff/admin/local/triggers/trigger-edit.component.ts

index 970f7c3..253601d 100644 (file)
@@ -1,5 +1,8 @@
 <eg-staff-banner bannerText="{{this.evtDefName}}" i18n-bannerText>
 </eg-staff-banner>
+<div class="text-center">
+    <button class="btn btn-outline-dark" (click)="back()">&#8592; Back to Notifications/Action Triggers</button>
+</div>
 <ul ngbNav #editNav="ngbNav" class="nav-tabs mb-3"
     [activeId]="editTab" (navChange)="onTabChange($event)">
     <li [ngbNavItem]="'def'">
                 [fieldOptions]="{message_template:{customTemplate:{template:textAreaTemplate}},template:{customTemplate:{template:textAreaTemplate}}}"
                 fieldOrder="owner,name,hook,active,delay,delay_field,group_field,reactor,validator,repeat_delay,id,cleanup_failure,granularity,max_delay,message_library_path,message_template,message_title,message_usr_path,opt_in_setting,usr_field,retention_interval,cleanup_success,template">
             </eg-fm-record-editor>
-        </ng-template>
+            <div class="text-right">
+                <button class="btn btn-outline-dark mr-3" (click)="back()">&#8592; Back to Notifications/Action Triggers</button>
+            </div>
+       </ng-template>
     </li>
     <li ngbNavItem="'env'">
         <a ngbNavLink i18n>Edit Environment</a>
index a659d63..3e76aa9 100644 (file)
@@ -11,6 +11,7 @@ import {FmRecordEditorComponent} from '@eg/share/fm-editor/fm-editor.component';
 import {StringComponent} from '@eg/share/string/string.component';
 import {ToastService} from '@eg/share/toast/toast.service';
 import {NgbNav, NgbNavChangeEvent} from '@ng-bootstrap/ng-bootstrap';
+import {Router} from '@angular/router';
 
 @Component({
     templateUrl: './trigger-edit.component.html'
@@ -47,7 +48,8 @@ export class EditEventDefinitionComponent implements OnInit {
     @ViewChild('createErrString') createErrString: StringComponent;
 
     constructor(
-        private idl: IdlService,
+        private router: Router,
+       private idl: IdlService,
         private pcrud: PcrudService,
         private toast: ToastService,
         private route: ActivatedRoute,
@@ -196,4 +198,7 @@ export class EditEventDefinitionComponent implements OnInit {
         this.testErr2 = '';
         this.testResult = '';
     }
+    back = () => {
+        this.router.navigate(['/staff/admin/local/action_trigger/event_definition/']);
+    }
 }