@veloceapps/sdk 8.0.0-111 → 8.0.0-113

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,7 +16,7 @@ import * as i1 from 'primeng/dynamicdialog';
16
16
  import { BehaviorSubject, Subject, filter, first, tap, takeUntil, catchError, of, map, switchMap, shareReplay, startWith, distinctUntilChanged, from, take, combineLatest, forkJoin, throwError } from 'rxjs';
17
17
  import * as i1$2 from '@angular/router';
18
18
  import { NavigationEnd, NavigationStart, NavigationCancel, NavigationError, RouterModule } from '@angular/router';
19
- import { SalesforceIdUtils, ConfigurationContextMode, UUID } from '@veloceapps/core';
19
+ import { SalesforceIdUtils, mapShoppingCartSettings, getMaxRenewalTermsValue, ConfigurationContextMode, UUID } from '@veloceapps/core';
20
20
  import { HttpErrorResponse, HttpParams } from '@angular/common/http';
21
21
  import * as i5$1 from '@angular/forms';
22
22
  import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
@@ -593,9 +593,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
593
593
  }], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }, { type: i2.ContextService }, { type: i2.IntegrationState }]; } });
594
594
 
595
595
  class FlowDialogService {
596
- constructor(dialogService, contextService) {
596
+ constructor(dialogService, contextService, runtimeSettings) {
597
597
  this.dialogService = dialogService;
598
598
  this.contextService = contextService;
599
+ this.runtimeSettings = runtimeSettings;
599
600
  }
600
601
  show(config) {
601
602
  return this.dialogService.open(FlowDialogComponent, {
@@ -704,16 +705,25 @@ class FlowDialogService {
704
705
  secondaryButton: 'Cancel',
705
706
  });
706
707
  }
708
+ showTermsLimitReachedDialog() {
709
+ const shoppingCartSettings = mapShoppingCartSettings(this.runtimeSettings.getShoppingCartSettings() || []);
710
+ const maxRenewalTerms = getMaxRenewalTermsValue(shoppingCartSettings);
711
+ return this.show({
712
+ title: 'Terms Limit Reached',
713
+ description: `You have reached the term quantity limit: ${maxRenewalTerms}. You can increase the limit in the Shopping Cart Settings.`,
714
+ primaryButton: 'Ok',
715
+ });
716
+ }
707
717
  showDialog(dialog) {
708
718
  const dialogFunction = this[dialog].bind(this);
709
719
  return dialogFunction(dialog);
710
720
  }
711
721
  }
712
- FlowDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService, deps: [{ token: i1.DialogService }, { token: i2.ContextService }], target: i0.ɵɵFactoryTarget.Injectable });
722
+ FlowDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService, deps: [{ token: i1.DialogService }, { token: i2.ContextService }, { token: i2.RuntimeSettingsService }], target: i0.ɵɵFactoryTarget.Injectable });
713
723
  FlowDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService });
714
724
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService, decorators: [{
715
725
  type: Injectable
716
- }], ctorParameters: function () { return [{ type: i1.DialogService }, { type: i2.ContextService }]; } });
726
+ }], ctorParameters: function () { return [{ type: i1.DialogService }, { type: i2.ContextService }, { type: i2.RuntimeSettingsService }]; } });
717
727
 
718
728
  class FlowService {
719
729
  constructor(integrationState, flowRouterService, quoteDraftService, configurationService, flowConfigurationService, flowDialogService) {
@@ -820,7 +830,7 @@ class FlowGuidedSellingService {
820
830
  constructor(integrationState) {
821
831
  this.integrationState = integrationState;
822
832
  this.cleanup$ = new Subject();
823
- this.isVisibleSubj$ = new BehaviorSubject(true);
833
+ this.isVisibleSubj$ = new BehaviorSubject(false);
824
834
  this.isVisible$ = this.isVisibleSubj$.asObservable();
825
835
  this.initSubscriptions();
826
836
  }