@valtimo/process-link 13.41.0 → 13.42.0

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.
@@ -4330,9 +4330,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
4330
4330
  */
4331
4331
  class FormFlowComponent {
4332
4332
  set formFlowInstanceId(value) {
4333
+ if (this.formFlowInstanceId$.getValue() === value)
4334
+ return;
4333
4335
  this.formFlowInstanceId$.next(value);
4334
- if (value)
4335
- this.getBreadcrumbs();
4336
+ // Hide the step of the previous instance until the new one has been loaded.
4337
+ this.formFlowStepType$.next(null);
4338
+ if (!value)
4339
+ return;
4340
+ this.getBreadcrumbs();
4341
+ this.getFormFlowStep();
4336
4342
  }
4337
4343
  constructor(formFlowService, modalService, translateService, configService) {
4338
4344
  this.formFlowService = formFlowService;
@@ -4353,9 +4359,6 @@ class FormFlowComponent {
4353
4359
  this.formioOptions = new FormioOptionsImpl();
4354
4360
  this.formioOptions.disableAlerts = true;
4355
4361
  }
4356
- ngOnInit() {
4357
- this.getFormFlowStep();
4358
- }
4359
4362
  ngOnDestroy() {
4360
4363
  this._breadcrumbsSubscription?.unsubscribe();
4361
4364
  }
@@ -4430,14 +4433,18 @@ class FormFlowComponent {
4430
4433
  .subscribe(breadcrumbs => {
4431
4434
  const classElement = document.getElementsByClassName('cds--progress-step--current');
4432
4435
  this.currentStepIndex$.next(breadcrumbs.currentStepIndex);
4433
- this.breadcrumbs$.next(breadcrumbs.breadcrumbs.map(breadcrumb => ({
4434
- label: breadcrumb.title ??
4435
- this.translateService.instant(`formFlow.step.${breadcrumb.key}.title`) ??
4436
- breadcrumb.key,
4437
- disabled: breadcrumb.stepInstanceId === null,
4438
- complete: breadcrumb.completed,
4439
- stepInstanceId: breadcrumb.stepInstanceId,
4440
- })));
4436
+ this.breadcrumbs$.next(breadcrumbs.breadcrumbs.map(breadcrumb => {
4437
+ const translationKey = `formFlow.step.${breadcrumb.key}.title`;
4438
+ // instant() returns the key itself when no translation exists
4439
+ const translatedTitle = this.translateService.instant(translationKey);
4440
+ return {
4441
+ label: breadcrumb.title ??
4442
+ (translatedTitle !== translationKey ? translatedTitle : breadcrumb.key),
4443
+ disabled: breadcrumb.stepInstanceId === null,
4444
+ complete: breadcrumb.completed,
4445
+ stepInstanceId: breadcrumb.stepInstanceId,
4446
+ };
4447
+ }));
4441
4448
  if (classElement.length > 0) {
4442
4449
  classElement[0].scrollIntoView({ behavior: 'smooth', inline: 'center' });
4443
4450
  }