@idsoftsource/initial-process 4.0.2 → 4.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3464,10 +3464,19 @@ class PreviewComponent {
|
|
|
3464
3464
|
}
|
|
3465
3465
|
loadProfessionTypes() {
|
|
3466
3466
|
this.professionService.getProfessions({ filter: 'isActive=true', orderBy: 'professionName asc' }).subscribe({
|
|
3467
|
-
next: (res) => { this.professionTypes = res?.data || []; this.recomputeProfessionGroupAndTypeOptions(); },
|
|
3467
|
+
next: (res) => { this.professionTypes = this.mapProfessionTypes(res?.data || []); this.recomputeProfessionGroupAndTypeOptions(); },
|
|
3468
3468
|
error: () => { this.professionTypes = []; this.recomputeProfessionGroupAndTypeOptions(); }
|
|
3469
3469
|
});
|
|
3470
3470
|
}
|
|
3471
|
+
// getProfession returns the group/type under `ProfessionGroupAssignmentType`/`assignmentType`;
|
|
3472
|
+
// normalize them onto `professionGroup`/`professionAssignmentType`, the fields the table and manual rows use.
|
|
3473
|
+
mapProfessionTypes(items) {
|
|
3474
|
+
return items.map((p) => ({
|
|
3475
|
+
...p,
|
|
3476
|
+
professionGroup: p.professionGroup ?? p.ProfessionGroupAssignmentType ?? '',
|
|
3477
|
+
professionAssignmentType: p.professionAssignmentType ?? p.assignmentType ?? '',
|
|
3478
|
+
}));
|
|
3479
|
+
}
|
|
3471
3480
|
professionSearchQry = null;
|
|
3472
3481
|
isSavingProfessionsTable = false;
|
|
3473
3482
|
deletingProfessionTypeId = signal(null, ...(ngDevMode ? [{ debugName: "deletingProfessionTypeId" }] : []));
|
|
@@ -3599,7 +3608,7 @@ class PreviewComponent {
|
|
|
3599
3608
|
recomputeProfessionGroupAndTypeOptions() {
|
|
3600
3609
|
const groups = this.professionTypes.map((p) => p.professionGroup).filter((g) => !!g);
|
|
3601
3610
|
this.professionGroupOptions = Array.from(new Set(groups)).sort();
|
|
3602
|
-
const types = this.professionTypes.map((p) => p.
|
|
3611
|
+
const types = this.professionTypes.map((p) => p.professionAssignmentType).filter((t) => !!t);
|
|
3603
3612
|
this.professionTypeOptions = Array.from(new Set(types)).sort();
|
|
3604
3613
|
}
|
|
3605
3614
|
isManualProfessionType(id) {
|
|
@@ -36467,10 +36476,19 @@ class ProfessionComponent {
|
|
|
36467
36476
|
}
|
|
36468
36477
|
loadProfessionTypes() {
|
|
36469
36478
|
this.professionService.getProfessions({ filter: 'isActive=true', orderBy: 'professionName asc' }).subscribe({
|
|
36470
|
-
next: (res) => { this.professionTypes = res?.data || []; this.recomputeProfessionGroupAndTypeOptions(); },
|
|
36479
|
+
next: (res) => { this.professionTypes = this.mapProfessionTypes(res?.data || []); this.recomputeProfessionGroupAndTypeOptions(); },
|
|
36471
36480
|
error: () => { this.professionTypes = []; this.recomputeProfessionGroupAndTypeOptions(); }
|
|
36472
36481
|
});
|
|
36473
36482
|
}
|
|
36483
|
+
// getProfession returns the group/type under `ProfessionGroupAssignmentType`/`assignmentType`;
|
|
36484
|
+
// normalize them onto `professionGroup`/`professionAssignmentType`, the fields the table and manual rows use.
|
|
36485
|
+
mapProfessionTypes(items) {
|
|
36486
|
+
return items.map((p) => ({
|
|
36487
|
+
...p,
|
|
36488
|
+
professionGroup: p.professionGroup ?? p.ProfessionGroupAssignmentType ?? '',
|
|
36489
|
+
professionAssignmentType: p.professionAssignmentType ?? p.assignmentType ?? '',
|
|
36490
|
+
}));
|
|
36491
|
+
}
|
|
36474
36492
|
buildProfessionQuery(orderBy) {
|
|
36475
36493
|
return {
|
|
36476
36494
|
page: 1,
|
|
@@ -36496,7 +36514,7 @@ class ProfessionComponent {
|
|
|
36496
36514
|
recomputeProfessionGroupAndTypeOptions() {
|
|
36497
36515
|
const groups = this.professionTypes.map((p) => p.professionGroup).filter((g) => !!g);
|
|
36498
36516
|
this.professionGroupOptions = Array.from(new Set(groups)).sort();
|
|
36499
|
-
const types = this.professionTypes.map((p) => p.
|
|
36517
|
+
const types = this.professionTypes.map((p) => p.professionAssignmentType).filter((t) => !!t);
|
|
36500
36518
|
this.professionTypeOptions = Array.from(new Set(types)).sort();
|
|
36501
36519
|
}
|
|
36502
36520
|
normalizeProfessionTypeId(id) {
|