Merge pull request #2671 from JaySoni1/WEB-108-gsim-glim-overview-not-updated-after-activation
WEB-108 GSIM/GLIM Overview Not Updated After Activation
This commit is contained in:
@@ -19,6 +19,7 @@ import { StatusLookupPipe } from '../../../pipes/status-lookup.pipe';
|
|||||||
import { AccountsFilterPipe } from '../../../pipes/accounts-filter.pipe';
|
import { AccountsFilterPipe } from '../../../pipes/accounts-filter.pipe';
|
||||||
import { DateFormatPipe } from '../../../pipes/date-format.pipe';
|
import { DateFormatPipe } from '../../../pipes/date-format.pipe';
|
||||||
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
||||||
|
import { GroupsService } from '../../groups.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Groups View General Tab Component.
|
* Groups View General Tab Component.
|
||||||
@@ -123,11 +124,10 @@ export class GeneralTabComponent {
|
|||||||
/** Boolean for toggling savings accounts table */
|
/** Boolean for toggling savings accounts table */
|
||||||
showClosedSavingAccounts = false;
|
showClosedSavingAccounts = false;
|
||||||
|
|
||||||
/**
|
constructor(
|
||||||
* Fetches group's related data from `resolve`
|
private route: ActivatedRoute,
|
||||||
* @param {ActivatedRoute} route Activated Route.
|
private groupsService: GroupsService
|
||||||
*/
|
) {
|
||||||
constructor(private route: ActivatedRoute) {
|
|
||||||
this.route.data.subscribe(
|
this.route.data.subscribe(
|
||||||
(data: { groupAccountsData: any; groupClientMembers: any; groupSummary: any; glimData: any; gsimData: any }) => {
|
(data: { groupAccountsData: any; groupClientMembers: any; groupSummary: any; glimData: any; gsimData: any }) => {
|
||||||
this.glimAccounts = data.glimData;
|
this.glimAccounts = data.glimData;
|
||||||
@@ -143,6 +143,18 @@ export class GeneralTabComponent {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Refreshes group account data from backend (for GSIM/GLIM status/balance update)
|
||||||
|
*/
|
||||||
|
refreshAccounts(groupId: string) {
|
||||||
|
this.groupsService.getGroupAccountsData(groupId).subscribe((data: any) => {
|
||||||
|
this.groupAccountData = data;
|
||||||
|
this.savingAccounts = data.savingsAccounts;
|
||||||
|
this.loanAccounts = data.loanAccounts;
|
||||||
|
// If GSIM/GLIM data is separate, fetch and update here as well
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggles loan accounts table.
|
* Toggles loan accounts table.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -100,6 +100,12 @@ export class GroupsViewComponent {
|
|||||||
case 'Manage Members':
|
case 'Manage Members':
|
||||||
case 'Transfer Clients':
|
case 'Transfer Clients':
|
||||||
this.router.navigate([`actions/${name}`], { relativeTo: this.route });
|
this.router.navigate([`actions/${name}`], { relativeTo: this.route });
|
||||||
|
if (name === 'Activate') {
|
||||||
|
const generalTab = this.getGeneralTabComponent();
|
||||||
|
if (generalTab) {
|
||||||
|
generalTab.refreshAccounts(this.groupViewData.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'Edit Meeting':
|
case 'Edit Meeting':
|
||||||
const queryParams: any = { calendarId: this.groupViewData.collectionMeetingCalendar.id };
|
const queryParams: any = { calendarId: this.groupViewData.collectionMeetingCalendar.id };
|
||||||
@@ -116,7 +122,9 @@ export class GroupsViewComponent {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
getGeneralTabComponent(): any {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Checks if meeting is editable.
|
* Checks if meeting is editable.
|
||||||
*/
|
*/
|
||||||
@@ -129,7 +137,6 @@ export class GroupsViewComponent {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Refetches data for the component
|
* Refetches data for the component
|
||||||
* TODO: Replace by a custom reload component instead of hard-coded back-routing.
|
* TODO: Replace by a custom reload component instead of hard-coded back-routing.
|
||||||
|
|||||||
Reference in New Issue
Block a user