ng-easycommerce 0.0.600 → 0.0.601

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,5 @@
1
+ # version 0.0.601
2
+ - Se arregló un error en el checkout (`dataform-ec.component.ts`), que se intentaba agregar el código de la primera provincia, sin verificar que existieran provincias.
1
3
  # version 0.0.600
2
4
  - Se implementa la validación de documentos según el tipo seleccionado en el formulario de checkout.
3
5
  - Se agrega la lógica en `dataform-ec.component.ts` para establecer patrones de validación dinámicos de acuerdo con el tipo de documento.
@@ -8100,14 +8100,15 @@
8100
8100
  :
8101
8101
  [];
8102
8102
  _this.provincesSubject.next(provinces);
8103
- _this.checkoutForm.controls['provinceCode'].setValue(provinces[0].code);
8103
+ if (provinces.length) {
8104
+ _this.checkoutForm.controls['provinceCode'].setValue(provinces[0].code);
8105
+ }
8104
8106
  //Document types
8105
- var documentTypes = value && value != 'null' ?
8106
- _this.countriesSubject.value.find(function (country) { return country.code == value; }).documentTypes
8107
- :
8108
- [];
8107
+ var documentTypes = selectedCountry ? selectedCountry.documentTypes : [];
8109
8108
  _this.documentTypesSubject.next(documentTypes);
8110
- _this.checkoutForm.controls['documentType'].setValue(documentTypes[0].code);
8109
+ if (documentTypes.length) {
8110
+ _this.checkoutForm.controls['documentType'].setValue(documentTypes[0].code);
8111
+ }
8111
8112
  var selectedDocumentType = documentTypes.find(function (doc) { return doc.code == _this.checkoutForm.controls['documentType'].value; });
8112
8113
  if (selectedDocumentType) {
8113
8114
  _this.updateDocumentValidation(selectedDocumentType);