update summary when contacts are edited
authorGalen Charlton <gmc@equinoxinitiative.org>
Mon, 13 Apr 2020 21:36:58 +0000 (17:36 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Mon, 13 Apr 2020 21:36:58 +0000 (17:36 -0400)
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/eg2/src/app/staff/acq/provider/acq-provider.component.html
Open-ILS/src/eg2/src/app/staff/acq/provider/provider-contacts.component.ts

index 4277ce5..6a5d0d2 100644 (file)
@@ -45,7 +45,7 @@
       </ngb-tab>
       <ngb-tab title="Contacts" i18n-title id="contacts" [disabled]="!id">
         <ng-template ngbTabContent>
-          <eg-provider-contacts></eg-provider-contacts>
+          <eg-provider-contacts (desireSummarize)="onDesireSummarize($event, true)"></eg-provider-contacts>
         </ng-template>
       </ngb-tab>
       <ngb-tab title="Attribute Definitions" i18n-title id="attributes" [disabled]="!id">
index d2fd645..1553206 100644 (file)
@@ -1,4 +1,4 @@
-import {Component, OnInit, AfterViewInit, Input, ViewChild, ChangeDetectorRef} from '@angular/core';
+import {Component, OnInit, AfterViewInit, Input, Output, ViewChild, EventEmitter, ChangeDetectorRef} from '@angular/core';
 import {empty, throwError, Observable, from} from 'rxjs';
 import {map} from 'rxjs/operators';
 import {Router, ActivatedRoute, ParamMap} from '@angular/router';
@@ -36,6 +36,8 @@ export class ProviderContactsComponent implements OnInit, AfterViewInit {
     @ViewChild('deleteFailedString', { static: true }) deleteFailedString: StringComponent;
     @ViewChild('deleteSuccessString', { static: true }) deleteSuccessString: StringComponent;
 
+    @Output('desireSummarize') summarize: EventEmitter<number> = new EventEmitter<number>();
+
     cellTextGenerator: GridCellTextGenerator;
     provider: IdlObject;
     selectedContact: IdlObject;
@@ -71,6 +73,7 @@ export class ProviderContactsComponent implements OnInit, AfterViewInit {
                     console.debug('deleted: ' + val);
                     this.deleteSuccessString.current()
                         .then(str => this.toast.success(str));
+                    this.summarize.emit(this.provider.id());
                 },
                 err => {
                     this.deleteFailedString.current()
@@ -144,6 +147,7 @@ export class ProviderContactsComponent implements OnInit, AfterViewInit {
                     this.providerRecord.refreshCurrent().then(
                         () => this.providerContactsGrid.reload()
                     );
+                    this.summarize.emit(this.provider.id());
                     resolve(result);
                 },
                 error => {
@@ -180,6 +184,7 @@ export class ProviderContactsComponent implements OnInit, AfterViewInit {
                 this.providerRecord.refreshCurrent().then(
                     () => this.providerContactsGrid.reload()
                 );
+                this.summarize.emit(this.provider.id());
             },
             rejection => {
                 if (!rejection.dismissed) {