@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,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,22 +226,32 @@ 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();
241
- this.router.navigate(["exclusions-list", this._entityName], {
252
+ this.router.navigate([], {
242
253
  queryParams: {
254
+ entityName: this._entityName,
243
255
  entityDescription: this.entityDescription
244
256
  }
245
257
  });
@@ -256,14 +268,14 @@ var ExclusionDetailsComponent = /** @class */ (function () {
256
268
  if (!((_a = this.processDetails) === null || _a === void 0 ? void 0 : _a.startDate)) {
257
269
  return "";
258
270
  }
259
- return moment(this.processDetails.startDate).format("DD/MM/YYYY HH:mm");
271
+ return moment(this.processDetails.startDate).format("DD/MM/YYYY HH:mm:ss");
260
272
  };
261
273
  ExclusionDetailsComponent.prototype.getFinishDate = function () {
262
274
  var _a;
263
275
  if (!((_a = this.processDetails) === null || _a === void 0 ? void 0 : _a.finishDate)) {
264
276
  return "";
265
277
  }
266
- return moment(this.processDetails.finishDate).format("DD/MM/YYYY HH:mm");
278
+ return moment(this.processDetails.finishDate).format("DD/MM/YYYY HH:mm:ss");
267
279
  };
268
280
  ExclusionDetailsComponent.prototype.isFinished = function () {
269
281
  var _a;
@@ -351,14 +363,37 @@ var ExclusionDetailsComponent = /** @class */ (function () {
351
363
  .pipe(takeUntil(this.ngUnsubscribe))
352
364
  .pipe(finalize(function () { return _this._isLoading = false; }))
353
365
  .subscribe(function (process) {
366
+ if (!process) {
367
+ return;
368
+ }
354
369
  _this.processDetails = process;
355
370
  _this.loadProcessSummary(process);
356
371
  });
357
372
  };
373
+ ExclusionDetailsComponent.prototype.sortByDate = function (startDate, finishDate) {
374
+ if (startDate.getTime() > finishDate.getTime()) {
375
+ return 1;
376
+ }
377
+ if (startDate.getTime() < finishDate.getTime()) {
378
+ return -1;
379
+ }
380
+ return 0;
381
+ };
382
+ ExclusionDetailsComponent.prototype.sortGroupsByStartDate = function (groups) {
383
+ var _this = this;
384
+ return groups.sort(function (a, b) { return _this.sortByDate(a.startDate, b.finishDate); });
385
+ };
386
+ ExclusionDetailsComponent.prototype.sortStepsByStartDate = function (steps) {
387
+ var _this = this;
388
+ return steps.sort(function (a, b) { return _this.sortByDate(a.startDate, b.finishDate); });
389
+ };
358
390
  ExclusionDetailsComponent.prototype.loadProcessSummary = function (process) {
391
+ var _this = this;
359
392
  var stepLogs = [];
360
- process.groups.forEach(function (group) {
361
- var steps = group.steps.map(function (step) { return ({
393
+ this.sortGroupsByStartDate(process.groups)
394
+ .forEach(function (group) {
395
+ var steps = _this.sortStepsByStartDate(group.steps)
396
+ .map(function (step) { return ({
362
397
  description: step.description,
363
398
  status: step.status,
364
399
  errorMessage: step.errorMessage
@@ -367,6 +402,55 @@ var ExclusionDetailsComponent = /** @class */ (function () {
367
402
  });
368
403
  this._processSummaryData = stepLogs;
369
404
  };
405
+ ExclusionDetailsComponent.prototype.disconnectWebSocket = function () {
406
+ if (this._exclusionProcessStatusChangedSubscribe) {
407
+ this._exclusionProcessStatusChangedSubscribe.unsubscribe();
408
+ this._exclusionProcessStatusChangedSubscribe = null;
409
+ }
410
+ if (this._websocketService) {
411
+ this._websocketService.disconnect();
412
+ this._websocketService = null;
413
+ }
414
+ };
415
+ ExclusionDetailsComponent.prototype.connectWebSocket = function () {
416
+ var _this = this;
417
+ if (this._websocketService) {
418
+ this.disconnectWebSocket();
419
+ }
420
+ this._websocketService = new WebsocketService();
421
+ this._websocketService
422
+ .onConnect()
423
+ .pipe(takeUntil(this.ngUnsubscribe))
424
+ .subscribe(function () {
425
+ _this.startListeningWebhookEvents();
426
+ });
427
+ };
428
+ ExclusionDetailsComponent.prototype.startListeningWebhookEvents = function () {
429
+ var _this = this;
430
+ this._websocketService
431
+ .onError()
432
+ .pipe(takeUntil(this.ngUnsubscribe))
433
+ .subscribe(function (data) {
434
+ console.error('onError', data);
435
+ });
436
+ this._exclusionProcessStatusChangedSubscribe = this._websocketService
437
+ .onEvent({
438
+ domain: this.projectConfigs.getDomain(),
439
+ service: this.projectConfigs.getService(),
440
+ primitive: "exclusionProcessStatusChanged"
441
+ })
442
+ .pipe(takeUntil(this.ngUnsubscribe))
443
+ .subscribe(function (event) {
444
+ var data = event.data;
445
+ if (_this._exclusionDetails.processId && data.pid === _this._exclusionDetails.processId) {
446
+ _this.loadProcessDetails(_this._exclusionDetails);
447
+ return;
448
+ }
449
+ if (_this._exclusionDetails.recordId && data.recordId === _this._exclusionDetails.recordId) {
450
+ _this.loadProcessDetails(_this._exclusionDetails);
451
+ }
452
+ });
453
+ };
370
454
  ExclusionDetailsComponent.ctorParameters = function () { return [
371
455
  { type: Router },
372
456
  { type: ActivatedRoute },
@@ -395,7 +479,7 @@ var ExclusionDetailsComponent = /** @class */ (function () {
395
479
  ExclusionDetailsComponent = __decorate([
396
480
  Component({
397
481
  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",
482
+ 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
483
  encapsulation: ViewEncapsulation.None,
400
484
  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
485
  })
@@ -535,7 +619,7 @@ var FilterService = /** @class */ (function () {
535
619
  var HTTP_CODE_SERVER_ERROR_START = 500;
536
620
  var HTTP_CODE_SERVER_ERROR_END = 600;
537
621
  var ExclusionsListComponent = /** @class */ (function () {
538
- function ExclusionsListComponent(route, translate, formBuilder, changeDetectorRef, logicalDeleteService, filterService, projectConfigs) {
622
+ function ExclusionsListComponent(route, translate, formBuilder, changeDetectorRef, logicalDeleteService, filterService, projectConfigs, cdr) {
539
623
  this.route = route;
540
624
  this.translate = translate;
541
625
  this.formBuilder = formBuilder;
@@ -543,6 +627,7 @@ var ExclusionsListComponent = /** @class */ (function () {
543
627
  this.logicalDeleteService = logicalDeleteService;
544
628
  this.filterService = filterService;
545
629
  this.projectConfigs = projectConfigs;
630
+ this.cdr = cdr;
546
631
  this.currentListParams = { page: 0, size: 10, sort: [], filterData: {} };
547
632
  this.showLoader = false;
548
633
  this.totalRecords = 0;
@@ -562,27 +647,22 @@ var ExclusionsListComponent = /** @class */ (function () {
562
647
  .subscribe(function (data) {
563
648
  _this.locale = data.localeConfig;
564
649
  });
565
- this.route.params
566
- .pipe(takeUntil(this.ngUnsubscribe))
567
- .subscribe(function (params) {
568
- _this.entityName = params.entityName;
569
- _this.showBasedOnRoute();
570
- });
571
650
  this.route.queryParams
572
651
  .pipe(takeUntil(this.ngUnsubscribe))
573
652
  .subscribe(function (queryParams) {
653
+ _this.entityName = queryParams.entityName;
574
654
  _this.entityDescription = queryParams.entityDescription;
575
655
  _this.processId = queryParams.processId;
576
- _this.showBasedOnRoute();
577
656
  });
578
657
  };
579
- ExclusionsListComponent.prototype.showBasedOnRoute = function () {
658
+ ExclusionsListComponent.prototype.ngAfterViewInit = function () {
580
659
  if (this.entityName && this.entityDescription && this.processId) {
581
660
  this.exclusionDetailsComponent.showDetails({
582
661
  processId: this.processId,
583
662
  entityDescription: this.entityDescription,
584
663
  entityName: this.entityName
585
664
  });
665
+ this.cdr.detectChanges();
586
666
  }
587
667
  };
588
668
  ExclusionsListComponent.prototype.ngOnDestroy = function () {
@@ -617,6 +697,7 @@ var ExclusionsListComponent = /** @class */ (function () {
617
697
  style: {
618
698
  width: "100px"
619
699
  },
700
+ tooltip: this.getColumnStatusTooltip,
620
701
  badgeConfigs: [
621
702
  {
622
703
  enumValue: EnumExclusionProcessStatus.ERROR,
@@ -641,7 +722,7 @@ var ExclusionsListComponent = /** @class */ (function () {
641
722
  attributes: ["startDate"],
642
723
  header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_start"),
643
724
  type: EnumColumnFieldType.DATE,
644
- dateFormat: "DD/MM/YYYY HH:mm",
725
+ dateFormat: "DD/MM/YYYY HH:mm:ss",
645
726
  style: {
646
727
  width: "100px"
647
728
  }
@@ -651,13 +732,19 @@ var ExclusionsListComponent = /** @class */ (function () {
651
732
  attributes: ["finishDate"],
652
733
  header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_finish"),
653
734
  type: EnumColumnFieldType.DATE,
654
- dateFormat: "DD/MM/YYYY HH:mm",
735
+ dateFormat: "DD/MM/YYYY HH:mm:ss",
655
736
  style: {
656
737
  width: "100px"
657
738
  }
658
739
  }
659
740
  ];
660
741
  };
742
+ ExclusionsListComponent.prototype.getColumnStatusTooltip = function (rowValue) {
743
+ if (rowValue.errorMessage) {
744
+ return rowValue.errorMessage;
745
+ }
746
+ return null;
747
+ };
661
748
  ExclusionsListComponent.prototype.getFilterFields = function () {
662
749
  var translationPrefix = this.projectConfigs.getTranslationPrefix();
663
750
  return [
@@ -811,8 +898,12 @@ var ExclusionsListComponent = /** @class */ (function () {
811
898
  this.searchTokens = this.getFilterTokens();
812
899
  var filterQuery = this.getFilterQuery();
813
900
  var displayFields = __spread([
814
- "recordId"
901
+ "recordId",
902
+ "errorMessage"
815
903
  ], this.gridColumns.map(function (column) { return column.field; }));
904
+ if (!sort.length) {
905
+ sort.push({ field: 'startDate', order: -1 });
906
+ }
816
907
  this.listExclusions({ page: page, size: size, sort: sort, filterQuery: filterQuery, displayFields: displayFields });
817
908
  };
818
909
  ExclusionsListComponent.prototype.listExclusions = function (params) {
@@ -862,7 +953,8 @@ var ExclusionsListComponent = /** @class */ (function () {
862
953
  { type: ChangeDetectorRef },
863
954
  { type: LogicalDeleteService },
864
955
  { type: FilterService },
865
- { type: LogicalDeleteConfigService }
956
+ { type: LogicalDeleteConfigService },
957
+ { type: ChangeDetectorRef }
866
958
  ]; };
867
959
  __decorate([
868
960
  ViewChild("exclusionsTable")
@@ -872,7 +964,7 @@ var ExclusionsListComponent = /** @class */ (function () {
872
964
  ], ExclusionsListComponent.prototype, "exclusionDetailsComponent", void 0);
873
965
  ExclusionsListComponent = ExclusionsListComponent_1 = __decorate([
874
966
  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",
967
+ 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
968
  providers: []
877
969
  })
878
970
  ], ExclusionsListComponent);
@@ -961,7 +1053,7 @@ var routes = [
961
1053
  },
962
1054
  children: [
963
1055
  {
964
- path: ":entityName",
1056
+ path: "",
965
1057
  component: ExclusionsListComponent
966
1058
  }
967
1059
  ]