Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
170b0c7
fix: batch Nikshay villages request to avoid oversized GET query string
vishwab1 Sep 9, 2026
5712b6c
Merge pull request #161 from PSMRI/vb/relse-3.8.2-village-fix
snehar-nd Sep 9, 2026
9a1829f
Role Mapping Not Saving When Updating Multiple Roles (Registrar/Nurse…
vishwab1 Sep 11, 2026
115d843
fix: surface activation/deactivation failures instead of reporting su…
snehar-nd Sep 11, 2026
7a5139a
perf(work-location-mapping): keep Nikshay dropdowns responsive on lar…
vishwab1 Sep 28, 2026
2ab4b58
fix(work-location-mapping): let reset and Edit cancel pending Nikshay…
vishwab1 Sep 28, 2026
842c365
perf(work-location-mapping): use Set lookups when prefilling Nikshay …
vishwab1 Oct 9, 2026
f76086a
perf(work-location-mapping): select large Nikshay lists in one pass
vishwab1 Oct 9, 2026
46e6075
perf(work-location-mapping): draw only visible Nikshay facility/villa…
vishwab1 Oct 9, 2026
85ddc80
fix(work-location-mapping): keep Nikshay option rows one line high
vishwab1 Oct 10, 2026
a44c059
Merge origin/release-3.11.0 into vb/release-3.8.4-wlm-perf-lite
vishwab1 Oct 14, 2026
75f60c5
feat(work-location-mapping): add Stop TB team selection (AMM-2496)
vishwab1 Oct 14, 2026
cdd5304
feat(work-location-mapping): show the van ID in the Stop TB team list
vishwab1 Oct 14, 2026
e202a35
feat(work-location-mapping): send the Stop TB team with save and upda…
vishwab1 Oct 14, 2026
dd39cb3
chore: keep the bulk user upload template from release-3.8.4
vishwab1 Oct 14, 2026
b677c8b
fix(bulk-upload): employee id in template, submit button, refresh use…
vishwab1 Oct 14, 2026
08b0bd4
feat(AMM-2491): add min stock to item master create and edit
vishwab1 Oct 15, 2026
24a8b09
Merge vb/stoptb-bulk-upload-fixes (bulk upload fixes, AMM-2496 Stop T…
vishwab1 Oct 20, 2026
d989b07
chore: set version to 3.12.0
vishwab1 Oct 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.iemr.admin-ui</groupId>
<artifactId>admin-ui</artifactId>
<version>3.8.2</version>
<version>3.12.0</version>
<name>Admin-UI</name>
<description>Piramal - admin: Module ui</description>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ScrollingModule } from '@angular/cdk/scrolling';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { ProviderAdminRoleService } from './services/state-serviceline-role.service';
import { MaterialModule } from 'src/app/core/material.module';
Expand All @@ -25,6 +26,7 @@ import { RoleMasterComponent } from './role-master/provider-admin-role-master.co
import { ServicelineCdssMappingComponent } from './serviceline-cdss-mapping/servicelineCdssMapping.component';
import { SpecialistMappingComponent } from './specialist-mapping/specialist-mapping.component';
import { WorkLocationMappingComponent } from './work-location-mapping/work-location-mapping.component';
import { FastBulkSelectDirective } from './work-location-mapping/fast-bulk-select.directive';
import { UserFacilityMappingComponent } from './work-location-mapping/user-facility-mapping/user-facility-mapping.component';
import { VillageMasterService } from 'src/app/core/services/adminServices/AdminVillage/village-master-service.service';
import { CommonServices } from 'src/app/core/services/inventory-services/commonServices';
Expand Down Expand Up @@ -123,6 +125,7 @@ import { CoreModule } from 'src/app/core/core.module';
InstituteDirectoryMasterComponent,
EditInstituteDirectoryComponent,
WorkLocationMappingComponent,
FastBulkSelectDirective,
FeedbackComplaintNatureMasterComponent,
EditFeedbackNatureModalComponent,
NatureOfComplaintCategoryMappingComponent,
Expand Down Expand Up @@ -161,6 +164,7 @@ import { CoreModule } from 'src/app/core/core.module';
],
imports: [
CommonModule,
ScrollingModule,
MaterialModule,
FormsModule,
ReactiveFormsModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ <h4>Bulk User Upload</h4>
<span class="help-block" *ngIf="error2"
>File size should not exceed {{ maxFileSize }}MB</span
>
<div class="m-t-10" style="margin-left: 60px" *ngIf="pendingXml">
<span
>{{ pendingFileName }}: {{ pendingRowCount }} user(s) ready.
Click Submit to upload.</span
>
</div>
</div>
<div class="m-t-20" style="margin-left: 60px; margin-bottom: 20px">
<span class="help-block" *ngIf="successcount" style="color: green"
Expand All @@ -76,6 +82,17 @@ <h4>Bulk User Upload</h4>
Back
</button>
</div>
<div class="col-md-3" *ngIf="showUpload">
<button
mat-raised-button
color="primary"
class="mat_blue"
[disabled]="!pendingXml || showProgressBar"
(click)="submitUpload()"
>
Submit
</button>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
})
export class EmployeeMasterBulkUploadComponent {
@Output() closeUpload = new EventEmitter<void>();
// Emitted after users are created, so the user list can reload.
@Output() usersUploaded = new EventEmitter<void>();
objs = new MatTableDataSource<any>();

paginator!: MatPaginator;
Expand Down Expand Up @@ -56,6 +58,10 @@
fileuploadedCount = 0;
filetotalCount = 0;
errorloglist: any;
// File checked and ready, waiting for Submit.
pendingXml: string | null = null;
pendingFileName = '';
pendingRowCount = 0;

tableMode = true;
editMode = false;
Expand All @@ -68,7 +74,7 @@
private location: Location,
) {}

ngOnInit() {

Check warning on line 77 in src/app/app-provider-admin/provider-admin/activities/employee-master-bulk-upload/employee-master-bulk-upload.component.ts

View workflow job for this annotation

GitHub Actions / lint-and-audit / lint-and-audit

Lifecycle interface 'OnInit' should be implemented for method 'ngOnInit'. (https://angular.io/styleguide#style-09-01)
this.userID = this.dataService.uid;
const servicelines = this.dataService.userPriveliges;

Expand Down Expand Up @@ -128,57 +134,85 @@
const wb: XLSX.WorkBook = XLSX.read(binarystr, { type: 'binary' });
const wsname: string = wb.SheetNames[0];
const ws: XLSX.WorkSheet = wb.Sheets[wsname];
const header: any[] =
(XLSX.utils.sheet_to_json(ws, { header: 1 })[0] as any[]) || [];
if (!header.includes('EmployeeId')) {
this.alertService.alert(
'Employee Id column is missing. Download the latest Bulk User Template and fill Employee Id for every user.',
'error',
);
this.clearSelection();
return;
}
const data = XLSX.utils.sheet_to_json(ws);
if (!data.length) {
this.alertService.alert('The file has no users to upload', 'error');
this.clearSelection();
return;
}
// Checked and ready; the upload starts on Submit.
this.pendingXml = this.convertJsonToXml(data);
this.pendingFileName = file.name;
this.pendingRowCount = data.length;
this.successcount = false;
this.errorloglist = null;
};
}

const xmlData = this.convertJsonToXml(data);

this.showProgressBar = true;
this.blockSubcenterMappingService.memberBulkUploadXML(xmlData).subscribe(
submitUpload() {
if (!this.pendingXml || this.showProgressBar) return;
this.showProgressBar = true;
this.blockSubcenterMappingService
.memberBulkUploadXML(this.pendingXml)
.subscribe(
(response: any) => {
if (response) {
this.fileuploadedCount = response.registeredUser;
this.filetotalCount = response.totalUser;

if (
Number(this.fileuploadedCount) !== Number(this.filetotalCount)
) {
this.downloadFile();
}
this.showProgressBar = false;
this.alertService.alert('File Uploaded', 'success');

this.resetFileInput();
this.file = undefined;
this.successcount = true;

this.errorloglist = response.error;
} else {
this.showProgressBar = false;
this.alertService.alert(response.errorMessage, 'error');
this.showProgressBar = false;
if (!response || response.totalUser === undefined) {
this.alertService.alert(
response?.errorMessage || 'Upload failed',
'error',
);
return;
}
this.fileuploadedCount = response.registeredUser;
this.filetotalCount = response.totalUser;
if (Number(this.fileuploadedCount) !== Number(this.filetotalCount)) {
this.downloadFile();
}
this.alertService.alert('File Uploaded', 'success');
this.successcount = true;
this.errorloglist = response.error;
this.clearSelection();
if (Number(this.fileuploadedCount) > 0) {
this.usersUploaded.emit();
}
},
(error: HttpErrorResponse) => {
this.showProgressBar = false;
if (
!navigator.onLine ||
(error.status === 0 && error.error instanceof ProgressEvent)
) {
this.showProgressBar = false;
this.alertService.alert(
'Internet connection not available!',
'error',
);
} else {
this.alertService.alert(
error?.error?.errorMessage || 'Upload failed',
'error',
);
}
},
);
(err: any) => {
this.showProgressBar = false;
this.alertService.alert(err.errorMessage, 'error');
this.resetFileInput();
this.file = undefined;
this.fileContent = null;
this.disableUpload = true;
};
};
}

clearSelection() {
this.pendingXml = null;
this.pendingFileName = '';
this.pendingRowCount = 0;
this.file = undefined;
this.resetFileInput();
}

convertJsonToXml(json: any): string {
Expand Down Expand Up @@ -231,6 +265,10 @@
}

back() {
if (!this.pendingXml) {
this.closeUpload.emit();
return;
}
this.alertService
.confirm(
'confirm',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1219,6 +1219,9 @@ <h4 class="pull-left">Permanent Address</h4>
</div>
</div>
<div *ngIf="employeeMasterUpload">
<app-employee-master-bulk-upload (closeUpload)="closeBulkUpload()"></app-employee-master-bulk-upload>
<app-employee-master-bulk-upload
(closeUpload)="closeBulkUpload()"
(usersUploaded)="getAllUserDetails()"
></app-employee-master-bulk-upload>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -1616,16 +1616,34 @@ export class EmployeeMasterNewComponent implements OnInit {
this.employeeMasterNewService
.userActivationDeactivation(obj)
.subscribe(
(res) => {
console.log('Activation or deactivation response', res.data);
(res: any) => {
if (res?.statusCode !== 200) {
this.dialogService.alert(
res?.errorMessage ||
'Failed to ' +
this.confirmMessage.toLowerCase() +
' the user',
'error',
);
return;
}
this.dialogService.alert(
this.confirmMessage + 'd successfully',
'success',
);
this.getAllUserDetails();
this.searchTerm = null;
},
(err) => console.log('error', err),
(err: any) => {
console.log('error', err);
this.dialogService.alert(
err?.errorMessage ||
'Failed to ' +
this.confirmMessage.toLowerCase() +
' the user',
'error',
);
},
);
}
},
Expand Down Expand Up @@ -1770,6 +1788,8 @@ export class EmployeeMasterNewComponent implements OnInit {
this.employeeMasterUpload = false;
this.tableMode = true;
this.formMode = false;
// Show users created by the upload.
this.getAllUserDetails();
}

private refreshFilteredData(rows: any[]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,18 @@
*/
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { forkJoin, of } from 'rxjs';
import { map } from 'rxjs/operators';
import { ConfigService } from 'src/app/core/services/config/config.service';
import { environment } from 'src/environments/environment';

// A "select all" facility pick (e.g. every facility under several Nikshay
// TUs) can put 1000+ IDs on this GET's query string, which blows past the
// server/proxy request-line limit (~8KB) and comes back as a 400. The
// backend only exposes a comma-separated-param GET (no POST/body variant),
// so batch client-side instead of widening a single request.
const NIKSHAY_VILLAGES_BATCH_SIZE = 200;

/**
* Author: krishna Gunti ( 378952 )
* Date: 05-03-2018
Expand Down Expand Up @@ -152,8 +161,29 @@ export class WorkLocationMapping {
}

getNikshayVillages(facilityIDs: any[]) {
return this.http.get(
`${environment.nikshayVillages_url}?facilityIDs=${facilityIDs.join(',')}`,
const ids = (facilityIDs || []).filter(
(id) => id !== null && id !== undefined,
);
if (!ids.length) {
return of({ data: [] });
}
const chunks: any[][] = [];
for (let i = 0; i < ids.length; i += NIKSHAY_VILLAGES_BATCH_SIZE) {
chunks.push(ids.slice(i, i + NIKSHAY_VILLAGES_BATCH_SIZE));
}
return forkJoin(
chunks.map((chunk) =>
this.http.get(
`${environment.nikshayVillages_url}?facilityIDs=${chunk.join(',')}`,
),
),
).pipe(
map((responses: any[]) => ({
data: responses.reduce(
(acc: any[], r: any) => acc.concat(r?.data || []),
[],
),
})),
);
}

Expand All @@ -166,4 +196,23 @@ export class WorkLocationMapping {
`${environment.nikshayUserMapping_url}?usrMappingID=${usrMappingID}`,
);
}

// Stop TB teams are the MMU vans of the user's state (AMM-2496).
getStopTBTeams(stateID: any, serviceProviderID: any) {
return this.http.get(
`${environment.stopTBTeams_url}?stateID=${stateID}&serviceProviderID=${serviceProviderID}`,
);
}

getStopTBUserTeam(userID: any, providerServiceMapID: any) {
return this.http.get(
`${environment.stopTBUserTeam_url}?userID=${userID}&providerServiceMapID=${providerServiceMapID}`,
);
}

getStopTBTeamMembers(vanID: any, providerServiceMapID: any) {
return this.http.get(
`${environment.stopTBTeamMembers_url}?vanID=${vanID}&providerServiceMapID=${providerServiceMapID}`,
);
}
}
Loading
Loading