@idsoftsource/initial-process 3.3.3 → 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.buildSectionQuery('professionName asc', true)));
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
  }
@@ -3393,7 +3393,7 @@ class PreviewComponent {
3393
3393
  targetProviderId: this.effectiveTargetProviderId,
3394
3394
  professionName: name,
3395
3395
  notes: '',
3396
- year: null,
3396
+ year: 0,
3397
3397
  starRating: null,
3398
3398
  profileVisibility: false,
3399
3399
  status: RequestedStatus.InReview,
@@ -3461,7 +3461,15 @@ class PreviewComponent {
3461
3461
  }
3462
3462
  isProfessionTypeSaved(id) {
3463
3463
  const typeId = this.normalizeProfessionTypeId(id);
3464
- return !!typeId && this.savedProfessionTypeIds.has(typeId);
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);
3465
3473
  }
3466
3474
  markProfessionSelectionSaved(id, serverRecordId) {
3467
3475
  const typeId = this.normalizeProfessionTypeId(id);
@@ -3537,10 +3545,6 @@ class PreviewComponent {
3537
3545
  get hasNoProfessionMatches() {
3538
3546
  return !!(this.professionSearchQry || '').trim() && this.filteredProfessionTypes.length === 0;
3539
3547
  }
3540
- // Plain (not getter) fields: ng-select's [items] input resets/reprocesses itself whenever
3541
- // it receives a new array reference, including mid-open on the same click that opened it.
3542
- // A getter here would return a fresh array on every change-detection tick and cause the
3543
- // dropdown to flash open then immediately close. Recomputed only when professionTypes changes.
3544
3548
  professionGroupOptions = [];
3545
3549
  professionTypeOptions = [];
3546
3550
  recomputeProfessionGroupAndTypeOptions() {
@@ -4287,6 +4291,15 @@ class PreviewComponent {
4287
4291
  orderBy,
4288
4292
  };
4289
4293
  }
4294
+ buildProfessionQuery(orderBy) {
4295
+ return {
4296
+ page: 1,
4297
+ pageSize: 100,
4298
+ filter: `forUser=${ForUser.ForProducer}`,
4299
+ targetUserId: this.effectiveTargetUserId,
4300
+ orderBy,
4301
+ };
4302
+ }
4290
4303
  buildSectionForUserQuery(orderBy, includeForUser = false) {
4291
4304
  return {
4292
4305
  page: 1,
@@ -4642,7 +4655,7 @@ class PreviewComponent {
4642
4655
  const payload = this.mapProfessions(this.resumeData)[index];
4643
4656
  if (!payload)
4644
4657
  return;
4645
- const res = await firstValueFrom(this.userProfessionService.getUserProfession(this.buildSectionQuery('professionName asc', true)));
4658
+ const res = await firstValueFrom(this.userProfessionService.getUserProfession(this.buildProfessionQuery('professionName asc')));
4646
4659
  const saved = Array.isArray(res?.data) ? res.data : [];
4647
4660
  const targetName = this.normalizedText(payload.professionName);
4648
4661
  const targetYear = payload.year;
@@ -4706,7 +4719,7 @@ class PreviewComponent {
4706
4719
  })),
4707
4720
  firstValueFrom(this.userSkillSetService.getUserSkillSet(this.buildSectionQuery('skillSetName asc', true))),
4708
4721
  firstValueFrom(this.userToolService.getUserTool(this.buildSectionQuery('toolName asc', true))),
4709
- firstValueFrom(this.userProfessionService.getUserProfession(this.buildSectionQuery('professionName asc', true))),
4722
+ firstValueFrom(this.userProfessionService.getUserProfession(this.buildProfessionQuery('professionName asc'))),
4710
4723
  firstValueFrom(this.userDetailService.getByUserId(this.payloadUserId, request)).catch(() => null),
4711
4724
  ]);
4712
4725
  this.store.sectionDataLoaded.set(true);