@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.
- package/bundles/seniorsistemas-exclusion-process-component.umd.js +125 -35
- package/bundles/seniorsistemas-exclusion-process-component.umd.js.map +1 -1
- package/bundles/seniorsistemas-exclusion-process-component.umd.min.js +2 -2
- package/bundles/seniorsistemas-exclusion-process-component.umd.min.js.map +1 -1
- package/esm2015/exclusion-details/exclusion-details.component.js +86 -9
- package/esm2015/exclusion-details/protocols/exclusion-process-status-changed.js +1 -0
- package/esm2015/exclusion-details/protocols/web-socket-event-data.js +1 -0
- package/esm2015/exclusions-list/exclusions-list.component.js +23 -15
- package/esm2015/exclusions-list/exclusions-list.routing.js +2 -2
- package/esm2015/services/logical-delete.service.js +10 -11
- package/esm5/exclusion-details/exclusion-details.component.js +91 -9
- package/esm5/exclusion-details/protocols/exclusion-process-status-changed.js +1 -0
- package/esm5/exclusion-details/protocols/web-socket-event-data.js +1 -0
- package/esm5/exclusions-list/exclusions-list.component.js +24 -16
- package/esm5/exclusions-list/exclusions-list.routing.js +2 -2
- package/esm5/services/logical-delete.service.js +13 -12
- package/exclusion-details/exclusion-details.component.d.ts +11 -1
- package/exclusion-details/protocols/exclusion-process-status-changed.d.ts +8 -0
- package/exclusion-details/protocols/web-socket-event-data.d.ts +6 -0
- package/exclusions-list/exclusions-list.component.d.ts +6 -4
- package/fesm2015/seniorsistemas-exclusion-process-component.js +115 -31
- package/fesm2015/seniorsistemas-exclusion-process-component.js.map +1 -1
- package/fesm5/seniorsistemas-exclusion-process-component.js +124 -33
- package/fesm5/seniorsistemas-exclusion-process-component.js.map +1 -1
- package/package.json +14 -6
- package/seniorsistemas-exclusion-process-component.metadata.json +1 -1
- package/services/logical-delete.service.d.ts +1 -1
|
@@ -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';
|
|
@@ -62,7 +63,6 @@ let LogicalDeleteService = class LogicalDeleteService {
|
|
|
62
63
|
this.projectConfigs = projectConfigs;
|
|
63
64
|
const entityUrl = `${projectConfigs.getDomain()}/${projectConfigs.getService()}`;
|
|
64
65
|
this.exclusionProcessUrl = `${entityUrl}/entities/exclusionProcess`;
|
|
65
|
-
this.listExclusionsUrl = `${entityUrl}/entities/exclusionProcess`;
|
|
66
66
|
this.defaultCatch = this.defaultCatch.bind(this);
|
|
67
67
|
}
|
|
68
68
|
defaultCatch() {
|
|
@@ -131,9 +131,16 @@ let LogicalDeleteService = class LogicalDeleteService {
|
|
|
131
131
|
if (!((_a = value.contents) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
132
132
|
return null;
|
|
133
133
|
}
|
|
134
|
-
return value.contents[0];
|
|
134
|
+
return this.mapExclusionsDates(value.contents[0]);
|
|
135
135
|
}));
|
|
136
136
|
}
|
|
137
|
+
mapExclusionsDates(exclusionProcess) {
|
|
138
|
+
var _a;
|
|
139
|
+
return Object.assign(Object.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(group => {
|
|
140
|
+
var _a;
|
|
141
|
+
return (Object.assign(Object.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(step => (Object.assign(Object.assign({}, step), { startDate: step.startDate ? moment(step.startDate).toDate() : null, finishDate: step.finishDate ? moment(step.finishDate).toDate() : null }))) }));
|
|
142
|
+
}) });
|
|
143
|
+
}
|
|
137
144
|
listExclusions(entityName, params = {}) {
|
|
138
145
|
if (params.filterQuery) {
|
|
139
146
|
params.filterQuery += ` and lower(entityName) eq lower('${entityName}')`;
|
|
@@ -144,14 +151,7 @@ let LogicalDeleteService = class LogicalDeleteService {
|
|
|
144
151
|
return this.http.get(this.exclusionProcessUrl, { params: this.getListQueryParams(params) })
|
|
145
152
|
.pipe(this.defaultCatch())
|
|
146
153
|
.pipe(map(value => {
|
|
147
|
-
value.contents.
|
|
148
|
-
if (p.startDate) {
|
|
149
|
-
p.startDate = moment(p.startDate).toDate();
|
|
150
|
-
}
|
|
151
|
-
if (p.finishDate) {
|
|
152
|
-
p.finishDate = moment(p.finishDate).toDate();
|
|
153
|
-
}
|
|
154
|
-
});
|
|
154
|
+
value.contents = value.contents.map(this.mapExclusionsDates);
|
|
155
155
|
return value;
|
|
156
156
|
}));
|
|
157
157
|
}
|
|
@@ -203,17 +203,26 @@ let ExclusionDetailsComponent = class ExclusionDetailsComponent {
|
|
|
203
203
|
ngOnDestroy() {
|
|
204
204
|
this.ngUnsubscribe.next();
|
|
205
205
|
this.ngUnsubscribe.complete();
|
|
206
|
+
this.disconnectWebSocket();
|
|
206
207
|
}
|
|
207
208
|
showDetails(details) {
|
|
208
|
-
this.
|
|
209
|
+
this._exclusionDetails = details;
|
|
209
210
|
this._entityName = details.entityName;
|
|
210
211
|
this._isVisible = true;
|
|
211
212
|
this._processSummaryData = [];
|
|
213
|
+
this.processDetails = null;
|
|
212
214
|
this.entityDescription = details.entityDescription;
|
|
213
215
|
this.loadProcessDetails(details);
|
|
216
|
+
this.connectWebSocket();
|
|
217
|
+
}
|
|
218
|
+
onVisibilityChanged(event) {
|
|
219
|
+
this.closeDetails();
|
|
214
220
|
}
|
|
215
221
|
closeDetails() {
|
|
216
222
|
this._isVisible = false;
|
|
223
|
+
this._exclusionDetails = null;
|
|
224
|
+
this._processSummaryData = [];
|
|
225
|
+
this.disconnectWebSocket();
|
|
217
226
|
}
|
|
218
227
|
openExclusions() {
|
|
219
228
|
this.closeDetails();
|
|
@@ -235,14 +244,14 @@ let ExclusionDetailsComponent = class ExclusionDetailsComponent {
|
|
|
235
244
|
if (!((_a = this.processDetails) === null || _a === void 0 ? void 0 : _a.startDate)) {
|
|
236
245
|
return "";
|
|
237
246
|
}
|
|
238
|
-
return moment(this.processDetails.startDate).format("DD/MM/YYYY HH:mm");
|
|
247
|
+
return moment(this.processDetails.startDate).format("DD/MM/YYYY HH:mm:ss");
|
|
239
248
|
}
|
|
240
249
|
getFinishDate() {
|
|
241
250
|
var _a;
|
|
242
251
|
if (!((_a = this.processDetails) === null || _a === void 0 ? void 0 : _a.finishDate)) {
|
|
243
252
|
return "";
|
|
244
253
|
}
|
|
245
|
-
return moment(this.processDetails.finishDate).format("DD/MM/YYYY HH:mm");
|
|
254
|
+
return moment(this.processDetails.finishDate).format("DD/MM/YYYY HH:mm:ss");
|
|
246
255
|
}
|
|
247
256
|
isFinished() {
|
|
248
257
|
var _a;
|
|
@@ -329,14 +338,34 @@ let ExclusionDetailsComponent = class ExclusionDetailsComponent {
|
|
|
329
338
|
.pipe(takeUntil(this.ngUnsubscribe))
|
|
330
339
|
.pipe(finalize(() => this._isLoading = false))
|
|
331
340
|
.subscribe((process) => {
|
|
341
|
+
if (!process) {
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
332
344
|
this.processDetails = process;
|
|
333
345
|
this.loadProcessSummary(process);
|
|
334
346
|
});
|
|
335
347
|
}
|
|
348
|
+
sortByDate(startDate, finishDate) {
|
|
349
|
+
if (startDate.getTime() > finishDate.getTime()) {
|
|
350
|
+
return 1;
|
|
351
|
+
}
|
|
352
|
+
if (startDate.getTime() < finishDate.getTime()) {
|
|
353
|
+
return -1;
|
|
354
|
+
}
|
|
355
|
+
return 0;
|
|
356
|
+
}
|
|
357
|
+
sortGroupsByStartDate(groups) {
|
|
358
|
+
return groups.sort((a, b) => this.sortByDate(a.startDate, b.finishDate));
|
|
359
|
+
}
|
|
360
|
+
sortStepsByStartDate(steps) {
|
|
361
|
+
return steps.sort((a, b) => this.sortByDate(a.startDate, b.finishDate));
|
|
362
|
+
}
|
|
336
363
|
loadProcessSummary(process) {
|
|
337
364
|
const stepLogs = [];
|
|
338
|
-
process.groups
|
|
339
|
-
|
|
365
|
+
this.sortGroupsByStartDate(process.groups)
|
|
366
|
+
.forEach(group => {
|
|
367
|
+
const steps = this.sortStepsByStartDate(group.steps)
|
|
368
|
+
.map(step => ({
|
|
340
369
|
description: step.description,
|
|
341
370
|
status: step.status,
|
|
342
371
|
errorMessage: step.errorMessage
|
|
@@ -345,6 +374,53 @@ let ExclusionDetailsComponent = class ExclusionDetailsComponent {
|
|
|
345
374
|
});
|
|
346
375
|
this._processSummaryData = stepLogs;
|
|
347
376
|
}
|
|
377
|
+
disconnectWebSocket() {
|
|
378
|
+
if (this._exclusionProcessStatusChangedSubscribe) {
|
|
379
|
+
this._exclusionProcessStatusChangedSubscribe.unsubscribe();
|
|
380
|
+
this._exclusionProcessStatusChangedSubscribe = null;
|
|
381
|
+
}
|
|
382
|
+
if (this._websocketService) {
|
|
383
|
+
this._websocketService.disconnect();
|
|
384
|
+
this._websocketService = null;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
connectWebSocket() {
|
|
388
|
+
if (this._websocketService) {
|
|
389
|
+
this.disconnectWebSocket();
|
|
390
|
+
}
|
|
391
|
+
this._websocketService = new WebsocketService();
|
|
392
|
+
this._websocketService
|
|
393
|
+
.onConnect()
|
|
394
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
395
|
+
.subscribe(() => {
|
|
396
|
+
this.startListeningWebhookEvents();
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
startListeningWebhookEvents() {
|
|
400
|
+
this._websocketService
|
|
401
|
+
.onError()
|
|
402
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
403
|
+
.subscribe((data) => {
|
|
404
|
+
console.error('onError', data);
|
|
405
|
+
});
|
|
406
|
+
this._exclusionProcessStatusChangedSubscribe = this._websocketService
|
|
407
|
+
.onEvent({
|
|
408
|
+
domain: this.projectConfigs.getDomain(),
|
|
409
|
+
service: this.projectConfigs.getService(),
|
|
410
|
+
primitive: "exclusionProcessStatusChanged"
|
|
411
|
+
})
|
|
412
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
413
|
+
.subscribe((event) => {
|
|
414
|
+
const { data } = event;
|
|
415
|
+
if (this._exclusionDetails.processId && data.pid === this._exclusionDetails.processId) {
|
|
416
|
+
this.loadProcessDetails(this._exclusionDetails);
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
if (this._exclusionDetails.recordId && data.recordId === this._exclusionDetails.recordId) {
|
|
420
|
+
this.loadProcessDetails(this._exclusionDetails);
|
|
421
|
+
}
|
|
422
|
+
});
|
|
423
|
+
}
|
|
348
424
|
};
|
|
349
425
|
ExclusionDetailsComponent.ctorParameters = () => [
|
|
350
426
|
{ type: Router },
|
|
@@ -374,7 +450,7 @@ __decorate([
|
|
|
374
450
|
ExclusionDetailsComponent = __decorate([
|
|
375
451
|
Component({
|
|
376
452
|
selector: "s-exclusion-details",
|
|
377
|
-
template: "<s-sidebar [visible]=\"isVisible\" (visibleChange)=\"
|
|
453
|
+
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",
|
|
378
454
|
encapsulation: ViewEncapsulation.None,
|
|
379
455
|
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}"]
|
|
380
456
|
})
|
|
@@ -505,7 +581,7 @@ var ExclusionsListComponent_1;
|
|
|
505
581
|
const HTTP_CODE_SERVER_ERROR_START = 500;
|
|
506
582
|
const HTTP_CODE_SERVER_ERROR_END = 600;
|
|
507
583
|
let ExclusionsListComponent = ExclusionsListComponent_1 = class ExclusionsListComponent {
|
|
508
|
-
constructor(route, translate, formBuilder, changeDetectorRef, logicalDeleteService, filterService, projectConfigs) {
|
|
584
|
+
constructor(route, translate, formBuilder, changeDetectorRef, logicalDeleteService, filterService, projectConfigs, cdr) {
|
|
509
585
|
this.route = route;
|
|
510
586
|
this.translate = translate;
|
|
511
587
|
this.formBuilder = formBuilder;
|
|
@@ -513,6 +589,7 @@ let ExclusionsListComponent = ExclusionsListComponent_1 = class ExclusionsListCo
|
|
|
513
589
|
this.logicalDeleteService = logicalDeleteService;
|
|
514
590
|
this.filterService = filterService;
|
|
515
591
|
this.projectConfigs = projectConfigs;
|
|
592
|
+
this.cdr = cdr;
|
|
516
593
|
this.currentListParams = { page: 0, size: 10, sort: [], filterData: {} };
|
|
517
594
|
this.showLoader = false;
|
|
518
595
|
this.totalRecords = 0;
|
|
@@ -530,27 +607,22 @@ let ExclusionsListComponent = ExclusionsListComponent_1 = class ExclusionsListCo
|
|
|
530
607
|
.subscribe((data) => {
|
|
531
608
|
this.locale = data.localeConfig;
|
|
532
609
|
});
|
|
533
|
-
this.route.params
|
|
534
|
-
.pipe(takeUntil(this.ngUnsubscribe))
|
|
535
|
-
.subscribe((params) => {
|
|
536
|
-
this.entityName = params.entityName;
|
|
537
|
-
this.showBasedOnRoute();
|
|
538
|
-
});
|
|
539
610
|
this.route.queryParams
|
|
540
611
|
.pipe(takeUntil(this.ngUnsubscribe))
|
|
541
612
|
.subscribe((queryParams) => {
|
|
613
|
+
this.entityName = queryParams.entityName;
|
|
542
614
|
this.entityDescription = queryParams.entityDescription;
|
|
543
615
|
this.processId = queryParams.processId;
|
|
544
|
-
this.showBasedOnRoute();
|
|
545
616
|
});
|
|
546
617
|
}
|
|
547
|
-
|
|
618
|
+
ngAfterViewInit() {
|
|
548
619
|
if (this.entityName && this.entityDescription && this.processId) {
|
|
549
620
|
this.exclusionDetailsComponent.showDetails({
|
|
550
621
|
processId: this.processId,
|
|
551
622
|
entityDescription: this.entityDescription,
|
|
552
623
|
entityName: this.entityName
|
|
553
624
|
});
|
|
625
|
+
this.cdr.detectChanges();
|
|
554
626
|
}
|
|
555
627
|
}
|
|
556
628
|
ngOnDestroy() {
|
|
@@ -585,6 +657,7 @@ let ExclusionsListComponent = ExclusionsListComponent_1 = class ExclusionsListCo
|
|
|
585
657
|
style: {
|
|
586
658
|
width: "100px"
|
|
587
659
|
},
|
|
660
|
+
tooltip: this.getColumnStatusTooltip,
|
|
588
661
|
badgeConfigs: [
|
|
589
662
|
{
|
|
590
663
|
enumValue: EnumExclusionProcessStatus.ERROR,
|
|
@@ -609,7 +682,7 @@ let ExclusionsListComponent = ExclusionsListComponent_1 = class ExclusionsListCo
|
|
|
609
682
|
attributes: ["startDate"],
|
|
610
683
|
header: this.translate.instant(`${this.projectConfigs.getTranslationPrefix()}.logical_delete_start`),
|
|
611
684
|
type: EnumColumnFieldType.DATE,
|
|
612
|
-
dateFormat: "DD/MM/YYYY HH:mm",
|
|
685
|
+
dateFormat: "DD/MM/YYYY HH:mm:ss",
|
|
613
686
|
style: {
|
|
614
687
|
width: "100px"
|
|
615
688
|
}
|
|
@@ -619,13 +692,19 @@ let ExclusionsListComponent = ExclusionsListComponent_1 = class ExclusionsListCo
|
|
|
619
692
|
attributes: ["finishDate"],
|
|
620
693
|
header: this.translate.instant(`${this.projectConfigs.getTranslationPrefix()}.logical_delete_finish`),
|
|
621
694
|
type: EnumColumnFieldType.DATE,
|
|
622
|
-
dateFormat: "DD/MM/YYYY HH:mm",
|
|
695
|
+
dateFormat: "DD/MM/YYYY HH:mm:ss",
|
|
623
696
|
style: {
|
|
624
697
|
width: "100px"
|
|
625
698
|
}
|
|
626
699
|
}
|
|
627
700
|
];
|
|
628
701
|
}
|
|
702
|
+
getColumnStatusTooltip(rowValue) {
|
|
703
|
+
if (rowValue.errorMessage) {
|
|
704
|
+
return rowValue.errorMessage;
|
|
705
|
+
}
|
|
706
|
+
return null;
|
|
707
|
+
}
|
|
629
708
|
getFilterFields() {
|
|
630
709
|
const translationPrefix = this.projectConfigs.getTranslationPrefix();
|
|
631
710
|
return [
|
|
@@ -768,8 +847,12 @@ let ExclusionsListComponent = ExclusionsListComponent_1 = class ExclusionsListCo
|
|
|
768
847
|
const filterQuery = this.getFilterQuery();
|
|
769
848
|
const displayFields = [
|
|
770
849
|
"recordId",
|
|
850
|
+
"errorMessage",
|
|
771
851
|
...this.gridColumns.map(column => column.field)
|
|
772
852
|
];
|
|
853
|
+
if (!sort.length) {
|
|
854
|
+
sort.push({ field: 'startDate', order: -1 });
|
|
855
|
+
}
|
|
773
856
|
this.listExclusions({ page, size, sort, filterQuery, displayFields });
|
|
774
857
|
}
|
|
775
858
|
listExclusions(params) {
|
|
@@ -818,7 +901,8 @@ ExclusionsListComponent.ctorParameters = () => [
|
|
|
818
901
|
{ type: ChangeDetectorRef },
|
|
819
902
|
{ type: LogicalDeleteService },
|
|
820
903
|
{ type: FilterService },
|
|
821
|
-
{ type: LogicalDeleteConfigService }
|
|
904
|
+
{ type: LogicalDeleteConfigService },
|
|
905
|
+
{ type: ChangeDetectorRef }
|
|
822
906
|
];
|
|
823
907
|
__decorate([
|
|
824
908
|
ViewChild("exclusionsTable")
|
|
@@ -828,7 +912,7 @@ __decorate([
|
|
|
828
912
|
], ExclusionsListComponent.prototype, "exclusionDetailsComponent", void 0);
|
|
829
913
|
ExclusionsListComponent = ExclusionsListComponent_1 = __decorate([
|
|
830
914
|
Component({
|
|
831
|
-
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",
|
|
915
|
+
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",
|
|
832
916
|
providers: []
|
|
833
917
|
})
|
|
834
918
|
], ExclusionsListComponent);
|
|
@@ -906,7 +990,7 @@ const routes = [
|
|
|
906
990
|
},
|
|
907
991
|
children: [
|
|
908
992
|
{
|
|
909
|
-
path: "
|
|
993
|
+
path: "",
|
|
910
994
|
component: ExclusionsListComponent
|
|
911
995
|
}
|
|
912
996
|
]
|