@seniorsistemas/exclusion-process-component 0.0.1-c049d10c-e93a-4d63-9c2a-b17bca40c324 → 0.2.0
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 +662 -33
- 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 +99 -12
- package/esm2015/exclusion-details/exclusion-details.module.js +4 -3
- package/esm2015/exclusion-details/protocols/exclusion-process-status-changed.js +1 -0
- package/esm2015/exclusion-details/protocols/show-details-information.js +1 -1
- package/esm2015/exclusion-details/protocols/web-socket-event-data.js +1 -0
- package/esm2015/exclusions-list/exclusions-list.component.js +358 -0
- package/esm2015/exclusions-list/exclusions-list.module.js +47 -0
- package/esm2015/exclusions-list/exclusions-list.routing.js +115 -0
- package/esm2015/exclusions-list/index.js +4 -0
- package/esm2015/public-api.js +2 -1
- package/esm2015/seniorsistemas-exclusion-process-component.js +4 -2
- package/esm2015/services/filter.service.js +4 -1
- package/esm2015/services/index.js +2 -0
- package/esm2015/services/logical-delete.service.js +33 -19
- package/esm5/exclusion-details/exclusion-details.component.js +104 -12
- package/esm5/exclusion-details/exclusion-details.module.js +4 -3
- package/esm5/exclusion-details/protocols/exclusion-process-status-changed.js +1 -0
- package/esm5/exclusion-details/protocols/show-details-information.js +1 -1
- package/esm5/exclusion-details/protocols/web-socket-event-data.js +1 -0
- package/esm5/exclusions-list/exclusions-list.component.js +373 -0
- package/esm5/exclusions-list/exclusions-list.module.js +50 -0
- package/esm5/exclusions-list/exclusions-list.routing.js +127 -0
- package/esm5/exclusions-list/index.js +4 -0
- package/esm5/public-api.js +2 -1
- package/esm5/seniorsistemas-exclusion-process-component.js +4 -2
- package/esm5/services/filter.service.js +4 -1
- package/esm5/services/index.js +2 -0
- package/esm5/services/logical-delete.service.js +36 -20
- package/exclusion-details/exclusion-details.component.d.ts +13 -1
- package/exclusion-details/protocols/exclusion-process-status-changed.d.ts +8 -0
- package/exclusion-details/protocols/show-details-information.d.ts +2 -1
- package/exclusion-details/protocols/web-socket-event-data.d.ts +6 -0
- package/exclusions-list/exclusions-list.component.d.ts +70 -0
- package/exclusions-list/exclusions-list.module.d.ts +2 -0
- package/exclusions-list/exclusions-list.routing.d.ts +29 -0
- package/exclusions-list/index.d.ts +3 -0
- package/fesm2015/seniorsistemas-exclusion-process-component.js +619 -33
- package/fesm2015/seniorsistemas-exclusion-process-component.js.map +1 -1
- package/fesm5/seniorsistemas-exclusion-process-component.js +657 -34
- package/fesm5/seniorsistemas-exclusion-process-component.js.map +1 -1
- package/package.json +14 -6
- package/public-api.d.ts +1 -0
- package/seniorsistemas-exclusion-process-component.d.ts +3 -1
- package/seniorsistemas-exclusion-process-component.metadata.json +1 -1
- package/services/index.d.ts +1 -0
- package/services/logical-delete.service.d.ts +5 -3
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
import { __decorate, __param,
|
|
1
|
+
import { __decorate, __param, __assign, __spread } from 'tslib';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { InjectionToken, Inject, Injectable, Output, Component, ViewEncapsulation, NgModule } from '@angular/core';
|
|
3
|
+
import { InjectionToken, Inject, Injectable, Output, Component, ViewEncapsulation, NgModule, ChangeDetectorRef, ViewChild } from '@angular/core';
|
|
4
4
|
import { PanelModule } from 'primeng/panel';
|
|
5
5
|
import { TableModule } from 'primeng/table';
|
|
6
|
-
import { EnumColumnFieldType, EnumBadgeColors, SidebarModule, ButtonModule, TableModule as TableModule$1, LoadingStateModule, LocaleModule, FieldType } from '@seniorsistemas/angular-components';
|
|
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
|
-
import { Router, ActivatedRoute } from '@angular/router';
|
|
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 } from '@ngx-translate/core';
|
|
13
14
|
import { MessageService } from 'primeng/api';
|
|
15
|
+
import { Validators, FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
16
|
+
import { DialogModule } from 'primeng/dialog';
|
|
17
|
+
import { ConfirmDialogModule } from 'primeng/confirmdialog';
|
|
18
|
+
import { InputTextModule } from 'primeng/inputtext';
|
|
19
|
+
import { PermissionsService } from '@seniorsistemas/platform-components';
|
|
14
20
|
|
|
15
21
|
var EnumExclusionProcessStatus;
|
|
16
22
|
(function (EnumExclusionProcessStatus) {
|
|
@@ -48,6 +54,8 @@ var LogicalDeleteConfigService = /** @class */ (function () {
|
|
|
48
54
|
return LogicalDeleteConfigService;
|
|
49
55
|
}());
|
|
50
56
|
|
|
57
|
+
var HTTP_UNAUTHORIZED_CODE = 401;
|
|
58
|
+
var DEFAULT_PAGE_SIZE = 10;
|
|
51
59
|
var LogicalDeleteService = /** @class */ (function () {
|
|
52
60
|
function LogicalDeleteService(http, messageService, translate, projectConfigs) {
|
|
53
61
|
this.http = http;
|
|
@@ -56,16 +64,16 @@ var LogicalDeleteService = /** @class */ (function () {
|
|
|
56
64
|
this.projectConfigs = projectConfigs;
|
|
57
65
|
var entityUrl = projectConfigs.getDomain() + "/" + projectConfigs.getService();
|
|
58
66
|
this.exclusionProcessUrl = entityUrl + "/entities/exclusionProcess";
|
|
59
|
-
this.listExclusionsUrl = entityUrl + "/entities/exclusionProcess";
|
|
60
67
|
this.defaultCatch = this.defaultCatch.bind(this);
|
|
61
68
|
}
|
|
62
69
|
LogicalDeleteService.prototype.defaultCatch = function () {
|
|
63
70
|
var _this = this;
|
|
64
71
|
return catchError(function (err) {
|
|
72
|
+
var _a;
|
|
65
73
|
if (err) {
|
|
66
74
|
var summary = err.status ? String(err.status) : "Error";
|
|
67
|
-
var detail = (err.error
|
|
68
|
-
if (err.status ===
|
|
75
|
+
var detail = ((_a = err.error) === null || _a === void 0 ? void 0 : _a.message) || err.statusText || err.message;
|
|
76
|
+
if (err.status === HTTP_UNAUTHORIZED_CODE) {
|
|
69
77
|
var prefix = _this.projectConfigs.getTranslationPrefix();
|
|
70
78
|
summary = _this.translate.instant(prefix + ".error_unauthorized_title");
|
|
71
79
|
detail = _this.translate.instant(prefix + ".error_unauthorized_description");
|
|
@@ -73,14 +81,14 @@ var LogicalDeleteService = /** @class */ (function () {
|
|
|
73
81
|
_this.messageService.add({
|
|
74
82
|
severity: "error",
|
|
75
83
|
summary: summary,
|
|
76
|
-
detail: detail
|
|
84
|
+
detail: detail || "Error"
|
|
77
85
|
});
|
|
78
86
|
}
|
|
79
87
|
return throwError(err);
|
|
80
88
|
});
|
|
81
89
|
};
|
|
82
90
|
LogicalDeleteService.prototype.getListQueryParams = function (listParams) {
|
|
83
|
-
var _a = listParams.page, page = _a === void 0 ? 0 : _a, _b = listParams.size, size = _b === void 0 ?
|
|
91
|
+
var _a = listParams.page, page = _a === void 0 ? 0 : _a, _b = listParams.size, size = _b === void 0 ? DEFAULT_PAGE_SIZE : _b, _c = listParams.sort, sort = _c === void 0 ? [] : _c, _d = listParams.filterQuery, filterQuery = _d === void 0 ? "" : _d, _e = listParams.displayFields, displayFields = _e === void 0 ? [] : _e;
|
|
84
92
|
var params = new HttpParams();
|
|
85
93
|
params = params.append("size", String(size));
|
|
86
94
|
params = params.append("offset", String(page));
|
|
@@ -102,10 +110,23 @@ var LogicalDeleteService = /** @class */ (function () {
|
|
|
102
110
|
}
|
|
103
111
|
return params;
|
|
104
112
|
};
|
|
105
|
-
LogicalDeleteService.prototype.getProcessDetails = function (
|
|
106
|
-
|
|
107
|
-
filter: "
|
|
108
|
-
|
|
113
|
+
LogicalDeleteService.prototype.getProcessDetails = function (id) {
|
|
114
|
+
return this.doGetProcessDetails({
|
|
115
|
+
filter: "id eq '" + id + "'",
|
|
116
|
+
size: "1",
|
|
117
|
+
offset: "0",
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
LogicalDeleteService.prototype.getLatestProcessDetails = function (recordId) {
|
|
121
|
+
return this.doGetProcessDetails({
|
|
122
|
+
filter: "recordId eq '" + recordId + "'",
|
|
123
|
+
size: "1",
|
|
124
|
+
offset: "0",
|
|
125
|
+
orderby: "startDate desc"
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
LogicalDeleteService.prototype.doGetProcessDetails = function (filterParams) {
|
|
129
|
+
var _this = this;
|
|
109
130
|
return this.http.get(this.exclusionProcessUrl, { params: filterParams })
|
|
110
131
|
.pipe(this.defaultCatch())
|
|
111
132
|
.pipe(map(function (value) {
|
|
@@ -113,10 +134,18 @@ var LogicalDeleteService = /** @class */ (function () {
|
|
|
113
134
|
if (!((_a = value.contents) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
114
135
|
return null;
|
|
115
136
|
}
|
|
116
|
-
return value.contents[0];
|
|
137
|
+
return _this.mapExclusionsDates(value.contents[0]);
|
|
117
138
|
}));
|
|
118
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
|
+
};
|
|
119
147
|
LogicalDeleteService.prototype.listExclusions = function (entityName, params) {
|
|
148
|
+
var _this = this;
|
|
120
149
|
if (params === void 0) { params = {}; }
|
|
121
150
|
if (params.filterQuery) {
|
|
122
151
|
params.filterQuery += " and lower(entityName) eq lower('" + entityName + "')";
|
|
@@ -127,14 +156,7 @@ var LogicalDeleteService = /** @class */ (function () {
|
|
|
127
156
|
return this.http.get(this.exclusionProcessUrl, { params: this.getListQueryParams(params) })
|
|
128
157
|
.pipe(this.defaultCatch())
|
|
129
158
|
.pipe(map(function (value) {
|
|
130
|
-
value.contents.
|
|
131
|
-
if (p.startDate) {
|
|
132
|
-
p.startDate = moment(p.startDate).toDate();
|
|
133
|
-
}
|
|
134
|
-
if (p.finishDate) {
|
|
135
|
-
p.finishDate = moment(p.finishDate).toDate();
|
|
136
|
-
}
|
|
137
|
-
});
|
|
159
|
+
value.contents = value.contents.map(_this.mapExclusionsDates);
|
|
138
160
|
return value;
|
|
139
161
|
}));
|
|
140
162
|
};
|
|
@@ -204,16 +226,26 @@ var ExclusionDetailsComponent = /** @class */ (function () {
|
|
|
204
226
|
ExclusionDetailsComponent.prototype.ngOnDestroy = function () {
|
|
205
227
|
this.ngUnsubscribe.next();
|
|
206
228
|
this.ngUnsubscribe.complete();
|
|
229
|
+
this.disconnectWebSocket();
|
|
207
230
|
};
|
|
208
231
|
ExclusionDetailsComponent.prototype.showDetails = function (details) {
|
|
209
|
-
this.
|
|
232
|
+
this._exclusionDetails = details;
|
|
210
233
|
this._entityName = details.entityName;
|
|
211
234
|
this._isVisible = true;
|
|
235
|
+
this._processSummaryData = [];
|
|
236
|
+
this.processDetails = null;
|
|
212
237
|
this.entityDescription = details.entityDescription;
|
|
213
|
-
this.loadProcessDetails(details
|
|
238
|
+
this.loadProcessDetails(details);
|
|
239
|
+
this.connectWebSocket();
|
|
240
|
+
};
|
|
241
|
+
ExclusionDetailsComponent.prototype.onVisibilityChanged = function (event) {
|
|
242
|
+
this.closeDetails();
|
|
214
243
|
};
|
|
215
244
|
ExclusionDetailsComponent.prototype.closeDetails = function () {
|
|
216
245
|
this._isVisible = false;
|
|
246
|
+
this._exclusionDetails = null;
|
|
247
|
+
this._processSummaryData = [];
|
|
248
|
+
this.disconnectWebSocket();
|
|
217
249
|
};
|
|
218
250
|
ExclusionDetailsComponent.prototype.openExclusions = function () {
|
|
219
251
|
this.closeDetails();
|
|
@@ -235,14 +267,14 @@ var ExclusionDetailsComponent = /** @class */ (function () {
|
|
|
235
267
|
if (!((_a = this.processDetails) === null || _a === void 0 ? void 0 : _a.startDate)) {
|
|
236
268
|
return "";
|
|
237
269
|
}
|
|
238
|
-
return moment(this.processDetails.startDate).format("DD/MM/YYYY HH:mm");
|
|
270
|
+
return moment(this.processDetails.startDate).format("DD/MM/YYYY HH:mm:ss");
|
|
239
271
|
};
|
|
240
272
|
ExclusionDetailsComponent.prototype.getFinishDate = function () {
|
|
241
273
|
var _a;
|
|
242
274
|
if (!((_a = this.processDetails) === null || _a === void 0 ? void 0 : _a.finishDate)) {
|
|
243
275
|
return "";
|
|
244
276
|
}
|
|
245
|
-
return moment(this.processDetails.finishDate).format("DD/MM/YYYY HH:mm");
|
|
277
|
+
return moment(this.processDetails.finishDate).format("DD/MM/YYYY HH:mm:ss");
|
|
246
278
|
};
|
|
247
279
|
ExclusionDetailsComponent.prototype.isFinished = function () {
|
|
248
280
|
var _a;
|
|
@@ -266,6 +298,12 @@ var ExclusionDetailsComponent = /** @class */ (function () {
|
|
|
266
298
|
ExclusionDetailsComponent.prototype.getSidebarTitle = function () {
|
|
267
299
|
return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_details_title");
|
|
268
300
|
};
|
|
301
|
+
ExclusionDetailsComponent.prototype.getEmptyStateTitle = function () {
|
|
302
|
+
return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_empty_state_title");
|
|
303
|
+
};
|
|
304
|
+
ExclusionDetailsComponent.prototype.getEmptyStateDescription = function () {
|
|
305
|
+
return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_empty_state_description");
|
|
306
|
+
};
|
|
269
307
|
ExclusionDetailsComponent.prototype.getSummaryColumns = function () {
|
|
270
308
|
return [
|
|
271
309
|
{
|
|
@@ -314,21 +352,47 @@ var ExclusionDetailsComponent = /** @class */ (function () {
|
|
|
314
352
|
}
|
|
315
353
|
return null;
|
|
316
354
|
};
|
|
317
|
-
ExclusionDetailsComponent.prototype.loadProcessDetails = function (
|
|
355
|
+
ExclusionDetailsComponent.prototype.loadProcessDetails = function (details) {
|
|
318
356
|
var _this = this;
|
|
319
357
|
this._isLoading = true;
|
|
320
|
-
|
|
358
|
+
var processObservable = details.processId
|
|
359
|
+
? this.logicalDeleteService.getProcessDetails(details.processId)
|
|
360
|
+
: this.logicalDeleteService.getLatestProcessDetails(details.recordId);
|
|
361
|
+
processObservable
|
|
321
362
|
.pipe(takeUntil(this.ngUnsubscribe))
|
|
322
363
|
.pipe(finalize(function () { return _this._isLoading = false; }))
|
|
323
364
|
.subscribe(function (process) {
|
|
365
|
+
if (!process) {
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
324
368
|
_this.processDetails = process;
|
|
325
369
|
_this.loadProcessSummary(process);
|
|
326
370
|
});
|
|
327
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
|
+
};
|
|
328
389
|
ExclusionDetailsComponent.prototype.loadProcessSummary = function (process) {
|
|
390
|
+
var _this = this;
|
|
329
391
|
var stepLogs = [];
|
|
330
|
-
process.groups
|
|
331
|
-
|
|
392
|
+
this.sortGroupsByStartDate(process.groups)
|
|
393
|
+
.forEach(function (group) {
|
|
394
|
+
var steps = _this.sortStepsByStartDate(group.steps)
|
|
395
|
+
.map(function (step) { return ({
|
|
332
396
|
description: step.description,
|
|
333
397
|
status: step.status,
|
|
334
398
|
errorMessage: step.errorMessage
|
|
@@ -337,6 +401,55 @@ var ExclusionDetailsComponent = /** @class */ (function () {
|
|
|
337
401
|
});
|
|
338
402
|
this._processSummaryData = stepLogs;
|
|
339
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: "erpx_fnd",
|
|
438
|
+
service: "produto",
|
|
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
|
+
};
|
|
340
453
|
ExclusionDetailsComponent.ctorParameters = function () { return [
|
|
341
454
|
{ type: Router },
|
|
342
455
|
{ type: ActivatedRoute },
|
|
@@ -365,7 +478,7 @@ var ExclusionDetailsComponent = /** @class */ (function () {
|
|
|
365
478
|
ExclusionDetailsComponent = __decorate([
|
|
366
479
|
Component({
|
|
367
480
|
selector: "s-exclusion-details",
|
|
368
|
-
template: "<s-sidebar [visible]=\"isVisible\" (visibleChange)=\"
|
|
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",
|
|
369
482
|
encapsulation: ViewEncapsulation.None,
|
|
370
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}"]
|
|
371
484
|
})
|
|
@@ -386,7 +499,8 @@ var ExclusionDetailsModule = /** @class */ (function () {
|
|
|
386
499
|
TableModule,
|
|
387
500
|
TableModule$1,
|
|
388
501
|
LoadingStateModule,
|
|
389
|
-
LocaleModule
|
|
502
|
+
LocaleModule,
|
|
503
|
+
EmptyStateModule
|
|
390
504
|
],
|
|
391
505
|
declarations: [ExclusionDetailsComponent],
|
|
392
506
|
exports: [ExclusionDetailsComponent],
|
|
@@ -467,6 +581,9 @@ var FilterService = /** @class */ (function () {
|
|
|
467
581
|
? this.translate.instant(this.logicalDeleteConfigService.getTranslationPrefix() + ".list_grid_boolean_true")
|
|
468
582
|
: this.translate.instant(this.logicalDeleteConfigService.getTranslationPrefix() + ".list_grid_boolean_false");
|
|
469
583
|
break;
|
|
584
|
+
default:
|
|
585
|
+
labelValue = value;
|
|
586
|
+
break;
|
|
470
587
|
}
|
|
471
588
|
return { id: name, label: label + ": " + labelValue };
|
|
472
589
|
};
|
|
@@ -498,6 +615,512 @@ var FilterService = /** @class */ (function () {
|
|
|
498
615
|
return FilterService;
|
|
499
616
|
}());
|
|
500
617
|
|
|
618
|
+
var HTTP_CODE_SERVER_ERROR_START = 500;
|
|
619
|
+
var HTTP_CODE_SERVER_ERROR_END = 600;
|
|
620
|
+
var ExclusionsListComponent = /** @class */ (function () {
|
|
621
|
+
function ExclusionsListComponent(route, translate, formBuilder, changeDetectorRef, logicalDeleteService, filterService, projectConfigs) {
|
|
622
|
+
this.route = route;
|
|
623
|
+
this.translate = translate;
|
|
624
|
+
this.formBuilder = formBuilder;
|
|
625
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
626
|
+
this.logicalDeleteService = logicalDeleteService;
|
|
627
|
+
this.filterService = filterService;
|
|
628
|
+
this.projectConfigs = projectConfigs;
|
|
629
|
+
this.currentListParams = { page: 0, size: 10, sort: [], filterData: {} };
|
|
630
|
+
this.showLoader = false;
|
|
631
|
+
this.totalRecords = 0;
|
|
632
|
+
this.filtersPanelCollapsed = true;
|
|
633
|
+
this.searchTokens = [];
|
|
634
|
+
this.serverError = false;
|
|
635
|
+
this.ngUnsubscribe = new Subject();
|
|
636
|
+
}
|
|
637
|
+
ExclusionsListComponent_1 = ExclusionsListComponent;
|
|
638
|
+
ExclusionsListComponent.prototype.ngOnInit = function () {
|
|
639
|
+
var _this = this;
|
|
640
|
+
this.filterFormGroup = this.getFormBuilder();
|
|
641
|
+
this.filterFields = this.getFilterFields();
|
|
642
|
+
this.gridColumns = this.getGridColumns();
|
|
643
|
+
this.route.data
|
|
644
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
645
|
+
.subscribe(function (data) {
|
|
646
|
+
_this.locale = data.localeConfig;
|
|
647
|
+
});
|
|
648
|
+
this.route.params
|
|
649
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
650
|
+
.subscribe(function (params) {
|
|
651
|
+
_this.entityName = params.entityName;
|
|
652
|
+
_this.showBasedOnRoute();
|
|
653
|
+
});
|
|
654
|
+
this.route.queryParams
|
|
655
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
656
|
+
.subscribe(function (queryParams) {
|
|
657
|
+
_this.entityDescription = queryParams.entityDescription;
|
|
658
|
+
_this.processId = queryParams.processId;
|
|
659
|
+
_this.showBasedOnRoute();
|
|
660
|
+
});
|
|
661
|
+
};
|
|
662
|
+
ExclusionsListComponent.prototype.showBasedOnRoute = function () {
|
|
663
|
+
if (this.entityName && this.entityDescription && this.processId) {
|
|
664
|
+
this.exclusionDetailsComponent.showDetails({
|
|
665
|
+
processId: this.processId,
|
|
666
|
+
entityDescription: this.entityDescription,
|
|
667
|
+
entityName: this.entityName
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
};
|
|
671
|
+
ExclusionsListComponent.prototype.ngOnDestroy = function () {
|
|
672
|
+
this.ngUnsubscribe.next();
|
|
673
|
+
this.ngUnsubscribe.complete();
|
|
674
|
+
};
|
|
675
|
+
ExclusionsListComponent.prototype.getFormBuilder = function () {
|
|
676
|
+
return this.formBuilder.group({
|
|
677
|
+
description: [undefined, Validators.compose([])],
|
|
678
|
+
status: [undefined, Validators.compose([])],
|
|
679
|
+
startDate: [{ value: undefined, disabled: false }, Validators.compose([])],
|
|
680
|
+
endDate: [{ value: undefined, disabled: false }, Validators.compose([])]
|
|
681
|
+
});
|
|
682
|
+
};
|
|
683
|
+
ExclusionsListComponent.prototype.getGridColumns = function () {
|
|
684
|
+
return [
|
|
685
|
+
{
|
|
686
|
+
field: "description",
|
|
687
|
+
attributes: ["description"],
|
|
688
|
+
header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_description"),
|
|
689
|
+
type: EnumColumnFieldType.STRING,
|
|
690
|
+
style: {
|
|
691
|
+
width: "300px"
|
|
692
|
+
}
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
field: "status",
|
|
696
|
+
attributes: ["status"],
|
|
697
|
+
header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_status"),
|
|
698
|
+
type: EnumColumnFieldType.ENUM,
|
|
699
|
+
enumPrefix: this.projectConfigs.getTranslationPrefix() + ".logical_delete_enum_exclusion_process_status_",
|
|
700
|
+
style: {
|
|
701
|
+
width: "100px"
|
|
702
|
+
},
|
|
703
|
+
tooltip: this.getColumnStatusTooltip,
|
|
704
|
+
badgeConfigs: [
|
|
705
|
+
{
|
|
706
|
+
enumValue: EnumExclusionProcessStatus.ERROR,
|
|
707
|
+
color: EnumBadgeColors.RED
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
enumValue: EnumExclusionProcessStatus.PENDING,
|
|
711
|
+
color: EnumBadgeColors.YELLOW
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
enumValue: EnumExclusionProcessStatus.PROCESSING,
|
|
715
|
+
color: EnumBadgeColors.BLUE
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
enumValue: EnumExclusionProcessStatus.SUCCESS,
|
|
719
|
+
color: EnumBadgeColors.GREEN
|
|
720
|
+
}
|
|
721
|
+
]
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
field: "startDate",
|
|
725
|
+
attributes: ["startDate"],
|
|
726
|
+
header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_start"),
|
|
727
|
+
type: EnumColumnFieldType.DATE,
|
|
728
|
+
dateFormat: "DD/MM/YYYY HH:mm:ss",
|
|
729
|
+
style: {
|
|
730
|
+
width: "100px"
|
|
731
|
+
}
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
field: "finishDate",
|
|
735
|
+
attributes: ["finishDate"],
|
|
736
|
+
header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_finish"),
|
|
737
|
+
type: EnumColumnFieldType.DATE,
|
|
738
|
+
dateFormat: "DD/MM/YYYY HH:mm:ss",
|
|
739
|
+
style: {
|
|
740
|
+
width: "100px"
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
];
|
|
744
|
+
};
|
|
745
|
+
ExclusionsListComponent.prototype.getColumnStatusTooltip = function (rowValue) {
|
|
746
|
+
if (rowValue.errorMessage) {
|
|
747
|
+
return rowValue.errorMessage;
|
|
748
|
+
}
|
|
749
|
+
return null;
|
|
750
|
+
};
|
|
751
|
+
ExclusionsListComponent.prototype.getFilterFields = function () {
|
|
752
|
+
var translationPrefix = this.projectConfigs.getTranslationPrefix();
|
|
753
|
+
return [
|
|
754
|
+
new FormField({
|
|
755
|
+
type: FieldType.String,
|
|
756
|
+
name: "description",
|
|
757
|
+
label: this.translate.instant(translationPrefix + ".logical_delete_description")
|
|
758
|
+
}),
|
|
759
|
+
new FormField({
|
|
760
|
+
type: FieldType.Enum,
|
|
761
|
+
name: "status",
|
|
762
|
+
label: this.translate.instant(translationPrefix + ".logical_delete_status"),
|
|
763
|
+
placeholder: this.translate.instant(translationPrefix + ".logical_delete_status"),
|
|
764
|
+
multiple: true,
|
|
765
|
+
options: [
|
|
766
|
+
{
|
|
767
|
+
label: this.translate.instant(translationPrefix + ".logical_delete_enum_exclusion_process_status_error"),
|
|
768
|
+
value: EnumExclusionProcessStatus.ERROR
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
label: this.translate.instant(translationPrefix + ".logical_delete_enum_exclusion_process_status_pending"),
|
|
772
|
+
value: EnumExclusionProcessStatus.PENDING
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
label: this.translate.instant(translationPrefix + ".logical_delete_enum_exclusion_process_status_processing"),
|
|
776
|
+
value: EnumExclusionProcessStatus.PROCESSING
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
label: this.translate.instant(translationPrefix + ".logical_delete_enum_exclusion_process_status_success"),
|
|
780
|
+
value: EnumExclusionProcessStatus.SUCCESS
|
|
781
|
+
}
|
|
782
|
+
]
|
|
783
|
+
}),
|
|
784
|
+
new FormField({
|
|
785
|
+
type: FieldType.Date,
|
|
786
|
+
name: "startDate",
|
|
787
|
+
label: this.translate.instant(translationPrefix + ".logical_delete_start")
|
|
788
|
+
}),
|
|
789
|
+
new FormField({
|
|
790
|
+
type: FieldType.Date,
|
|
791
|
+
name: "endDate",
|
|
792
|
+
label: this.translate.instant(translationPrefix + ".logical_delete_finish")
|
|
793
|
+
})
|
|
794
|
+
];
|
|
795
|
+
};
|
|
796
|
+
ExclusionsListComponent.prototype.getEmptyStateTitle = function () {
|
|
797
|
+
return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_empty_state_title");
|
|
798
|
+
};
|
|
799
|
+
ExclusionsListComponent.prototype.getEmptyStateDescription = function () {
|
|
800
|
+
return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_empty_state_description");
|
|
801
|
+
};
|
|
802
|
+
ExclusionsListComponent.prototype.getTitle = function () {
|
|
803
|
+
return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_list_title");
|
|
804
|
+
};
|
|
805
|
+
ExclusionsListComponent.prototype.getDetailsButtonTitle = function () {
|
|
806
|
+
return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_details");
|
|
807
|
+
};
|
|
808
|
+
ExclusionsListComponent.prototype.getFiltersTitle = function () {
|
|
809
|
+
return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".filters");
|
|
810
|
+
};
|
|
811
|
+
ExclusionsListComponent.prototype.getFilterButtonTitle = function () {
|
|
812
|
+
return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".filter");
|
|
813
|
+
};
|
|
814
|
+
ExclusionsListComponent.prototype.getClearButtonTitle = function () {
|
|
815
|
+
return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".clear");
|
|
816
|
+
};
|
|
817
|
+
ExclusionsListComponent.prototype.getErrorInvalid = function () {
|
|
818
|
+
return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".error_invalid");
|
|
819
|
+
};
|
|
820
|
+
ExclusionsListComponent.prototype.getErrorServerTitle = function () {
|
|
821
|
+
return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".error_server_title");
|
|
822
|
+
};
|
|
823
|
+
ExclusionsListComponent.prototype.getErrorServerDescription = function () {
|
|
824
|
+
return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".error_server_description");
|
|
825
|
+
};
|
|
826
|
+
ExclusionsListComponent.prototype.getActionsColumnLabel = function () {
|
|
827
|
+
return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".actions");
|
|
828
|
+
};
|
|
829
|
+
ExclusionsListComponent.prototype.onSearch = function () {
|
|
830
|
+
var filterData = this.filterFormGroup.getRawValue();
|
|
831
|
+
this.filtersPanelCollapsed = true;
|
|
832
|
+
this.resetGrid({ filterData: filterData });
|
|
833
|
+
};
|
|
834
|
+
ExclusionsListComponent.prototype.onClear = function () {
|
|
835
|
+
this.filterFormGroup.reset();
|
|
836
|
+
var filterData = this.filterFormGroup.getRawValue();
|
|
837
|
+
this.resetGrid({ filterData: filterData });
|
|
838
|
+
};
|
|
839
|
+
ExclusionsListComponent.prototype.onRemoveToken = function (token) {
|
|
840
|
+
this.filterFormGroup.get(token.id).setValue(undefined);
|
|
841
|
+
var filterData = this.filterFormGroup.getRawValue();
|
|
842
|
+
this.resetGrid({ filterData: filterData });
|
|
843
|
+
};
|
|
844
|
+
ExclusionsListComponent.prototype.onGridChange = function (event) {
|
|
845
|
+
var size = event.rows;
|
|
846
|
+
var page = event.first / size;
|
|
847
|
+
var sort = event.multiSortMeta ? event.multiSortMeta : [];
|
|
848
|
+
return this.updateGrid({ page: page, size: size, sort: sort });
|
|
849
|
+
};
|
|
850
|
+
ExclusionsListComponent.prototype.getFilterTokens = function () {
|
|
851
|
+
var _this = this;
|
|
852
|
+
var filterData = this.filterFormGroup.value;
|
|
853
|
+
return this.filterFields
|
|
854
|
+
.filter(function (_a) {
|
|
855
|
+
var name = _a.name;
|
|
856
|
+
return filterData[name] !== undefined && filterData[name] !== "" && filterData[name] !== null;
|
|
857
|
+
})
|
|
858
|
+
.map(function (formField) { return _this.filterService.createFilterTokens(formField, filterData[formField.name]); });
|
|
859
|
+
};
|
|
860
|
+
ExclusionsListComponent.prototype.getFilterQuery = function () {
|
|
861
|
+
var _this = this;
|
|
862
|
+
var filterData = this.currentListParams.filterData;
|
|
863
|
+
var dateFields = ["startDate", "endDate"];
|
|
864
|
+
var filterQuery = this.filterFields
|
|
865
|
+
.filter(function (_a) {
|
|
866
|
+
var name = _a.name;
|
|
867
|
+
return !dateFields.includes(name);
|
|
868
|
+
})
|
|
869
|
+
.filter(function (_a) {
|
|
870
|
+
var name = _a.name;
|
|
871
|
+
return filterData[name] !== undefined && filterData[name] !== "" && filterData[name] !== null;
|
|
872
|
+
})
|
|
873
|
+
.map(function (formField) { return _this.filterService.createFilterString(formField, filterData[formField.name]); })
|
|
874
|
+
.join(" and ");
|
|
875
|
+
var dateQuery;
|
|
876
|
+
if (filterData.startDate && filterData.endDate) {
|
|
877
|
+
var startDate = moment(filterData.startDate).format(ExclusionsListComponent_1.DATE_FORMAT);
|
|
878
|
+
var endDate = moment(filterData.endDate).format(ExclusionsListComponent_1.DATE_FORMAT);
|
|
879
|
+
dateQuery = "startDate between '" + startDate + "T00:00:00Z' and '" + endDate + "T23:59:59Z'";
|
|
880
|
+
}
|
|
881
|
+
else if (filterData.startDate) {
|
|
882
|
+
var startDate = moment(filterData.startDate).format(ExclusionsListComponent_1.DATE_FORMAT);
|
|
883
|
+
dateQuery = "startDate >= '" + startDate + "T00:00:00Z'";
|
|
884
|
+
}
|
|
885
|
+
else if (filterData.endDate) {
|
|
886
|
+
var endDate = moment(filterData.endDate).format(ExclusionsListComponent_1.DATE_FORMAT);
|
|
887
|
+
dateQuery = "finishDate <= '" + endDate + "T23:59:59Z'";
|
|
888
|
+
}
|
|
889
|
+
else {
|
|
890
|
+
// Não é necessário nenhuma condição a mais no filtro.
|
|
891
|
+
}
|
|
892
|
+
if (dateQuery) {
|
|
893
|
+
filterQuery += filterQuery ? " and " + dateQuery : dateQuery;
|
|
894
|
+
}
|
|
895
|
+
return filterQuery;
|
|
896
|
+
};
|
|
897
|
+
ExclusionsListComponent.prototype.updateGrid = function (listParams) {
|
|
898
|
+
if (listParams === void 0) { listParams = {}; }
|
|
899
|
+
this.currentListParams = __assign(__assign({}, this.currentListParams), listParams);
|
|
900
|
+
var _a = this.currentListParams, page = _a.page, size = _a.size, sort = _a.sort;
|
|
901
|
+
this.searchTokens = this.getFilterTokens();
|
|
902
|
+
var filterQuery = this.getFilterQuery();
|
|
903
|
+
var displayFields = __spread([
|
|
904
|
+
"recordId",
|
|
905
|
+
"errorMessage"
|
|
906
|
+
], this.gridColumns.map(function (column) { return column.field; }));
|
|
907
|
+
if (!sort.length) {
|
|
908
|
+
sort.push({ field: 'startDate', order: -1 });
|
|
909
|
+
}
|
|
910
|
+
this.listExclusions({ page: page, size: size, sort: sort, filterQuery: filterQuery, displayFields: displayFields });
|
|
911
|
+
};
|
|
912
|
+
ExclusionsListComponent.prototype.listExclusions = function (params) {
|
|
913
|
+
var _this = this;
|
|
914
|
+
this.showLoader = true;
|
|
915
|
+
this.serverError = false;
|
|
916
|
+
this.changeDetectorRef.detectChanges();
|
|
917
|
+
this.logicalDeleteService
|
|
918
|
+
.listExclusions(this.entityName, params)
|
|
919
|
+
.pipe(takeUntil(this.ngUnsubscribe), catchError(function (err) {
|
|
920
|
+
if (err.status >= HTTP_CODE_SERVER_ERROR_START && err.status < HTTP_CODE_SERVER_ERROR_END) {
|
|
921
|
+
_this.serverError = true;
|
|
922
|
+
}
|
|
923
|
+
throw err;
|
|
924
|
+
}), finalize(function () { return _this.showLoader = false; }))
|
|
925
|
+
.subscribe(function (list) {
|
|
926
|
+
_this.gridData = list.contents;
|
|
927
|
+
_this.totalRecords = list.totalElements;
|
|
928
|
+
});
|
|
929
|
+
};
|
|
930
|
+
ExclusionsListComponent.prototype.focusInput = function (elementId) {
|
|
931
|
+
var element = document.getElementById("" + elementId);
|
|
932
|
+
if (element) {
|
|
933
|
+
element.focus();
|
|
934
|
+
}
|
|
935
|
+
};
|
|
936
|
+
ExclusionsListComponent.prototype.resetGrid = function (listParams) {
|
|
937
|
+
if (listParams) {
|
|
938
|
+
this.currentListParams = __assign(__assign({}, this.currentListParams), listParams);
|
|
939
|
+
}
|
|
940
|
+
this.currentListParams = __assign(__assign({}, this.currentListParams), { page: 0, sort: [] });
|
|
941
|
+
this.table.reset();
|
|
942
|
+
};
|
|
943
|
+
ExclusionsListComponent.prototype.onClickDetails = function (rowData) {
|
|
944
|
+
this.exclusionDetailsComponent.showDetails({
|
|
945
|
+
processId: rowData.id,
|
|
946
|
+
entityDescription: this.entityDescription,
|
|
947
|
+
entityName: this.entityName
|
|
948
|
+
});
|
|
949
|
+
};
|
|
950
|
+
var ExclusionsListComponent_1;
|
|
951
|
+
ExclusionsListComponent.DATE_FORMAT = "YYYY-MM-DD";
|
|
952
|
+
ExclusionsListComponent.ctorParameters = function () { return [
|
|
953
|
+
{ type: ActivatedRoute },
|
|
954
|
+
{ type: TranslateService },
|
|
955
|
+
{ type: FormBuilder },
|
|
956
|
+
{ type: ChangeDetectorRef },
|
|
957
|
+
{ type: LogicalDeleteService },
|
|
958
|
+
{ type: FilterService },
|
|
959
|
+
{ type: LogicalDeleteConfigService }
|
|
960
|
+
]; };
|
|
961
|
+
__decorate([
|
|
962
|
+
ViewChild("exclusionsTable")
|
|
963
|
+
], ExclusionsListComponent.prototype, "table", void 0);
|
|
964
|
+
__decorate([
|
|
965
|
+
ViewChild(ExclusionDetailsComponent)
|
|
966
|
+
], ExclusionsListComponent.prototype, "exclusionDetailsComponent", void 0);
|
|
967
|
+
ExclusionsListComponent = ExclusionsListComponent_1 = __decorate([
|
|
968
|
+
Component({
|
|
969
|
+
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",
|
|
970
|
+
providers: []
|
|
971
|
+
})
|
|
972
|
+
], ExclusionsListComponent);
|
|
973
|
+
return ExclusionsListComponent;
|
|
974
|
+
}());
|
|
975
|
+
|
|
976
|
+
var ExclusionsListFeatureRoutingGuard = /** @class */ (function () {
|
|
977
|
+
function ExclusionsListFeatureRoutingGuard() {
|
|
978
|
+
}
|
|
979
|
+
ExclusionsListFeatureRoutingGuard.prototype.canActivate = function () {
|
|
980
|
+
return true;
|
|
981
|
+
};
|
|
982
|
+
ExclusionsListFeatureRoutingGuard = __decorate([
|
|
983
|
+
Injectable()
|
|
984
|
+
], ExclusionsListFeatureRoutingGuard);
|
|
985
|
+
return ExclusionsListFeatureRoutingGuard;
|
|
986
|
+
}());
|
|
987
|
+
var ExclusionsListFeatureRoutingListTitleResolver = /** @class */ (function () {
|
|
988
|
+
function ExclusionsListFeatureRoutingListTitleResolver(translate, projectConfigs) {
|
|
989
|
+
this.translate = translate;
|
|
990
|
+
this.projectConfigs = projectConfigs;
|
|
991
|
+
}
|
|
992
|
+
ExclusionsListFeatureRoutingListTitleResolver.prototype.resolve = function () {
|
|
993
|
+
return this.translate.get(this.projectConfigs.getTranslationPrefix() + ".logical_delete_list_title");
|
|
994
|
+
};
|
|
995
|
+
ExclusionsListFeatureRoutingListTitleResolver.ctorParameters = function () { return [
|
|
996
|
+
{ type: TranslateService },
|
|
997
|
+
{ type: LogicalDeleteConfigService }
|
|
998
|
+
]; };
|
|
999
|
+
ExclusionsListFeatureRoutingListTitleResolver = __decorate([
|
|
1000
|
+
Injectable()
|
|
1001
|
+
], ExclusionsListFeatureRoutingListTitleResolver);
|
|
1002
|
+
return ExclusionsListFeatureRoutingListTitleResolver;
|
|
1003
|
+
}());
|
|
1004
|
+
var ExclusionsListFeatureRoutingPermissionResolver = /** @class */ (function () {
|
|
1005
|
+
function ExclusionsListFeatureRoutingPermissionResolver(permissionsService) {
|
|
1006
|
+
this.permissionsService = permissionsService;
|
|
1007
|
+
}
|
|
1008
|
+
ExclusionsListFeatureRoutingPermissionResolver.prototype.resolve = function () {
|
|
1009
|
+
return this.permissionsService.get();
|
|
1010
|
+
};
|
|
1011
|
+
ExclusionsListFeatureRoutingPermissionResolver.ctorParameters = function () { return [
|
|
1012
|
+
{ type: PermissionsService }
|
|
1013
|
+
]; };
|
|
1014
|
+
ExclusionsListFeatureRoutingPermissionResolver = __decorate([
|
|
1015
|
+
Injectable()
|
|
1016
|
+
], ExclusionsListFeatureRoutingPermissionResolver);
|
|
1017
|
+
return ExclusionsListFeatureRoutingPermissionResolver;
|
|
1018
|
+
}());
|
|
1019
|
+
var ExclusionsListFeatureRoutingLocaleResolver = /** @class */ (function () {
|
|
1020
|
+
function ExclusionsListFeatureRoutingLocaleResolver(localeService) {
|
|
1021
|
+
this.localeService = localeService;
|
|
1022
|
+
}
|
|
1023
|
+
ExclusionsListFeatureRoutingLocaleResolver.prototype.resolve = function () {
|
|
1024
|
+
return this.localeService.get();
|
|
1025
|
+
};
|
|
1026
|
+
ExclusionsListFeatureRoutingLocaleResolver.ctorParameters = function () { return [
|
|
1027
|
+
{ type: LocaleService }
|
|
1028
|
+
]; };
|
|
1029
|
+
ExclusionsListFeatureRoutingLocaleResolver = __decorate([
|
|
1030
|
+
Injectable()
|
|
1031
|
+
], ExclusionsListFeatureRoutingLocaleResolver);
|
|
1032
|
+
return ExclusionsListFeatureRoutingLocaleResolver;
|
|
1033
|
+
}());
|
|
1034
|
+
var EmptyComponent = /** @class */ (function () {
|
|
1035
|
+
function EmptyComponent() {
|
|
1036
|
+
}
|
|
1037
|
+
EmptyComponent = __decorate([
|
|
1038
|
+
Component({
|
|
1039
|
+
template: "<router-outlet></router-outlet>"
|
|
1040
|
+
})
|
|
1041
|
+
], EmptyComponent);
|
|
1042
|
+
return EmptyComponent;
|
|
1043
|
+
}());
|
|
1044
|
+
var routes = [
|
|
1045
|
+
{
|
|
1046
|
+
path: "exclusions-list",
|
|
1047
|
+
component: EmptyComponent,
|
|
1048
|
+
canActivate: [
|
|
1049
|
+
ExclusionsListFeatureRoutingGuard
|
|
1050
|
+
],
|
|
1051
|
+
resolve: {
|
|
1052
|
+
allPermissions: ExclusionsListFeatureRoutingPermissionResolver,
|
|
1053
|
+
localeConfig: ExclusionsListFeatureRoutingLocaleResolver,
|
|
1054
|
+
routeTitle: ExclusionsListFeatureRoutingListTitleResolver
|
|
1055
|
+
},
|
|
1056
|
+
children: [
|
|
1057
|
+
{
|
|
1058
|
+
path: ":entityName",
|
|
1059
|
+
component: ExclusionsListComponent
|
|
1060
|
+
}
|
|
1061
|
+
]
|
|
1062
|
+
}
|
|
1063
|
+
];
|
|
1064
|
+
var ExclusionsListFeatureRouting = /** @class */ (function () {
|
|
1065
|
+
function ExclusionsListFeatureRouting() {
|
|
1066
|
+
}
|
|
1067
|
+
ExclusionsListFeatureRouting = __decorate([
|
|
1068
|
+
NgModule({
|
|
1069
|
+
imports: [
|
|
1070
|
+
RouterModule.forChild(routes)
|
|
1071
|
+
],
|
|
1072
|
+
exports: [
|
|
1073
|
+
RouterModule
|
|
1074
|
+
],
|
|
1075
|
+
providers: [
|
|
1076
|
+
ExclusionsListFeatureRoutingGuard,
|
|
1077
|
+
ExclusionsListFeatureRoutingPermissionResolver,
|
|
1078
|
+
ExclusionsListFeatureRoutingLocaleResolver,
|
|
1079
|
+
ExclusionsListFeatureRoutingListTitleResolver
|
|
1080
|
+
],
|
|
1081
|
+
declarations: [
|
|
1082
|
+
EmptyComponent
|
|
1083
|
+
]
|
|
1084
|
+
})
|
|
1085
|
+
], ExclusionsListFeatureRouting);
|
|
1086
|
+
return ExclusionsListFeatureRouting;
|
|
1087
|
+
}());
|
|
1088
|
+
|
|
1089
|
+
var ExclusionsListModule = /** @class */ (function () {
|
|
1090
|
+
function ExclusionsListModule() {
|
|
1091
|
+
}
|
|
1092
|
+
ExclusionsListModule = __decorate([
|
|
1093
|
+
NgModule({
|
|
1094
|
+
imports: [
|
|
1095
|
+
FormsModule,
|
|
1096
|
+
ReactiveFormsModule,
|
|
1097
|
+
TranslateModule,
|
|
1098
|
+
CommonModule,
|
|
1099
|
+
ControlErrorsModule,
|
|
1100
|
+
ButtonModule,
|
|
1101
|
+
PanelModule,
|
|
1102
|
+
InputTextModule,
|
|
1103
|
+
InfoSignModule,
|
|
1104
|
+
ConfirmDialogModule,
|
|
1105
|
+
DialogModule,
|
|
1106
|
+
TableModule,
|
|
1107
|
+
TableModule$1,
|
|
1108
|
+
LoadingStateModule,
|
|
1109
|
+
EmptyStateModule,
|
|
1110
|
+
DynamicFormModule,
|
|
1111
|
+
TokenListModule,
|
|
1112
|
+
LocaleModule.forChild(),
|
|
1113
|
+
ExclusionDetailsModule,
|
|
1114
|
+
ExclusionsListFeatureRouting
|
|
1115
|
+
],
|
|
1116
|
+
declarations: [ExclusionsListComponent],
|
|
1117
|
+
exports: [ExclusionsListComponent],
|
|
1118
|
+
entryComponents: [ExclusionsListComponent]
|
|
1119
|
+
})
|
|
1120
|
+
], ExclusionsListModule);
|
|
1121
|
+
return ExclusionsListModule;
|
|
1122
|
+
}());
|
|
1123
|
+
|
|
501
1124
|
var LogicalDeleteModule = /** @class */ (function () {
|
|
502
1125
|
function LogicalDeleteModule() {
|
|
503
1126
|
}
|
|
@@ -526,5 +1149,5 @@ var LogicalDeleteModule = /** @class */ (function () {
|
|
|
526
1149
|
* Generated bundle index. Do not edit.
|
|
527
1150
|
*/
|
|
528
1151
|
|
|
529
|
-
export { ExclusionDetailsComponent, ExclusionDetailsModule, LogicalDeleteModule, LogicalDeleteService as ɵa, LogicalDeleteConfigService as ɵb, ProjectConfigsInjectionToken as ɵc,
|
|
1152
|
+
export { EmptyComponent, ExclusionDetailsComponent, ExclusionDetailsModule, ExclusionsListComponent, ExclusionsListFeatureRouting, ExclusionsListFeatureRoutingGuard, ExclusionsListFeatureRoutingListTitleResolver, ExclusionsListFeatureRoutingLocaleResolver, ExclusionsListFeatureRoutingPermissionResolver, ExclusionsListModule, LogicalDeleteModule, routes, LogicalDeleteService as ɵa, LogicalDeleteConfigService as ɵb, ProjectConfigsInjectionToken as ɵc, ExclusionDetailsModule as ɵe, ExclusionDetailsComponent as ɵf, LogicalDeleteService as ɵg, FilterService as ɵh };
|
|
530
1153
|
//# sourceMappingURL=seniorsistemas-exclusion-process-component.js.map
|