@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,4 +1,4 @@
1
- import { __decorate, __param, __spread, __assign } from 'tslib';
1
+ import { __decorate, __param, __assign, __spread } from 'tslib';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { InjectionToken, Inject, Injectable, Output, Component, ViewEncapsulation, NgModule, ChangeDetectorRef, ViewChild } from '@angular/core';
4
4
  import { PanelModule } from 'primeng/panel';
@@ -6,10 +6,11 @@ import { TableModule } from 'primeng/table';
6
6
  import { EnumColumnFieldType, EnumBadgeColors, SidebarModule, ButtonModule, TableModule as TableModule$1, LoadingStateModule, LocaleModule, EmptyStateModule, FieldType, FormField, LocaleService, ControlErrorsModule, InfoSignModule, DynamicFormModule, TokenListModule } from '@seniorsistemas/angular-components';
7
7
  import * as moment from 'moment';
8
8
  import { Router, ActivatedRoute, RouterModule } from '@angular/router';
9
+ import { TranslateService, TranslateModule } from '@ngx-translate/core';
9
10
  import { throwError, Subject } from 'rxjs';
10
11
  import { catchError, map, takeUntil, finalize } from 'rxjs/operators';
12
+ import { WebsocketService } from '@senior-gestao-empresarial/angular-components';
11
13
  import { HttpParams, HttpClient } from '@angular/common/http';
12
- import { TranslateService, TranslateModule } from '@ngx-translate/core';
13
14
  import { MessageService } from 'primeng/api';
14
15
  import { Validators, FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
15
16
  import { DialogModule } from 'primeng/dialog';
@@ -63,7 +64,6 @@ var LogicalDeleteService = /** @class */ (function () {
63
64
  this.projectConfigs = projectConfigs;
64
65
  var entityUrl = projectConfigs.getDomain() + "/" + projectConfigs.getService();
65
66
  this.exclusionProcessUrl = entityUrl + "/entities/exclusionProcess";
66
- this.listExclusionsUrl = entityUrl + "/entities/exclusionProcess";
67
67
  this.defaultCatch = this.defaultCatch.bind(this);
68
68
  }
69
69
  LogicalDeleteService.prototype.defaultCatch = function () {
@@ -126,6 +126,7 @@ var LogicalDeleteService = /** @class */ (function () {
126
126
  });
127
127
  };
128
128
  LogicalDeleteService.prototype.doGetProcessDetails = function (filterParams) {
129
+ var _this = this;
129
130
  return this.http.get(this.exclusionProcessUrl, { params: filterParams })
130
131
  .pipe(this.defaultCatch())
131
132
  .pipe(map(function (value) {
@@ -133,10 +134,18 @@ var LogicalDeleteService = /** @class */ (function () {
133
134
  if (!((_a = value.contents) === null || _a === void 0 ? void 0 : _a.length)) {
134
135
  return null;
135
136
  }
136
- return value.contents[0];
137
+ return _this.mapExclusionsDates(value.contents[0]);
137
138
  }));
138
139
  };
140
+ LogicalDeleteService.prototype.mapExclusionsDates = function (exclusionProcess) {
141
+ var _a;
142
+ 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) {
143
+ var _a;
144
+ 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 })); }) }));
145
+ }) });
146
+ };
139
147
  LogicalDeleteService.prototype.listExclusions = function (entityName, params) {
148
+ var _this = this;
140
149
  if (params === void 0) { params = {}; }
141
150
  if (params.filterQuery) {
142
151
  params.filterQuery += " and lower(entityName) eq lower('" + entityName + "')";
@@ -147,14 +156,7 @@ var LogicalDeleteService = /** @class */ (function () {
147
156
  return this.http.get(this.exclusionProcessUrl, { params: this.getListQueryParams(params) })
148
157
  .pipe(this.defaultCatch())
149
158
  .pipe(map(function (value) {
150
- value.contents.forEach(function (p) {
151
- if (p.startDate) {
152
- p.startDate = moment(p.startDate).toDate();
153
- }
154
- if (p.finishDate) {
155
- p.finishDate = moment(p.finishDate).toDate();
156
- }
157
- });
159
+ value.contents = value.contents.map(_this.mapExclusionsDates);
158
160
  return value;
159
161
  }));
160
162
  };
@@ -224,17 +226,26 @@ var ExclusionDetailsComponent = /** @class */ (function () {
224
226
  ExclusionDetailsComponent.prototype.ngOnDestroy = function () {
225
227
  this.ngUnsubscribe.next();
226
228
  this.ngUnsubscribe.complete();
229
+ this.disconnectWebSocket();
227
230
  };
228
231
  ExclusionDetailsComponent.prototype.showDetails = function (details) {
229
- this.processDetails = null;
232
+ this._exclusionDetails = details;
230
233
  this._entityName = details.entityName;
231
234
  this._isVisible = true;
232
235
  this._processSummaryData = [];
236
+ this.processDetails = null;
233
237
  this.entityDescription = details.entityDescription;
234
238
  this.loadProcessDetails(details);
239
+ this.connectWebSocket();
240
+ };
241
+ ExclusionDetailsComponent.prototype.onVisibilityChanged = function (event) {
242
+ this.closeDetails();
235
243
  };
236
244
  ExclusionDetailsComponent.prototype.closeDetails = function () {
237
245
  this._isVisible = false;
246
+ this._exclusionDetails = null;
247
+ this._processSummaryData = [];
248
+ this.disconnectWebSocket();
238
249
  };
239
250
  ExclusionDetailsComponent.prototype.openExclusions = function () {
240
251
  this.closeDetails();
@@ -256,14 +267,14 @@ var ExclusionDetailsComponent = /** @class */ (function () {
256
267
  if (!((_a = this.processDetails) === null || _a === void 0 ? void 0 : _a.startDate)) {
257
268
  return "";
258
269
  }
259
- return moment(this.processDetails.startDate).format("DD/MM/YYYY HH:mm");
270
+ return moment(this.processDetails.startDate).format("DD/MM/YYYY HH:mm:ss");
260
271
  };
261
272
  ExclusionDetailsComponent.prototype.getFinishDate = function () {
262
273
  var _a;
263
274
  if (!((_a = this.processDetails) === null || _a === void 0 ? void 0 : _a.finishDate)) {
264
275
  return "";
265
276
  }
266
- return moment(this.processDetails.finishDate).format("DD/MM/YYYY HH:mm");
277
+ return moment(this.processDetails.finishDate).format("DD/MM/YYYY HH:mm:ss");
267
278
  };
268
279
  ExclusionDetailsComponent.prototype.isFinished = function () {
269
280
  var _a;
@@ -351,14 +362,37 @@ var ExclusionDetailsComponent = /** @class */ (function () {
351
362
  .pipe(takeUntil(this.ngUnsubscribe))
352
363
  .pipe(finalize(function () { return _this._isLoading = false; }))
353
364
  .subscribe(function (process) {
365
+ if (!process) {
366
+ return;
367
+ }
354
368
  _this.processDetails = process;
355
369
  _this.loadProcessSummary(process);
356
370
  });
357
371
  };
372
+ ExclusionDetailsComponent.prototype.sortByDate = function (startDate, finishDate) {
373
+ if (startDate.getTime() > finishDate.getTime()) {
374
+ return 1;
375
+ }
376
+ if (startDate.getTime() < finishDate.getTime()) {
377
+ return -1;
378
+ }
379
+ return 0;
380
+ };
381
+ ExclusionDetailsComponent.prototype.sortGroupsByStartDate = function (groups) {
382
+ var _this = this;
383
+ return groups.sort(function (a, b) { return _this.sortByDate(a.startDate, b.finishDate); });
384
+ };
385
+ ExclusionDetailsComponent.prototype.sortStepsByStartDate = function (steps) {
386
+ var _this = this;
387
+ return steps.sort(function (a, b) { return _this.sortByDate(a.startDate, b.finishDate); });
388
+ };
358
389
  ExclusionDetailsComponent.prototype.loadProcessSummary = function (process) {
390
+ var _this = this;
359
391
  var stepLogs = [];
360
- process.groups.forEach(function (group) {
361
- var steps = group.steps.map(function (step) { return ({
392
+ this.sortGroupsByStartDate(process.groups)
393
+ .forEach(function (group) {
394
+ var steps = _this.sortStepsByStartDate(group.steps)
395
+ .map(function (step) { return ({
362
396
  description: step.description,
363
397
  status: step.status,
364
398
  errorMessage: step.errorMessage
@@ -367,6 +401,55 @@ var ExclusionDetailsComponent = /** @class */ (function () {
367
401
  });
368
402
  this._processSummaryData = stepLogs;
369
403
  };
404
+ ExclusionDetailsComponent.prototype.disconnectWebSocket = function () {
405
+ if (this._exclusionProcessStatusChangedSubscribe) {
406
+ this._exclusionProcessStatusChangedSubscribe.unsubscribe();
407
+ this._exclusionProcessStatusChangedSubscribe = null;
408
+ }
409
+ if (this._websocketService) {
410
+ this._websocketService.disconnect();
411
+ this._websocketService = null;
412
+ }
413
+ };
414
+ ExclusionDetailsComponent.prototype.connectWebSocket = function () {
415
+ var _this = this;
416
+ if (this._websocketService) {
417
+ this.disconnectWebSocket();
418
+ }
419
+ this._websocketService = new WebsocketService();
420
+ this._websocketService
421
+ .onConnect()
422
+ .pipe(takeUntil(this.ngUnsubscribe))
423
+ .subscribe(function () {
424
+ _this.startListeningWebhookEvents();
425
+ });
426
+ };
427
+ ExclusionDetailsComponent.prototype.startListeningWebhookEvents = function () {
428
+ var _this = this;
429
+ this._websocketService
430
+ .onError()
431
+ .pipe(takeUntil(this.ngUnsubscribe))
432
+ .subscribe(function (data) {
433
+ console.error('onError', data);
434
+ });
435
+ this._exclusionProcessStatusChangedSubscribe = this._websocketService
436
+ .onEvent({
437
+ domain: this.projectConfigs.getDomain(),
438
+ service: this.projectConfigs.getService(),
439
+ primitive: "exclusionProcessStatusChanged"
440
+ })
441
+ .pipe(takeUntil(this.ngUnsubscribe))
442
+ .subscribe(function (event) {
443
+ var data = event.data;
444
+ if (_this._exclusionDetails.processId && data.pid === _this._exclusionDetails.processId) {
445
+ _this.loadProcessDetails(_this._exclusionDetails);
446
+ return;
447
+ }
448
+ if (_this._exclusionDetails.recordId && data.recordId === _this._exclusionDetails.recordId) {
449
+ _this.loadProcessDetails(_this._exclusionDetails);
450
+ }
451
+ });
452
+ };
370
453
  ExclusionDetailsComponent.ctorParameters = function () { return [
371
454
  { type: Router },
372
455
  { type: ActivatedRoute },
@@ -395,7 +478,7 @@ var ExclusionDetailsComponent = /** @class */ (function () {
395
478
  ExclusionDetailsComponent = __decorate([
396
479
  Component({
397
480
  selector: "s-exclusion-details",
398
- 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",
481
+ 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",
399
482
  encapsulation: ViewEncapsulation.None,
400
483
  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}"]
401
484
  })
@@ -535,7 +618,7 @@ var FilterService = /** @class */ (function () {
535
618
  var HTTP_CODE_SERVER_ERROR_START = 500;
536
619
  var HTTP_CODE_SERVER_ERROR_END = 600;
537
620
  var ExclusionsListComponent = /** @class */ (function () {
538
- function ExclusionsListComponent(route, translate, formBuilder, changeDetectorRef, logicalDeleteService, filterService, projectConfigs) {
621
+ function ExclusionsListComponent(route, translate, formBuilder, changeDetectorRef, logicalDeleteService, filterService, projectConfigs, cdr) {
539
622
  this.route = route;
540
623
  this.translate = translate;
541
624
  this.formBuilder = formBuilder;
@@ -543,6 +626,7 @@ var ExclusionsListComponent = /** @class */ (function () {
543
626
  this.logicalDeleteService = logicalDeleteService;
544
627
  this.filterService = filterService;
545
628
  this.projectConfigs = projectConfigs;
629
+ this.cdr = cdr;
546
630
  this.currentListParams = { page: 0, size: 10, sort: [], filterData: {} };
547
631
  this.showLoader = false;
548
632
  this.totalRecords = 0;
@@ -562,27 +646,22 @@ var ExclusionsListComponent = /** @class */ (function () {
562
646
  .subscribe(function (data) {
563
647
  _this.locale = data.localeConfig;
564
648
  });
565
- this.route.params
566
- .pipe(takeUntil(this.ngUnsubscribe))
567
- .subscribe(function (params) {
568
- _this.entityName = params.entityName;
569
- _this.showBasedOnRoute();
570
- });
571
649
  this.route.queryParams
572
650
  .pipe(takeUntil(this.ngUnsubscribe))
573
651
  .subscribe(function (queryParams) {
652
+ _this.entityName = queryParams.entityName;
574
653
  _this.entityDescription = queryParams.entityDescription;
575
654
  _this.processId = queryParams.processId;
576
- _this.showBasedOnRoute();
577
655
  });
578
656
  };
579
- ExclusionsListComponent.prototype.showBasedOnRoute = function () {
657
+ ExclusionsListComponent.prototype.ngAfterViewInit = function () {
580
658
  if (this.entityName && this.entityDescription && this.processId) {
581
659
  this.exclusionDetailsComponent.showDetails({
582
660
  processId: this.processId,
583
661
  entityDescription: this.entityDescription,
584
662
  entityName: this.entityName
585
663
  });
664
+ this.cdr.detectChanges();
586
665
  }
587
666
  };
588
667
  ExclusionsListComponent.prototype.ngOnDestroy = function () {
@@ -617,6 +696,7 @@ var ExclusionsListComponent = /** @class */ (function () {
617
696
  style: {
618
697
  width: "100px"
619
698
  },
699
+ tooltip: this.getColumnStatusTooltip,
620
700
  badgeConfigs: [
621
701
  {
622
702
  enumValue: EnumExclusionProcessStatus.ERROR,
@@ -641,7 +721,7 @@ var ExclusionsListComponent = /** @class */ (function () {
641
721
  attributes: ["startDate"],
642
722
  header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_start"),
643
723
  type: EnumColumnFieldType.DATE,
644
- dateFormat: "DD/MM/YYYY HH:mm",
724
+ dateFormat: "DD/MM/YYYY HH:mm:ss",
645
725
  style: {
646
726
  width: "100px"
647
727
  }
@@ -651,13 +731,19 @@ var ExclusionsListComponent = /** @class */ (function () {
651
731
  attributes: ["finishDate"],
652
732
  header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_finish"),
653
733
  type: EnumColumnFieldType.DATE,
654
- dateFormat: "DD/MM/YYYY HH:mm",
734
+ dateFormat: "DD/MM/YYYY HH:mm:ss",
655
735
  style: {
656
736
  width: "100px"
657
737
  }
658
738
  }
659
739
  ];
660
740
  };
741
+ ExclusionsListComponent.prototype.getColumnStatusTooltip = function (rowValue) {
742
+ if (rowValue.errorMessage) {
743
+ return rowValue.errorMessage;
744
+ }
745
+ return null;
746
+ };
661
747
  ExclusionsListComponent.prototype.getFilterFields = function () {
662
748
  var translationPrefix = this.projectConfigs.getTranslationPrefix();
663
749
  return [
@@ -811,8 +897,12 @@ var ExclusionsListComponent = /** @class */ (function () {
811
897
  this.searchTokens = this.getFilterTokens();
812
898
  var filterQuery = this.getFilterQuery();
813
899
  var displayFields = __spread([
814
- "recordId"
900
+ "recordId",
901
+ "errorMessage"
815
902
  ], this.gridColumns.map(function (column) { return column.field; }));
903
+ if (!sort.length) {
904
+ sort.push({ field: 'startDate', order: -1 });
905
+ }
816
906
  this.listExclusions({ page: page, size: size, sort: sort, filterQuery: filterQuery, displayFields: displayFields });
817
907
  };
818
908
  ExclusionsListComponent.prototype.listExclusions = function (params) {
@@ -862,7 +952,8 @@ var ExclusionsListComponent = /** @class */ (function () {
862
952
  { type: ChangeDetectorRef },
863
953
  { type: LogicalDeleteService },
864
954
  { type: FilterService },
865
- { type: LogicalDeleteConfigService }
955
+ { type: LogicalDeleteConfigService },
956
+ { type: ChangeDetectorRef }
866
957
  ]; };
867
958
  __decorate([
868
959
  ViewChild("exclusionsTable")
@@ -872,7 +963,7 @@ var ExclusionsListComponent = /** @class */ (function () {
872
963
  ], ExclusionsListComponent.prototype, "exclusionDetailsComponent", void 0);
873
964
  ExclusionsListComponent = ExclusionsListComponent_1 = __decorate([
874
965
  Component({
875
- 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",
966
+ 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",
876
967
  providers: []
877
968
  })
878
969
  ], ExclusionsListComponent);
@@ -961,7 +1052,7 @@ var routes = [
961
1052
  },
962
1053
  children: [
963
1054
  {
964
- path: ":entityName",
1055
+ path: "",
965
1056
  component: ExclusionsListComponent
966
1057
  }
967
1058
  ]