@seniorsistemas/exclusion-process-component 0.1.0 → 0.2.1-2d8fcb05-679c-44e2-bb03-d0034a226dc9

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 +127 -36
  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 +88 -10
  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 +93 -10
  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 +117 -32
  22. package/fesm2015/seniorsistemas-exclusion-process-component.js.map +1 -1
  23. package/fesm5/seniorsistemas-exclusion-process-component.js +126 -34
  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,22 +431,32 @@
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();
447
- this.router.navigate(["exclusions-list", this._entityName], {
457
+ this.router.navigate([], {
448
458
  queryParams: {
459
+ entityName: this._entityName,
449
460
  entityDescription: this.entityDescription
450
461
  }
451
462
  });
@@ -462,14 +473,14 @@
462
473
  if (!((_a = this.processDetails) === null || _a === void 0 ? void 0 : _a.startDate)) {
463
474
  return "";
464
475
  }
465
- return moment(this.processDetails.startDate).format("DD/MM/YYYY HH:mm");
476
+ return moment(this.processDetails.startDate).format("DD/MM/YYYY HH:mm:ss");
466
477
  };
467
478
  ExclusionDetailsComponent.prototype.getFinishDate = function () {
468
479
  var _a;
469
480
  if (!((_a = this.processDetails) === null || _a === void 0 ? void 0 : _a.finishDate)) {
470
481
  return "";
471
482
  }
472
- return moment(this.processDetails.finishDate).format("DD/MM/YYYY HH:mm");
483
+ return moment(this.processDetails.finishDate).format("DD/MM/YYYY HH:mm:ss");
473
484
  };
474
485
  ExclusionDetailsComponent.prototype.isFinished = function () {
475
486
  var _a;
@@ -557,14 +568,37 @@
557
568
  .pipe(operators.takeUntil(this.ngUnsubscribe))
558
569
  .pipe(operators.finalize(function () { return _this._isLoading = false; }))
559
570
  .subscribe(function (process) {
571
+ if (!process) {
572
+ return;
573
+ }
560
574
  _this.processDetails = process;
561
575
  _this.loadProcessSummary(process);
562
576
  });
563
577
  };
578
+ ExclusionDetailsComponent.prototype.sortByDate = function (startDate, finishDate) {
579
+ if (startDate.getTime() > finishDate.getTime()) {
580
+ return 1;
581
+ }
582
+ if (startDate.getTime() < finishDate.getTime()) {
583
+ return -1;
584
+ }
585
+ return 0;
586
+ };
587
+ ExclusionDetailsComponent.prototype.sortGroupsByStartDate = function (groups) {
588
+ var _this = this;
589
+ return groups.sort(function (a, b) { return _this.sortByDate(a.startDate, b.finishDate); });
590
+ };
591
+ ExclusionDetailsComponent.prototype.sortStepsByStartDate = function (steps) {
592
+ var _this = this;
593
+ return steps.sort(function (a, b) { return _this.sortByDate(a.startDate, b.finishDate); });
594
+ };
564
595
  ExclusionDetailsComponent.prototype.loadProcessSummary = function (process) {
596
+ var _this = this;
565
597
  var stepLogs = [];
566
- process.groups.forEach(function (group) {
567
- var steps = group.steps.map(function (step) { return ({
598
+ this.sortGroupsByStartDate(process.groups)
599
+ .forEach(function (group) {
600
+ var steps = _this.sortStepsByStartDate(group.steps)
601
+ .map(function (step) { return ({
568
602
  description: step.description,
569
603
  status: step.status,
570
604
  errorMessage: step.errorMessage
@@ -573,6 +607,55 @@
573
607
  });
574
608
  this._processSummaryData = stepLogs;
575
609
  };
610
+ ExclusionDetailsComponent.prototype.disconnectWebSocket = function () {
611
+ if (this._exclusionProcessStatusChangedSubscribe) {
612
+ this._exclusionProcessStatusChangedSubscribe.unsubscribe();
613
+ this._exclusionProcessStatusChangedSubscribe = null;
614
+ }
615
+ if (this._websocketService) {
616
+ this._websocketService.disconnect();
617
+ this._websocketService = null;
618
+ }
619
+ };
620
+ ExclusionDetailsComponent.prototype.connectWebSocket = function () {
621
+ var _this = this;
622
+ if (this._websocketService) {
623
+ this.disconnectWebSocket();
624
+ }
625
+ this._websocketService = new angularComponents$1.WebsocketService();
626
+ this._websocketService
627
+ .onConnect()
628
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
629
+ .subscribe(function () {
630
+ _this.startListeningWebhookEvents();
631
+ });
632
+ };
633
+ ExclusionDetailsComponent.prototype.startListeningWebhookEvents = function () {
634
+ var _this = this;
635
+ this._websocketService
636
+ .onError()
637
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
638
+ .subscribe(function (data) {
639
+ console.error('onError', data);
640
+ });
641
+ this._exclusionProcessStatusChangedSubscribe = this._websocketService
642
+ .onEvent({
643
+ domain: this.projectConfigs.getDomain(),
644
+ service: this.projectConfigs.getService(),
645
+ primitive: "exclusionProcessStatusChanged"
646
+ })
647
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
648
+ .subscribe(function (event) {
649
+ var data = event.data;
650
+ if (_this._exclusionDetails.processId && data.pid === _this._exclusionDetails.processId) {
651
+ _this.loadProcessDetails(_this._exclusionDetails);
652
+ return;
653
+ }
654
+ if (_this._exclusionDetails.recordId && data.recordId === _this._exclusionDetails.recordId) {
655
+ _this.loadProcessDetails(_this._exclusionDetails);
656
+ }
657
+ });
658
+ };
576
659
  ExclusionDetailsComponent.ctorParameters = function () { return [
577
660
  { type: router.Router },
578
661
  { type: router.ActivatedRoute },
@@ -601,7 +684,7 @@
601
684
  ExclusionDetailsComponent = __decorate([
602
685
  core.Component({
603
686
  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",
687
+ 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
688
  encapsulation: core.ViewEncapsulation.None,
606
689
  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
690
  })
@@ -741,7 +824,7 @@
741
824
  var HTTP_CODE_SERVER_ERROR_START = 500;
742
825
  var HTTP_CODE_SERVER_ERROR_END = 600;
743
826
  var ExclusionsListComponent = /** @class */ (function () {
744
- function ExclusionsListComponent(route, translate, formBuilder, changeDetectorRef, logicalDeleteService, filterService, projectConfigs) {
827
+ function ExclusionsListComponent(route, translate, formBuilder, changeDetectorRef, logicalDeleteService, filterService, projectConfigs, cdr) {
745
828
  this.route = route;
746
829
  this.translate = translate;
747
830
  this.formBuilder = formBuilder;
@@ -749,6 +832,7 @@
749
832
  this.logicalDeleteService = logicalDeleteService;
750
833
  this.filterService = filterService;
751
834
  this.projectConfigs = projectConfigs;
835
+ this.cdr = cdr;
752
836
  this.currentListParams = { page: 0, size: 10, sort: [], filterData: {} };
753
837
  this.showLoader = false;
754
838
  this.totalRecords = 0;
@@ -768,27 +852,22 @@
768
852
  .subscribe(function (data) {
769
853
  _this.locale = data.localeConfig;
770
854
  });
771
- this.route.params
772
- .pipe(operators.takeUntil(this.ngUnsubscribe))
773
- .subscribe(function (params) {
774
- _this.entityName = params.entityName;
775
- _this.showBasedOnRoute();
776
- });
777
855
  this.route.queryParams
778
856
  .pipe(operators.takeUntil(this.ngUnsubscribe))
779
857
  .subscribe(function (queryParams) {
858
+ _this.entityName = queryParams.entityName;
780
859
  _this.entityDescription = queryParams.entityDescription;
781
860
  _this.processId = queryParams.processId;
782
- _this.showBasedOnRoute();
783
861
  });
784
862
  };
785
- ExclusionsListComponent.prototype.showBasedOnRoute = function () {
863
+ ExclusionsListComponent.prototype.ngAfterViewInit = function () {
786
864
  if (this.entityName && this.entityDescription && this.processId) {
787
865
  this.exclusionDetailsComponent.showDetails({
788
866
  processId: this.processId,
789
867
  entityDescription: this.entityDescription,
790
868
  entityName: this.entityName
791
869
  });
870
+ this.cdr.detectChanges();
792
871
  }
793
872
  };
794
873
  ExclusionsListComponent.prototype.ngOnDestroy = function () {
@@ -823,6 +902,7 @@
823
902
  style: {
824
903
  width: "100px"
825
904
  },
905
+ tooltip: this.getColumnStatusTooltip,
826
906
  badgeConfigs: [
827
907
  {
828
908
  enumValue: EnumExclusionProcessStatus.ERROR,
@@ -847,7 +927,7 @@
847
927
  attributes: ["startDate"],
848
928
  header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_start"),
849
929
  type: angularComponents.EnumColumnFieldType.DATE,
850
- dateFormat: "DD/MM/YYYY HH:mm",
930
+ dateFormat: "DD/MM/YYYY HH:mm:ss",
851
931
  style: {
852
932
  width: "100px"
853
933
  }
@@ -857,13 +937,19 @@
857
937
  attributes: ["finishDate"],
858
938
  header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_finish"),
859
939
  type: angularComponents.EnumColumnFieldType.DATE,
860
- dateFormat: "DD/MM/YYYY HH:mm",
940
+ dateFormat: "DD/MM/YYYY HH:mm:ss",
861
941
  style: {
862
942
  width: "100px"
863
943
  }
864
944
  }
865
945
  ];
866
946
  };
947
+ ExclusionsListComponent.prototype.getColumnStatusTooltip = function (rowValue) {
948
+ if (rowValue.errorMessage) {
949
+ return rowValue.errorMessage;
950
+ }
951
+ return null;
952
+ };
867
953
  ExclusionsListComponent.prototype.getFilterFields = function () {
868
954
  var translationPrefix = this.projectConfigs.getTranslationPrefix();
869
955
  return [
@@ -1017,8 +1103,12 @@
1017
1103
  this.searchTokens = this.getFilterTokens();
1018
1104
  var filterQuery = this.getFilterQuery();
1019
1105
  var displayFields = __spread([
1020
- "recordId"
1106
+ "recordId",
1107
+ "errorMessage"
1021
1108
  ], this.gridColumns.map(function (column) { return column.field; }));
1109
+ if (!sort.length) {
1110
+ sort.push({ field: 'startDate', order: -1 });
1111
+ }
1022
1112
  this.listExclusions({ page: page, size: size, sort: sort, filterQuery: filterQuery, displayFields: displayFields });
1023
1113
  };
1024
1114
  ExclusionsListComponent.prototype.listExclusions = function (params) {
@@ -1068,7 +1158,8 @@
1068
1158
  { type: core.ChangeDetectorRef },
1069
1159
  { type: LogicalDeleteService },
1070
1160
  { type: FilterService },
1071
- { type: LogicalDeleteConfigService }
1161
+ { type: LogicalDeleteConfigService },
1162
+ { type: core.ChangeDetectorRef }
1072
1163
  ]; };
1073
1164
  __decorate([
1074
1165
  core.ViewChild("exclusionsTable")
@@ -1078,7 +1169,7 @@
1078
1169
  ], ExclusionsListComponent.prototype, "exclusionDetailsComponent", void 0);
1079
1170
  ExclusionsListComponent = ExclusionsListComponent_1 = __decorate([
1080
1171
  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",
1172
+ 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
1173
  providers: []
1083
1174
  })
1084
1175
  ], ExclusionsListComponent);
@@ -1167,7 +1258,7 @@
1167
1258
  },
1168
1259
  children: [
1169
1260
  {
1170
- path: ":entityName",
1261
+ path: "",
1171
1262
  component: ExclusionsListComponent
1172
1263
  }
1173
1264
  ]