Skip to content

Commit f763365

Browse files
authored
Merge pull request #2671 from JaySoni1/WEB-108-gsim-glim-overview-not-updated-after-activation
WEB-108 GSIM/GLIM Overview Not Updated After Activation
2 parents 1822d7f + 965e3a6 commit f763365

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

src/app/groups/groups-view/general-tab/general-tab.component.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { StatusLookupPipe } from '../../../pipes/status-lookup.pipe';
1919
import { AccountsFilterPipe } from '../../../pipes/accounts-filter.pipe';
2020
import { DateFormatPipe } from '../../../pipes/date-format.pipe';
2121
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
22+
import { GroupsService } from '../../groups.service';
2223

2324
/**
2425
* Groups View General Tab Component.
@@ -123,11 +124,10 @@ export class GeneralTabComponent {
123124
/** Boolean for toggling savings accounts table */
124125
showClosedSavingAccounts = false;
125126

126-
/**
127-
* Fetches group's related data from `resolve`
128-
* @param {ActivatedRoute} route Activated Route.
129-
*/
130-
constructor(private route: ActivatedRoute) {
127+
constructor(
128+
private route: ActivatedRoute,
129+
private groupsService: GroupsService
130+
) {
131131
this.route.data.subscribe(
132132
(data: { groupAccountsData: any; groupClientMembers: any; groupSummary: any; glimData: any; gsimData: any }) => {
133133
this.glimAccounts = data.glimData;
@@ -143,6 +143,18 @@ export class GeneralTabComponent {
143143
});
144144
}
145145

146+
/**
147+
* Refreshes group account data from backend (for GSIM/GLIM status/balance update)
148+
*/
149+
refreshAccounts(groupId: string) {
150+
this.groupsService.getGroupAccountsData(groupId).subscribe((data: any) => {
151+
this.groupAccountData = data;
152+
this.savingAccounts = data.savingsAccounts;
153+
this.loanAccounts = data.loanAccounts;
154+
// If GSIM/GLIM data is separate, fetch and update here as well
155+
});
156+
}
157+
146158
/**
147159
* Toggles loan accounts table.
148160
*/

src/app/groups/groups-view/groups-view.component.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ export class GroupsViewComponent {
100100
case 'Manage Members':
101101
case 'Transfer Clients':
102102
this.router.navigate([`actions/${name}`], { relativeTo: this.route });
103+
if (name === 'Activate') {
104+
const generalTab = this.getGeneralTabComponent();
105+
if (generalTab) {
106+
generalTab.refreshAccounts(this.groupViewData.id);
107+
}
108+
}
103109
break;
104110
case 'Edit Meeting':
105111
const queryParams: any = { calendarId: this.groupViewData.collectionMeetingCalendar.id };
@@ -116,7 +122,9 @@ export class GroupsViewComponent {
116122
break;
117123
}
118124
}
119-
125+
getGeneralTabComponent(): any {
126+
return null;
127+
}
120128
/**
121129
* Checks if meeting is editable.
122130
*/
@@ -129,7 +137,6 @@ export class GroupsViewComponent {
129137
}
130138
return false;
131139
}
132-
133140
/**
134141
* Refetches data for the component
135142
* TODO: Replace by a custom reload component instead of hard-coded back-routing.

0 commit comments

Comments
 (0)