@veloceapps/sdk 12.0.0-19 → 12.0.0-20

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.
@@ -588,6 +588,22 @@ class ConfigurationService {
588
588
  this.previousConfigurationStateSubj$.next(configurationState);
589
589
  }), map$1(noop));
590
590
  }
591
+ patchState$(context) {
592
+ return this.configure$(context).pipe(catchError(error => {
593
+ console.error(error);
594
+ if (!this.configurationRuntimeService.uiDefinitionProps.suppressToastMessages) {
595
+ this.messageService.add({ severity: 'error', summary: error });
596
+ }
597
+ return throwError(() => error);
598
+ }), tap$1(() => {
599
+ if (!this.hasUnsavedChanges) {
600
+ this.hasUnsavedChanges = true;
601
+ }
602
+ }), map$1(noop));
603
+ }
604
+ patchState(context) {
605
+ this.patchState$(context).subscribe();
606
+ }
591
607
  patch$(transactionItem) {
592
608
  const { state, root } = this;
593
609
  if (!state) {
@@ -604,17 +620,7 @@ class ConfigurationService {
604
620
  salesTransactionItems: [newRoot],
605
621
  },
606
622
  };
607
- return this.configure$(newTransactionContext).pipe(catchError(error => {
608
- console.error(error);
609
- if (!this.configurationRuntimeService.uiDefinitionProps.suppressToastMessages) {
610
- this.messageService.add({ severity: 'error', summary: error });
611
- }
612
- return throwError(() => error);
613
- }), tap$1(() => {
614
- if (!this.hasUnsavedChanges) {
615
- this.hasUnsavedChanges = true;
616
- }
617
- }), map$1(noop));
623
+ return this.patchState$(newTransactionContext);
618
624
  }
619
625
  patch(transactionItem) {
620
626
  this.patch$(transactionItem).subscribe();
@@ -1586,12 +1592,12 @@ class ConfigurationStateService {
1586
1592
  return of({ id: '' });
1587
1593
  }
1588
1594
  const { standalone } = this.flowInfoService.flow.properties;
1589
- const transactionContext = this.salesTransactionService.state;
1595
+ const transactionContext = this.configurationService.state;
1590
1596
  const configurationRoot = this.configurationService.root;
1591
1597
  if (!transactionContext || !configurationRoot) {
1592
1598
  return of({ id: '' });
1593
1599
  }
1594
- const stateItems = transactionContext.salesTransaction.salesTransactionItems;
1600
+ const stateItems = this.salesTransactionService.state?.salesTransaction.salesTransactionItems ?? [];
1595
1601
  const isNewTransactionItem = stateItems.every(ti => ti.id !== configurationRoot.id);
1596
1602
  let salesTransactionItems;
1597
1603
  if (isNewTransactionItem) {