@seniorsistemas/exclusion-process-component 0.0.1-40efacd8-8a6c-4d38-8102-8c977c14410a

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 (85) hide show
  1. package/bundles/seniorsistemas-exclusion-process-component.umd.js +1205 -0
  2. package/bundles/seniorsistemas-exclusion-process-component.umd.js.map +1 -0
  3. package/bundles/seniorsistemas-exclusion-process-component.umd.min.js +16 -0
  4. package/bundles/seniorsistemas-exclusion-process-component.umd.min.js.map +1 -0
  5. package/enums/enum-exclusion-process-status.d.ts +6 -0
  6. package/esm2015/enums/enum-exclusion-process-status.js +8 -0
  7. package/esm2015/exclusion-details/exclusion-details.component.js +216 -0
  8. package/esm2015/exclusion-details/exclusion-details.module.js +28 -0
  9. package/esm2015/exclusion-details/index.js +3 -0
  10. package/esm2015/exclusion-details/protocols/exclusion-details.js +1 -0
  11. package/esm2015/exclusion-details/protocols/index.js +2 -0
  12. package/esm2015/exclusion-details/protocols/show-details-information.js +3 -0
  13. package/esm2015/exclusions-list/exclusions-list.component.js +299 -0
  14. package/esm2015/exclusions-list/exclusions-list.module.js +47 -0
  15. package/esm2015/exclusions-list/exclusions-list.routing.js +115 -0
  16. package/esm2015/exclusions-list/index.js +4 -0
  17. package/esm2015/logical-delete.module.js +27 -0
  18. package/esm2015/models/exclusion-process-step-group.js +1 -0
  19. package/esm2015/models/exclusion-process-step.js +1 -0
  20. package/esm2015/models/exclusion-process.js +1 -0
  21. package/esm2015/models/index.js +1 -0
  22. package/esm2015/models/list-params.js +1 -0
  23. package/esm2015/models/list-result.js +1 -0
  24. package/esm2015/models/project-config.js +3 -0
  25. package/esm2015/public-api.js +4 -0
  26. package/esm2015/seniorsistemas-exclusion-process-component.js +11 -0
  27. package/esm2015/services/filter.service.js +104 -0
  28. package/esm2015/services/index.js +2 -0
  29. package/esm2015/services/logical-delete-config.service.js +29 -0
  30. package/esm2015/services/logical-delete.service.js +109 -0
  31. package/esm5/enums/enum-exclusion-process-status.js +8 -0
  32. package/esm5/exclusion-details/exclusion-details.component.js +235 -0
  33. package/esm5/exclusion-details/exclusion-details.module.js +31 -0
  34. package/esm5/exclusion-details/index.js +3 -0
  35. package/esm5/exclusion-details/protocols/exclusion-details.js +1 -0
  36. package/esm5/exclusion-details/protocols/index.js +2 -0
  37. package/esm5/exclusion-details/protocols/show-details-information.js +7 -0
  38. package/esm5/exclusions-list/exclusions-list.component.js +313 -0
  39. package/esm5/exclusions-list/exclusions-list.module.js +50 -0
  40. package/esm5/exclusions-list/exclusions-list.routing.js +127 -0
  41. package/esm5/exclusions-list/index.js +4 -0
  42. package/esm5/logical-delete.module.js +31 -0
  43. package/esm5/models/exclusion-process-step-group.js +1 -0
  44. package/esm5/models/exclusion-process-step.js +1 -0
  45. package/esm5/models/exclusion-process.js +1 -0
  46. package/esm5/models/index.js +1 -0
  47. package/esm5/models/list-params.js +1 -0
  48. package/esm5/models/list-result.js +1 -0
  49. package/esm5/models/project-config.js +3 -0
  50. package/esm5/public-api.js +4 -0
  51. package/esm5/seniorsistemas-exclusion-process-component.js +11 -0
  52. package/esm5/services/filter.service.js +109 -0
  53. package/esm5/services/index.js +2 -0
  54. package/esm5/services/logical-delete-config.service.js +30 -0
  55. package/esm5/services/logical-delete.service.js +112 -0
  56. package/exclusion-details/exclusion-details.component.d.ts +49 -0
  57. package/exclusion-details/exclusion-details.module.d.ts +2 -0
  58. package/exclusion-details/index.d.ts +2 -0
  59. package/exclusion-details/protocols/exclusion-details.d.ts +6 -0
  60. package/exclusion-details/protocols/index.d.ts +2 -0
  61. package/exclusion-details/protocols/show-details-information.d.ts +5 -0
  62. package/exclusions-list/exclusions-list.component.d.ts +59 -0
  63. package/exclusions-list/exclusions-list.module.d.ts +2 -0
  64. package/exclusions-list/exclusions-list.routing.d.ts +29 -0
  65. package/exclusions-list/index.d.ts +3 -0
  66. package/fesm2015/seniorsistemas-exclusion-process-component.js +917 -0
  67. package/fesm2015/seniorsistemas-exclusion-process-component.js.map +1 -0
  68. package/fesm5/seniorsistemas-exclusion-process-component.js +981 -0
  69. package/fesm5/seniorsistemas-exclusion-process-component.js.map +1 -0
  70. package/logical-delete.module.d.ts +5 -0
  71. package/models/exclusion-process-step-group.d.ts +13 -0
  72. package/models/exclusion-process-step.d.ts +9 -0
  73. package/models/exclusion-process.d.ts +13 -0
  74. package/models/index.d.ts +4 -0
  75. package/models/list-params.d.ts +9 -0
  76. package/models/list-result.d.ts +5 -0
  77. package/models/project-config.d.ts +7 -0
  78. package/package.json +63 -0
  79. package/public-api.d.ts +4 -0
  80. package/seniorsistemas-exclusion-process-component.d.ts +10 -0
  81. package/seniorsistemas-exclusion-process-component.metadata.json +1 -0
  82. package/services/filter.service.d.ts +19 -0
  83. package/services/index.d.ts +1 -0
  84. package/services/logical-delete-config.service.d.ts +8 -0
  85. package/services/logical-delete.service.d.ts +20 -0
@@ -0,0 +1,1205 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('primeng/panel'), require('primeng/table'), require('@seniorsistemas/angular-components'), require('moment'), require('@angular/router'), require('rxjs'), require('rxjs/operators'), require('@angular/common/http'), require('@ngx-translate/core'), require('primeng/api'), require('@angular/forms'), require('primeng/dialog'), require('primeng/confirmdialog'), require('primeng/inputtext'), require('@seniorsistemas/platform-components')) :
3
+ typeof define === 'function' && define.amd ? define('@seniorsistemas/exclusion-process-component', ['exports', '@angular/common', '@angular/core', 'primeng/panel', 'primeng/table', '@seniorsistemas/angular-components', 'moment', '@angular/router', 'rxjs', 'rxjs/operators', '@angular/common/http', '@ngx-translate/core', 'primeng/api', '@angular/forms', 'primeng/dialog', 'primeng/confirmdialog', 'primeng/inputtext', '@seniorsistemas/platform-components'], factory) :
4
+ (global = global || self, factory((global.seniorsistemas = global.seniorsistemas || {}, global.seniorsistemas['exclusion-process-component'] = {}), global.ng.common, global.ng.core, global.panel, global.table, global.angularComponents, global.moment, global.ng.router, global.rxjs, global.rxjs.operators, global.ng.common.http, global.core$1, global.api, global.ng.forms, global.dialog, global.confirmdialog, global.inputtext, global.platformComponents));
5
+ }(this, (function (exports, common, core, panel, table, angularComponents, moment, router, rxjs, operators, http, core$1, api, forms, dialog, confirmdialog, inputtext, platformComponents) { 'use strict';
6
+
7
+ /*! *****************************************************************************
8
+ Copyright (c) Microsoft Corporation.
9
+
10
+ Permission to use, copy, modify, and/or distribute this software for any
11
+ purpose with or without fee is hereby granted.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
+ PERFORMANCE OF THIS SOFTWARE.
20
+ ***************************************************************************** */
21
+ /* global Reflect, Promise */
22
+
23
+ var extendStatics = function(d, b) {
24
+ extendStatics = Object.setPrototypeOf ||
25
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
27
+ return extendStatics(d, b);
28
+ };
29
+
30
+ function __extends(d, b) {
31
+ extendStatics(d, b);
32
+ function __() { this.constructor = d; }
33
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
+ }
35
+
36
+ var __assign = function() {
37
+ __assign = Object.assign || function __assign(t) {
38
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
39
+ s = arguments[i];
40
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
41
+ }
42
+ return t;
43
+ };
44
+ return __assign.apply(this, arguments);
45
+ };
46
+
47
+ function __rest(s, e) {
48
+ var t = {};
49
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
50
+ t[p] = s[p];
51
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
52
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
53
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
54
+ t[p[i]] = s[p[i]];
55
+ }
56
+ return t;
57
+ }
58
+
59
+ function __decorate(decorators, target, key, desc) {
60
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
61
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
62
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
63
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
64
+ }
65
+
66
+ function __param(paramIndex, decorator) {
67
+ return function (target, key) { decorator(target, key, paramIndex); }
68
+ }
69
+
70
+ function __metadata(metadataKey, metadataValue) {
71
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
72
+ }
73
+
74
+ function __awaiter(thisArg, _arguments, P, generator) {
75
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
76
+ return new (P || (P = Promise))(function (resolve, reject) {
77
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
78
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
79
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
80
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
81
+ });
82
+ }
83
+
84
+ function __generator(thisArg, body) {
85
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
86
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
87
+ function verb(n) { return function (v) { return step([n, v]); }; }
88
+ function step(op) {
89
+ if (f) throw new TypeError("Generator is already executing.");
90
+ while (_) try {
91
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
92
+ if (y = 0, t) op = [op[0] & 2, t.value];
93
+ switch (op[0]) {
94
+ case 0: case 1: t = op; break;
95
+ case 4: _.label++; return { value: op[1], done: false };
96
+ case 5: _.label++; y = op[1]; op = [0]; continue;
97
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
98
+ default:
99
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
100
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
101
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
102
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
103
+ if (t[2]) _.ops.pop();
104
+ _.trys.pop(); continue;
105
+ }
106
+ op = body.call(thisArg, _);
107
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
108
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
109
+ }
110
+ }
111
+
112
+ function __createBinding(o, m, k, k2) {
113
+ if (k2 === undefined) k2 = k;
114
+ o[k2] = m[k];
115
+ }
116
+
117
+ function __exportStar(m, exports) {
118
+ for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
119
+ }
120
+
121
+ function __values(o) {
122
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
123
+ if (m) return m.call(o);
124
+ if (o && typeof o.length === "number") return {
125
+ next: function () {
126
+ if (o && i >= o.length) o = void 0;
127
+ return { value: o && o[i++], done: !o };
128
+ }
129
+ };
130
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
131
+ }
132
+
133
+ function __read(o, n) {
134
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
135
+ if (!m) return o;
136
+ var i = m.call(o), r, ar = [], e;
137
+ try {
138
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
139
+ }
140
+ catch (error) { e = { error: error }; }
141
+ finally {
142
+ try {
143
+ if (r && !r.done && (m = i["return"])) m.call(i);
144
+ }
145
+ finally { if (e) throw e.error; }
146
+ }
147
+ return ar;
148
+ }
149
+
150
+ function __spread() {
151
+ for (var ar = [], i = 0; i < arguments.length; i++)
152
+ ar = ar.concat(__read(arguments[i]));
153
+ return ar;
154
+ }
155
+
156
+ function __spreadArrays() {
157
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
158
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
159
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
160
+ r[k] = a[j];
161
+ return r;
162
+ };
163
+
164
+ function __await(v) {
165
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
166
+ }
167
+
168
+ function __asyncGenerator(thisArg, _arguments, generator) {
169
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
170
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
171
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
172
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
173
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
174
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
175
+ function fulfill(value) { resume("next", value); }
176
+ function reject(value) { resume("throw", value); }
177
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
178
+ }
179
+
180
+ function __asyncDelegator(o) {
181
+ var i, p;
182
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
183
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
184
+ }
185
+
186
+ function __asyncValues(o) {
187
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
188
+ var m = o[Symbol.asyncIterator], i;
189
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
190
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
191
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
192
+ }
193
+
194
+ function __makeTemplateObject(cooked, raw) {
195
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
196
+ return cooked;
197
+ };
198
+
199
+ function __importStar(mod) {
200
+ if (mod && mod.__esModule) return mod;
201
+ var result = {};
202
+ if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
203
+ result.default = mod;
204
+ return result;
205
+ }
206
+
207
+ function __importDefault(mod) {
208
+ return (mod && mod.__esModule) ? mod : { default: mod };
209
+ }
210
+
211
+ function __classPrivateFieldGet(receiver, privateMap) {
212
+ if (!privateMap.has(receiver)) {
213
+ throw new TypeError("attempted to get private field on non-instance");
214
+ }
215
+ return privateMap.get(receiver);
216
+ }
217
+
218
+ function __classPrivateFieldSet(receiver, privateMap, value) {
219
+ if (!privateMap.has(receiver)) {
220
+ throw new TypeError("attempted to set private field on non-instance");
221
+ }
222
+ privateMap.set(receiver, value);
223
+ return value;
224
+ }
225
+
226
+ var EnumExclusionProcessStatus;
227
+ (function (EnumExclusionProcessStatus) {
228
+ EnumExclusionProcessStatus["PENDING"] = "PENDING";
229
+ EnumExclusionProcessStatus["PROCESSING"] = "PROCESSING";
230
+ EnumExclusionProcessStatus["ERROR"] = "ERROR";
231
+ EnumExclusionProcessStatus["SUCCESS"] = "SUCCESS";
232
+ })(EnumExclusionProcessStatus || (EnumExclusionProcessStatus = {}));
233
+
234
+ var ProjectConfigsInjectionToken = new core.InjectionToken("projectConfigs");
235
+
236
+ var LogicalDeleteConfigService = /** @class */ (function () {
237
+ function LogicalDeleteConfigService(projectConfigs) {
238
+ this.projectConfigs = projectConfigs;
239
+ }
240
+ LogicalDeleteConfigService.prototype.getDomain = function () {
241
+ return this.projectConfigs.domain;
242
+ };
243
+ LogicalDeleteConfigService.prototype.getService = function () {
244
+ return this.projectConfigs.service;
245
+ };
246
+ LogicalDeleteConfigService.prototype.getTranslationPrefix = function () {
247
+ if (this.projectConfigs.translationPrefix) {
248
+ return this.projectConfigs.translationPrefix;
249
+ }
250
+ return this.projectConfigs.domain + "." + this.projectConfigs.service;
251
+ };
252
+ LogicalDeleteConfigService.ctorParameters = function () { return [
253
+ { type: undefined, decorators: [{ type: core.Inject, args: [ProjectConfigsInjectionToken,] }] }
254
+ ]; };
255
+ LogicalDeleteConfigService = __decorate([
256
+ core.Injectable(),
257
+ __param(0, core.Inject(ProjectConfigsInjectionToken))
258
+ ], LogicalDeleteConfigService);
259
+ return LogicalDeleteConfigService;
260
+ }());
261
+
262
+ var LogicalDeleteService = /** @class */ (function () {
263
+ function LogicalDeleteService(http, messageService, translate, projectConfigs) {
264
+ this.http = http;
265
+ this.messageService = messageService;
266
+ this.translate = translate;
267
+ this.projectConfigs = projectConfigs;
268
+ var entityUrl = projectConfigs.getDomain() + "/" + projectConfigs.getService();
269
+ this.exclusionProcessUrl = entityUrl + "/entities/exclusionProcess";
270
+ this.listExclusionsUrl = entityUrl + "/entities/exclusionProcess";
271
+ this.defaultCatch = this.defaultCatch.bind(this);
272
+ }
273
+ LogicalDeleteService.prototype.defaultCatch = function () {
274
+ var _this = this;
275
+ return operators.catchError(function (err) {
276
+ if (err) {
277
+ var summary = err.status ? String(err.status) : "Error";
278
+ var detail = (err.error && err.error.message) || err.statusText || err.message || "Error";
279
+ if (err.status === 401) {
280
+ var prefix = _this.projectConfigs.getTranslationPrefix();
281
+ summary = _this.translate.instant(prefix + ".error_unauthorized_title");
282
+ detail = _this.translate.instant(prefix + ".error_unauthorized_description");
283
+ }
284
+ _this.messageService.add({
285
+ severity: "error",
286
+ summary: summary,
287
+ detail: detail
288
+ });
289
+ }
290
+ return rxjs.throwError(err);
291
+ });
292
+ };
293
+ LogicalDeleteService.prototype.getListQueryParams = function (listParams) {
294
+ var _a = listParams.page, page = _a === void 0 ? 0 : _a, _b = listParams.size, size = _b === void 0 ? 10 : _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;
295
+ var params = new http.HttpParams();
296
+ params = params.append("size", String(size));
297
+ params = params.append("offset", String(page));
298
+ if (sort && sort.length) {
299
+ params = params.append("orderby", sort
300
+ .map(function (s) {
301
+ if (s.order === -1) {
302
+ return s.field + " desc";
303
+ }
304
+ return s.field + " asc";
305
+ })
306
+ .join(", "));
307
+ }
308
+ if (filterQuery) {
309
+ params = params.append("filter", filterQuery);
310
+ }
311
+ if (displayFields && displayFields.length) {
312
+ params = params.append("displayfields", displayFields.join());
313
+ }
314
+ return params;
315
+ };
316
+ LogicalDeleteService.prototype.getProcessDetails = function (recordId) {
317
+ var filterParams = {
318
+ filter: "recordId eq '" + recordId + "'"
319
+ };
320
+ return this.http.get(this.exclusionProcessUrl, { params: filterParams })
321
+ .pipe(this.defaultCatch())
322
+ .pipe(operators.map(function (value) {
323
+ var _a;
324
+ if (!((_a = value.contents) === null || _a === void 0 ? void 0 : _a.length)) {
325
+ return null;
326
+ }
327
+ return value.contents[0];
328
+ }));
329
+ };
330
+ LogicalDeleteService.prototype.listExclusions = function (entityName, params) {
331
+ if (params === void 0) { params = {}; }
332
+ if (params.filterQuery) {
333
+ params.filterQuery += " and lower(entityName) eq lower('" + entityName + "')";
334
+ }
335
+ else {
336
+ params.filterQuery = "lower(entityName) eq lower('" + entityName + "')";
337
+ }
338
+ return this.http.get(this.exclusionProcessUrl, { params: this.getListQueryParams(params) })
339
+ .pipe(this.defaultCatch())
340
+ .pipe(operators.map(function (value) {
341
+ value.contents.forEach(function (p) {
342
+ if (p.startDate) {
343
+ p.startDate = moment(p.startDate).toDate();
344
+ }
345
+ if (p.finishDate) {
346
+ p.finishDate = moment(p.finishDate).toDate();
347
+ }
348
+ });
349
+ return value;
350
+ }));
351
+ };
352
+ LogicalDeleteService.ctorParameters = function () { return [
353
+ { type: http.HttpClient },
354
+ { type: api.MessageService },
355
+ { type: core$1.TranslateService },
356
+ { type: LogicalDeleteConfigService }
357
+ ]; };
358
+ LogicalDeleteService = __decorate([
359
+ core.Injectable()
360
+ ], LogicalDeleteService);
361
+ return LogicalDeleteService;
362
+ }());
363
+
364
+ var ExclusionDetailsComponent = /** @class */ (function () {
365
+ function ExclusionDetailsComponent(router, route, translate, logicalDeleteService, projectConfigs) {
366
+ this.router = router;
367
+ this.route = route;
368
+ this.translate = translate;
369
+ this.logicalDeleteService = logicalDeleteService;
370
+ this.projectConfigs = projectConfigs;
371
+ this._entityName = "";
372
+ this._isVisible = false;
373
+ this._isLoading = false;
374
+ this._processSummaryData = [];
375
+ this._processSummaryColumns = [];
376
+ this.ngUnsubscribe = new rxjs.Subject();
377
+ }
378
+ Object.defineProperty(ExclusionDetailsComponent.prototype, "isVisible", {
379
+ get: function () {
380
+ return this._isVisible;
381
+ },
382
+ enumerable: true,
383
+ configurable: true
384
+ });
385
+ Object.defineProperty(ExclusionDetailsComponent.prototype, "isLoading", {
386
+ get: function () {
387
+ return this._isLoading;
388
+ },
389
+ enumerable: true,
390
+ configurable: true
391
+ });
392
+ Object.defineProperty(ExclusionDetailsComponent.prototype, "processSummaryData", {
393
+ get: function () {
394
+ return this._processSummaryData;
395
+ },
396
+ enumerable: true,
397
+ configurable: true
398
+ });
399
+ Object.defineProperty(ExclusionDetailsComponent.prototype, "processSummaryColumns", {
400
+ get: function () {
401
+ return this._processSummaryColumns;
402
+ },
403
+ enumerable: true,
404
+ configurable: true
405
+ });
406
+ ExclusionDetailsComponent.prototype.ngOnInit = function () {
407
+ var _this = this;
408
+ this.route.data
409
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
410
+ .subscribe(function (data) {
411
+ _this.locale = data.localeConfig;
412
+ });
413
+ this._processSummaryColumns = this.getSummaryColumns();
414
+ };
415
+ ExclusionDetailsComponent.prototype.ngOnDestroy = function () {
416
+ this.ngUnsubscribe.next();
417
+ this.ngUnsubscribe.complete();
418
+ };
419
+ ExclusionDetailsComponent.prototype.showDetails = function (details) {
420
+ this.processDetails = null;
421
+ this._entityName = details.entityName;
422
+ this._isVisible = true;
423
+ this.entityDescription = details.entityDescription;
424
+ this.loadProcessDetails(details.recordId);
425
+ };
426
+ ExclusionDetailsComponent.prototype.closeDetails = function () {
427
+ this._isVisible = false;
428
+ };
429
+ ExclusionDetailsComponent.prototype.openExclusions = function () {
430
+ this.closeDetails();
431
+ this.router.navigate(["exclusions-list", this._entityName], {
432
+ queryParams: {
433
+ entityDescription: this.entityDescription
434
+ }
435
+ });
436
+ };
437
+ ExclusionDetailsComponent.prototype.getRecordDescription = function () {
438
+ var _a;
439
+ if (!((_a = this.processDetails) === null || _a === void 0 ? void 0 : _a.description)) {
440
+ return "";
441
+ }
442
+ return this.processDetails.description;
443
+ };
444
+ ExclusionDetailsComponent.prototype.getInicialDate = function () {
445
+ var _a;
446
+ if (!((_a = this.processDetails) === null || _a === void 0 ? void 0 : _a.startDate)) {
447
+ return "";
448
+ }
449
+ return moment(this.processDetails.startDate).format("DD/MM/YYYY HH:mm");
450
+ };
451
+ ExclusionDetailsComponent.prototype.getFinishDate = function () {
452
+ var _a;
453
+ if (!((_a = this.processDetails) === null || _a === void 0 ? void 0 : _a.finishDate)) {
454
+ return "";
455
+ }
456
+ return moment(this.processDetails.finishDate).format("DD/MM/YYYY HH:mm");
457
+ };
458
+ ExclusionDetailsComponent.prototype.isFinished = function () {
459
+ var _a;
460
+ return !!((_a = this.processDetails) === null || _a === void 0 ? void 0 : _a.finishDate);
461
+ };
462
+ ExclusionDetailsComponent.prototype.getShowExclusionsButtonLabel = function () {
463
+ return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_show_deletions");
464
+ };
465
+ ExclusionDetailsComponent.prototype.getCloseButtonLabel = function () {
466
+ return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_close");
467
+ };
468
+ ExclusionDetailsComponent.prototype.getSummaryLabel = function () {
469
+ return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_summary");
470
+ };
471
+ ExclusionDetailsComponent.prototype.getStartDateLabel = function () {
472
+ return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_start");
473
+ };
474
+ ExclusionDetailsComponent.prototype.getFinishDateLabel = function () {
475
+ return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_finish");
476
+ };
477
+ ExclusionDetailsComponent.prototype.getSidebarTitle = function () {
478
+ return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_details_title");
479
+ };
480
+ ExclusionDetailsComponent.prototype.getSummaryColumns = function () {
481
+ return [
482
+ {
483
+ field: "description",
484
+ attributes: ["description"],
485
+ header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_description"),
486
+ type: angularComponents.EnumColumnFieldType.STRING,
487
+ style: {
488
+ width: "300px"
489
+ }
490
+ },
491
+ {
492
+ field: "status",
493
+ attributes: ["status"],
494
+ header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_status"),
495
+ type: angularComponents.EnumColumnFieldType.ENUM,
496
+ enumPrefix: this.projectConfigs.getTranslationPrefix() + ".logical_delete_enum_exclusion_process_status_",
497
+ style: {
498
+ width: "100px"
499
+ },
500
+ tooltip: this.getColumnStatusTooltip,
501
+ badgeConfigs: [
502
+ {
503
+ enumValue: EnumExclusionProcessStatus.ERROR,
504
+ color: angularComponents.EnumBadgeColors.RED
505
+ },
506
+ {
507
+ enumValue: EnumExclusionProcessStatus.PENDING,
508
+ color: angularComponents.EnumBadgeColors.YELLOW
509
+ },
510
+ {
511
+ enumValue: EnumExclusionProcessStatus.PROCESSING,
512
+ color: angularComponents.EnumBadgeColors.BLUE
513
+ },
514
+ {
515
+ enumValue: EnumExclusionProcessStatus.SUCCESS,
516
+ color: angularComponents.EnumBadgeColors.GREEN
517
+ }
518
+ ]
519
+ }
520
+ ];
521
+ };
522
+ ExclusionDetailsComponent.prototype.getColumnStatusTooltip = function (rowValue) {
523
+ if (rowValue.errorMessage) {
524
+ return rowValue.errorMessage;
525
+ }
526
+ return null;
527
+ };
528
+ ExclusionDetailsComponent.prototype.loadProcessDetails = function (recordId) {
529
+ var _this = this;
530
+ this._isLoading = true;
531
+ this.logicalDeleteService.getProcessDetails(recordId)
532
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
533
+ .pipe(operators.finalize(function () { return _this._isLoading = false; }))
534
+ .subscribe(function (process) {
535
+ _this.processDetails = process;
536
+ _this.loadProcessSummary(process);
537
+ });
538
+ };
539
+ ExclusionDetailsComponent.prototype.loadProcessSummary = function (process) {
540
+ var stepLogs = [];
541
+ process.groups.forEach(function (group) {
542
+ var steps = group.steps.map(function (step) { return ({
543
+ description: step.description,
544
+ status: step.status,
545
+ errorMessage: step.errorMessage
546
+ }); });
547
+ stepLogs.push.apply(stepLogs, __spread(steps));
548
+ });
549
+ this._processSummaryData = stepLogs;
550
+ };
551
+ ExclusionDetailsComponent.ctorParameters = function () { return [
552
+ { type: router.Router },
553
+ { type: router.ActivatedRoute },
554
+ { type: core$1.TranslateService },
555
+ { type: LogicalDeleteService },
556
+ { type: LogicalDeleteConfigService }
557
+ ]; };
558
+ __decorate([
559
+ core.Output()
560
+ ], ExclusionDetailsComponent.prototype, "isVisible", null);
561
+ __decorate([
562
+ core.Output()
563
+ ], ExclusionDetailsComponent.prototype, "isLoading", null);
564
+ __decorate([
565
+ core.Output()
566
+ ], ExclusionDetailsComponent.prototype, "processSummaryData", null);
567
+ __decorate([
568
+ core.Output()
569
+ ], ExclusionDetailsComponent.prototype, "processSummaryColumns", null);
570
+ __decorate([
571
+ core.Output()
572
+ ], ExclusionDetailsComponent.prototype, "processDetails", void 0);
573
+ __decorate([
574
+ core.Output()
575
+ ], ExclusionDetailsComponent.prototype, "entityDescription", void 0);
576
+ ExclusionDetailsComponent = __decorate([
577
+ core.Component({
578
+ selector: "s-exclusion-details",
579
+ 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 <i class=\"far fa-file-alt s-exclusion-details-record-icon\"></i>\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 <p-table\n [value]=\"processSummaryData\"\n [columns]=\"processSummaryColumns\"\n dataKey=\"id\"\n [lazy]=\"false\"\n [scrollable]=\"false\"\n [paginator]=\"false\">\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",
580
+ encapsulation: core.ViewEncapsulation.None,
581
+ 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}"]
582
+ })
583
+ ], ExclusionDetailsComponent);
584
+ return ExclusionDetailsComponent;
585
+ }());
586
+
587
+ var ExclusionDetailsModule = /** @class */ (function () {
588
+ function ExclusionDetailsModule() {
589
+ }
590
+ ExclusionDetailsModule = __decorate([
591
+ core.NgModule({
592
+ imports: [
593
+ common.CommonModule,
594
+ angularComponents.SidebarModule,
595
+ angularComponents.ButtonModule,
596
+ panel.PanelModule,
597
+ table.TableModule,
598
+ angularComponents.TableModule,
599
+ angularComponents.LoadingStateModule,
600
+ angularComponents.LocaleModule
601
+ ],
602
+ declarations: [ExclusionDetailsComponent],
603
+ exports: [ExclusionDetailsComponent],
604
+ entryComponents: [ExclusionDetailsComponent]
605
+ })
606
+ ], ExclusionDetailsModule);
607
+ return ExclusionDetailsModule;
608
+ }());
609
+
610
+ var FilterService = /** @class */ (function () {
611
+ function FilterService(logicalDeleteConfigService, translate) {
612
+ this.logicalDeleteConfigService = logicalDeleteConfigService;
613
+ this.translate = translate;
614
+ this.numberTypes = [angularComponents.FieldType.Integer, angularComponents.FieldType.Double];
615
+ }
616
+ FilterService.prototype.getEnumQuery = function (name, value, multiple) {
617
+ if (multiple === void 0) { multiple = false; }
618
+ if (multiple) {
619
+ var filter = value.map(function (selected) { return name + " eq '" + selected + "'"; }).join(" or ");
620
+ return "(" + filter + ")";
621
+ }
622
+ return name + " eq '" + value + "'";
623
+ };
624
+ FilterService.prototype.createFilterString = function (formField, value) {
625
+ var name = formField.name, type = formField.type, multiple = formField.multiple;
626
+ if (typeof value == "number") {
627
+ return name + " eq " + value;
628
+ }
629
+ switch (type) {
630
+ case angularComponents.FieldType.Date:
631
+ return name + " eq '" + moment(value).format("YYYY-MM-DD") + "'";
632
+ case angularComponents.FieldType.Time:
633
+ return name + " eq '" + moment(value).format("HH:mm:ss") + "'";
634
+ case angularComponents.FieldType.DateTime:
635
+ return name + " eq '" + moment(value).format() + "'";
636
+ case angularComponents.FieldType.LocalDateTime:
637
+ return name + " eq '" + moment(value).format("YYYY-MM-DD[T]HH:mm:ss.SSS") + "'";
638
+ case angularComponents.FieldType.Enum:
639
+ return this.getEnumQuery(name, value, multiple);
640
+ case angularComponents.FieldType.String:
641
+ return "containing(upper(" + name + "), upper('" + value.replace(/'/g, "'") + "'))";
642
+ case angularComponents.FieldType.Lookup:
643
+ return name + " eq '" + value.id + "'";
644
+ default:
645
+ return name + " eq '" + value + "'";
646
+ }
647
+ };
648
+ FilterService.prototype.createFilterTokens = function (formField, value) {
649
+ var _this = this;
650
+ var _a = formField, name = _a.name, type = _a.type, label = _a.label, searchFields = _a.searchFields, options = _a.options;
651
+ var labelValue = value;
652
+ switch (type) {
653
+ case angularComponents.FieldType.Date:
654
+ labelValue = moment(value).format("L");
655
+ break;
656
+ case angularComponents.FieldType.Time:
657
+ labelValue = moment(value).format("LTS");
658
+ break;
659
+ case angularComponents.FieldType.LocalDateTime:
660
+ case angularComponents.FieldType.DateTime:
661
+ labelValue = moment(value).format("L LTS");
662
+ break;
663
+ case angularComponents.FieldType.Lookup:
664
+ labelValue = searchFields.map(function (field) { return _this.getProp(value, field.name); }).join(" - ");
665
+ break;
666
+ case angularComponents.FieldType.Enum:
667
+ if (Array.isArray(value)) {
668
+ labelValue = value.map(function (element) {
669
+ return options.filter(function (en) { return en.value === element; })[0].label;
670
+ });
671
+ }
672
+ else {
673
+ labelValue = options.filter(function (option) { return option.value === labelValue; })[0].label;
674
+ }
675
+ break;
676
+ case angularComponents.FieldType.Boolean:
677
+ labelValue = value
678
+ ? this.translate.instant(this.logicalDeleteConfigService.getTranslationPrefix() + ".list_grid_boolean_true")
679
+ : this.translate.instant(this.logicalDeleteConfigService.getTranslationPrefix() + ".list_grid_boolean_false");
680
+ break;
681
+ }
682
+ return { id: name, label: label + ": " + labelValue };
683
+ };
684
+ FilterService.prototype.getSuggestionValue = function (displayFields, ownerEntity, value, separator) {
685
+ var _this = this;
686
+ return displayFields.map(function (field) { return _this.getProp(value, ownerEntity + "." + field); })
687
+ .reduce(function (acc, val) { return "" + acc + separator + val; }) + "";
688
+ };
689
+ FilterService.prototype.getProp = function (obj, path) {
690
+ return path.split(".").reduce(function (result, prop) { return (result[prop] === undefined ? "" : result[prop]); }, obj);
691
+ };
692
+ FilterService.prototype.getLabelValueRequest = function (contents, displayFields) {
693
+ var _this = this;
694
+ return contents.map(function (item) { return (__assign(__assign({}, item), { label: displayFields.map(function (field) { return _this.getProp(item, field); }).join(" - ") })); });
695
+ };
696
+ FilterService.prototype.isValidFilter = function (type, value) {
697
+ var isTypeNumber = this.numberTypes.includes(type);
698
+ var numberPattern = /^\d+\b$/;
699
+ var isNumber = value.match(numberPattern);
700
+ return !(isTypeNumber && !isNumber);
701
+ };
702
+ FilterService.ctorParameters = function () { return [
703
+ { type: LogicalDeleteConfigService },
704
+ { type: core$1.TranslateService }
705
+ ]; };
706
+ FilterService = __decorate([
707
+ core.Injectable()
708
+ ], FilterService);
709
+ return FilterService;
710
+ }());
711
+
712
+ var ExclusionsListComponent = /** @class */ (function () {
713
+ function ExclusionsListComponent(route, translate, formBuilder, changeDetectorRef, logicalDeleteService, filterService, projectConfigs) {
714
+ this.route = route;
715
+ this.translate = translate;
716
+ this.formBuilder = formBuilder;
717
+ this.changeDetectorRef = changeDetectorRef;
718
+ this.logicalDeleteService = logicalDeleteService;
719
+ this.filterService = filterService;
720
+ this.projectConfigs = projectConfigs;
721
+ this.currentListParams = { page: 0, size: 10, sort: [], filterData: {} };
722
+ this.showLoader = false;
723
+ this.totalRecords = 0;
724
+ this.filtersPanelCollapsed = true;
725
+ this.searchTokens = [];
726
+ this.serverError = false;
727
+ this.ngUnsubscribe = new rxjs.Subject();
728
+ }
729
+ ExclusionsListComponent.prototype.ngOnInit = function () {
730
+ var _this = this;
731
+ this.filterFormGroup = this.getFormBuilder();
732
+ this.filterFields = this.getFilterFields();
733
+ this.gridColumns = this.getGridColumns();
734
+ this.route.data
735
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
736
+ .subscribe(function (data) {
737
+ _this.locale = data.localeConfig;
738
+ });
739
+ this.route.params
740
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
741
+ .subscribe(function (params) {
742
+ _this.entityName = params.entityName;
743
+ });
744
+ this.route.queryParams
745
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
746
+ .subscribe(function (queryParams) {
747
+ _this.entityDescription = queryParams.entityDescription;
748
+ });
749
+ };
750
+ ExclusionsListComponent.prototype.ngOnDestroy = function () {
751
+ this.ngUnsubscribe.next();
752
+ this.ngUnsubscribe.complete();
753
+ };
754
+ ExclusionsListComponent.prototype.getFormBuilder = function () {
755
+ return this.formBuilder.group({
756
+ description: [undefined, forms.Validators.compose([])],
757
+ state: [undefined, forms.Validators.compose([])],
758
+ startDate: [{ value: undefined, disabled: false }, forms.Validators.compose([])],
759
+ endDate: [{ value: undefined, disabled: false }, forms.Validators.compose([])]
760
+ });
761
+ };
762
+ ExclusionsListComponent.prototype.getGridColumns = function () {
763
+ return [
764
+ {
765
+ field: "description",
766
+ attributes: ['description'],
767
+ header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_description"),
768
+ type: angularComponents.EnumColumnFieldType.STRING,
769
+ style: {
770
+ width: '300px'
771
+ }
772
+ },
773
+ {
774
+ field: "status",
775
+ attributes: ['status'],
776
+ header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_status"),
777
+ type: angularComponents.EnumColumnFieldType.ENUM,
778
+ enumPrefix: this.projectConfigs.getTranslationPrefix() + ".logical_delete_enum_exclusion_process_status_",
779
+ style: {
780
+ width: '100px'
781
+ },
782
+ badgeConfigs: [
783
+ {
784
+ enumValue: EnumExclusionProcessStatus.ERROR,
785
+ color: angularComponents.EnumBadgeColors.RED
786
+ },
787
+ {
788
+ enumValue: EnumExclusionProcessStatus.PENDING,
789
+ color: angularComponents.EnumBadgeColors.YELLOW
790
+ },
791
+ {
792
+ enumValue: EnumExclusionProcessStatus.PROCESSING,
793
+ color: angularComponents.EnumBadgeColors.BLUE
794
+ },
795
+ {
796
+ enumValue: EnumExclusionProcessStatus.SUCCESS,
797
+ color: angularComponents.EnumBadgeColors.GREEN
798
+ }
799
+ ]
800
+ },
801
+ {
802
+ field: "startDate",
803
+ attributes: ['startDate'],
804
+ header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_start"),
805
+ type: angularComponents.EnumColumnFieldType.DATE,
806
+ dateFormat: "DD/MM/YYYY HH:mm",
807
+ style: {
808
+ width: '100px'
809
+ }
810
+ },
811
+ {
812
+ field: "finishDate",
813
+ attributes: ['finishDate'],
814
+ header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_finish"),
815
+ type: angularComponents.EnumColumnFieldType.DATE,
816
+ dateFormat: "DD/MM/YYYY HH:mm",
817
+ style: {
818
+ width: '100px'
819
+ }
820
+ }
821
+ ];
822
+ };
823
+ ExclusionsListComponent.prototype.getFilterFields = function () {
824
+ return [
825
+ new angularComponents.FormField({
826
+ type: angularComponents.FieldType.String,
827
+ name: "description",
828
+ label: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_description")
829
+ }),
830
+ new angularComponents.FormField({
831
+ type: angularComponents.FieldType.Enum,
832
+ name: "state",
833
+ label: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_status"),
834
+ placeholder: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_status"),
835
+ multiple: true,
836
+ options: [
837
+ {
838
+ label: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_enum_exclusion_process_status_error"),
839
+ value: EnumExclusionProcessStatus.ERROR
840
+ },
841
+ {
842
+ label: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_enum_exclusion_process_status_pending"),
843
+ value: EnumExclusionProcessStatus.PENDING
844
+ },
845
+ {
846
+ label: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_enum_exclusion_process_status_processing"),
847
+ value: EnumExclusionProcessStatus.PROCESSING
848
+ },
849
+ {
850
+ label: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_enum_exclusion_process_status_success"),
851
+ value: EnumExclusionProcessStatus.SUCCESS
852
+ }
853
+ ]
854
+ }),
855
+ new angularComponents.FormField({
856
+ type: angularComponents.FieldType.Date,
857
+ name: "startDate",
858
+ label: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_start")
859
+ }),
860
+ new angularComponents.FormField({
861
+ type: angularComponents.FieldType.Date,
862
+ name: "endDate",
863
+ label: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_finish")
864
+ })
865
+ ];
866
+ };
867
+ ExclusionsListComponent.prototype.getEmptyStateTitle = function () {
868
+ return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_empty_state_title");
869
+ };
870
+ ExclusionsListComponent.prototype.getEmptyStateDescription = function () {
871
+ return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_empty_state_description");
872
+ };
873
+ ExclusionsListComponent.prototype.getTitle = function () {
874
+ return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_list_title");
875
+ };
876
+ ExclusionsListComponent.prototype.getDetailsButtonTitle = function () {
877
+ return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_details");
878
+ };
879
+ ExclusionsListComponent.prototype.onSearch = function () {
880
+ var filterData = this.filterFormGroup.getRawValue();
881
+ this.filtersPanelCollapsed = true;
882
+ this.resetGrid({ filterData: filterData });
883
+ };
884
+ ExclusionsListComponent.prototype.onClear = function () {
885
+ this.filterFormGroup.reset();
886
+ var filterData = this.filterFormGroup.getRawValue();
887
+ this.resetGrid({ filterData: filterData });
888
+ };
889
+ ExclusionsListComponent.prototype.onRemoveToken = function (token) {
890
+ this.filterFormGroup.get(token.id).setValue(undefined);
891
+ var filterData = this.filterFormGroup.getRawValue();
892
+ this.resetGrid({ filterData: filterData });
893
+ };
894
+ ExclusionsListComponent.prototype.onGridChange = function (event) {
895
+ var size = event.rows;
896
+ var page = event.first / size;
897
+ var sort = event.multiSortMeta ? event.multiSortMeta : [];
898
+ return this.updateGrid({ page: page, size: size, sort: sort });
899
+ };
900
+ ExclusionsListComponent.prototype.getFilterTokens = function () {
901
+ var _this = this;
902
+ var filterData = this.filterFormGroup.value;
903
+ return this.filterFields
904
+ .filter(function (_a) {
905
+ var name = _a.name;
906
+ return filterData[name] != undefined && filterData[name] !== "";
907
+ })
908
+ .map(function (formField) { return _this.filterService.createFilterTokens(formField, filterData[formField.name]); });
909
+ };
910
+ ExclusionsListComponent.prototype.getFilterQuery = function () {
911
+ var _this = this;
912
+ var filterData = this.currentListParams.filterData;
913
+ var dateFields = ['startDate', 'endDate'];
914
+ var filterQuery = this.filterFields
915
+ .filter(function (_a) {
916
+ var name = _a.name;
917
+ return !dateFields.includes(name);
918
+ })
919
+ .filter(function (_a) {
920
+ var name = _a.name;
921
+ return filterData[name] != undefined;
922
+ })
923
+ .map(function (formField) { return _this.filterService.createFilterString(formField, filterData[formField.name]); })
924
+ .join(" and ");
925
+ if (filterData.startDate && filterData.endDate) {
926
+ var startDate = moment(filterData.startDate).format('YYYY-MM-DD');
927
+ var endDate = moment(filterData.endDate).format('YYYY-MM-DD');
928
+ var dateQuery = "startDate between '" + startDate + "' and '" + endDate + "'";
929
+ if (filterQuery) {
930
+ filterQuery += " and " + dateQuery;
931
+ }
932
+ else {
933
+ filterQuery = dateQuery;
934
+ }
935
+ }
936
+ return filterQuery;
937
+ };
938
+ ExclusionsListComponent.prototype.updateGrid = function (listParams) {
939
+ if (listParams === void 0) { listParams = {}; }
940
+ this.currentListParams = __assign(__assign({}, this.currentListParams), listParams);
941
+ var _a = this.currentListParams, page = _a.page, size = _a.size, sort = _a.sort;
942
+ this.searchTokens = this.getFilterTokens();
943
+ var filterQuery = this.getFilterQuery();
944
+ var displayFields = __spread([
945
+ 'recordId'
946
+ ], this.gridColumns.map(function (column) { return column.field; }));
947
+ this.listExclusions({ page: page, size: size, sort: sort, filterQuery: filterQuery, displayFields: displayFields });
948
+ };
949
+ ExclusionsListComponent.prototype.listExclusions = function (params) {
950
+ var _this = this;
951
+ this.showLoader = true;
952
+ this.serverError = false;
953
+ this.changeDetectorRef.detectChanges();
954
+ this.logicalDeleteService
955
+ .listExclusions(this.entityName, params)
956
+ .pipe(operators.takeUntil(this.ngUnsubscribe), operators.catchError(function (err) {
957
+ if (err.status >= 500 && err.status < 600) {
958
+ _this.serverError = true;
959
+ }
960
+ throw err;
961
+ }), operators.finalize(function () { return _this.showLoader = false; }))
962
+ .subscribe(function (list) {
963
+ _this.gridData = list.contents;
964
+ _this.totalRecords = list.totalElements;
965
+ });
966
+ };
967
+ ExclusionsListComponent.prototype.focusInput = function (elementId) {
968
+ var element = document.getElementById("" + elementId);
969
+ if (element) {
970
+ element.focus();
971
+ }
972
+ };
973
+ ExclusionsListComponent.prototype.resetGrid = function (listParams) {
974
+ if (listParams)
975
+ this.currentListParams = __assign(__assign({}, this.currentListParams), listParams);
976
+ this.currentListParams = __assign(__assign({}, this.currentListParams), { page: 0, sort: [] });
977
+ this.table.reset();
978
+ };
979
+ ExclusionsListComponent.prototype.onClickDetails = function (rowData) {
980
+ this.exclusionDetailsComponent.showDetails({
981
+ recordId: rowData.recordId,
982
+ entityDescription: this.entityDescription,
983
+ entityName: this.entityName
984
+ });
985
+ };
986
+ ExclusionsListComponent.ctorParameters = function () { return [
987
+ { type: router.ActivatedRoute },
988
+ { type: core$1.TranslateService },
989
+ { type: forms.FormBuilder },
990
+ { type: core.ChangeDetectorRef },
991
+ { type: LogicalDeleteService },
992
+ { type: FilterService },
993
+ { type: LogicalDeleteConfigService }
994
+ ]; };
995
+ __decorate([
996
+ core.ViewChild("exclusionsTable")
997
+ ], ExclusionsListComponent.prototype, "table", void 0);
998
+ __decorate([
999
+ core.ViewChild(ExclusionDetailsComponent)
1000
+ ], ExclusionsListComponent.prototype, "exclusionDetailsComponent", void 0);
1001
+ ExclusionsListComponent = __decorate([
1002
+ core.Component({
1003
+ 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 {{ 'filters' | translate }}\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: 'error_invalid' | translate }\"\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]=\"'filter' | translate\"\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]=\"'clear' | translate\"\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=\"{{ 'error_server_title' | translate }}\"\n primaryActionLabel=\"{{ 'error_server_try_again' | translate }}\"\n (primaryAction)=\"resetGrid()\"\n description=\"{{ 'error_server_description' | 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\">{{'A\u00E7\u00F5es'}}</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>",
1004
+ providers: []
1005
+ })
1006
+ ], ExclusionsListComponent);
1007
+ return ExclusionsListComponent;
1008
+ }());
1009
+
1010
+ var ExclusionsListFeatureRoutingGuard = /** @class */ (function () {
1011
+ function ExclusionsListFeatureRoutingGuard() {
1012
+ }
1013
+ ExclusionsListFeatureRoutingGuard.prototype.canActivate = function () {
1014
+ return true;
1015
+ };
1016
+ ExclusionsListFeatureRoutingGuard = __decorate([
1017
+ core.Injectable()
1018
+ ], ExclusionsListFeatureRoutingGuard);
1019
+ return ExclusionsListFeatureRoutingGuard;
1020
+ }());
1021
+ var ExclusionsListFeatureRoutingListTitleResolver = /** @class */ (function () {
1022
+ function ExclusionsListFeatureRoutingListTitleResolver(translate, projectConfigs) {
1023
+ this.translate = translate;
1024
+ this.projectConfigs = projectConfigs;
1025
+ }
1026
+ ExclusionsListFeatureRoutingListTitleResolver.prototype.resolve = function () {
1027
+ return this.translate.get(this.projectConfigs.getTranslationPrefix() + ".logical_delete_list_title");
1028
+ };
1029
+ ExclusionsListFeatureRoutingListTitleResolver.ctorParameters = function () { return [
1030
+ { type: core$1.TranslateService },
1031
+ { type: LogicalDeleteConfigService }
1032
+ ]; };
1033
+ ExclusionsListFeatureRoutingListTitleResolver = __decorate([
1034
+ core.Injectable()
1035
+ ], ExclusionsListFeatureRoutingListTitleResolver);
1036
+ return ExclusionsListFeatureRoutingListTitleResolver;
1037
+ }());
1038
+ var ExclusionsListFeatureRoutingPermissionResolver = /** @class */ (function () {
1039
+ function ExclusionsListFeatureRoutingPermissionResolver(permissionsService) {
1040
+ this.permissionsService = permissionsService;
1041
+ }
1042
+ ExclusionsListFeatureRoutingPermissionResolver.prototype.resolve = function () {
1043
+ return this.permissionsService.get();
1044
+ };
1045
+ ExclusionsListFeatureRoutingPermissionResolver.ctorParameters = function () { return [
1046
+ { type: platformComponents.PermissionsService }
1047
+ ]; };
1048
+ ExclusionsListFeatureRoutingPermissionResolver = __decorate([
1049
+ core.Injectable()
1050
+ ], ExclusionsListFeatureRoutingPermissionResolver);
1051
+ return ExclusionsListFeatureRoutingPermissionResolver;
1052
+ }());
1053
+ var ExclusionsListFeatureRoutingLocaleResolver = /** @class */ (function () {
1054
+ function ExclusionsListFeatureRoutingLocaleResolver(localeService) {
1055
+ this.localeService = localeService;
1056
+ }
1057
+ ExclusionsListFeatureRoutingLocaleResolver.prototype.resolve = function () {
1058
+ return this.localeService.get();
1059
+ };
1060
+ ExclusionsListFeatureRoutingLocaleResolver.ctorParameters = function () { return [
1061
+ { type: angularComponents.LocaleService }
1062
+ ]; };
1063
+ ExclusionsListFeatureRoutingLocaleResolver = __decorate([
1064
+ core.Injectable()
1065
+ ], ExclusionsListFeatureRoutingLocaleResolver);
1066
+ return ExclusionsListFeatureRoutingLocaleResolver;
1067
+ }());
1068
+ var EmptyComponent = /** @class */ (function () {
1069
+ function EmptyComponent() {
1070
+ }
1071
+ EmptyComponent = __decorate([
1072
+ core.Component({
1073
+ template: "<router-outlet></router-outlet>"
1074
+ })
1075
+ ], EmptyComponent);
1076
+ return EmptyComponent;
1077
+ }());
1078
+ var routes = [
1079
+ {
1080
+ path: "exclusions-list",
1081
+ component: EmptyComponent,
1082
+ canActivate: [
1083
+ ExclusionsListFeatureRoutingGuard
1084
+ ],
1085
+ resolve: {
1086
+ allPermissions: ExclusionsListFeatureRoutingPermissionResolver,
1087
+ localeConfig: ExclusionsListFeatureRoutingLocaleResolver,
1088
+ routeTitle: ExclusionsListFeatureRoutingListTitleResolver
1089
+ },
1090
+ children: [
1091
+ {
1092
+ path: ":entityName",
1093
+ component: ExclusionsListComponent
1094
+ }
1095
+ ]
1096
+ }
1097
+ ];
1098
+ var ExclusionsListFeatureRouting = /** @class */ (function () {
1099
+ function ExclusionsListFeatureRouting() {
1100
+ }
1101
+ ExclusionsListFeatureRouting = __decorate([
1102
+ core.NgModule({
1103
+ imports: [
1104
+ router.RouterModule.forChild(routes)
1105
+ ],
1106
+ exports: [
1107
+ router.RouterModule
1108
+ ],
1109
+ providers: [
1110
+ ExclusionsListFeatureRoutingGuard,
1111
+ ExclusionsListFeatureRoutingPermissionResolver,
1112
+ ExclusionsListFeatureRoutingLocaleResolver,
1113
+ ExclusionsListFeatureRoutingListTitleResolver
1114
+ ],
1115
+ declarations: [
1116
+ EmptyComponent
1117
+ ]
1118
+ })
1119
+ ], ExclusionsListFeatureRouting);
1120
+ return ExclusionsListFeatureRouting;
1121
+ }());
1122
+
1123
+ var ExclusionsListModule = /** @class */ (function () {
1124
+ function ExclusionsListModule() {
1125
+ }
1126
+ ExclusionsListModule = __decorate([
1127
+ core.NgModule({
1128
+ imports: [
1129
+ forms.FormsModule,
1130
+ forms.ReactiveFormsModule,
1131
+ core$1.TranslateModule,
1132
+ common.CommonModule,
1133
+ angularComponents.ControlErrorsModule,
1134
+ angularComponents.ButtonModule,
1135
+ panel.PanelModule,
1136
+ inputtext.InputTextModule,
1137
+ angularComponents.InfoSignModule,
1138
+ confirmdialog.ConfirmDialogModule,
1139
+ dialog.DialogModule,
1140
+ table.TableModule,
1141
+ angularComponents.TableModule,
1142
+ angularComponents.LoadingStateModule,
1143
+ angularComponents.EmptyStateModule,
1144
+ angularComponents.DynamicFormModule,
1145
+ angularComponents.TokenListModule,
1146
+ angularComponents.LocaleModule.forChild(),
1147
+ ExclusionDetailsModule,
1148
+ ExclusionsListFeatureRouting
1149
+ ],
1150
+ declarations: [ExclusionsListComponent],
1151
+ exports: [ExclusionsListComponent],
1152
+ entryComponents: [ExclusionsListComponent]
1153
+ })
1154
+ ], ExclusionsListModule);
1155
+ return ExclusionsListModule;
1156
+ }());
1157
+
1158
+ var LogicalDeleteModule = /** @class */ (function () {
1159
+ function LogicalDeleteModule() {
1160
+ }
1161
+ LogicalDeleteModule_1 = LogicalDeleteModule;
1162
+ LogicalDeleteModule.forRoot = function (config) {
1163
+ return {
1164
+ ngModule: LogicalDeleteModule_1,
1165
+ providers: [
1166
+ {
1167
+ provide: ProjectConfigsInjectionToken,
1168
+ useValue: config
1169
+ }
1170
+ ]
1171
+ };
1172
+ };
1173
+ var LogicalDeleteModule_1;
1174
+ LogicalDeleteModule = LogicalDeleteModule_1 = __decorate([
1175
+ core.NgModule({
1176
+ providers: [LogicalDeleteService, LogicalDeleteConfigService, FilterService]
1177
+ })
1178
+ ], LogicalDeleteModule);
1179
+ return LogicalDeleteModule;
1180
+ }());
1181
+
1182
+ exports.EmptyComponent = EmptyComponent;
1183
+ exports.ExclusionDetailsComponent = ExclusionDetailsComponent;
1184
+ exports.ExclusionDetailsModule = ExclusionDetailsModule;
1185
+ exports.ExclusionsListComponent = ExclusionsListComponent;
1186
+ exports.ExclusionsListFeatureRouting = ExclusionsListFeatureRouting;
1187
+ exports.ExclusionsListFeatureRoutingGuard = ExclusionsListFeatureRoutingGuard;
1188
+ exports.ExclusionsListFeatureRoutingListTitleResolver = ExclusionsListFeatureRoutingListTitleResolver;
1189
+ exports.ExclusionsListFeatureRoutingLocaleResolver = ExclusionsListFeatureRoutingLocaleResolver;
1190
+ exports.ExclusionsListFeatureRoutingPermissionResolver = ExclusionsListFeatureRoutingPermissionResolver;
1191
+ exports.ExclusionsListModule = ExclusionsListModule;
1192
+ exports.LogicalDeleteModule = LogicalDeleteModule;
1193
+ exports.routes = routes;
1194
+ exports.ɵa = LogicalDeleteService;
1195
+ exports.ɵb = LogicalDeleteConfigService;
1196
+ exports.ɵc = ProjectConfigsInjectionToken;
1197
+ exports.ɵe = ExclusionDetailsModule;
1198
+ exports.ɵf = ExclusionDetailsComponent;
1199
+ exports.ɵg = LogicalDeleteService;
1200
+ exports.ɵh = FilterService;
1201
+
1202
+ Object.defineProperty(exports, '__esModule', { value: true });
1203
+
1204
+ })));
1205
+ //# sourceMappingURL=seniorsistemas-exclusion-process-component.umd.js.map