@alfresco/adf-process-services-cloud 9.2.0-32283329264 → 9.2.0-32299189723

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.
@@ -9574,16 +9574,23 @@ class BaseScreenCloudComponent {
9574
9574
  ngOnInit() {
9575
9575
  this.createDynamicComponent();
9576
9576
  }
9577
+ ngOnDestroy() {
9578
+ this.componentRef?.destroy();
9579
+ this.componentRef = undefined;
9580
+ this._componentRefChanged.set(undefined);
9581
+ }
9577
9582
  createDynamicComponent() {
9578
- if (this.screenId) {
9579
- const componentType = this.screenRenderingService.resolveComponentType({ type: this.screenId });
9580
- this.componentRef = this.container.createComponent(componentType);
9581
- this._componentRefChanged.set(this.componentRef);
9582
- this.setInputsForDynamicComponent();
9583
- this.subscribeToOutputs();
9583
+ if (!this.screenId || !this.container) {
9584
+ return;
9584
9585
  }
9586
+ const componentType = this.screenRenderingService.resolveComponentType({ type: this.screenId });
9587
+ const componentRef = this.container.createComponent(componentType);
9588
+ this.componentRef = componentRef;
9589
+ this._componentRefChanged.set(componentRef);
9590
+ this.setInputsForDynamicComponent(componentRef);
9591
+ this.subscribeToOutputs(componentRef);
9585
9592
  }
9586
- setInputsForDynamicComponent() { }
9593
+ setInputsForDynamicComponent(_componentRef) { }
9587
9594
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: BaseScreenCloudComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
9588
9595
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.27", type: BaseScreenCloudComponent, isStandalone: true, selector: "ng-component", inputs: { screenId: "screenId" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: '', isInline: true }); }
9589
9596
  }
@@ -9648,64 +9655,64 @@ class TaskScreenCloudComponent extends BaseScreenCloudComponent {
9648
9655
  this.nextTaskCheckboxCheckedChanged = new EventEmitter();
9649
9656
  this.destroyRef = inject(DestroyRef);
9650
9657
  }
9651
- setInputsForDynamicComponent() {
9652
- if (this.taskId && Object.prototype.hasOwnProperty.call(this.componentRef.instance, 'taskId')) {
9653
- this.componentRef.setInput('taskId', this.taskId);
9658
+ setInputsForDynamicComponent(componentRef) {
9659
+ if (this.taskId && Object.prototype.hasOwnProperty.call(componentRef.instance, 'taskId')) {
9660
+ componentRef.setInput('taskId', this.taskId);
9654
9661
  }
9655
- if (this.appName && Object.prototype.hasOwnProperty.call(this.componentRef.instance, 'appName')) {
9656
- this.componentRef.setInput('appName', this.appName);
9662
+ if (this.appName && Object.prototype.hasOwnProperty.call(componentRef.instance, 'appName')) {
9663
+ componentRef.setInput('appName', this.appName);
9657
9664
  }
9658
- if (this.screenId && Object.prototype.hasOwnProperty.call(this.componentRef.instance, 'screenId')) {
9659
- this.componentRef.setInput('screenId', this.screenId);
9665
+ if (this.screenId && Object.prototype.hasOwnProperty.call(componentRef.instance, 'screenId')) {
9666
+ componentRef.setInput('screenId', this.screenId);
9660
9667
  }
9661
- if (this.processInstanceId && Object.prototype.hasOwnProperty.call(this.componentRef.instance, 'processInstanceId')) {
9662
- this.componentRef.setInput('processInstanceId', this.processInstanceId);
9668
+ if (this.processInstanceId && Object.prototype.hasOwnProperty.call(componentRef.instance, 'processInstanceId')) {
9669
+ componentRef.setInput('processInstanceId', this.processInstanceId);
9663
9670
  }
9664
- if (this.taskName && Object.prototype.hasOwnProperty.call(this.componentRef.instance, 'taskName')) {
9665
- this.componentRef.setInput('taskName', this.taskName);
9671
+ if (this.taskName && Object.prototype.hasOwnProperty.call(componentRef.instance, 'taskName')) {
9672
+ componentRef.setInput('taskName', this.taskName);
9666
9673
  }
9667
- if (this.canClaimTask && Object.prototype.hasOwnProperty.call(this.componentRef.instance, 'canClaimTask')) {
9668
- this.componentRef.setInput('canClaimTask', this.canClaimTask);
9674
+ if (this.canClaimTask && Object.prototype.hasOwnProperty.call(componentRef.instance, 'canClaimTask')) {
9675
+ componentRef.setInput('canClaimTask', this.canClaimTask);
9669
9676
  }
9670
- if (this.canUnclaimTask && Object.prototype.hasOwnProperty.call(this.componentRef.instance, 'canUnclaimTask')) {
9671
- this.componentRef.setInput('canUnclaimTask', this.canUnclaimTask);
9677
+ if (this.canUnclaimTask && Object.prototype.hasOwnProperty.call(componentRef.instance, 'canUnclaimTask')) {
9678
+ componentRef.setInput('canUnclaimTask', this.canUnclaimTask);
9672
9679
  }
9673
- if (this.showCancelButton && Object.prototype.hasOwnProperty.call(this.componentRef.instance, 'showCancelButton')) {
9674
- this.componentRef.setInput('showCancelButton', this.showCancelButton);
9680
+ if (this.showCancelButton && Object.prototype.hasOwnProperty.call(componentRef.instance, 'showCancelButton')) {
9681
+ componentRef.setInput('showCancelButton', this.showCancelButton);
9675
9682
  }
9676
- if (this.rootProcessInstanceId && Object.prototype.hasOwnProperty.call(this.componentRef.instance, 'rootProcessInstanceId')) {
9677
- this.componentRef.setInput('rootProcessInstanceId', this.rootProcessInstanceId);
9683
+ if (this.rootProcessInstanceId && Object.prototype.hasOwnProperty.call(componentRef.instance, 'rootProcessInstanceId')) {
9684
+ componentRef.setInput('rootProcessInstanceId', this.rootProcessInstanceId);
9678
9685
  }
9679
- if (this.showNextTaskCheckbox && Object.prototype.hasOwnProperty.call(this.componentRef.instance, 'showNextTaskCheckbox')) {
9680
- this.componentRef.setInput('showNextTaskCheckbox', this.showNextTaskCheckbox);
9686
+ if (this.showNextTaskCheckbox && Object.prototype.hasOwnProperty.call(componentRef.instance, 'showNextTaskCheckbox')) {
9687
+ componentRef.setInput('showNextTaskCheckbox', this.showNextTaskCheckbox);
9681
9688
  }
9682
- if (this.isNextTaskCheckboxChecked && Object.prototype.hasOwnProperty.call(this.componentRef.instance, 'isNextTaskCheckboxChecked')) {
9683
- this.componentRef.setInput('isNextTaskCheckboxChecked', this.isNextTaskCheckboxChecked);
9689
+ if (this.isNextTaskCheckboxChecked && Object.prototype.hasOwnProperty.call(componentRef.instance, 'isNextTaskCheckboxChecked')) {
9690
+ componentRef.setInput('isNextTaskCheckboxChecked', this.isNextTaskCheckboxChecked);
9684
9691
  }
9685
9692
  }
9686
- subscribeToOutputs() {
9687
- if (this.componentRef.instance?.taskSaved) {
9688
- this.componentRef.instance.taskSaved.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => this.taskSaved.emit());
9693
+ subscribeToOutputs(componentRef) {
9694
+ if (componentRef.instance?.taskSaved) {
9695
+ componentRef.instance.taskSaved.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => this.taskSaved.emit());
9689
9696
  }
9690
- if (this.componentRef.instance?.taskCompleted) {
9691
- this.componentRef.instance.taskCompleted
9697
+ if (componentRef.instance?.taskCompleted) {
9698
+ componentRef.instance.taskCompleted
9692
9699
  .pipe(takeUntilDestroyed(this.destroyRef))
9693
9700
  .subscribe((openNextTask) => this.taskCompleted.emit(openNextTask));
9694
9701
  }
9695
- if (this.componentRef.instance?.error) {
9696
- this.componentRef.instance.error.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((data) => this.error.emit(data));
9702
+ if (componentRef.instance?.error) {
9703
+ componentRef.instance.error.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((data) => this.error.emit(data));
9697
9704
  }
9698
- if (this.componentRef.instance?.claimTask) {
9699
- this.componentRef.instance.claimTask.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((data) => this.claimTask.emit(data));
9705
+ if (componentRef.instance?.claimTask) {
9706
+ componentRef.instance.claimTask.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((data) => this.claimTask.emit(data));
9700
9707
  }
9701
- if (this.componentRef.instance?.unclaimTask) {
9702
- this.componentRef.instance.unclaimTask.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((data) => this.unclaimTask.emit(data));
9708
+ if (componentRef.instance?.unclaimTask) {
9709
+ componentRef.instance.unclaimTask.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((data) => this.unclaimTask.emit(data));
9703
9710
  }
9704
- if (this.componentRef.instance?.cancelTask) {
9705
- this.componentRef.instance.cancelTask.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((data) => this.cancelTask.emit(data));
9711
+ if (componentRef.instance?.cancelTask) {
9712
+ componentRef.instance.cancelTask.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((data) => this.cancelTask.emit(data));
9706
9713
  }
9707
- if (this.componentRef.instance?.nextTaskCheckboxCheckedChanged) {
9708
- this.componentRef.instance.nextTaskCheckboxCheckedChanged
9714
+ if (componentRef.instance?.nextTaskCheckboxCheckedChanged) {
9715
+ componentRef.instance.nextTaskCheckboxCheckedChanged
9709
9716
  .pipe(takeUntilDestroyed(this.destroyRef))
9710
9717
  .subscribe((data) => this.nextTaskCheckboxCheckedChanged.emit(data));
9711
9718
  }
@@ -13676,7 +13683,7 @@ class StartProcessScreenCloudComponent extends BaseScreenCloudComponent {
13676
13683
  this.showStartProcessButtons = signal(false, ...(ngDevMode ? [{ debugName: "showStartProcessButtons" }] : []));
13677
13684
  effect(() => {
13678
13685
  const componentRef = this.componentRefChanged();
13679
- if (componentRef.instance && 'appName' in componentRef.instance) {
13686
+ if (componentRef?.instance && 'appName' in componentRef.instance) {
13680
13687
  componentRef.setInput('appName', this.appName());
13681
13688
  }
13682
13689
  });
@@ -13688,9 +13695,9 @@ class StartProcessScreenCloudComponent extends BaseScreenCloudComponent {
13688
13695
  }
13689
13696
  });
13690
13697
  }
13691
- subscribeToOutputs() {
13692
- this.componentRef.instance.startProcessPayloadChanged.subscribe((payload) => this.screenStartProcessPayloadChange.emit(payload));
13693
- this.componentRef.instance.defaultStartProcessButtonsConfigurationChange.subscribe((config) => {
13698
+ subscribeToOutputs(componentRef) {
13699
+ componentRef.instance.startProcessPayloadChanged.subscribe((payload) => this.screenStartProcessPayloadChange.emit(payload));
13700
+ componentRef.instance.defaultStartProcessButtonsConfigurationChange.subscribe((config) => {
13694
13701
  this.showStartProcessButtons.set(config.show);
13695
13702
  this.disableStartProcessButton.emit(config.disable);
13696
13703
  });