@idsoftsource/initial-process 3.3.2 → 3.3.4
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.
|
@@ -3351,7 +3351,7 @@ class PreviewComponent {
|
|
|
3351
3351
|
professions = computed(() => this.store.profileSignal()?.professions || [], ...(ngDevMode ? [{ debugName: "professions" }] : []));
|
|
3352
3352
|
async refreshUserProfessionOptions() {
|
|
3353
3353
|
try {
|
|
3354
|
-
const res = await firstValueFrom(this.userProfessionService.getUserProfession(this.
|
|
3354
|
+
const res = await firstValueFrom(this.userProfessionService.getUserProfession(this.buildProfessionQuery('professionName asc')));
|
|
3355
3355
|
this.userProfessionOptions = Array.isArray(res?.data) ? res.data : [];
|
|
3356
3356
|
this.applySavedProfessionsToTable();
|
|
3357
3357
|
}
|
|
@@ -3389,9 +3389,11 @@ class PreviewComponent {
|
|
|
3389
3389
|
try {
|
|
3390
3390
|
const payload = {
|
|
3391
3391
|
forUser: ForUser.ForProducer,
|
|
3392
|
+
targetUserId: this.effectiveTargetUserId,
|
|
3393
|
+
targetProviderId: this.effectiveTargetProviderId,
|
|
3392
3394
|
professionName: name,
|
|
3393
3395
|
notes: '',
|
|
3394
|
-
year:
|
|
3396
|
+
year: 0,
|
|
3395
3397
|
starRating: null,
|
|
3396
3398
|
profileVisibility: false,
|
|
3397
3399
|
status: RequestedStatus.InReview,
|
|
@@ -3459,7 +3461,15 @@ class PreviewComponent {
|
|
|
3459
3461
|
}
|
|
3460
3462
|
isProfessionTypeSaved(id) {
|
|
3461
3463
|
const typeId = this.normalizeProfessionTypeId(id);
|
|
3462
|
-
|
|
3464
|
+
if (!typeId)
|
|
3465
|
+
return false;
|
|
3466
|
+
if (this.savedProfessionTypeIds.has(typeId))
|
|
3467
|
+
return true;
|
|
3468
|
+
const profType = this.professionTypes.find((p) => p.id === id);
|
|
3469
|
+
const name = (profType?.professionName || '').trim().toLowerCase();
|
|
3470
|
+
if (!name)
|
|
3471
|
+
return false;
|
|
3472
|
+
return (this.userProfessionOptions ?? []).some((o) => (o.professionName || '').trim().toLowerCase() === name);
|
|
3463
3473
|
}
|
|
3464
3474
|
markProfessionSelectionSaved(id, serverRecordId) {
|
|
3465
3475
|
const typeId = this.normalizeProfessionTypeId(id);
|
|
@@ -3535,10 +3545,6 @@ class PreviewComponent {
|
|
|
3535
3545
|
get hasNoProfessionMatches() {
|
|
3536
3546
|
return !!(this.professionSearchQry || '').trim() && this.filteredProfessionTypes.length === 0;
|
|
3537
3547
|
}
|
|
3538
|
-
// Plain (not getter) fields: ng-select's [items] input resets/reprocesses itself whenever
|
|
3539
|
-
// it receives a new array reference, including mid-open on the same click that opened it.
|
|
3540
|
-
// A getter here would return a fresh array on every change-detection tick and cause the
|
|
3541
|
-
// dropdown to flash open then immediately close. Recomputed only when professionTypes changes.
|
|
3542
3548
|
professionGroupOptions = [];
|
|
3543
3549
|
professionTypeOptions = [];
|
|
3544
3550
|
recomputeProfessionGroupAndTypeOptions() {
|
|
@@ -3643,6 +3649,8 @@ class PreviewComponent {
|
|
|
3643
3649
|
const sel = this.professionSelections[id];
|
|
3644
3650
|
const payload = {
|
|
3645
3651
|
forUser: ForUser.ForProducer,
|
|
3652
|
+
targetUserId: this.effectiveTargetUserId,
|
|
3653
|
+
targetProviderId: this.effectiveTargetProviderId,
|
|
3646
3654
|
professionName: profType.professionName,
|
|
3647
3655
|
notes: sel.notes ?? '',
|
|
3648
3656
|
year: sel.year ?? null,
|
|
@@ -4279,6 +4287,16 @@ class PreviewComponent {
|
|
|
4279
4287
|
pageSize: 100,
|
|
4280
4288
|
filter: includeForUser ? `forUser=${ForUser.ForProducer}` : ``,
|
|
4281
4289
|
targetUserId: this.effectiveTargetUserId,
|
|
4290
|
+
targetProviderId: this.effectiveTargetProviderId ?? undefined,
|
|
4291
|
+
orderBy,
|
|
4292
|
+
};
|
|
4293
|
+
}
|
|
4294
|
+
buildProfessionQuery(orderBy) {
|
|
4295
|
+
return {
|
|
4296
|
+
page: 1,
|
|
4297
|
+
pageSize: 100,
|
|
4298
|
+
filter: `forUser=${ForUser.ForProducer}`,
|
|
4299
|
+
targetUserId: this.effectiveTargetUserId,
|
|
4282
4300
|
orderBy,
|
|
4283
4301
|
};
|
|
4284
4302
|
}
|
|
@@ -4287,6 +4305,7 @@ class PreviewComponent {
|
|
|
4287
4305
|
page: 1,
|
|
4288
4306
|
pageSize: 100,
|
|
4289
4307
|
targetUserId: this.effectiveTargetUserId,
|
|
4308
|
+
targetProviderId: this.effectiveTargetProviderId ?? undefined,
|
|
4290
4309
|
orderBy,
|
|
4291
4310
|
};
|
|
4292
4311
|
}
|
|
@@ -4636,7 +4655,7 @@ class PreviewComponent {
|
|
|
4636
4655
|
const payload = this.mapProfessions(this.resumeData)[index];
|
|
4637
4656
|
if (!payload)
|
|
4638
4657
|
return;
|
|
4639
|
-
const res = await firstValueFrom(this.userProfessionService.getUserProfession(this.
|
|
4658
|
+
const res = await firstValueFrom(this.userProfessionService.getUserProfession(this.buildProfessionQuery('professionName asc')));
|
|
4640
4659
|
const saved = Array.isArray(res?.data) ? res.data : [];
|
|
4641
4660
|
const targetName = this.normalizedText(payload.professionName);
|
|
4642
4661
|
const targetYear = payload.year;
|
|
@@ -4700,7 +4719,7 @@ class PreviewComponent {
|
|
|
4700
4719
|
})),
|
|
4701
4720
|
firstValueFrom(this.userSkillSetService.getUserSkillSet(this.buildSectionQuery('skillSetName asc', true))),
|
|
4702
4721
|
firstValueFrom(this.userToolService.getUserTool(this.buildSectionQuery('toolName asc', true))),
|
|
4703
|
-
firstValueFrom(this.userProfessionService.getUserProfession(this.
|
|
4722
|
+
firstValueFrom(this.userProfessionService.getUserProfession(this.buildProfessionQuery('professionName asc'))),
|
|
4704
4723
|
firstValueFrom(this.userDetailService.getByUserId(this.payloadUserId, request)).catch(() => null),
|
|
4705
4724
|
]);
|
|
4706
4725
|
this.store.sectionDataLoaded.set(true);
|