ng-easycommerce 0.0.405 → 0.0.408

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,5 +1,19 @@
1
1
  # Ultimas Modificaciones
2
2
 
3
+ ### version: 0.0.408
4
+
5
+ - Ajuste en componente SellerDashboardContainer (UI y backend redirect)
6
+
7
+ ### version: 0.0.407
8
+
9
+ - Ajustes en decidir envio de tipos de tarjeta (WIP).
10
+
11
+ ### version: 0.0.406
12
+
13
+ - Ajustes en decidir parametros de entorno backoffice (FIX).
14
+
15
+ - Metodo para verificar si un producto tiene todas sus variantes sin segumiento en seleccion multiple de items (FIX).
16
+
3
17
  ### version: 0.0.405
4
18
 
5
19
  - Ajustes en decidir parametros de entorno backoffice.
@@ -15,12 +15,21 @@
15
15
  const dataDecidirHead = localStorage.getItem('dataDecidir')
16
16
  && JSON.parse(localStorage.getItem('dataDecidir'))
17
17
 
18
- let modoHead = dataDecidirHead?.config?.public_enviroment || null
18
+
19
+ console.log("dataDecidirHead", dataDecidirHead);
20
+ console.log("dataDecidirHead.config", dataDecidirHead.config);
21
+ console.log("dataDecidirHead.config.public_environment", dataDecidirHead.config.public_environment);
22
+
23
+ let modoHead = dataDecidirHead?.config?.public_environment || null
24
+ console.log("modoHead 1", modoHead);
19
25
 
20
26
  modoHead && (modoHead == 'prod' && (modoHead = false) || modoHead == 'test' && (modoHead = true))
21
- !modoHead && (modoHead = window.location.host.includes('easycommercetech'))
22
27
 
23
- console.log('modoHead -> ', modoHead);
28
+ console.log("modoHead 2", modoHead);
29
+
30
+ !modoHead && (modoHead = window.location.host.includes('easycommerce'))
31
+
32
+ console.log('modoHead 3-> ', modoHead);
24
33
 
25
34
  let my_awesome_script = document.createElement('script');
26
35
 
@@ -173,9 +182,14 @@
173
182
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
174
183
  integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
175
184
 
185
+ <script src="https://sdk.mercadopago.com/js/v2"></script>
176
186
 
177
187
  <script defer>
178
188
 
189
+ const mp = new MercadoPago('APP_USR-d8364d3f-b9fb-4c11-9e47-aa437fc58a8d', {
190
+ locale: 'en-US'
191
+ });
192
+
179
193
  window.onload = function () {
180
194
 
181
195
  let loadToken = document.querySelector('#loadToken');
@@ -196,10 +210,10 @@
196
210
 
197
211
  const publicApiKey = dataDecidir?.config?.public_key
198
212
  const cybersource = dataDecidir?.config?.public_cybersource || true
199
- let modo = dataDecidir?.config?.public_enviroment || null
213
+ let modo = dataDecidir?.config?.public_environment || null
200
214
 
201
215
  modo && (modo == 'prod' && (modo = false) || modo == 'test' && (modo = true))
202
- !modo && (modo = window.location.host.includes('easycommercetech'))
216
+ !modo && (modo = window.location.host.includes('easycommerce'))
203
217
 
204
218
  console.log(modo);
205
219
 
@@ -207,9 +221,12 @@
207
221
  decidir.setPublishableKey(publicApiKey);
208
222
  decidir.setTimeout(5000);
209
223
 
224
+ console.log("decidir", decidir);
225
+
210
226
  let form = document.querySelector('#formulario');
211
227
 
212
228
  const sendToken = (data) => {
229
+
213
230
  fetch(dataRedirect, {
214
231
  method: 'POST',
215
232
  body: JSON.stringify(data),
@@ -237,13 +254,28 @@
237
254
  localStorage.removeItem('dataDecidir')
238
255
  }
239
256
 
257
+ const getAsBin = (data) => {
258
+ // console.log('validateCreditCardNumber',decidir.validateCreditCardNumber(decidir.collectFormData(form).card_number));
259
+ // console.log('cardType',decidir.cardType(decidir.collectFormData(form).card_number));
260
+ // console.log('collectFormData', decidir.collectFormData(form));
261
+ // console.log('getBin',JSON.stringify(decidir.getBin(decidir.collectFormData(form))));
262
+ // console.log('getHttp',decidir.getHttp(form));
263
+ mp.getPaymentMethods({ bin: data.bin }).then(
264
+ t => {
265
+ let resultmp = t.results[0]
266
+ let asBin = { tipo_tarjeta_decidir: decidir.cardType(decidir.collectFormData(form).card_number) ,as_bin: resultmp.id , issuer: resultmp.issuer.name , name:resultmp.name , payment_type: resultmp.payment_type_id ,resultmp }
267
+ sendToken({ ...data , ...asBin})
268
+ }
269
+ )
270
+ }
271
+
240
272
  const sdkResponseHandler = (status, response) => {
241
273
  if (status != 200 && status != 201) {
242
274
  //Manejo de error: Ver Respuesta de Error
243
275
  processError(response)
244
276
  } else {
245
277
  //Manejo de respuesta donde response = {token: "99ab0740-4ef9-4b38-bdf9-c4c963459b22"}
246
- sendToken(response)
278
+ getAsBin(response)
247
279
  }
248
280
  }
249
281
 
@@ -8956,12 +8956,6 @@
8956
8956
  _this.authService = authService;
8957
8957
  _this.toastrService = toastrService;
8958
8958
  _this.env = env;
8959
- _this.headerTab = false;
8960
- _this.generateBudgetBtn = false;
8961
- _this.manageOrdersBtn = false;
8962
- _this.sortSelect = false;
8963
- _this.searchForm = false;
8964
- _this.orderCounter = false;
8965
8959
  _this.UIComponents = [];
8966
8960
  _this.user = null;
8967
8961
  _this.activeCustomer = null;
@@ -9041,31 +9035,13 @@
9041
9035
  { type: ToastService },
9042
9036
  { type: undefined, decorators: [{ type: core.Inject, args: ['env',] }] }
9043
9037
  ]; };
9044
- __decorate$15([
9045
- core.Input()
9046
- ], SellerDashboardContainerEcComponent.prototype, "headerTab", void 0);
9047
- __decorate$15([
9048
- core.Input()
9049
- ], SellerDashboardContainerEcComponent.prototype, "generateBudgetBtn", void 0);
9050
- __decorate$15([
9051
- core.Input()
9052
- ], SellerDashboardContainerEcComponent.prototype, "manageOrdersBtn", void 0);
9053
- __decorate$15([
9054
- core.Input()
9055
- ], SellerDashboardContainerEcComponent.prototype, "sortSelect", void 0);
9056
- __decorate$15([
9057
- core.Input()
9058
- ], SellerDashboardContainerEcComponent.prototype, "searchForm", void 0);
9059
- __decorate$15([
9060
- core.Input()
9061
- ], SellerDashboardContainerEcComponent.prototype, "orderCounter", void 0);
9062
9038
  __decorate$15([
9063
9039
  core.Input()
9064
9040
  ], SellerDashboardContainerEcComponent.prototype, "UIComponents", void 0);
9065
9041
  SellerDashboardContainerEcComponent = __decorate$15([
9066
9042
  core.Component({
9067
9043
  selector: 'app-seller-dashboard-container',
9068
- template: "<section *ngIf=\"user\" id=\"seller-dashboard\">\n <div class=\"section-content mt-5 mb-2 tablaVendedores\">\n <div class=\"container-xl\">\n <div class=\"row\">\n <main class=\"col-md-12\">\n\n <ul *ngIf=\"hasHeader()\" class=\"nav nav-tabs\">\n <li class=\"nav-item col-12 col-lg-2\">\n <a *ngIf=\"hasUIComponent('HEADER_TAB')\" class=\"nav-link active cursor-pointer px-4\" aria-current=\"page\">\n {{ 'my-clients' | translate }}\n </a>\n </li>\n <div\n class=\"d-flex justify-content-end justify-content-lg-start justify-content-xl-end col-12 col-md-12 col-lg-6\">\n <a *ngIf=\"hasUIComponent('GENERATE_BUDGET_BTN')\" [routerLink]=\"'/collection'\"\n class=\"btn btn-seller-primary text-white btnGestionar d-flex align-items-center\"><i\n class=\"bi bi-file-earmark me-2 mr-2\"></i>{{ 'generate-budget' | translate }}</a>\n <a *ngIf=\"hasUIComponent('MANAGE_ORDERS_BTN')\" (click)=\"navigateExternal(env.apiUrl)\"\n class=\"btn btn-seller-primary text-white btnGestionar d-flex align-items-center me- me-lg-4 mr- mr-lg-4\"><i\n class=\"bi bi-archive-fill me-2 mr-2\"></i>{{ 'manage-orders' | translate }}</a>\n </div>\n <div class=\"d-flex ms-auto camposVendedores col-12 col-md-12 col-lg-4 justify-content-end\">\n <select *ngIf=\"hasUIComponent('SORT_SELECT')\" id=\"customerSort\" name=\"customerSort\"\n (change)=\"sortCustomers($event.target.value)\" class=\"mb-1 ordenarVendedores\">\n <option selected hidden disabled>{{ 'order-by' | translate }}</option>\n <option value='asc'>{{ 'client' | translate }} (A-Z)</option>\n <option value='desc'>{{ 'client' | translate }} (Z-A)</option>\n </select>\n <form *ngIf=\"hasUIComponent('SEARCH_FORM')\" class=\"col-lg-auto mb-lg-0 d-flex ms-3 ml-3 d-flex buscadorVendedores\">\n <input type=\"text\" name=\"searchInput\" class=\"form-control\"\n placeholder=\"{{ 'search' | translate }}\" [(ngModel)]=\"searchInput\"\n (keyup.enter)=\"updateCustomers()\">\n <button class=\"btn btn-primary ms-1 ml-1 bg-white border-dark btnSearch\"><i\n class=\"bi bi-search text-dark\" (click)=\"updateCustomers()\"></i></button>\n </form>\n </div>\n </ul>\n\n <ng-container *ngIf=\"user.customers?.length; else noCustomers\">\n\n <article class=\"card card-body mb-1 carritoProductoHeader m-0 py-0 mt-4\">\n <div class=\"row align-items-center font-bold border-bottom\">\n <div class=\"col-7 col-md-3 mb-md-0\">\n <small>{{ 'client' | translate | uppercase }}</small>\n </div>\n\n <div class=\"col-4 col-md-3 text-left d-none d-md-block\">\n <small>{{ 'user' | translate | uppercase }}</small>\n </div>\n\n <div class=\"col-3 col-md-2 text-left\">\n <small>{{ 'code' | translate | uppercase }}</small>\n </div>\n\n <div class=\"col-2 col-md-4 text-left\">\n <small></small>\n </div>\n\n </div>\n </article>\n\n <article *ngFor=\"let customer of filteredCustomers\" class=\"card card-body mb-3 cadaVendedor\">\n <div class=\"row d-flex align-items-center\">\n <div class=\"col-7 col-md-3 text-left\">\n <div class=\"price h6 fw-normal ps-2 pl-2 pb-0 mb-0\">\n {{ customer.firstName }} {{ customer.lastName }}\n <p class=\"d-block d-md-none fs-6 mt-1 mb-0 p-0 userMobile\">\n {{ customer.email }}\n </p>\n </div>\n </div>\n <div class=\"col-4 col-md-3 text-left d-none d-md-block\">\n <div class=\"price h6 fw-normal pb-0 mb-0 ps-2 pl-2\">\n {{ customer.email }}\n </div>\n </div>\n <div class=\"col-2 col-md-2 text-left ps-2 pl-2\">\n <div class=\"price h6 pb-0 mb-0 ps-1 pl-1\">{{ customer.id }}</div>\n </div>\n <div class=\"col-3 col-md-4 btnIngresar\">\n\n <ng-container\n *ngIf=\"authService.getCustomer()?.id == customer.id; else noActiveCustomer\">\n <a (click)=\"changeCustomer(null)\"\n class=\"btn btn-seller-primary justify-content-center\">\n <i class=\"bi bi-box-arrow-in-right me-2 ml-2\"></i>\n <small class=\"me-2 ml-2 d-none d-md-block\">\n {{ 'exit' | translate | uppercase }}\n </small>\n <div *ngIf=\"hasUIComponent('ORDER_COUNTER')\" class=\"contNumero\">\n {{ customer.ordersNotApproved }}\n </div>\n </a>\n </ng-container>\n <ng-template #noActiveCustomer>\n <a (click)=\"changeCustomer(customer)\"\n class=\"btn btn-seller-primary justify-content-center\">\n <i class=\"bi bi-box-arrow-in-right me-2 ml-2\"></i>\n <small class=\"me-2 ml-2 d-none d-md-block\">\n {{ 'access' | translate | uppercase }}\n </small>\n <div *ngIf=\"hasUIComponent('ORDER_COUNTER')\" class=\"contNumero\">\n {{ customer.ordersNotApproved }}\n </div>\n </a>\n </ng-template>\n\n </div>\n </div>\n </article>\n\n </ng-container>\n\n </main>\n </div>\n </div>\n </div>\n</section>\n\n<ng-template #noCustomers>\n <h4 class=\"text-center p-5\">{{ 'no-customers' | translate }}</h4>\n</ng-template>",
9044
+ template: "<section *ngIf=\"user\" id=\"seller-dashboard\">\n <div class=\"section-content mt-5 mb-2 tablaVendedores\">\n <div class=\"container-xl\">\n <div class=\"row\">\n <main class=\"col-md-12\">\n\n <ul *ngIf=\"hasHeader()\" class=\"nav nav-tabs\">\n <li class=\"nav-item col-12 col-lg-2\">\n <a *ngIf=\"hasUIComponent('HEADER_TAB')\" class=\"nav-link active cursor-pointer px-4\" aria-current=\"page\">\n {{ 'my-clients' | translate }}\n </a>\n </li>\n <div\n class=\"d-flex justify-content-end justify-content-lg-start justify-content-xl-end col-12 col-md-12 col-lg-6\">\n <a *ngIf=\"hasUIComponent('GENERATE_BUDGET_BTN')\" [routerLink]=\"'/collection'\"\n class=\"btn btn-seller-primary text-white btnGestionar d-flex align-items-center\"><i\n class=\"bi bi-file-earmark me-2 mr-2\"></i>{{ 'generate-budget' | translate }}</a>\n <a *ngIf=\"hasUIComponent('MANAGE_ORDERS_BTN')\" (click)=\"navigateExternal(env.apiUrl || window.__env.apiUrl)\"\n class=\"btn btn-seller-primary text-white btnGestionar d-flex align-items-center me- me-lg-4 mr- mr-lg-4\"><i\n class=\"bi bi-archive-fill me-2 mr-2\"></i>{{ 'manage-orders' | translate }}</a>\n </div>\n <div class=\"d-flex ms-auto camposVendedores col-12 col-md-12 col-lg-4 justify-content-end\">\n <select *ngIf=\"hasUIComponent('SORT_SELECT')\" id=\"customerSort\" name=\"customerSort\"\n (change)=\"sortCustomers($event.target.value)\" class=\"mb-1 ordenarVendedores\">\n <option selected hidden disabled>{{ 'order-by' | translate }}</option>\n <option value='asc'>{{ 'client' | translate }} (A-Z)</option>\n <option value='desc'>{{ 'client' | translate }} (Z-A)</option>\n </select>\n <form *ngIf=\"hasUIComponent('SEARCH_FORM')\" class=\"col-lg-auto mb-lg-0 d-flex ms-3 ml-3 d-flex buscadorVendedores\">\n <input type=\"text\" name=\"searchInput\" class=\"form-control\"\n placeholder=\"{{ 'search' | translate }}\" [(ngModel)]=\"searchInput\"\n (keyup.enter)=\"updateCustomers()\">\n <button class=\"btn btn-primary ms-1 ml-1 bg-white border-dark btnSearch\"><i\n class=\"bi bi-search text-dark\" (click)=\"updateCustomers()\"></i></button>\n </form>\n </div>\n </ul>\n\n <ng-container *ngIf=\"user.customers?.length; else noCustomers\">\n\n <article class=\"card card-body mb-1 carritoProductoHeader m-0 py-0 mt-4\">\n <div class=\"row align-items-center font-bold border-bottom\">\n <div class=\"col-7 col-md-3 mb-md-0\">\n <small>{{ 'client' | translate | uppercase }}</small>\n </div>\n\n <div class=\"col-4 col-md-3 text-left d-none d-md-block\">\n <small>{{ 'user' | translate | uppercase }}</small>\n </div>\n\n <div class=\"col-3 col-md-2 text-left\">\n <small>{{ 'code' | translate | uppercase }}</small>\n </div>\n\n <div class=\"col-2 col-md-4 text-left\">\n <small></small>\n </div>\n\n </div>\n </article>\n\n <article *ngFor=\"let customer of filteredCustomers\" class=\"card card-body mb-3 cadaVendedor\">\n <div class=\"row d-flex align-items-center\">\n <div class=\"col-7 col-md-3 text-left\">\n <div class=\"price h6 fw-normal ps-2 pl-2 pb-0 mb-0\">\n {{ customer.firstName }} {{ customer.lastName }}\n <p class=\"d-block d-md-none fs-6 mt-1 mb-0 p-0 userMobile\">\n {{ customer.email }}\n </p>\n </div>\n </div>\n <div class=\"col-4 col-md-3 text-left d-none d-md-block\">\n <div class=\"price h6 fw-normal pb-0 mb-0 ps-2 pl-2\">\n {{ customer.email }}\n </div>\n </div>\n <div class=\"col-2 col-md-2 text-left ps-2 pl-2\">\n <div class=\"price h6 pb-0 mb-0 ps-1 pl-1\">{{ customer.id }}</div>\n </div>\n <div class=\"col-3 col-md-4 btnIngresar\">\n\n <ng-container\n *ngIf=\"authService.getCustomer()?.id == customer.id; else noActiveCustomer\">\n <a (click)=\"changeCustomer(null)\"\n class=\"btn btn-seller-primary justify-content-center\">\n <i class=\"bi bi-box-arrow-in-right me-2 mr-2\"></i>\n <small class=\"me-2 mr-2 d-none d-md-block\">\n {{ 'exit' | translate | uppercase }}\n </small>\n <div *ngIf=\"hasUIComponent('ORDER_COUNTER')\" class=\"contNumero\">\n {{ customer.ordersNotApproved }}\n </div>\n </a>\n </ng-container>\n <ng-template #noActiveCustomer>\n <a (click)=\"changeCustomer(customer)\"\n class=\"btn btn-seller-primary justify-content-center\">\n <i class=\"bi bi-box-arrow-in-right me-2 mr-2\"></i>\n <small class=\"me-2 mr-2 d-none d-md-block\">\n {{ 'access' | translate | uppercase }}\n </small>\n <div *ngIf=\"hasUIComponent('ORDER_COUNTER')\" class=\"contNumero\">\n {{ customer.ordersNotApproved }}\n </div>\n </a>\n </ng-template>\n\n </div>\n </div>\n </article>\n\n </ng-container>\n\n </main>\n </div>\n </div>\n </div>\n</section>\n\n<ng-template #noCustomers>\n <h4 class=\"text-center p-5\">{{ 'no-customers' | translate }}</h4>\n</ng-template>",
9069
9045
  styles: ["#seller-dashboard{--seller-dashboard-primary-color:0,0,0}.btn-seller-primary{color:#fff!important;background-color:rgba(var(--seller-dashboard-primary-color),1)!important;border-color:rgba(var(--seller-dashboard-primary-color),1)!important}.btn-seller-primary:hover{background-color:rgba(var(--seller-dashboard-primary-color),.9)!important}.btn-seller-primary:active{background-color:rgba(var(--seller-dashboard-primary-color),.8)!important}.btnGestionar{padding:6px 12px!important;height:36px;display:flex;align-items:center;justify-content:center;margin-left:10px}.ordenarVendedores{width:150px!important;color:#8b8b8b!important;background-color:#fff;border:1px solid #b6b6b6!important;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px}.buscadorVendedores{margin-bottom:4px!important}.buscadorVendedores input{border:1px solid #b6b6b6!important;width:200px}.buscadorVendedores .btnSearch{border:1px solid #b6b6b6!important;padding:.375rem .75rem;font-size:1rem}.buscadorVendedores .btnSearch:focus{background-color:#fff!important}.carritoProductoHeader{border:none!important}.carritoProductoHeader small{font-size:13px}.cadaVendedor{padding:5px 0;margin-bottom:0!important;border:none!important;border-bottom:1px solid #ccc!important;border-radius:0!important;-webkit-border-radius:0}.cadaVendedor .btnIngresar a{padding:10px!important;border-width:1px!important;border-style:solid!important;display:flex;align-items:center;width:152px!important;margin-left:auto;color:#fff}.cadaVendedor .btnIngresar .contNumero{background-color:#eee;width:20px;height:20px;color:#000;font-size:13px;display:flex;align-items:center;justify-content:center;font-weight:600;border-radius:20px;-webkit-border-radius:20px;-moz-border-radius:20px;-ms-border-radius:20px;-o-border-radius:20px}.userMobile{font-size:14px!important;font-style:italic!important}.cadaVendedor .btnIngresar a:hover{background-color:rgba(var(--seller-dashboard-primary-color),.85)}.cadaVendedor .btnIngresar a:active{background-color:rgba(var(--seller-dashboard-primary-color),.8)}.cursor-pointer{cursor:pointer}.font-bold{font-weight:700}.border-bottom{border-bottom:1px solid #000!important}@media screen and (max-width:1200px){.btnGestionar{font-size:12px}}@media screen and (max-width:992px){.camposVendedores{justify-content:flex-end;margin-top:8px;margin-bottom:4px}}@media all and (max-width:768px){.ordenarVendedores{width:140px!important}.buscadorVendedores input{width:140px}.cadaVendedor .btnIngresar a{width:70px!important}}@media all and (max-width:576px){.tablaVendedores .nav-tabs .nav-link{font-size:13px;padding:6px!important}.btnGestionar{padding:6px 8px!important;font-size:13px;height:36px;display:flex;align-items:center;justify-content:center;margin-top:3px;margin-left:10px}.buscadorVendedores input,.ordenarVendedores{font-size:13px}}.fs-6{font-size:1rem!important}"]
9070
9046
  }),
9071
9047
  __param$9(2, core.Inject('env'))
@@ -12830,7 +12806,7 @@
12830
12806
  }
12831
12807
  return true;
12832
12808
  };
12833
- _this.allWithoutTracking = function () { return _this.optionsProductForVariant().some(function (item) { var _a; return ((_a = item.currentOption) === null || _a === void 0 ? void 0 : _a.stock) != 9999; }) || true; };
12809
+ _this.allWithoutTracking = function () { return _this.optionsProductForVariant().some(function (item) { var _a; return ((_a = item.currentOption) === null || _a === void 0 ? void 0 : _a.stock) != 9999; }); };
12834
12810
  _this.getObjectParamsWithVariant = function () {
12835
12811
  return _this.objectWithVariant || _this.getObjectWithVariant();
12836
12812
  };