@senior-gestao-empresarial/angular-components 5.1.0 → 5.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.
Files changed (31) hide show
  1. package/bundles/senior-gestao-empresarial-angular-components.umd.js +48 -43
  2. package/bundles/senior-gestao-empresarial-angular-components.umd.js.map +1 -1
  3. package/bundles/senior-gestao-empresarial-angular-components.umd.min.js +2 -2
  4. package/bundles/senior-gestao-empresarial-angular-components.umd.min.js.map +1 -1
  5. package/components/lookups/erp-lookups.d.ts +1 -0
  6. package/components/nps/index.d.ts +1 -0
  7. package/components/nps/nps.service.d.ts +4 -35
  8. package/components/nps/protocols/index.d.ts +3 -0
  9. package/components/nps/protocols/tenant-full-dto.d.ts +3 -0
  10. package/components/nps/protocols/token-senior-x.d.ts +14 -0
  11. package/components/nps/protocols/tracksale-request.d.ts +18 -0
  12. package/esm2015/components/lookups/erp-lookups.js +14 -19
  13. package/esm2015/components/nps/index.js +1 -1
  14. package/esm2015/components/nps/nps.service.js +12 -9
  15. package/esm2015/components/nps/protocols/index.js +1 -0
  16. package/esm2015/components/nps/protocols/tenant-full-dto.js +1 -0
  17. package/esm2015/components/nps/protocols/token-senior-x.js +1 -0
  18. package/esm2015/components/nps/protocols/tracksale-request.js +1 -0
  19. package/esm5/components/lookups/erp-lookups.js +15 -19
  20. package/esm5/components/nps/index.js +1 -1
  21. package/esm5/components/nps/nps.service.js +32 -23
  22. package/esm5/components/nps/protocols/index.js +1 -0
  23. package/esm5/components/nps/protocols/tenant-full-dto.js +1 -0
  24. package/esm5/components/nps/protocols/token-senior-x.js +1 -0
  25. package/esm5/components/nps/protocols/tracksale-request.js +1 -0
  26. package/fesm2015/senior-gestao-empresarial-angular-components.js +24 -26
  27. package/fesm2015/senior-gestao-empresarial-angular-components.js.map +1 -1
  28. package/fesm5/senior-gestao-empresarial-angular-components.js +45 -40
  29. package/fesm5/senior-gestao-empresarial-angular-components.js.map +1 -1
  30. package/package.json +1 -1
  31. package/senior-gestao-empresarial-angular-components.metadata.json +1 -1
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('primeng/breadcrumb'), require('@angular/router'), require('rxjs'), require('rxjs/operators'), require('moment'), require('@seniorsistemas/angular-components'), require('@angular/common/http'), require('primeng/api'), require('@ngx-translate/core'), require('@seniorsistemas/platform-components'), require('@seniorsistemas/senior-platform-data'), require('@angular/forms'), require('js-cookie'), require('@stomp/stompjs'), require('sockjs-client')) :
3
- typeof define === 'function' && define.amd ? define('@senior-gestao-empresarial/angular-components', ['exports', '@angular/core', '@angular/common', 'primeng/breadcrumb', '@angular/router', 'rxjs', 'rxjs/operators', 'moment', '@seniorsistemas/angular-components', '@angular/common/http', 'primeng/api', '@ngx-translate/core', '@seniorsistemas/platform-components', '@seniorsistemas/senior-platform-data', '@angular/forms', 'js-cookie', '@stomp/stompjs', 'sockjs-client'], factory) :
4
- (global = global || self, factory((global['senior-gestao-empresarial'] = global['senior-gestao-empresarial'] || {}, global['senior-gestao-empresarial']['angular-components'] = {}), global.ng.core, global.ng.common, global.breadcrumb, global.ng.router, global.rxjs, global.rxjs.operators, global.moment_, global.angularComponents, global.ng.common.http, global.api, global.core$1, global.platformComponents, global.seniorPlatformData, global.ng.forms, global.jsCookie, global.stompjs, global.SockJS));
5
- }(this, (function (exports, core, common, breadcrumb, router, rxjs, operators, moment_, angularComponents, http, api, core$1, platformComponents, seniorPlatformData, forms, jsCookie, stompjs, SockJS) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('primeng/breadcrumb'), require('@angular/router'), require('rxjs'), require('rxjs/operators'), require('moment'), require('@seniorsistemas/angular-components'), require('@angular/common/http'), require('primeng/api'), require('@ngx-translate/core'), require('@seniorsistemas/platform-components'), require('@seniorsistemas/senior-platform-data'), require('@angular/forms'), require('@stomp/stompjs'), require('js-cookie'), require('sockjs-client')) :
3
+ typeof define === 'function' && define.amd ? define('@senior-gestao-empresarial/angular-components', ['exports', '@angular/core', '@angular/common', 'primeng/breadcrumb', '@angular/router', 'rxjs', 'rxjs/operators', 'moment', '@seniorsistemas/angular-components', '@angular/common/http', 'primeng/api', '@ngx-translate/core', '@seniorsistemas/platform-components', '@seniorsistemas/senior-platform-data', '@angular/forms', '@stomp/stompjs', 'js-cookie', 'sockjs-client'], factory) :
4
+ (global = global || self, factory((global['senior-gestao-empresarial'] = global['senior-gestao-empresarial'] || {}, global['senior-gestao-empresarial']['angular-components'] = {}), global.ng.core, global.ng.common, global.breadcrumb, global.ng.router, global.rxjs, global.rxjs.operators, global.moment_, global.angularComponents, global.ng.common.http, global.api, global.core$1, global.platformComponents, global.seniorPlatformData, global.ng.forms, global.stompjs, global.jsCookie, global.SockJS));
5
+ }(this, (function (exports, core, common, breadcrumb, router, rxjs, operators, moment_, angularComponents, http, api, core$1, platformComponents, seniorPlatformData, forms, stompjs, jsCookie, SockJS) { 'use strict';
6
6
 
7
7
  /*! *****************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
@@ -629,15 +629,7 @@
629
629
  }, this.entity, options.domain || this.domain, options.service || this.service)
630
630
  .pipe(operators.takeUntil(this.ngUnsubscribe))
631
631
  .pipe(operators.map(function (list) {
632
- return list.contents.map(function (item) { return (__assign(__assign({}, item), { label: lookupDisplayFields
633
- .map(function (field) {
634
- if (field.indexOf(".") > 0)
635
- return _this.getProp(item, field, prefix);
636
- return item[field] !== undefined && item[field] !== null
637
- ? item[field]
638
- : _this.translate.instant(prefix + ".empty_label");
639
- })
640
- .join(" - ") })); });
632
+ return list.contents.map(function (item) { return (__assign(__assign({}, item), { label: _this.getItemLabel(item, prefix, lookupDisplayFields) })); });
641
633
  }))
642
634
  .subscribe(function (data) {
643
635
  _this.lookupSuggestionsObservable.next(data);
@@ -706,21 +698,25 @@
706
698
  .list({ page: page, sort: sort, filterQuery: filterQuery, displayFields: displayFields }, this.entity, options.domain || this.domain, options.service || this.service)
707
699
  .pipe(operators.takeUntil(this.ngUnsubscribe))
708
700
  .pipe(operators.map(function (list) { return ({
709
- gridData: list.contents.map(function (item) { return (__assign(__assign({}, item), { label: lookupDisplayFields
710
- .map(function (field) {
711
- if (field.indexOf(".") > 0)
712
- return _this.getProp(item, field, prefix);
713
- return item[field] !== undefined && item[field] !== null
714
- ? item[field]
715
- : _this.translate.instant(prefix + ".empty_label");
716
- })
717
- .join(" - ") })); }),
701
+ gridData: list.contents.map(function (item) { return (__assign(__assign({}, item), { label: _this.getItemLabel(item, prefix, lookupDisplayFields) })); }),
718
702
  totalRecords: list.totalElements
719
703
  }); }))
720
704
  .subscribe(function (data) {
721
705
  _this.lookupSearchObservable.next(data);
722
706
  });
723
707
  };
708
+ ErpLookups.prototype.getItemLabel = function (item, prefix, lookupDisplayFields) {
709
+ var _this = this;
710
+ return lookupDisplayFields
711
+ .map(function (field) {
712
+ if (field.indexOf(".") > 0)
713
+ return _this.getProp(item, field, prefix);
714
+ return item[field] !== undefined && item[field] !== null
715
+ ? item[field]
716
+ : _this.translate.instant(prefix + ".empty_label");
717
+ })
718
+ .join(" - ");
719
+ };
724
720
  ErpLookups.ctorParameters = function () { return [
725
721
  { type: ErpLookupsService },
726
722
  { type: core$1.TranslateService },
@@ -6676,38 +6672,47 @@
6676
6672
  return UtilsModule;
6677
6673
  }());
6678
6674
 
6675
+ // https://widget.tracksale.co/
6679
6676
  var NpsService = /** @class */ (function () {
6680
6677
  function NpsService() {
6681
6678
  }
6682
- Object.defineProperty(NpsService.prototype, "cookieInformation", {
6683
- get: function () {
6684
- return JSON.parse(jsCookie.get("com.senior.pau.userdata") || "{}");
6685
- },
6686
- enumerable: true,
6687
- configurable: true
6688
- });
6679
+ NpsService.prototype.getUserInformation = function () {
6680
+ return __awaiter(this, void 0, void 0, function () {
6681
+ return __generator(this, function (_a) {
6682
+ switch (_a.label) {
6683
+ case 0: return [4 /*yield*/, seniorPlatformData.user.getToken()];
6684
+ case 1: return [2 /*return*/, _a.sent()];
6685
+ }
6686
+ });
6687
+ });
6688
+ };
6689
6689
  /**
6690
6690
  * Executa o serviço de NPS utilizando os dados do usuário atual, no caso sobreescrevendos os campos name, email, identification,
6691
6691
  * tags.tenant e tags.email fornecidos no request original. Esses serão sobreescritos com os valores retornados pelo cookie
6692
- * com.senior.pau.userdata. *
6692
+ * com.senior.pau.userdata.
6693
+ *
6693
6694
  * @param tracksaleRequest request que será enviado ao serviço de nps
6694
6695
  */
6695
6696
  NpsService.prototype.currentUserInitNPS = function (tracksaleRequest) {
6696
6697
  return __awaiter(this, void 0, void 0, function () {
6697
- var _a, tenantName, email, fullname, id, copyTracksaleRequest;
6698
+ var _a, tenantName, email, fullName, copyTracksaleRequest;
6698
6699
  return __generator(this, function (_b) {
6699
- _a = this.cookieInformation, tenantName = _a.tenantName, email = _a.email, fullname = _a.fullname, id = _a.id;
6700
- copyTracksaleRequest = __assign({}, tracksaleRequest);
6701
- copyTracksaleRequest.tags =
6702
- (tracksaleRequest.tags && __assign({}, tracksaleRequest.tags)) ||
6703
- {};
6704
- copyTracksaleRequest.name = fullname;
6705
- copyTracksaleRequest.email = email;
6706
- copyTracksaleRequest.identification = id;
6707
- copyTracksaleRequest.tags.tenant = tenantName;
6708
- copyTracksaleRequest.tags.email = email;
6709
- this.initNPS(copyTracksaleRequest);
6710
- return [2 /*return*/];
6700
+ switch (_b.label) {
6701
+ case 0: return [4 /*yield*/, this.getUserInformation()];
6702
+ case 1:
6703
+ _a = _b.sent(), tenantName = _a.tenantName, email = _a.email, fullName = _a.fullName;
6704
+ copyTracksaleRequest = __assign({}, tracksaleRequest);
6705
+ copyTracksaleRequest.tags =
6706
+ (tracksaleRequest.tags && __assign({}, tracksaleRequest.tags)) ||
6707
+ {};
6708
+ copyTracksaleRequest.name = fullName;
6709
+ copyTracksaleRequest.email = email;
6710
+ copyTracksaleRequest.identification = email;
6711
+ copyTracksaleRequest.tags.tenant = tenantName;
6712
+ copyTracksaleRequest.tags.email = email;
6713
+ this.initNPS(copyTracksaleRequest);
6714
+ return [2 /*return*/];
6715
+ }
6711
6716
  });
6712
6717
  });
6713
6718
  };