@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 { mapShoppingCartSettings, getMaxRenewalTermsValue, SalesforceIdUtils, 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';
@@ -419,9 +419,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
419
419
  }] });
420
420
 
421
421
  class FlowDialogService {
422
- constructor(dialogService, contextService) {
422
+ constructor(dialogService, contextService, runtimeSettings) {
423
423
  this.dialogService = dialogService;
424
424
  this.contextService = contextService;
425
+ this.runtimeSettings = runtimeSettings;
425
426
  }
426
427
  show(config) {
427
428
  return this.dialogService.open(FlowDialogComponent, {
@@ -530,16 +531,25 @@ class FlowDialogService {
530
531
  secondaryButton: 'Cancel',
531
532
  });
532
533
  }
534
+ showTermsLimitReachedDialog() {
535
+ const shoppingCartSettings = mapShoppingCartSettings(this.runtimeSettings.getShoppingCartSettings() || []);
536
+ const maxRenewalTerms = getMaxRenewalTermsValue(shoppingCartSettings);
537
+ return this.show({
538
+ title: 'Terms Limit Reached',
539
+ description: `You have reached the term quantity limit: ${maxRenewalTerms}. You can increase the limit in the Shopping Cart Settings.`,
540
+ primaryButton: 'Ok',
541
+ });
542
+ }
533
543
  showDialog(dialog) {
534
544
  const dialogFunction = this[dialog].bind(this);
535
545
  return dialogFunction(dialog);
536
546
  }
537
547
  }
538
- 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 });
548
+ 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 });
539
549
  FlowDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService });
540
550
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService, decorators: [{
541
551
  type: Injectable
542
- }], ctorParameters: function () { return [{ type: i1.DialogService }, { type: i2.ContextService }]; } });
552
+ }], ctorParameters: function () { return [{ type: i1.DialogService }, { type: i2.ContextService }, { type: i2.RuntimeSettingsService }]; } });
543
553
 
544
554
  class FlowRouterService {
545
555
  constructor(router, route, contextService, integrationState) {
@@ -805,7 +815,7 @@ class FlowGuidedSellingService {
805
815
  constructor(integrationState) {
806
816
  this.integrationState = integrationState;
807
817
  this.cleanup$ = new Subject();
808
- this.isVisibleSubj$ = new BehaviorSubject(true);
818
+ this.isVisibleSubj$ = new BehaviorSubject(false);
809
819
  this.isVisible$ = this.isVisibleSubj$.asObservable();
810
820
  this.initSubscriptions();
811
821
  }