ng-easycommerce 0.1.0 → 0.1.1

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.
@@ -19523,7 +19523,7 @@ var __decorate$1z = (this && this.__decorate) || function (decorators, target, k
19523
19523
  };
19524
19524
  var RegisterWholesalerFormEcComponent = /** @class */ (function (_super) {
19525
19525
  __extends$T(RegisterWholesalerFormEcComponent, _super);
19526
- function RegisterWholesalerFormEcComponent(authService, toastr, router, consts, paramsService, formBuilder) {
19526
+ function RegisterWholesalerFormEcComponent(authService, toastr, router, consts, paramsService, formBuilder, channelConfigService) {
19527
19527
  var _this = _super.call(this) || this;
19528
19528
  _this.authService = authService;
19529
19529
  _this.toastr = toastr;
@@ -19531,6 +19531,7 @@ var RegisterWholesalerFormEcComponent = /** @class */ (function (_super) {
19531
19531
  _this.consts = consts;
19532
19532
  _this.paramsService = paramsService;
19533
19533
  _this.formBuilder = formBuilder;
19534
+ _this.channelConfigService = channelConfigService;
19534
19535
  _this.provincesSubject = new BehaviorSubject([]);
19535
19536
  _this.countriesSubject = new BehaviorSubject([]);
19536
19537
  _this.documentTypesSubject = new BehaviorSubject([]);
@@ -19546,6 +19547,8 @@ var RegisterWholesalerFormEcComponent = /** @class */ (function (_super) {
19546
19547
  _this.requestTerms = false;
19547
19548
  _this.campospersonajuridica = false;
19548
19549
  _this.params = {};
19550
+ _this.isAccountVerificationRequired = false;
19551
+ _this.isSendWelcomeEmail = false;
19549
19552
  _this.onCountrySelected = function (value) {
19550
19553
  $('#selectOpPais').attr('disabled', true);
19551
19554
  _this.registerForm.controls['countryCode'].setValue(value);
@@ -19580,7 +19583,18 @@ var RegisterWholesalerFormEcComponent = /** @class */ (function (_super) {
19580
19583
  var formValue = __assign$t(__assign$t({}, _this.registerForm.value), { postcode: String(_this.registerForm.value.postcode) });
19581
19584
  _this.authService.signUpWholesaler(formValue).toPromise().then(function (res) {
19582
19585
  _this.register_loading = false;
19583
- _this.toastr.show('register-ok');
19586
+ var messageKey;
19587
+ switch (true) {
19588
+ case _this.isAccountVerificationRequired:
19589
+ messageKey = 'register-ok';
19590
+ break;
19591
+ case _this.isSendWelcomeEmail:
19592
+ messageKey = 'register-welcome';
19593
+ break;
19594
+ default:
19595
+ messageKey = 'register-success';
19596
+ }
19597
+ _this.toastr.showPersistent(messageKey);
19584
19598
  _this.success = true;
19585
19599
  _this.ready.emit(true);
19586
19600
  if (_this.redirect) {
@@ -19610,6 +19624,14 @@ var RegisterWholesalerFormEcComponent = /** @class */ (function (_super) {
19610
19624
  RegisterWholesalerFormEcComponent.prototype.ngOnInit = function () {
19611
19625
  var _this = this;
19612
19626
  this.paramsService.parameters.subscribe(function (res) { return _this.params = res; });
19627
+ this.channelConfigService.channelConfig$.subscribe(function (config) {
19628
+ _this.isAccountVerificationRequired = config && config.isAccountVerificationRequired !== undefined
19629
+ ? config.isAccountVerificationRequired
19630
+ : false;
19631
+ _this.isSendWelcomeEmail = config && config.isSendWelcomeEmail !== undefined
19632
+ ? config.isSendWelcomeEmail
19633
+ : false;
19634
+ });
19613
19635
  this.registerForm = this.formBuilder.group({
19614
19636
  firstName: ['', [Validators.required, Validators.pattern(/^[A-Za-zÁÉÍÓÚáéíóúÑñ\s]+$/)]],
19615
19637
  lastName: ['', [Validators.required, Validators.pattern(/^[A-Za-zÁÉÍÓÚáéíóúÑñ\s]+$/)]],
@@ -19655,7 +19677,8 @@ var RegisterWholesalerFormEcComponent = /** @class */ (function (_super) {
19655
19677
  { type: Router },
19656
19678
  { type: Constants },
19657
19679
  { type: ParametersService },
19658
- { type: FormBuilder }
19680
+ { type: FormBuilder },
19681
+ { type: ChannelConfigService }
19659
19682
  ]; };
19660
19683
  __decorate$1z([
19661
19684
  Input()