ng-easycommerce 0.0.460 → 0.0.462

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.
package/README.md CHANGED
@@ -1,3 +1,9 @@
1
+ # version 0.0.462
2
+ - Se actualiza el componente de build-your-ec para que al finalizar la secuencia de carga de un paso, se puedar ejecutar n funciones al terminar la carga. Se corrige la posicion de la variable loadingStep para que marque correctamente cuando el paso se esta cargando.
3
+
4
+ # version 0.0.461
5
+ - Se agrega el control de que cuando el metodo de pago incluya la clave "mercado_pago" y "credit" no muestre las dos vistas juntas.
6
+
1
7
  # version 0.0.460
2
8
  - Se agrega parametro en las funciones de logout para poder decidir a donde redireccionar tras el cierre de sesión. Quedan los valores que estaban por defecto en el parametro.
3
9
 
@@ -7357,7 +7357,7 @@
7357
7357
  _this.getPK = function (method) { return (method.config.public_key || method.public_key); };
7358
7358
  _this.isRedirectRedsys = function (code) { return code && code.toLocaleLowerCase().includes('redsys_redirect'); };
7359
7359
  _this.isRedirectCecaBank = function (code) { return code && code.toLocaleLowerCase().includes('ceca_bank_redirect'); };
7360
- _this.isMP = function (code) { return code && code.toLocaleLowerCase().includes('mercado_pago'); };
7360
+ _this.isMP = function (code) { return code && code.toLocaleLowerCase().includes('mercado_pago') && !code.toLocaleLowerCase().includes('credit'); };
7361
7361
  _this.isMPTarjetaDeCredito = function (code) { return code && code.toLocaleLowerCase().includes('credit'); };
7362
7362
  _this.isMethodOffline = function (code) { return code && code.toLocaleLowerCase().includes('offline'); };
7363
7363
  _this.isPeyPalExpress = function (code) { return code && code.toLocaleLowerCase().includes('paypal') && code.toLocaleLowerCase().includes('express'); };
@@ -14360,6 +14360,12 @@
14360
14360
  _this.finished = false; //Marca si finalizo la secuencia de pasos
14361
14361
  _this.noMoreCoincidences = false; //Marca si no hay mas coincidencias de productos
14362
14362
  _this.products = []; //Recibe el/los producto/s resultantes
14363
+ /**
14364
+ * @description Arreglo de funciones para ejecutarse al terminar la carga de pasos.
14365
+ * El objeto se arma { function: [Function] , args: [Argumentos] }
14366
+ */
14367
+ _this.functionsToNextStep = [];
14368
+ _this.functionsToPrevStep = [];
14363
14369
  /**
14364
14370
  * @description inserta atributos adicionales a los pasos recibidos.
14365
14371
  * current => para indicar cuando el paso esta activo.
@@ -14483,7 +14489,8 @@
14483
14489
  }).then(function (e) { return _this.setNextStep(selectValue); }).catch(function (e) { e.status == 500 ? _this.noMoreCoincidences = true : null; });
14484
14490
  console.log('vacio pa');
14485
14491
  }
14486
- _this.loadingStep = false;
14492
+ //this.loadingStep = false
14493
+ //console.log(this.loadingStep)
14487
14494
  };
14488
14495
  /**
14489
14496
  * @description realiza el transpaso de datos desde el paso actual al siguiente paso de filtrado.
@@ -14504,7 +14511,9 @@
14504
14511
  _this.setValuesByFilter(_this.stepList[_this.currentPosition], _this.getValuesByFilter(_this.currentStep));
14505
14512
  _this.itemValuesFactory(_this.stepList[_this.currentPosition]);
14506
14513
  _this.itemCurrentSelected = '';
14514
+ _this.functionsToNextStep.length > 0 ? _this.executeFunctions() : null;
14507
14515
  }
14516
+ _this.loadingStep = false;
14508
14517
  };
14509
14518
  /**
14510
14519
  * @description realiza las configuraciones necesarias para el retroceso de un paso.
@@ -14526,7 +14535,7 @@
14526
14535
  _this.itemCurrentSelected = _this.stepList[_this.currentPosition].valueSelected
14527
14536
  ? _this.stepList[_this.currentPosition].valueSelected.code
14528
14537
  : '';
14529
- /* console.log(this.stepList) */
14538
+ _this.functionsToNextStep.length > 0 ? _this.executeFunctions('prev') : null;
14530
14539
  };
14531
14540
  /**
14532
14541
  * @description limpia los pasos, volviendo sus valores a los iniciales.
@@ -14557,6 +14566,23 @@
14557
14566
  _this.updateList = function (list) {
14558
14567
  _this.concatenated.updateStepList(list);
14559
14568
  };
14569
+ /**
14570
+ * @description Ejecuta las funciones que se deben realizar al finalizar el proceso de un paso.
14571
+ * @param typeStep
14572
+ */
14573
+ _this.executeFunctions = function (typeStep) {
14574
+ if (typeStep === void 0) { typeStep = 'next'; }
14575
+ if (typeStep == 'next') {
14576
+ _this.functionsToNextStep.forEach(function (fn) {
14577
+ fn.function(fn.args);
14578
+ });
14579
+ }
14580
+ else {
14581
+ _this.functionsToPrevStep.forEach(function (fn) {
14582
+ fn.function(fn.args);
14583
+ });
14584
+ }
14585
+ };
14560
14586
  _this.load();
14561
14587
  _this.concatenated.stepList$.subscribe(function (res) {
14562
14588
  _this.stepList = res;
@@ -14564,6 +14590,10 @@
14564
14590
  if (_this.stepList[0]) {
14565
14591
  _this.itemValuesFactory(_this.stepList[0]);
14566
14592
  _this.code = _this.stepList[0].code;
14593
+ if (!_this.stepList[0].skippeable && (_this.stepList[0].values.length == 1)) {
14594
+ console.log('uno solo vieja...');
14595
+ _this.setItemCurrentSelected(_this.stepList[0].values[0].code);
14596
+ }
14567
14597
  }
14568
14598
  });
14569
14599
  _this.concatenated.currentStep$.subscribe(function (res) { return _this.currentStep = res; });