@seniorsistemas/exclusion-process-component 0.1.0 → 0.2.1-534b2cd2-c9f9-432d-af2e-5630b05ee46f

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 (27) hide show
  1. package/bundles/seniorsistemas-exclusion-process-component.umd.js +125 -35
  2. package/bundles/seniorsistemas-exclusion-process-component.umd.js.map +1 -1
  3. package/bundles/seniorsistemas-exclusion-process-component.umd.min.js +2 -2
  4. package/bundles/seniorsistemas-exclusion-process-component.umd.min.js.map +1 -1
  5. package/esm2015/exclusion-details/exclusion-details.component.js +86 -9
  6. package/esm2015/exclusion-details/protocols/exclusion-process-status-changed.js +1 -0
  7. package/esm2015/exclusion-details/protocols/web-socket-event-data.js +1 -0
  8. package/esm2015/exclusions-list/exclusions-list.component.js +23 -15
  9. package/esm2015/exclusions-list/exclusions-list.routing.js +2 -2
  10. package/esm2015/services/logical-delete.service.js +10 -11
  11. package/esm5/exclusion-details/exclusion-details.component.js +91 -9
  12. package/esm5/exclusion-details/protocols/exclusion-process-status-changed.js +1 -0
  13. package/esm5/exclusion-details/protocols/web-socket-event-data.js +1 -0
  14. package/esm5/exclusions-list/exclusions-list.component.js +24 -16
  15. package/esm5/exclusions-list/exclusions-list.routing.js +2 -2
  16. package/esm5/services/logical-delete.service.js +13 -12
  17. package/exclusion-details/exclusion-details.component.d.ts +11 -1
  18. package/exclusion-details/protocols/exclusion-process-status-changed.d.ts +8 -0
  19. package/exclusion-details/protocols/web-socket-event-data.d.ts +6 -0
  20. package/exclusions-list/exclusions-list.component.d.ts +6 -4
  21. package/fesm2015/seniorsistemas-exclusion-process-component.js +115 -31
  22. package/fesm2015/seniorsistemas-exclusion-process-component.js.map +1 -1
  23. package/fesm5/seniorsistemas-exclusion-process-component.js +124 -33
  24. package/fesm5/seniorsistemas-exclusion-process-component.js.map +1 -1
  25. package/package.json +14 -6
  26. package/seniorsistemas-exclusion-process-component.metadata.json +1 -1
  27. package/services/logical-delete.service.d.ts +1 -1
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('primeng/panel'), require('primeng/table'), require('@seniorsistemas/angular-components'), require('moment'), require('@angular/router'), require('rxjs'), require('rxjs/operators'), require('@angular/common/http'), require('@ngx-translate/core'), require('primeng/api'), require('@angular/forms'), require('primeng/dialog'), require('primeng/confirmdialog'), require('primeng/inputtext'), require('@seniorsistemas/platform-components')) :
3
- typeof define === 'function' && define.amd ? define('@seniorsistemas/exclusion-process-component', ['exports', '@angular/common', '@angular/core', 'primeng/panel', 'primeng/table', '@seniorsistemas/angular-components', 'moment', '@angular/router', 'rxjs', 'rxjs/operators', '@angular/common/http', '@ngx-translate/core', 'primeng/api', '@angular/forms', 'primeng/dialog', 'primeng/confirmdialog', 'primeng/inputtext', '@seniorsistemas/platform-components'], factory) :
4
- (global = global || self, factory((global.seniorsistemas = global.seniorsistemas || {}, global.seniorsistemas['exclusion-process-component'] = {}), global.ng.common, global.ng.core, global.panel, global.table, global.angularComponents, global.moment, global.ng.router, global.rxjs, global.rxjs.operators, global.ng.common.http, global.core$1, global.api, global.ng.forms, global.dialog, global.confirmdialog, global.inputtext, global.platformComponents));
5
- }(this, (function (exports, common, core, panel, table, angularComponents, moment, router, rxjs, operators, http, core$1, api, forms, dialog, confirmdialog, inputtext, platformComponents) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('primeng/panel'), require('primeng/table'), require('@seniorsistemas/angular-components'), require('moment'), require('@angular/router'), require('@ngx-translate/core'), require('rxjs'), require('rxjs/operators'), require('@senior-gestao-empresarial/angular-components'), require('@angular/common/http'), require('primeng/api'), require('@angular/forms'), require('primeng/dialog'), require('primeng/confirmdialog'), require('primeng/inputtext'), require('@seniorsistemas/platform-components')) :
3
+ typeof define === 'function' && define.amd ? define('@seniorsistemas/exclusion-process-component', ['exports', '@angular/common', '@angular/core', 'primeng/panel', 'primeng/table', '@seniorsistemas/angular-components', 'moment', '@angular/router', '@ngx-translate/core', 'rxjs', 'rxjs/operators', '@senior-gestao-empresarial/angular-components', '@angular/common/http', 'primeng/api', '@angular/forms', 'primeng/dialog', 'primeng/confirmdialog', 'primeng/inputtext', '@seniorsistemas/platform-components'], factory) :
4
+ (global = global || self, factory((global.seniorsistemas = global.seniorsistemas || {}, global.seniorsistemas['exclusion-process-component'] = {}), global.ng.common, global.ng.core, global.panel, global.table, global.angularComponents, global.moment, global.ng.router, global.core$1, global.rxjs, global.rxjs.operators, global.angularComponents$1, global.ng.common.http, global.api, global.ng.forms, global.dialog, global.confirmdialog, global.inputtext, global.platformComponents));
5
+ }(this, (function (exports, common, core, panel, table, angularComponents, moment, router, core$1, rxjs, operators, angularComponents$1, http, api, forms, dialog, confirmdialog, inputtext, platformComponents) { 'use strict';
6
6
 
7
7
  /*! *****************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
@@ -269,7 +269,6 @@
269
269
  this.projectConfigs = projectConfigs;
270
270
  var entityUrl = projectConfigs.getDomain() + "/" + projectConfigs.getService();
271
271
  this.exclusionProcessUrl = entityUrl + "/entities/exclusionProcess";
272
- this.listExclusionsUrl = entityUrl + "/entities/exclusionProcess";
273
272
  this.defaultCatch = this.defaultCatch.bind(this);
274
273
  }
275
274
  LogicalDeleteService.prototype.defaultCatch = function () {
@@ -332,6 +331,7 @@
332
331
  });
333
332
  };
334
333
  LogicalDeleteService.prototype.doGetProcessDetails = function (filterParams) {
334
+ var _this = this;
335
335
  return this.http.get(this.exclusionProcessUrl, { params: filterParams })
336
336
  .pipe(this.defaultCatch())
337
337
  .pipe(operators.map(function (value) {
@@ -339,10 +339,18 @@
339
339
  if (!((_a = value.contents) === null || _a === void 0 ? void 0 : _a.length)) {
340
340
  return null;
341
341
  }
342
- return value.contents[0];
342
+ return _this.mapExclusionsDates(value.contents[0]);
343
343
  }));
344
344
  };
345
+ LogicalDeleteService.prototype.mapExclusionsDates = function (exclusionProcess) {
346
+ var _a;
347
+ return __assign(__assign({}, exclusionProcess), { startDate: exclusionProcess.startDate ? moment(exclusionProcess.startDate).toDate() : null, finishDate: exclusionProcess.finishDate ? moment(exclusionProcess.finishDate).toDate() : null, groups: (_a = exclusionProcess.groups) === null || _a === void 0 ? void 0 : _a.map(function (group) {
348
+ var _a;
349
+ return (__assign(__assign({}, group), { startDate: group.startDate ? moment(group.startDate).toDate() : null, finishDate: group.finishDate ? moment(group.finishDate).toDate() : null, steps: (_a = group.steps) === null || _a === void 0 ? void 0 : _a.map(function (step) { return (__assign(__assign({}, step), { startDate: step.startDate ? moment(step.startDate).toDate() : null, finishDate: step.finishDate ? moment(step.finishDate).toDate() : null })); }) }));
350
+ }) });
351
+ };
345
352
  LogicalDeleteService.prototype.listExclusions = function (entityName, params) {
353
+ var _this = this;
346
354
  if (params === void 0) { params = {}; }
347
355
  if (params.filterQuery) {
348
356
  params.filterQuery += " and lower(entityName) eq lower('" + entityName + "')";
@@ -353,14 +361,7 @@
353
361
  return this.http.get(this.exclusionProcessUrl, { params: this.getListQueryParams(params) })
354
362
  .pipe(this.defaultCatch())
355
363
  .pipe(operators.map(function (value) {
356
- value.contents.forEach(function (p) {
357
- if (p.startDate) {
358
- p.startDate = moment(p.startDate).toDate();
359
- }
360
- if (p.finishDate) {
361
- p.finishDate = moment(p.finishDate).toDate();
362
- }
363
- });
364
+ value.contents = value.contents.map(_this.mapExclusionsDates);
364
365
  return value;
365
366
  }));
366
367
  };
@@ -430,17 +431,26 @@
430
431
  ExclusionDetailsComponent.prototype.ngOnDestroy = function () {
431
432
  this.ngUnsubscribe.next();
432
433
  this.ngUnsubscribe.complete();
434
+ this.disconnectWebSocket();
433
435
  };
434
436
  ExclusionDetailsComponent.prototype.showDetails = function (details) {
435
- this.processDetails = null;
437
+ this._exclusionDetails = details;
436
438
  this._entityName = details.entityName;
437
439
  this._isVisible = true;
438
440
  this._processSummaryData = [];
441
+ this.processDetails = null;
439
442
  this.entityDescription = details.entityDescription;
440
443
  this.loadProcessDetails(details);
444
+ this.connectWebSocket();
445
+ };
446
+ ExclusionDetailsComponent.prototype.onVisibilityChanged = function (event) {
447
+ this.closeDetails();
441
448
  };
442
449
  ExclusionDetailsComponent.prototype.closeDetails = function () {
443
450
  this._isVisible = false;
451
+ this._exclusionDetails = null;
452
+ this._processSummaryData = [];
453
+ this.disconnectWebSocket();
444
454
  };
445
455
  ExclusionDetailsComponent.prototype.openExclusions = function () {
446
456
  this.closeDetails();
@@ -462,14 +472,14 @@
462
472
  if (!((_a = this.processDetails) === null || _a === void 0 ? void 0 : _a.startDate)) {
463
473
  return "";
464
474
  }
465
- return moment(this.processDetails.startDate).format("DD/MM/YYYY HH:mm");
475
+ return moment(this.processDetails.startDate).format("DD/MM/YYYY HH:mm:ss");
466
476
  };
467
477
  ExclusionDetailsComponent.prototype.getFinishDate = function () {
468
478
  var _a;
469
479
  if (!((_a = this.processDetails) === null || _a === void 0 ? void 0 : _a.finishDate)) {
470
480
  return "";
471
481
  }
472
- return moment(this.processDetails.finishDate).format("DD/MM/YYYY HH:mm");
482
+ return moment(this.processDetails.finishDate).format("DD/MM/YYYY HH:mm:ss");
473
483
  };
474
484
  ExclusionDetailsComponent.prototype.isFinished = function () {
475
485
  var _a;
@@ -557,14 +567,37 @@
557
567
  .pipe(operators.takeUntil(this.ngUnsubscribe))
558
568
  .pipe(operators.finalize(function () { return _this._isLoading = false; }))
559
569
  .subscribe(function (process) {
570
+ if (!process) {
571
+ return;
572
+ }
560
573
  _this.processDetails = process;
561
574
  _this.loadProcessSummary(process);
562
575
  });
563
576
  };
577
+ ExclusionDetailsComponent.prototype.sortByDate = function (startDate, finishDate) {
578
+ if (startDate.getTime() > finishDate.getTime()) {
579
+ return 1;
580
+ }
581
+ if (startDate.getTime() < finishDate.getTime()) {
582
+ return -1;
583
+ }
584
+ return 0;
585
+ };
586
+ ExclusionDetailsComponent.prototype.sortGroupsByStartDate = function (groups) {
587
+ var _this = this;
588
+ return groups.sort(function (a, b) { return _this.sortByDate(a.startDate, b.finishDate); });
589
+ };
590
+ ExclusionDetailsComponent.prototype.sortStepsByStartDate = function (steps) {
591
+ var _this = this;
592
+ return steps.sort(function (a, b) { return _this.sortByDate(a.startDate, b.finishDate); });
593
+ };
564
594
  ExclusionDetailsComponent.prototype.loadProcessSummary = function (process) {
595
+ var _this = this;
565
596
  var stepLogs = [];
566
- process.groups.forEach(function (group) {
567
- var steps = group.steps.map(function (step) { return ({
597
+ this.sortGroupsByStartDate(process.groups)
598
+ .forEach(function (group) {
599
+ var steps = _this.sortStepsByStartDate(group.steps)
600
+ .map(function (step) { return ({
568
601
  description: step.description,
569
602
  status: step.status,
570
603
  errorMessage: step.errorMessage
@@ -573,6 +606,55 @@
573
606
  });
574
607
  this._processSummaryData = stepLogs;
575
608
  };
609
+ ExclusionDetailsComponent.prototype.disconnectWebSocket = function () {
610
+ if (this._exclusionProcessStatusChangedSubscribe) {
611
+ this._exclusionProcessStatusChangedSubscribe.unsubscribe();
612
+ this._exclusionProcessStatusChangedSubscribe = null;
613
+ }
614
+ if (this._websocketService) {
615
+ this._websocketService.disconnect();
616
+ this._websocketService = null;
617
+ }
618
+ };
619
+ ExclusionDetailsComponent.prototype.connectWebSocket = function () {
620
+ var _this = this;
621
+ if (this._websocketService) {
622
+ this.disconnectWebSocket();
623
+ }
624
+ this._websocketService = new angularComponents$1.WebsocketService();
625
+ this._websocketService
626
+ .onConnect()
627
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
628
+ .subscribe(function () {
629
+ _this.startListeningWebhookEvents();
630
+ });
631
+ };
632
+ ExclusionDetailsComponent.prototype.startListeningWebhookEvents = function () {
633
+ var _this = this;
634
+ this._websocketService
635
+ .onError()
636
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
637
+ .subscribe(function (data) {
638
+ console.error('onError', data);
639
+ });
640
+ this._exclusionProcessStatusChangedSubscribe = this._websocketService
641
+ .onEvent({
642
+ domain: this.projectConfigs.getDomain(),
643
+ service: this.projectConfigs.getService(),
644
+ primitive: "exclusionProcessStatusChanged"
645
+ })
646
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
647
+ .subscribe(function (event) {
648
+ var data = event.data;
649
+ if (_this._exclusionDetails.processId && data.pid === _this._exclusionDetails.processId) {
650
+ _this.loadProcessDetails(_this._exclusionDetails);
651
+ return;
652
+ }
653
+ if (_this._exclusionDetails.recordId && data.recordId === _this._exclusionDetails.recordId) {
654
+ _this.loadProcessDetails(_this._exclusionDetails);
655
+ }
656
+ });
657
+ };
576
658
  ExclusionDetailsComponent.ctorParameters = function () { return [
577
659
  { type: router.Router },
578
660
  { type: router.ActivatedRoute },
@@ -601,7 +683,7 @@
601
683
  ExclusionDetailsComponent = __decorate([
602
684
  core.Component({
603
685
  selector: "s-exclusion-details",
604
- template: "<s-sidebar [visible]=\"isVisible\" (visibleChange)=\"closeDetails()\" [header]=\"getSidebarTitle()\">\n <s-loading-state [loading]=\"isLoading\">\n <p-panel [showHeader]=\"false\" styleClass=\"s-exclusion-details-record-details-panel\">\n <div class=\"s-exclusion-details-record-details-container\">\n <div class=\"s-exclusion-details-record-icon-background\">\n <em class=\"far fa-file-alt s-exclusion-details-record-icon\"></em>\n </div>\n\n <div class=\"s-exclusion-details-record-details-recordinfo\">\n <span class=\"s-exclusion-details-record-details-type\">\n {{entityDescription}}\n </span>\n <span>\n {{getRecordDescription()}}\n </span>\n </div>\n\n <div class=\"s-exclusion-details-record-details-dateinfo\">\n <span>\n {{getStartDateLabel()}}: {{getInicialDate()}}\n </span>\n <span *ngIf=\"isFinished()\">\n {{getFinishDateLabel()}}: {{getFinishDate()}}\n </span>\n </div>\n </div>\n </p-panel>\n\n <p-panel>\n <p-header>\n {{getSummaryLabel()}}\n </p-header>\n\n <s-empty-state\n *ngIf=\"processSummaryData && !processSummaryData.length\"\n [title]=\"getEmptyStateTitle()\"\n [description]=\"getEmptyStateDescription()\">\n [showPrimaryAction]=\"false\"\n </s-empty-state>\n\n <p-table\n [value]=\"processSummaryData\"\n [columns]=\"processSummaryColumns\"\n dataKey=\"id\"\n [lazy]=\"false\"\n [scrollable]=\"false\"\n [paginator]=\"false\"\n *ngIf=\"processSummaryData && processSummaryData.length\">\n\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col *ngFor=\"let col of columns\"\n [style.width]=\"col.width\"\n />\n </colgroup>\n </ng-template>\n\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th *ngFor=\"let col of columns\"\n [id]=\"col.field\"\n [ngStyle]=\"col.style\"\n [pSortableColumn]=\"col.field\">\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.header }}</span>\n <p-sortIcon [field]=\"col.field\" ></p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\">\n <tr>\n <s-table-columns\n [columns]=\"columns\"\n [rowValue]=\"rowData\"\n [locale]=\"locale\">\n </s-table-columns>\n </tr>\n </ng-template>\n </p-table>\n </p-panel>\n </s-loading-state>\n\n <s-footer>\n <div class=\"ui-fluid\">\n <div class=\"ui-g\">\n <s-button [label]=\"getShowExclusionsButtonLabel()\" (onClick)=\"openExclusions()\"></s-button>\n <s-button [label]=\"getCloseButtonLabel()\" priority=\"link\" (onClick)=\"closeDetails()\"></s-button>\n </div>\n </div>\n </s-footer>\n</s-sidebar>\n",
686
+ template: "<s-sidebar [visible]=\"isVisible\" (visibleChange)=\"onVisibilityChanged($event)\" [header]=\"getSidebarTitle()\">\n <s-loading-state [loading]=\"isLoading\">\n <p-panel [showHeader]=\"false\" styleClass=\"s-exclusion-details-record-details-panel\">\n <div class=\"s-exclusion-details-record-details-container\">\n <div class=\"s-exclusion-details-record-icon-background\">\n <em class=\"far fa-file-alt s-exclusion-details-record-icon\"></em>\n </div>\n\n <div class=\"s-exclusion-details-record-details-recordinfo\">\n <span class=\"s-exclusion-details-record-details-type\">\n {{entityDescription}}\n </span>\n <span>\n {{getRecordDescription()}}\n </span>\n </div>\n\n <div class=\"s-exclusion-details-record-details-dateinfo\">\n <span>\n {{getStartDateLabel()}}: {{getInicialDate()}}\n </span>\n <span *ngIf=\"isFinished()\">\n {{getFinishDateLabel()}}: {{getFinishDate()}}\n </span>\n </div>\n </div>\n </p-panel>\n\n <p-panel>\n <p-header>\n {{getSummaryLabel()}}\n </p-header>\n\n <s-empty-state\n *ngIf=\"processSummaryData && !processSummaryData.length\"\n [title]=\"getEmptyStateTitle()\"\n [description]=\"getEmptyStateDescription()\">\n [showPrimaryAction]=\"false\"\n </s-empty-state>\n\n <p-table\n [value]=\"processSummaryData\"\n [columns]=\"processSummaryColumns\"\n dataKey=\"id\"\n [lazy]=\"false\"\n [scrollable]=\"false\"\n [paginator]=\"false\"\n *ngIf=\"processSummaryData && processSummaryData.length\">\n\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col *ngFor=\"let col of columns\"\n [style.width]=\"col.width\"\n />\n </colgroup>\n </ng-template>\n\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th *ngFor=\"let col of columns\"\n [id]=\"col.field\"\n [ngStyle]=\"col.style\"\n [pSortableColumn]=\"col.field\">\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.header }}</span>\n <p-sortIcon [field]=\"col.field\" ></p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\">\n <tr>\n <s-table-columns\n [columns]=\"columns\"\n [rowValue]=\"rowData\"\n [locale]=\"locale\">\n </s-table-columns>\n </tr>\n </ng-template>\n </p-table>\n </p-panel>\n </s-loading-state>\n\n <s-footer>\n <div class=\"ui-fluid\">\n <div class=\"ui-g\">\n <s-button [label]=\"getShowExclusionsButtonLabel()\" (onClick)=\"openExclusions()\"></s-button>\n <s-button [label]=\"getCloseButtonLabel()\" priority=\"link\" (onClick)=\"closeDetails()\"></s-button>\n </div>\n </div>\n </s-footer>\n</s-sidebar>\n",
605
687
  encapsulation: core.ViewEncapsulation.None,
606
688
  styles: [".s-exclusion-details-record-details-panel{margin-bottom:10px}.s-exclusion-details-record-details-container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}.s-exclusion-details-record-details-recordinfo{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin-left:10px;-ms-flex:1;flex:1}.s-exclusion-details-record-details-dateinfo{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin-left:10px;-ms-flex-align:end;align-items:flex-end;font-size:12px}.s-exclusion-details-record-details-type{color:#999}.s-exclusion-details-record-icon{font-size:22pt;color:#7e8d95}.s-exclusion-details-record-icon-background{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:16px;background-color:#c1cad1;border-radius:50%;height:60px;width:60px}"]
607
689
  })
@@ -741,7 +823,7 @@
741
823
  var HTTP_CODE_SERVER_ERROR_START = 500;
742
824
  var HTTP_CODE_SERVER_ERROR_END = 600;
743
825
  var ExclusionsListComponent = /** @class */ (function () {
744
- function ExclusionsListComponent(route, translate, formBuilder, changeDetectorRef, logicalDeleteService, filterService, projectConfigs) {
826
+ function ExclusionsListComponent(route, translate, formBuilder, changeDetectorRef, logicalDeleteService, filterService, projectConfigs, cdr) {
745
827
  this.route = route;
746
828
  this.translate = translate;
747
829
  this.formBuilder = formBuilder;
@@ -749,6 +831,7 @@
749
831
  this.logicalDeleteService = logicalDeleteService;
750
832
  this.filterService = filterService;
751
833
  this.projectConfigs = projectConfigs;
834
+ this.cdr = cdr;
752
835
  this.currentListParams = { page: 0, size: 10, sort: [], filterData: {} };
753
836
  this.showLoader = false;
754
837
  this.totalRecords = 0;
@@ -768,27 +851,22 @@
768
851
  .subscribe(function (data) {
769
852
  _this.locale = data.localeConfig;
770
853
  });
771
- this.route.params
772
- .pipe(operators.takeUntil(this.ngUnsubscribe))
773
- .subscribe(function (params) {
774
- _this.entityName = params.entityName;
775
- _this.showBasedOnRoute();
776
- });
777
854
  this.route.queryParams
778
855
  .pipe(operators.takeUntil(this.ngUnsubscribe))
779
856
  .subscribe(function (queryParams) {
857
+ _this.entityName = queryParams.entityName;
780
858
  _this.entityDescription = queryParams.entityDescription;
781
859
  _this.processId = queryParams.processId;
782
- _this.showBasedOnRoute();
783
860
  });
784
861
  };
785
- ExclusionsListComponent.prototype.showBasedOnRoute = function () {
862
+ ExclusionsListComponent.prototype.ngAfterViewInit = function () {
786
863
  if (this.entityName && this.entityDescription && this.processId) {
787
864
  this.exclusionDetailsComponent.showDetails({
788
865
  processId: this.processId,
789
866
  entityDescription: this.entityDescription,
790
867
  entityName: this.entityName
791
868
  });
869
+ this.cdr.detectChanges();
792
870
  }
793
871
  };
794
872
  ExclusionsListComponent.prototype.ngOnDestroy = function () {
@@ -823,6 +901,7 @@
823
901
  style: {
824
902
  width: "100px"
825
903
  },
904
+ tooltip: this.getColumnStatusTooltip,
826
905
  badgeConfigs: [
827
906
  {
828
907
  enumValue: EnumExclusionProcessStatus.ERROR,
@@ -847,7 +926,7 @@
847
926
  attributes: ["startDate"],
848
927
  header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_start"),
849
928
  type: angularComponents.EnumColumnFieldType.DATE,
850
- dateFormat: "DD/MM/YYYY HH:mm",
929
+ dateFormat: "DD/MM/YYYY HH:mm:ss",
851
930
  style: {
852
931
  width: "100px"
853
932
  }
@@ -857,13 +936,19 @@
857
936
  attributes: ["finishDate"],
858
937
  header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_finish"),
859
938
  type: angularComponents.EnumColumnFieldType.DATE,
860
- dateFormat: "DD/MM/YYYY HH:mm",
939
+ dateFormat: "DD/MM/YYYY HH:mm:ss",
861
940
  style: {
862
941
  width: "100px"
863
942
  }
864
943
  }
865
944
  ];
866
945
  };
946
+ ExclusionsListComponent.prototype.getColumnStatusTooltip = function (rowValue) {
947
+ if (rowValue.errorMessage) {
948
+ return rowValue.errorMessage;
949
+ }
950
+ return null;
951
+ };
867
952
  ExclusionsListComponent.prototype.getFilterFields = function () {
868
953
  var translationPrefix = this.projectConfigs.getTranslationPrefix();
869
954
  return [
@@ -1017,8 +1102,12 @@
1017
1102
  this.searchTokens = this.getFilterTokens();
1018
1103
  var filterQuery = this.getFilterQuery();
1019
1104
  var displayFields = __spread([
1020
- "recordId"
1105
+ "recordId",
1106
+ "errorMessage"
1021
1107
  ], this.gridColumns.map(function (column) { return column.field; }));
1108
+ if (!sort.length) {
1109
+ sort.push({ field: 'startDate', order: -1 });
1110
+ }
1022
1111
  this.listExclusions({ page: page, size: size, sort: sort, filterQuery: filterQuery, displayFields: displayFields });
1023
1112
  };
1024
1113
  ExclusionsListComponent.prototype.listExclusions = function (params) {
@@ -1068,7 +1157,8 @@
1068
1157
  { type: core.ChangeDetectorRef },
1069
1158
  { type: LogicalDeleteService },
1070
1159
  { type: FilterService },
1071
- { type: LogicalDeleteConfigService }
1160
+ { type: LogicalDeleteConfigService },
1161
+ { type: core.ChangeDetectorRef }
1072
1162
  ]; };
1073
1163
  __decorate([
1074
1164
  core.ViewChild("exclusionsTable")
@@ -1078,7 +1168,7 @@
1078
1168
  ], ExclusionsListComponent.prototype, "exclusionDetailsComponent", void 0);
1079
1169
  ExclusionsListComponent = ExclusionsListComponent_1 = __decorate([
1080
1170
  core.Component({
1081
- template: "<div>\n <form [formGroup]=\"filterFormGroup\" autocomplete=\"off\">\n <p-panel\n *sLoadingState=\"showLoader\"\n styleClass=\"form-group\"\n [toggleable]=\"true\"\n [(collapsed)]=\"filtersPanelCollapsed\"\n (onAfterToggle)=\"focusInput('description')\"\n >\n <p-header>\n {{ getFiltersTitle() }}\n <s-token-list\n [tokens]=\"searchTokens\"\n (tokenRemoved)=\"onRemoveToken($event)\"\n [removableTokens]=\"true\"\n ></s-token-list>\n </p-header>\n <div>\n <s-dynamic-form\n [fields]=\"filterFields\"\n [form]=\"filterFormGroup\"\n [errorMessages]=\"{ pattern: getErrorInvalid() }\"\n ></s-dynamic-form>\n </div>\n <p-footer>\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <button\n id=\"filter-button\"\n class=\"ui-button\"\n type=\"submit\"\n pButton\n [label]=\"getFilterButtonTitle()\"\n (click)=\"onSearch()\"\n ></button>\n <button\n id=\"clear-button\"\n class=\"ui-button ui-button-link\"\n type=\"button\"\n pButton\n [label]=\"getClearButtonTitle()\"\n (click)=\"onClear()\"\n ></button>\n </div>\n </div>\n </p-footer>\n </p-panel>\n </form>\n <p-panel *sLoadingState=\"showLoader\">\n <p-header>\n {{ getTitle() }}\n </p-header>\n <ng-container>\n <s-empty-state\n *ngIf=\"serverError && !showLoader\"\n iconClass=\"fa fa-exclamation-triangle\"\n title=\"{{ getErrorServerTitle() | translate }}\"\n primaryActionLabel=\"{{ 'error_server_try_again' | translate }}\"\n (primaryAction)=\"resetGrid()\"\n description=\"{{ getErrorServerDescription() | translate }}\"\n ></s-empty-state>\n\n <s-empty-state\n *ngIf=\"!showLoader && !serverError && totalRecords === 0\"\n [title]=\"getEmptyStateTitle()\"\n [showPrimaryAction]=\"false\"\n [description]=\"getEmptyStateDescription()\"\n ></s-empty-state>\n\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <p-table\n #exclusionsTable\n id=\"exclusionsTable\"\n [hidden]=\"totalRecords === 0 || serverError\"\n [value]=\"gridData\"\n [columns]=\"gridColumns\"\n dataKey=\"id\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [resizableColumns]=\"true\"\n sortMode=\"multiple\"\n [paginator]=\"true\"\n [totalRecords]=\"totalRecords\"\n [rows]=\"10\"\n rows=\"10\"\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\"\n (onLazyLoad)=\"onGridChange($event)\"\n >\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col\n *ngFor=\"let col of columns\"\n [style.width]=\"col.width\"\n />\n </colgroup>\n </ng-template>\n\n <ng-template\n pTemplate=\"header\"\n let-columns\n >\n <tr>\n <th *ngFor=\"let col of columns\"\n [id]=\"col.field\"\n [pSortableColumn]=\"col.field\"\n [ngStyle]=\"col.style\"\n pResizableColumn\n >\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">\n {{ col.header }}\n </span>\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\n </div>\n </th>\n <th id=\"action-column\" style=\"width: 100px\">\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ getActionsColumnLabel() }}</span>\n </div>\n </th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\">\n <tr [pSelectableRow]=\"rowData\">\n <s-table-columns\n [columns]=\"columns\"\n [rowValue]=\"rowData\"\n [locale]=\"locale\">\n </s-table-columns>\n <td style=\"width: 100px\">\n <s-button\n id=\"details-button\"\n priority=\"default\"\n [label]=\"getDetailsButtonTitle()\"\n [auxiliary]=\"true\"\n (onClick)=\"onClickDetails(rowData)\">\n </s-button>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"paginatorright\">\n <s-table-paging\n [table]=\"exclusionsTable\"\n [totalRecords]=\"totalRecords\"\n ></s-table-paging>\n </ng-template>\n </p-table>\n </div>\n </div>\n </ng-container>\n </p-panel>\n</div>\n\n<s-exclusion-details></s-exclusion-details>\n",
1171
+ template: "<div>\n <form [formGroup]=\"filterFormGroup\" autocomplete=\"off\">\n <p-panel\n *sLoadingState=\"showLoader\"\n styleClass=\"form-group\"\n [toggleable]=\"true\"\n [(collapsed)]=\"filtersPanelCollapsed\"\n (onAfterToggle)=\"focusInput('description')\"\n >\n <p-header>\n {{ getFiltersTitle() }}\n <s-token-list\n [tokens]=\"searchTokens\"\n (tokenRemoved)=\"onRemoveToken($event)\"\n [removableTokens]=\"true\"\n ></s-token-list>\n </p-header>\n <div>\n <s-dynamic-form\n [fields]=\"filterFields\"\n [form]=\"filterFormGroup\"\n [errorMessages]=\"{ pattern: getErrorInvalid() }\"\n ></s-dynamic-form>\n </div>\n <p-footer>\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <button\n id=\"filter-button\"\n class=\"ui-button\"\n type=\"submit\"\n pButton\n [label]=\"getFilterButtonTitle()\"\n (click)=\"onSearch()\"\n ></button>\n <button\n id=\"clear-button\"\n class=\"ui-button ui-button-link\"\n type=\"button\"\n pButton\n [label]=\"getClearButtonTitle()\"\n (click)=\"onClear()\"\n ></button>\n </div>\n </div>\n </p-footer>\n </p-panel>\n </form>\n <p-panel *sLoadingState=\"showLoader\">\n <p-header>\n {{ getTitle() }}\n </p-header>\n <ng-container>\n <s-empty-state\n *ngIf=\"serverError && !showLoader\"\n iconClass=\"fa fa-exclamation-triangle\"\n title=\"{{ getErrorServerTitle() | translate }}\"\n primaryActionLabel=\"{{ 'error_server_try_again' | translate }}\"\n (primaryAction)=\"resetGrid()\"\n description=\"{{ getErrorServerDescription() | translate }}\"\n ></s-empty-state>\n\n <s-empty-state\n *ngIf=\"!showLoader && !serverError && totalRecords === 0\"\n [title]=\"getEmptyStateTitle()\"\n [showPrimaryAction]=\"false\"\n [description]=\"getEmptyStateDescription()\"\n ></s-empty-state>\n\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <p-table\n #exclusionsTable\n id=\"exclusionsTable\"\n [hidden]=\"totalRecords === 0 || serverError\"\n [value]=\"gridData\"\n [columns]=\"gridColumns\"\n dataKey=\"id\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [resizableColumns]=\"true\"\n sortMode=\"multiple\"\n [paginator]=\"true\"\n [totalRecords]=\"totalRecords\"\n [rows]=\"10\"\n sortField=\"startDate\"\n sortOrder=\"-1\"\n rows=\"10\"\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\"\n (onLazyLoad)=\"onGridChange($event)\"\n >\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col\n *ngFor=\"let col of columns\"\n [style.width]=\"col.width\"\n />\n </colgroup>\n </ng-template>\n\n <ng-template\n pTemplate=\"header\"\n let-columns\n >\n <tr>\n <th *ngFor=\"let col of columns\"\n [id]=\"col.field\"\n [pSortableColumn]=\"col.field\"\n [ngStyle]=\"col.style\"\n pResizableColumn\n >\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">\n {{ col.header }}\n </span>\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\n </div>\n </th>\n <th id=\"action-column\" style=\"width: 100px\">\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ getActionsColumnLabel() }}</span>\n </div>\n </th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\">\n <tr [pSelectableRow]=\"rowData\">\n <s-table-columns\n [columns]=\"columns\"\n [rowValue]=\"rowData\"\n [locale]=\"locale\">\n </s-table-columns>\n <td style=\"width: 100px\">\n <s-button\n id=\"details-button\"\n priority=\"default\"\n [label]=\"getDetailsButtonTitle()\"\n [auxiliary]=\"true\"\n (onClick)=\"onClickDetails(rowData)\">\n </s-button>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"paginatorright\">\n <s-table-paging\n [table]=\"exclusionsTable\"\n [totalRecords]=\"totalRecords\"\n ></s-table-paging>\n </ng-template>\n </p-table>\n </div>\n </div>\n </ng-container>\n </p-panel>\n</div>\n\n<s-exclusion-details></s-exclusion-details>\n",
1082
1172
  providers: []
1083
1173
  })
1084
1174
  ], ExclusionsListComponent);
@@ -1167,7 +1257,7 @@
1167
1257
  },
1168
1258
  children: [
1169
1259
  {
1170
- path: ":entityName",
1260
+ path: "",
1171
1261
  component: ExclusionsListComponent
1172
1262
  }
1173
1263
  ]