@seniorsistemas/exclusion-process-component 0.0.1-40efacd8-8a6c-4d38-8102-8c977c14410a → 0.6.0-44030ff3-2eeb-49f7-8927-0920cc01a805

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 (213) hide show
  1. package/.editorconfig +19 -0
  2. package/.gitlab-ci.yml +74 -0
  3. package/.prettierrc +8 -0
  4. package/.senior-ci-extensions.sh +21 -0
  5. package/.vscode/settings.json +6 -0
  6. package/CHANGELOG.md +22 -0
  7. package/README.md +16 -0
  8. package/angular.json +144 -0
  9. package/archive.tar.gz +0 -0
  10. package/e2e/app.e2e-spec.ts +14 -0
  11. package/e2e/app.po.ts +11 -0
  12. package/e2e/tsconfig.e2e.json +14 -0
  13. package/karma.conf.js +53 -0
  14. package/lib/.browserslistrc +5 -0
  15. package/lib/package.json +19 -0
  16. package/{enums/enum-exclusion-process-status.d.ts → lib/src/enums/enum-exclusion-process-status.ts} +1 -1
  17. package/lib/src/exclusion-details/exclusion-details.component.html +84 -0
  18. package/lib/src/exclusion-details/exclusion-details.component.scss +47 -0
  19. package/lib/src/exclusion-details/exclusion-details.component.spec.ts +171 -0
  20. package/lib/src/exclusion-details/exclusion-details.component.ts +235 -0
  21. package/lib/src/exclusion-details/exclusion-details.module.ts +23 -0
  22. package/{exclusion-details/protocols/exclusion-details.d.ts → lib/src/exclusion-details/protocols/exclusion-details.ts} +1 -0
  23. package/{exclusion-details/protocols/show-details-information.d.ts → lib/src/exclusion-details/protocols/show-details-information.ts} +1 -1
  24. package/lib/src/exclusions-list/exclusions-list.component.html +157 -0
  25. package/lib/src/exclusions-list/exclusions-list.component.spec.ts +526 -0
  26. package/lib/src/exclusions-list/exclusions-list.component.ts +335 -0
  27. package/lib/src/exclusions-list/exclusions-list.module.ts +52 -0
  28. package/lib/src/exclusions-list/exclusions-list.routing.ts +89 -0
  29. package/{exclusions-list/index.d.ts → lib/src/exclusions-list/index.ts} +0 -1
  30. package/lib/src/logical-delete.module.ts +22 -0
  31. package/{models/exclusion-process-step-group.d.ts → lib/src/models/exclusion-process-step-group.ts} +1 -0
  32. package/{models/exclusion-process-step.d.ts → lib/src/models/exclusion-process-step.ts} +1 -0
  33. package/{models/exclusion-process.d.ts → lib/src/models/exclusion-process.ts} +1 -0
  34. package/{models/list-params.d.ts → lib/src/models/list-params.ts} +1 -0
  35. package/{models/project-config.d.ts → lib/src/models/project-config.ts} +3 -1
  36. package/{public-api.d.ts → lib/src/public-api.ts} +0 -1
  37. package/lib/src/services/filter.service.spec.ts +290 -0
  38. package/lib/src/services/filter.service.ts +109 -0
  39. package/lib/src/services/logical-delete-config.service.spec.ts +59 -0
  40. package/lib/src/services/logical-delete-config.service.ts +25 -0
  41. package/lib/src/services/logical-delete.service.spec.ts +322 -0
  42. package/lib/src/services/logical-delete.service.ts +122 -0
  43. package/lib/test.ts +14 -0
  44. package/lib/tsconfig.lib.json +19 -0
  45. package/lib/tsconfig.lib.prod.json +6 -0
  46. package/lib/tsconfig.spec.json +12 -0
  47. package/lib/tslint.json +19 -0
  48. package/package.json +59 -18
  49. package/protractor.conf.js +28 -0
  50. package/senior-ci/.devcontainer/Dockerfile +27 -0
  51. package/senior-ci/.devcontainer/devcontainer.json +71 -0
  52. package/senior-ci/.editorconfig +14 -0
  53. package/senior-ci/.gitattributes +5 -0
  54. package/senior-ci/.gitlab-ci.yml +53 -0
  55. package/senior-ci/.pylintrc +562 -0
  56. package/senior-ci/.vscode/launch.json +102 -0
  57. package/senior-ci/CHANGELOG.md +1564 -0
  58. package/senior-ci/CONTRIBUTING.md +31 -0
  59. package/senior-ci/README.md +26 -0
  60. package/senior-ci/ci/ci.sh +74 -0
  61. package/senior-ci/ci/sonar_scanner.py +48 -0
  62. package/senior-ci/common/__init__.py +250 -0
  63. package/senior-ci/common/default-files/pom.xml +10 -0
  64. package/senior-ci/common/docker-helpers.sh +57 -0
  65. package/senior-ci/common/extensions.py +88 -0
  66. package/senior-ci/common/flutter-helpers.sh +3 -0
  67. package/senior-ci/common/getopt_helper.py +168 -0
  68. package/senior-ci/common/graphql_client.py +40 -0
  69. package/senior-ci/common/helm_helpers.py +40 -0
  70. package/senior-ci/common/notification-helpers.sh +15 -0
  71. package/senior-ci/common/npm-helper.sh +4 -0
  72. package/senior-ci/common/parallel-helper.sh +8 -0
  73. package/senior-ci/common/release-helpers.sh +196 -0
  74. package/senior-ci/common/s3cache-helpers.sh +47 -0
  75. package/senior-ci/common/senior-ci-extensions-helpers.sh +15 -0
  76. package/senior-ci/common/sonar_helper.py +203 -0
  77. package/senior-ci/common/validations/buildable_project.py +61 -0
  78. package/senior-ci/common/validations/check_deprecated_primitives.py +49 -0
  79. package/senior-ci/common/validations/check_project_path.py +40 -0
  80. package/senior-ci/common/validations/check_sonar_config_files.py +41 -0
  81. package/senior-ci/common/validations/check_tags.py +41 -0
  82. package/senior-ci/common/validations/validate_changelog.py +151 -0
  83. package/senior-ci/common/validations/validate_issues.py +320 -0
  84. package/senior-ci/docker/build.sh +18 -0
  85. package/senior-ci/docker/config-host.sh +29 -0
  86. package/senior-ci/docker/deploy-service.sh +79 -0
  87. package/senior-ci/docker/push.sh +22 -0
  88. package/senior-ci/frontend/npm/bibliotecas/ci.sh +149 -0
  89. package/senior-ci/frontend/npm/ci.sh +370 -0
  90. package/senior-ci/frontend/npm/release-translations.sh +164 -0
  91. package/senior-ci/helm/deploy.py +56 -0
  92. package/senior-ci/helm/publish.py +41 -0
  93. package/senior-ci/hook/release_notification.sh +88 -0
  94. package/senior-ci/hook/text_notification.sh +10 -0
  95. package/senior-ci/java/bibliotecas/ci.sh +215 -0
  96. package/senior-ci/java/sdl/ci.sh +372 -0
  97. package/senior-ci/java/sdl/scripts/hotfix.sh +78 -0
  98. package/senior-ci/mobile/flutter/apps/__main__.py +5 -0
  99. package/senior-ci/mobile/flutter/apps/ci.py +193 -0
  100. package/senior-ci/mobile/flutter/libs/__main__.py +5 -0
  101. package/senior-ci/mobile/flutter/libs/ci.py +178 -0
  102. package/senior-ci/mobile/flutter/scripts/release.sh +54 -0
  103. package/senior-ci/release-candidate/backend/get_version.sh +64 -0
  104. package/senior-ci/release-candidate/close_branch.sh +113 -0
  105. package/senior-ci/release-candidate/common/create_hotfix.sh +28 -0
  106. package/senior-ci/release-candidate/common/create_release.sh +30 -0
  107. package/senior-ci/release-candidate/create_branch.sh +64 -0
  108. package/senior-ci/release-candidate/frontend/get_version.sh +43 -0
  109. package/senior-ci/requirements-dev.txt +5 -0
  110. package/senior-ci/requirements.txt +5 -0
  111. package/senior-ci/scripts/apply_yamls.py +229 -0
  112. package/senior-ci/scripts/create_sre_issue/__main__.py +7 -0
  113. package/senior-ci/scripts/create_sre_issue/create_sre_issue.py +267 -0
  114. package/senior-ci/scripts/create_sre_issue/helpers.py +166 -0
  115. package/senior-ci/scripts/create_sre_issue/jira_manager.py +37 -0
  116. package/senior-ci/scripts/validate_changelog.sh +3 -0
  117. package/senior-ci/sonar-project.properties +1 -0
  118. package/server.js +5 -0
  119. package/sonar-project.properties +10 -0
  120. package/src/app/app.component.html +43 -0
  121. package/src/app/app.component.scss +36 -0
  122. package/src/app/app.component.ts +56 -0
  123. package/src/app/app.module.ts +64 -0
  124. package/src/app/shared/shared.module.ts +28 -0
  125. package/src/environments/environment.default.ts +3 -0
  126. package/src/environments/environment.prod.ts +6 -0
  127. package/src/environments/environment.ts +7 -0
  128. package/src/favicon.ico +0 -0
  129. package/src/index.html +17 -0
  130. package/src/locale/en-US.json +3 -0
  131. package/src/locale/es-ES.json +3 -0
  132. package/src/locale/pt-BR.json +3 -0
  133. package/src/main.ts +13 -0
  134. package/src/polyfills.ts +58 -0
  135. package/src/styles.scss +11 -0
  136. package/src/tsconfig.app.json +21 -0
  137. package/src/typings.d.ts +15 -0
  138. package/tsconfig.json +39 -0
  139. package/tslint.json +80 -0
  140. package/bundles/seniorsistemas-exclusion-process-component.umd.js +0 -1205
  141. package/bundles/seniorsistemas-exclusion-process-component.umd.js.map +0 -1
  142. package/bundles/seniorsistemas-exclusion-process-component.umd.min.js +0 -16
  143. package/bundles/seniorsistemas-exclusion-process-component.umd.min.js.map +0 -1
  144. package/esm2015/enums/enum-exclusion-process-status.js +0 -8
  145. package/esm2015/exclusion-details/exclusion-details.component.js +0 -216
  146. package/esm2015/exclusion-details/exclusion-details.module.js +0 -28
  147. package/esm2015/exclusion-details/index.js +0 -3
  148. package/esm2015/exclusion-details/protocols/exclusion-details.js +0 -1
  149. package/esm2015/exclusion-details/protocols/index.js +0 -2
  150. package/esm2015/exclusion-details/protocols/show-details-information.js +0 -3
  151. package/esm2015/exclusions-list/exclusions-list.component.js +0 -299
  152. package/esm2015/exclusions-list/exclusions-list.module.js +0 -47
  153. package/esm2015/exclusions-list/exclusions-list.routing.js +0 -115
  154. package/esm2015/exclusions-list/index.js +0 -4
  155. package/esm2015/logical-delete.module.js +0 -27
  156. package/esm2015/models/exclusion-process-step-group.js +0 -1
  157. package/esm2015/models/exclusion-process-step.js +0 -1
  158. package/esm2015/models/exclusion-process.js +0 -1
  159. package/esm2015/models/index.js +0 -1
  160. package/esm2015/models/list-params.js +0 -1
  161. package/esm2015/models/list-result.js +0 -1
  162. package/esm2015/models/project-config.js +0 -3
  163. package/esm2015/public-api.js +0 -4
  164. package/esm2015/seniorsistemas-exclusion-process-component.js +0 -11
  165. package/esm2015/services/filter.service.js +0 -104
  166. package/esm2015/services/index.js +0 -2
  167. package/esm2015/services/logical-delete-config.service.js +0 -29
  168. package/esm2015/services/logical-delete.service.js +0 -109
  169. package/esm5/enums/enum-exclusion-process-status.js +0 -8
  170. package/esm5/exclusion-details/exclusion-details.component.js +0 -235
  171. package/esm5/exclusion-details/exclusion-details.module.js +0 -31
  172. package/esm5/exclusion-details/index.js +0 -3
  173. package/esm5/exclusion-details/protocols/exclusion-details.js +0 -1
  174. package/esm5/exclusion-details/protocols/index.js +0 -2
  175. package/esm5/exclusion-details/protocols/show-details-information.js +0 -7
  176. package/esm5/exclusions-list/exclusions-list.component.js +0 -313
  177. package/esm5/exclusions-list/exclusions-list.module.js +0 -50
  178. package/esm5/exclusions-list/exclusions-list.routing.js +0 -127
  179. package/esm5/exclusions-list/index.js +0 -4
  180. package/esm5/logical-delete.module.js +0 -31
  181. package/esm5/models/exclusion-process-step-group.js +0 -1
  182. package/esm5/models/exclusion-process-step.js +0 -1
  183. package/esm5/models/exclusion-process.js +0 -1
  184. package/esm5/models/index.js +0 -1
  185. package/esm5/models/list-params.js +0 -1
  186. package/esm5/models/list-result.js +0 -1
  187. package/esm5/models/project-config.js +0 -3
  188. package/esm5/public-api.js +0 -4
  189. package/esm5/seniorsistemas-exclusion-process-component.js +0 -11
  190. package/esm5/services/filter.service.js +0 -109
  191. package/esm5/services/index.js +0 -2
  192. package/esm5/services/logical-delete-config.service.js +0 -30
  193. package/esm5/services/logical-delete.service.js +0 -112
  194. package/exclusion-details/exclusion-details.component.d.ts +0 -49
  195. package/exclusion-details/exclusion-details.module.d.ts +0 -2
  196. package/exclusions-list/exclusions-list.component.d.ts +0 -59
  197. package/exclusions-list/exclusions-list.module.d.ts +0 -2
  198. package/exclusions-list/exclusions-list.routing.d.ts +0 -29
  199. package/fesm2015/seniorsistemas-exclusion-process-component.js +0 -917
  200. package/fesm2015/seniorsistemas-exclusion-process-component.js.map +0 -1
  201. package/fesm5/seniorsistemas-exclusion-process-component.js +0 -981
  202. package/fesm5/seniorsistemas-exclusion-process-component.js.map +0 -1
  203. package/logical-delete.module.d.ts +0 -5
  204. package/seniorsistemas-exclusion-process-component.d.ts +0 -10
  205. package/seniorsistemas-exclusion-process-component.metadata.json +0 -1
  206. package/services/filter.service.d.ts +0 -19
  207. package/services/logical-delete-config.service.d.ts +0 -8
  208. package/services/logical-delete.service.d.ts +0 -20
  209. /package/{exclusion-details/index.d.ts → lib/src/exclusion-details/index.ts} +0 -0
  210. /package/{exclusion-details/protocols/index.d.ts → lib/src/exclusion-details/protocols/index.ts} +0 -0
  211. /package/{models/index.d.ts → lib/src/models/index.ts} +0 -0
  212. /package/{models/list-result.d.ts → lib/src/models/list-result.ts} +0 -0
  213. /package/{services/index.d.ts → lib/src/services/index.ts} +0 -0
@@ -1,981 +0,0 @@
1
- import { __decorate, __param, __spread, __assign } from 'tslib';
2
- import { CommonModule } from '@angular/common';
3
- import { InjectionToken, Inject, Injectable, Output, Component, ViewEncapsulation, NgModule, ChangeDetectorRef, ViewChild } from '@angular/core';
4
- import { PanelModule } from 'primeng/panel';
5
- import { TableModule } from 'primeng/table';
6
- import { EnumColumnFieldType, EnumBadgeColors, SidebarModule, ButtonModule, TableModule as TableModule$1, LoadingStateModule, LocaleModule, FieldType, FormField, LocaleService, ControlErrorsModule, InfoSignModule, EmptyStateModule, DynamicFormModule, TokenListModule } from '@seniorsistemas/angular-components';
7
- import * as moment from 'moment';
8
- import { Router, ActivatedRoute, RouterModule } from '@angular/router';
9
- import { throwError, Subject } from 'rxjs';
10
- import { catchError, map, takeUntil, finalize } from 'rxjs/operators';
11
- import { HttpParams, HttpClient } from '@angular/common/http';
12
- import { TranslateService, TranslateModule } from '@ngx-translate/core';
13
- import { MessageService } from 'primeng/api';
14
- import { Validators, FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
15
- import { DialogModule } from 'primeng/dialog';
16
- import { ConfirmDialogModule } from 'primeng/confirmdialog';
17
- import { InputTextModule } from 'primeng/inputtext';
18
- import { PermissionsService } from '@seniorsistemas/platform-components';
19
-
20
- var EnumExclusionProcessStatus;
21
- (function (EnumExclusionProcessStatus) {
22
- EnumExclusionProcessStatus["PENDING"] = "PENDING";
23
- EnumExclusionProcessStatus["PROCESSING"] = "PROCESSING";
24
- EnumExclusionProcessStatus["ERROR"] = "ERROR";
25
- EnumExclusionProcessStatus["SUCCESS"] = "SUCCESS";
26
- })(EnumExclusionProcessStatus || (EnumExclusionProcessStatus = {}));
27
-
28
- var ProjectConfigsInjectionToken = new InjectionToken("projectConfigs");
29
-
30
- var LogicalDeleteConfigService = /** @class */ (function () {
31
- function LogicalDeleteConfigService(projectConfigs) {
32
- this.projectConfigs = projectConfigs;
33
- }
34
- LogicalDeleteConfigService.prototype.getDomain = function () {
35
- return this.projectConfigs.domain;
36
- };
37
- LogicalDeleteConfigService.prototype.getService = function () {
38
- return this.projectConfigs.service;
39
- };
40
- LogicalDeleteConfigService.prototype.getTranslationPrefix = function () {
41
- if (this.projectConfigs.translationPrefix) {
42
- return this.projectConfigs.translationPrefix;
43
- }
44
- return this.projectConfigs.domain + "." + this.projectConfigs.service;
45
- };
46
- LogicalDeleteConfigService.ctorParameters = function () { return [
47
- { type: undefined, decorators: [{ type: Inject, args: [ProjectConfigsInjectionToken,] }] }
48
- ]; };
49
- LogicalDeleteConfigService = __decorate([
50
- Injectable(),
51
- __param(0, Inject(ProjectConfigsInjectionToken))
52
- ], LogicalDeleteConfigService);
53
- return LogicalDeleteConfigService;
54
- }());
55
-
56
- var LogicalDeleteService = /** @class */ (function () {
57
- function LogicalDeleteService(http, messageService, translate, projectConfigs) {
58
- this.http = http;
59
- this.messageService = messageService;
60
- this.translate = translate;
61
- this.projectConfigs = projectConfigs;
62
- var entityUrl = projectConfigs.getDomain() + "/" + projectConfigs.getService();
63
- this.exclusionProcessUrl = entityUrl + "/entities/exclusionProcess";
64
- this.listExclusionsUrl = entityUrl + "/entities/exclusionProcess";
65
- this.defaultCatch = this.defaultCatch.bind(this);
66
- }
67
- LogicalDeleteService.prototype.defaultCatch = function () {
68
- var _this = this;
69
- return catchError(function (err) {
70
- if (err) {
71
- var summary = err.status ? String(err.status) : "Error";
72
- var detail = (err.error && err.error.message) || err.statusText || err.message || "Error";
73
- if (err.status === 401) {
74
- var prefix = _this.projectConfigs.getTranslationPrefix();
75
- summary = _this.translate.instant(prefix + ".error_unauthorized_title");
76
- detail = _this.translate.instant(prefix + ".error_unauthorized_description");
77
- }
78
- _this.messageService.add({
79
- severity: "error",
80
- summary: summary,
81
- detail: detail
82
- });
83
- }
84
- return throwError(err);
85
- });
86
- };
87
- LogicalDeleteService.prototype.getListQueryParams = function (listParams) {
88
- 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;
89
- var params = new HttpParams();
90
- params = params.append("size", String(size));
91
- params = params.append("offset", String(page));
92
- if (sort && sort.length) {
93
- params = params.append("orderby", sort
94
- .map(function (s) {
95
- if (s.order === -1) {
96
- return s.field + " desc";
97
- }
98
- return s.field + " asc";
99
- })
100
- .join(", "));
101
- }
102
- if (filterQuery) {
103
- params = params.append("filter", filterQuery);
104
- }
105
- if (displayFields && displayFields.length) {
106
- params = params.append("displayfields", displayFields.join());
107
- }
108
- return params;
109
- };
110
- LogicalDeleteService.prototype.getProcessDetails = function (recordId) {
111
- var filterParams = {
112
- filter: "recordId eq '" + recordId + "'"
113
- };
114
- return this.http.get(this.exclusionProcessUrl, { params: filterParams })
115
- .pipe(this.defaultCatch())
116
- .pipe(map(function (value) {
117
- var _a;
118
- if (!((_a = value.contents) === null || _a === void 0 ? void 0 : _a.length)) {
119
- return null;
120
- }
121
- return value.contents[0];
122
- }));
123
- };
124
- LogicalDeleteService.prototype.listExclusions = function (entityName, params) {
125
- if (params === void 0) { params = {}; }
126
- if (params.filterQuery) {
127
- params.filterQuery += " and lower(entityName) eq lower('" + entityName + "')";
128
- }
129
- else {
130
- params.filterQuery = "lower(entityName) eq lower('" + entityName + "')";
131
- }
132
- return this.http.get(this.exclusionProcessUrl, { params: this.getListQueryParams(params) })
133
- .pipe(this.defaultCatch())
134
- .pipe(map(function (value) {
135
- value.contents.forEach(function (p) {
136
- if (p.startDate) {
137
- p.startDate = moment(p.startDate).toDate();
138
- }
139
- if (p.finishDate) {
140
- p.finishDate = moment(p.finishDate).toDate();
141
- }
142
- });
143
- return value;
144
- }));
145
- };
146
- LogicalDeleteService.ctorParameters = function () { return [
147
- { type: HttpClient },
148
- { type: MessageService },
149
- { type: TranslateService },
150
- { type: LogicalDeleteConfigService }
151
- ]; };
152
- LogicalDeleteService = __decorate([
153
- Injectable()
154
- ], LogicalDeleteService);
155
- return LogicalDeleteService;
156
- }());
157
-
158
- var ExclusionDetailsComponent = /** @class */ (function () {
159
- function ExclusionDetailsComponent(router, route, translate, logicalDeleteService, projectConfigs) {
160
- this.router = router;
161
- this.route = route;
162
- this.translate = translate;
163
- this.logicalDeleteService = logicalDeleteService;
164
- this.projectConfigs = projectConfigs;
165
- this._entityName = "";
166
- this._isVisible = false;
167
- this._isLoading = false;
168
- this._processSummaryData = [];
169
- this._processSummaryColumns = [];
170
- this.ngUnsubscribe = new Subject();
171
- }
172
- Object.defineProperty(ExclusionDetailsComponent.prototype, "isVisible", {
173
- get: function () {
174
- return this._isVisible;
175
- },
176
- enumerable: true,
177
- configurable: true
178
- });
179
- Object.defineProperty(ExclusionDetailsComponent.prototype, "isLoading", {
180
- get: function () {
181
- return this._isLoading;
182
- },
183
- enumerable: true,
184
- configurable: true
185
- });
186
- Object.defineProperty(ExclusionDetailsComponent.prototype, "processSummaryData", {
187
- get: function () {
188
- return this._processSummaryData;
189
- },
190
- enumerable: true,
191
- configurable: true
192
- });
193
- Object.defineProperty(ExclusionDetailsComponent.prototype, "processSummaryColumns", {
194
- get: function () {
195
- return this._processSummaryColumns;
196
- },
197
- enumerable: true,
198
- configurable: true
199
- });
200
- ExclusionDetailsComponent.prototype.ngOnInit = function () {
201
- var _this = this;
202
- this.route.data
203
- .pipe(takeUntil(this.ngUnsubscribe))
204
- .subscribe(function (data) {
205
- _this.locale = data.localeConfig;
206
- });
207
- this._processSummaryColumns = this.getSummaryColumns();
208
- };
209
- ExclusionDetailsComponent.prototype.ngOnDestroy = function () {
210
- this.ngUnsubscribe.next();
211
- this.ngUnsubscribe.complete();
212
- };
213
- ExclusionDetailsComponent.prototype.showDetails = function (details) {
214
- this.processDetails = null;
215
- this._entityName = details.entityName;
216
- this._isVisible = true;
217
- this.entityDescription = details.entityDescription;
218
- this.loadProcessDetails(details.recordId);
219
- };
220
- ExclusionDetailsComponent.prototype.closeDetails = function () {
221
- this._isVisible = false;
222
- };
223
- ExclusionDetailsComponent.prototype.openExclusions = function () {
224
- this.closeDetails();
225
- this.router.navigate(["exclusions-list", this._entityName], {
226
- queryParams: {
227
- entityDescription: this.entityDescription
228
- }
229
- });
230
- };
231
- ExclusionDetailsComponent.prototype.getRecordDescription = function () {
232
- var _a;
233
- if (!((_a = this.processDetails) === null || _a === void 0 ? void 0 : _a.description)) {
234
- return "";
235
- }
236
- return this.processDetails.description;
237
- };
238
- ExclusionDetailsComponent.prototype.getInicialDate = function () {
239
- var _a;
240
- if (!((_a = this.processDetails) === null || _a === void 0 ? void 0 : _a.startDate)) {
241
- return "";
242
- }
243
- return moment(this.processDetails.startDate).format("DD/MM/YYYY HH:mm");
244
- };
245
- ExclusionDetailsComponent.prototype.getFinishDate = function () {
246
- var _a;
247
- if (!((_a = this.processDetails) === null || _a === void 0 ? void 0 : _a.finishDate)) {
248
- return "";
249
- }
250
- return moment(this.processDetails.finishDate).format("DD/MM/YYYY HH:mm");
251
- };
252
- ExclusionDetailsComponent.prototype.isFinished = function () {
253
- var _a;
254
- return !!((_a = this.processDetails) === null || _a === void 0 ? void 0 : _a.finishDate);
255
- };
256
- ExclusionDetailsComponent.prototype.getShowExclusionsButtonLabel = function () {
257
- return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_show_deletions");
258
- };
259
- ExclusionDetailsComponent.prototype.getCloseButtonLabel = function () {
260
- return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_close");
261
- };
262
- ExclusionDetailsComponent.prototype.getSummaryLabel = function () {
263
- return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_summary");
264
- };
265
- ExclusionDetailsComponent.prototype.getStartDateLabel = function () {
266
- return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_start");
267
- };
268
- ExclusionDetailsComponent.prototype.getFinishDateLabel = function () {
269
- return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_finish");
270
- };
271
- ExclusionDetailsComponent.prototype.getSidebarTitle = function () {
272
- return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_details_title");
273
- };
274
- ExclusionDetailsComponent.prototype.getSummaryColumns = function () {
275
- return [
276
- {
277
- field: "description",
278
- attributes: ["description"],
279
- header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_description"),
280
- type: EnumColumnFieldType.STRING,
281
- style: {
282
- width: "300px"
283
- }
284
- },
285
- {
286
- field: "status",
287
- attributes: ["status"],
288
- header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_status"),
289
- type: EnumColumnFieldType.ENUM,
290
- enumPrefix: this.projectConfigs.getTranslationPrefix() + ".logical_delete_enum_exclusion_process_status_",
291
- style: {
292
- width: "100px"
293
- },
294
- tooltip: this.getColumnStatusTooltip,
295
- badgeConfigs: [
296
- {
297
- enumValue: EnumExclusionProcessStatus.ERROR,
298
- color: EnumBadgeColors.RED
299
- },
300
- {
301
- enumValue: EnumExclusionProcessStatus.PENDING,
302
- color: EnumBadgeColors.YELLOW
303
- },
304
- {
305
- enumValue: EnumExclusionProcessStatus.PROCESSING,
306
- color: EnumBadgeColors.BLUE
307
- },
308
- {
309
- enumValue: EnumExclusionProcessStatus.SUCCESS,
310
- color: EnumBadgeColors.GREEN
311
- }
312
- ]
313
- }
314
- ];
315
- };
316
- ExclusionDetailsComponent.prototype.getColumnStatusTooltip = function (rowValue) {
317
- if (rowValue.errorMessage) {
318
- return rowValue.errorMessage;
319
- }
320
- return null;
321
- };
322
- ExclusionDetailsComponent.prototype.loadProcessDetails = function (recordId) {
323
- var _this = this;
324
- this._isLoading = true;
325
- this.logicalDeleteService.getProcessDetails(recordId)
326
- .pipe(takeUntil(this.ngUnsubscribe))
327
- .pipe(finalize(function () { return _this._isLoading = false; }))
328
- .subscribe(function (process) {
329
- _this.processDetails = process;
330
- _this.loadProcessSummary(process);
331
- });
332
- };
333
- ExclusionDetailsComponent.prototype.loadProcessSummary = function (process) {
334
- var stepLogs = [];
335
- process.groups.forEach(function (group) {
336
- var steps = group.steps.map(function (step) { return ({
337
- description: step.description,
338
- status: step.status,
339
- errorMessage: step.errorMessage
340
- }); });
341
- stepLogs.push.apply(stepLogs, __spread(steps));
342
- });
343
- this._processSummaryData = stepLogs;
344
- };
345
- ExclusionDetailsComponent.ctorParameters = function () { return [
346
- { type: Router },
347
- { type: ActivatedRoute },
348
- { type: TranslateService },
349
- { type: LogicalDeleteService },
350
- { type: LogicalDeleteConfigService }
351
- ]; };
352
- __decorate([
353
- Output()
354
- ], ExclusionDetailsComponent.prototype, "isVisible", null);
355
- __decorate([
356
- Output()
357
- ], ExclusionDetailsComponent.prototype, "isLoading", null);
358
- __decorate([
359
- Output()
360
- ], ExclusionDetailsComponent.prototype, "processSummaryData", null);
361
- __decorate([
362
- Output()
363
- ], ExclusionDetailsComponent.prototype, "processSummaryColumns", null);
364
- __decorate([
365
- Output()
366
- ], ExclusionDetailsComponent.prototype, "processDetails", void 0);
367
- __decorate([
368
- Output()
369
- ], ExclusionDetailsComponent.prototype, "entityDescription", void 0);
370
- ExclusionDetailsComponent = __decorate([
371
- Component({
372
- selector: "s-exclusion-details",
373
- 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",
374
- encapsulation: ViewEncapsulation.None,
375
- 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}"]
376
- })
377
- ], ExclusionDetailsComponent);
378
- return ExclusionDetailsComponent;
379
- }());
380
-
381
- var ExclusionDetailsModule = /** @class */ (function () {
382
- function ExclusionDetailsModule() {
383
- }
384
- ExclusionDetailsModule = __decorate([
385
- NgModule({
386
- imports: [
387
- CommonModule,
388
- SidebarModule,
389
- ButtonModule,
390
- PanelModule,
391
- TableModule,
392
- TableModule$1,
393
- LoadingStateModule,
394
- LocaleModule
395
- ],
396
- declarations: [ExclusionDetailsComponent],
397
- exports: [ExclusionDetailsComponent],
398
- entryComponents: [ExclusionDetailsComponent]
399
- })
400
- ], ExclusionDetailsModule);
401
- return ExclusionDetailsModule;
402
- }());
403
-
404
- var FilterService = /** @class */ (function () {
405
- function FilterService(logicalDeleteConfigService, translate) {
406
- this.logicalDeleteConfigService = logicalDeleteConfigService;
407
- this.translate = translate;
408
- this.numberTypes = [FieldType.Integer, FieldType.Double];
409
- }
410
- FilterService.prototype.getEnumQuery = function (name, value, multiple) {
411
- if (multiple === void 0) { multiple = false; }
412
- if (multiple) {
413
- var filter = value.map(function (selected) { return name + " eq '" + selected + "'"; }).join(" or ");
414
- return "(" + filter + ")";
415
- }
416
- return name + " eq '" + value + "'";
417
- };
418
- FilterService.prototype.createFilterString = function (formField, value) {
419
- var name = formField.name, type = formField.type, multiple = formField.multiple;
420
- if (typeof value == "number") {
421
- return name + " eq " + value;
422
- }
423
- switch (type) {
424
- case FieldType.Date:
425
- return name + " eq '" + moment(value).format("YYYY-MM-DD") + "'";
426
- case FieldType.Time:
427
- return name + " eq '" + moment(value).format("HH:mm:ss") + "'";
428
- case FieldType.DateTime:
429
- return name + " eq '" + moment(value).format() + "'";
430
- case FieldType.LocalDateTime:
431
- return name + " eq '" + moment(value).format("YYYY-MM-DD[T]HH:mm:ss.SSS") + "'";
432
- case FieldType.Enum:
433
- return this.getEnumQuery(name, value, multiple);
434
- case FieldType.String:
435
- return "containing(upper(" + name + "), upper('" + value.replace(/'/g, "'") + "'))";
436
- case FieldType.Lookup:
437
- return name + " eq '" + value.id + "'";
438
- default:
439
- return name + " eq '" + value + "'";
440
- }
441
- };
442
- FilterService.prototype.createFilterTokens = function (formField, value) {
443
- var _this = this;
444
- var _a = formField, name = _a.name, type = _a.type, label = _a.label, searchFields = _a.searchFields, options = _a.options;
445
- var labelValue = value;
446
- switch (type) {
447
- case FieldType.Date:
448
- labelValue = moment(value).format("L");
449
- break;
450
- case FieldType.Time:
451
- labelValue = moment(value).format("LTS");
452
- break;
453
- case FieldType.LocalDateTime:
454
- case FieldType.DateTime:
455
- labelValue = moment(value).format("L LTS");
456
- break;
457
- case FieldType.Lookup:
458
- labelValue = searchFields.map(function (field) { return _this.getProp(value, field.name); }).join(" - ");
459
- break;
460
- case FieldType.Enum:
461
- if (Array.isArray(value)) {
462
- labelValue = value.map(function (element) {
463
- return options.filter(function (en) { return en.value === element; })[0].label;
464
- });
465
- }
466
- else {
467
- labelValue = options.filter(function (option) { return option.value === labelValue; })[0].label;
468
- }
469
- break;
470
- case FieldType.Boolean:
471
- labelValue = value
472
- ? this.translate.instant(this.logicalDeleteConfigService.getTranslationPrefix() + ".list_grid_boolean_true")
473
- : this.translate.instant(this.logicalDeleteConfigService.getTranslationPrefix() + ".list_grid_boolean_false");
474
- break;
475
- }
476
- return { id: name, label: label + ": " + labelValue };
477
- };
478
- FilterService.prototype.getSuggestionValue = function (displayFields, ownerEntity, value, separator) {
479
- var _this = this;
480
- return displayFields.map(function (field) { return _this.getProp(value, ownerEntity + "." + field); })
481
- .reduce(function (acc, val) { return "" + acc + separator + val; }) + "";
482
- };
483
- FilterService.prototype.getProp = function (obj, path) {
484
- return path.split(".").reduce(function (result, prop) { return (result[prop] === undefined ? "" : result[prop]); }, obj);
485
- };
486
- FilterService.prototype.getLabelValueRequest = function (contents, displayFields) {
487
- var _this = this;
488
- return contents.map(function (item) { return (__assign(__assign({}, item), { label: displayFields.map(function (field) { return _this.getProp(item, field); }).join(" - ") })); });
489
- };
490
- FilterService.prototype.isValidFilter = function (type, value) {
491
- var isTypeNumber = this.numberTypes.includes(type);
492
- var numberPattern = /^\d+\b$/;
493
- var isNumber = value.match(numberPattern);
494
- return !(isTypeNumber && !isNumber);
495
- };
496
- FilterService.ctorParameters = function () { return [
497
- { type: LogicalDeleteConfigService },
498
- { type: TranslateService }
499
- ]; };
500
- FilterService = __decorate([
501
- Injectable()
502
- ], FilterService);
503
- return FilterService;
504
- }());
505
-
506
- var ExclusionsListComponent = /** @class */ (function () {
507
- function ExclusionsListComponent(route, translate, formBuilder, changeDetectorRef, logicalDeleteService, filterService, projectConfigs) {
508
- this.route = route;
509
- this.translate = translate;
510
- this.formBuilder = formBuilder;
511
- this.changeDetectorRef = changeDetectorRef;
512
- this.logicalDeleteService = logicalDeleteService;
513
- this.filterService = filterService;
514
- this.projectConfigs = projectConfigs;
515
- this.currentListParams = { page: 0, size: 10, sort: [], filterData: {} };
516
- this.showLoader = false;
517
- this.totalRecords = 0;
518
- this.filtersPanelCollapsed = true;
519
- this.searchTokens = [];
520
- this.serverError = false;
521
- this.ngUnsubscribe = new Subject();
522
- }
523
- ExclusionsListComponent.prototype.ngOnInit = function () {
524
- var _this = this;
525
- this.filterFormGroup = this.getFormBuilder();
526
- this.filterFields = this.getFilterFields();
527
- this.gridColumns = this.getGridColumns();
528
- this.route.data
529
- .pipe(takeUntil(this.ngUnsubscribe))
530
- .subscribe(function (data) {
531
- _this.locale = data.localeConfig;
532
- });
533
- this.route.params
534
- .pipe(takeUntil(this.ngUnsubscribe))
535
- .subscribe(function (params) {
536
- _this.entityName = params.entityName;
537
- });
538
- this.route.queryParams
539
- .pipe(takeUntil(this.ngUnsubscribe))
540
- .subscribe(function (queryParams) {
541
- _this.entityDescription = queryParams.entityDescription;
542
- });
543
- };
544
- ExclusionsListComponent.prototype.ngOnDestroy = function () {
545
- this.ngUnsubscribe.next();
546
- this.ngUnsubscribe.complete();
547
- };
548
- ExclusionsListComponent.prototype.getFormBuilder = function () {
549
- return this.formBuilder.group({
550
- description: [undefined, Validators.compose([])],
551
- state: [undefined, Validators.compose([])],
552
- startDate: [{ value: undefined, disabled: false }, Validators.compose([])],
553
- endDate: [{ value: undefined, disabled: false }, Validators.compose([])]
554
- });
555
- };
556
- ExclusionsListComponent.prototype.getGridColumns = function () {
557
- return [
558
- {
559
- field: "description",
560
- attributes: ['description'],
561
- header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_description"),
562
- type: EnumColumnFieldType.STRING,
563
- style: {
564
- width: '300px'
565
- }
566
- },
567
- {
568
- field: "status",
569
- attributes: ['status'],
570
- header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_status"),
571
- type: EnumColumnFieldType.ENUM,
572
- enumPrefix: this.projectConfigs.getTranslationPrefix() + ".logical_delete_enum_exclusion_process_status_",
573
- style: {
574
- width: '100px'
575
- },
576
- badgeConfigs: [
577
- {
578
- enumValue: EnumExclusionProcessStatus.ERROR,
579
- color: EnumBadgeColors.RED
580
- },
581
- {
582
- enumValue: EnumExclusionProcessStatus.PENDING,
583
- color: EnumBadgeColors.YELLOW
584
- },
585
- {
586
- enumValue: EnumExclusionProcessStatus.PROCESSING,
587
- color: EnumBadgeColors.BLUE
588
- },
589
- {
590
- enumValue: EnumExclusionProcessStatus.SUCCESS,
591
- color: EnumBadgeColors.GREEN
592
- }
593
- ]
594
- },
595
- {
596
- field: "startDate",
597
- attributes: ['startDate'],
598
- header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_start"),
599
- type: EnumColumnFieldType.DATE,
600
- dateFormat: "DD/MM/YYYY HH:mm",
601
- style: {
602
- width: '100px'
603
- }
604
- },
605
- {
606
- field: "finishDate",
607
- attributes: ['finishDate'],
608
- header: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_finish"),
609
- type: EnumColumnFieldType.DATE,
610
- dateFormat: "DD/MM/YYYY HH:mm",
611
- style: {
612
- width: '100px'
613
- }
614
- }
615
- ];
616
- };
617
- ExclusionsListComponent.prototype.getFilterFields = function () {
618
- return [
619
- new FormField({
620
- type: FieldType.String,
621
- name: "description",
622
- label: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_description")
623
- }),
624
- new FormField({
625
- type: FieldType.Enum,
626
- name: "state",
627
- label: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_status"),
628
- placeholder: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_status"),
629
- multiple: true,
630
- options: [
631
- {
632
- label: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_enum_exclusion_process_status_error"),
633
- value: EnumExclusionProcessStatus.ERROR
634
- },
635
- {
636
- label: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_enum_exclusion_process_status_pending"),
637
- value: EnumExclusionProcessStatus.PENDING
638
- },
639
- {
640
- label: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_enum_exclusion_process_status_processing"),
641
- value: EnumExclusionProcessStatus.PROCESSING
642
- },
643
- {
644
- label: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_enum_exclusion_process_status_success"),
645
- value: EnumExclusionProcessStatus.SUCCESS
646
- }
647
- ]
648
- }),
649
- new FormField({
650
- type: FieldType.Date,
651
- name: "startDate",
652
- label: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_start")
653
- }),
654
- new FormField({
655
- type: FieldType.Date,
656
- name: "endDate",
657
- label: this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_finish")
658
- })
659
- ];
660
- };
661
- ExclusionsListComponent.prototype.getEmptyStateTitle = function () {
662
- return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_empty_state_title");
663
- };
664
- ExclusionsListComponent.prototype.getEmptyStateDescription = function () {
665
- return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_empty_state_description");
666
- };
667
- ExclusionsListComponent.prototype.getTitle = function () {
668
- return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_list_title");
669
- };
670
- ExclusionsListComponent.prototype.getDetailsButtonTitle = function () {
671
- return this.translate.instant(this.projectConfigs.getTranslationPrefix() + ".logical_delete_details");
672
- };
673
- ExclusionsListComponent.prototype.onSearch = function () {
674
- var filterData = this.filterFormGroup.getRawValue();
675
- this.filtersPanelCollapsed = true;
676
- this.resetGrid({ filterData: filterData });
677
- };
678
- ExclusionsListComponent.prototype.onClear = function () {
679
- this.filterFormGroup.reset();
680
- var filterData = this.filterFormGroup.getRawValue();
681
- this.resetGrid({ filterData: filterData });
682
- };
683
- ExclusionsListComponent.prototype.onRemoveToken = function (token) {
684
- this.filterFormGroup.get(token.id).setValue(undefined);
685
- var filterData = this.filterFormGroup.getRawValue();
686
- this.resetGrid({ filterData: filterData });
687
- };
688
- ExclusionsListComponent.prototype.onGridChange = function (event) {
689
- var size = event.rows;
690
- var page = event.first / size;
691
- var sort = event.multiSortMeta ? event.multiSortMeta : [];
692
- return this.updateGrid({ page: page, size: size, sort: sort });
693
- };
694
- ExclusionsListComponent.prototype.getFilterTokens = function () {
695
- var _this = this;
696
- var filterData = this.filterFormGroup.value;
697
- return this.filterFields
698
- .filter(function (_a) {
699
- var name = _a.name;
700
- return filterData[name] != undefined && filterData[name] !== "";
701
- })
702
- .map(function (formField) { return _this.filterService.createFilterTokens(formField, filterData[formField.name]); });
703
- };
704
- ExclusionsListComponent.prototype.getFilterQuery = function () {
705
- var _this = this;
706
- var filterData = this.currentListParams.filterData;
707
- var dateFields = ['startDate', 'endDate'];
708
- var filterQuery = this.filterFields
709
- .filter(function (_a) {
710
- var name = _a.name;
711
- return !dateFields.includes(name);
712
- })
713
- .filter(function (_a) {
714
- var name = _a.name;
715
- return filterData[name] != undefined;
716
- })
717
- .map(function (formField) { return _this.filterService.createFilterString(formField, filterData[formField.name]); })
718
- .join(" and ");
719
- if (filterData.startDate && filterData.endDate) {
720
- var startDate = moment(filterData.startDate).format('YYYY-MM-DD');
721
- var endDate = moment(filterData.endDate).format('YYYY-MM-DD');
722
- var dateQuery = "startDate between '" + startDate + "' and '" + endDate + "'";
723
- if (filterQuery) {
724
- filterQuery += " and " + dateQuery;
725
- }
726
- else {
727
- filterQuery = dateQuery;
728
- }
729
- }
730
- return filterQuery;
731
- };
732
- ExclusionsListComponent.prototype.updateGrid = function (listParams) {
733
- if (listParams === void 0) { listParams = {}; }
734
- this.currentListParams = __assign(__assign({}, this.currentListParams), listParams);
735
- var _a = this.currentListParams, page = _a.page, size = _a.size, sort = _a.sort;
736
- this.searchTokens = this.getFilterTokens();
737
- var filterQuery = this.getFilterQuery();
738
- var displayFields = __spread([
739
- 'recordId'
740
- ], this.gridColumns.map(function (column) { return column.field; }));
741
- this.listExclusions({ page: page, size: size, sort: sort, filterQuery: filterQuery, displayFields: displayFields });
742
- };
743
- ExclusionsListComponent.prototype.listExclusions = function (params) {
744
- var _this = this;
745
- this.showLoader = true;
746
- this.serverError = false;
747
- this.changeDetectorRef.detectChanges();
748
- this.logicalDeleteService
749
- .listExclusions(this.entityName, params)
750
- .pipe(takeUntil(this.ngUnsubscribe), catchError(function (err) {
751
- if (err.status >= 500 && err.status < 600) {
752
- _this.serverError = true;
753
- }
754
- throw err;
755
- }), finalize(function () { return _this.showLoader = false; }))
756
- .subscribe(function (list) {
757
- _this.gridData = list.contents;
758
- _this.totalRecords = list.totalElements;
759
- });
760
- };
761
- ExclusionsListComponent.prototype.focusInput = function (elementId) {
762
- var element = document.getElementById("" + elementId);
763
- if (element) {
764
- element.focus();
765
- }
766
- };
767
- ExclusionsListComponent.prototype.resetGrid = function (listParams) {
768
- if (listParams)
769
- this.currentListParams = __assign(__assign({}, this.currentListParams), listParams);
770
- this.currentListParams = __assign(__assign({}, this.currentListParams), { page: 0, sort: [] });
771
- this.table.reset();
772
- };
773
- ExclusionsListComponent.prototype.onClickDetails = function (rowData) {
774
- this.exclusionDetailsComponent.showDetails({
775
- recordId: rowData.recordId,
776
- entityDescription: this.entityDescription,
777
- entityName: this.entityName
778
- });
779
- };
780
- ExclusionsListComponent.ctorParameters = function () { return [
781
- { type: ActivatedRoute },
782
- { type: TranslateService },
783
- { type: FormBuilder },
784
- { type: ChangeDetectorRef },
785
- { type: LogicalDeleteService },
786
- { type: FilterService },
787
- { type: LogicalDeleteConfigService }
788
- ]; };
789
- __decorate([
790
- ViewChild("exclusionsTable")
791
- ], ExclusionsListComponent.prototype, "table", void 0);
792
- __decorate([
793
- ViewChild(ExclusionDetailsComponent)
794
- ], ExclusionsListComponent.prototype, "exclusionDetailsComponent", void 0);
795
- ExclusionsListComponent = __decorate([
796
- Component({
797
- 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>",
798
- providers: []
799
- })
800
- ], ExclusionsListComponent);
801
- return ExclusionsListComponent;
802
- }());
803
-
804
- var ExclusionsListFeatureRoutingGuard = /** @class */ (function () {
805
- function ExclusionsListFeatureRoutingGuard() {
806
- }
807
- ExclusionsListFeatureRoutingGuard.prototype.canActivate = function () {
808
- return true;
809
- };
810
- ExclusionsListFeatureRoutingGuard = __decorate([
811
- Injectable()
812
- ], ExclusionsListFeatureRoutingGuard);
813
- return ExclusionsListFeatureRoutingGuard;
814
- }());
815
- var ExclusionsListFeatureRoutingListTitleResolver = /** @class */ (function () {
816
- function ExclusionsListFeatureRoutingListTitleResolver(translate, projectConfigs) {
817
- this.translate = translate;
818
- this.projectConfigs = projectConfigs;
819
- }
820
- ExclusionsListFeatureRoutingListTitleResolver.prototype.resolve = function () {
821
- return this.translate.get(this.projectConfigs.getTranslationPrefix() + ".logical_delete_list_title");
822
- };
823
- ExclusionsListFeatureRoutingListTitleResolver.ctorParameters = function () { return [
824
- { type: TranslateService },
825
- { type: LogicalDeleteConfigService }
826
- ]; };
827
- ExclusionsListFeatureRoutingListTitleResolver = __decorate([
828
- Injectable()
829
- ], ExclusionsListFeatureRoutingListTitleResolver);
830
- return ExclusionsListFeatureRoutingListTitleResolver;
831
- }());
832
- var ExclusionsListFeatureRoutingPermissionResolver = /** @class */ (function () {
833
- function ExclusionsListFeatureRoutingPermissionResolver(permissionsService) {
834
- this.permissionsService = permissionsService;
835
- }
836
- ExclusionsListFeatureRoutingPermissionResolver.prototype.resolve = function () {
837
- return this.permissionsService.get();
838
- };
839
- ExclusionsListFeatureRoutingPermissionResolver.ctorParameters = function () { return [
840
- { type: PermissionsService }
841
- ]; };
842
- ExclusionsListFeatureRoutingPermissionResolver = __decorate([
843
- Injectable()
844
- ], ExclusionsListFeatureRoutingPermissionResolver);
845
- return ExclusionsListFeatureRoutingPermissionResolver;
846
- }());
847
- var ExclusionsListFeatureRoutingLocaleResolver = /** @class */ (function () {
848
- function ExclusionsListFeatureRoutingLocaleResolver(localeService) {
849
- this.localeService = localeService;
850
- }
851
- ExclusionsListFeatureRoutingLocaleResolver.prototype.resolve = function () {
852
- return this.localeService.get();
853
- };
854
- ExclusionsListFeatureRoutingLocaleResolver.ctorParameters = function () { return [
855
- { type: LocaleService }
856
- ]; };
857
- ExclusionsListFeatureRoutingLocaleResolver = __decorate([
858
- Injectable()
859
- ], ExclusionsListFeatureRoutingLocaleResolver);
860
- return ExclusionsListFeatureRoutingLocaleResolver;
861
- }());
862
- var EmptyComponent = /** @class */ (function () {
863
- function EmptyComponent() {
864
- }
865
- EmptyComponent = __decorate([
866
- Component({
867
- template: "<router-outlet></router-outlet>"
868
- })
869
- ], EmptyComponent);
870
- return EmptyComponent;
871
- }());
872
- var routes = [
873
- {
874
- path: "exclusions-list",
875
- component: EmptyComponent,
876
- canActivate: [
877
- ExclusionsListFeatureRoutingGuard
878
- ],
879
- resolve: {
880
- allPermissions: ExclusionsListFeatureRoutingPermissionResolver,
881
- localeConfig: ExclusionsListFeatureRoutingLocaleResolver,
882
- routeTitle: ExclusionsListFeatureRoutingListTitleResolver
883
- },
884
- children: [
885
- {
886
- path: ":entityName",
887
- component: ExclusionsListComponent
888
- }
889
- ]
890
- }
891
- ];
892
- var ExclusionsListFeatureRouting = /** @class */ (function () {
893
- function ExclusionsListFeatureRouting() {
894
- }
895
- ExclusionsListFeatureRouting = __decorate([
896
- NgModule({
897
- imports: [
898
- RouterModule.forChild(routes)
899
- ],
900
- exports: [
901
- RouterModule
902
- ],
903
- providers: [
904
- ExclusionsListFeatureRoutingGuard,
905
- ExclusionsListFeatureRoutingPermissionResolver,
906
- ExclusionsListFeatureRoutingLocaleResolver,
907
- ExclusionsListFeatureRoutingListTitleResolver
908
- ],
909
- declarations: [
910
- EmptyComponent
911
- ]
912
- })
913
- ], ExclusionsListFeatureRouting);
914
- return ExclusionsListFeatureRouting;
915
- }());
916
-
917
- var ExclusionsListModule = /** @class */ (function () {
918
- function ExclusionsListModule() {
919
- }
920
- ExclusionsListModule = __decorate([
921
- NgModule({
922
- imports: [
923
- FormsModule,
924
- ReactiveFormsModule,
925
- TranslateModule,
926
- CommonModule,
927
- ControlErrorsModule,
928
- ButtonModule,
929
- PanelModule,
930
- InputTextModule,
931
- InfoSignModule,
932
- ConfirmDialogModule,
933
- DialogModule,
934
- TableModule,
935
- TableModule$1,
936
- LoadingStateModule,
937
- EmptyStateModule,
938
- DynamicFormModule,
939
- TokenListModule,
940
- LocaleModule.forChild(),
941
- ExclusionDetailsModule,
942
- ExclusionsListFeatureRouting
943
- ],
944
- declarations: [ExclusionsListComponent],
945
- exports: [ExclusionsListComponent],
946
- entryComponents: [ExclusionsListComponent]
947
- })
948
- ], ExclusionsListModule);
949
- return ExclusionsListModule;
950
- }());
951
-
952
- var LogicalDeleteModule = /** @class */ (function () {
953
- function LogicalDeleteModule() {
954
- }
955
- LogicalDeleteModule_1 = LogicalDeleteModule;
956
- LogicalDeleteModule.forRoot = function (config) {
957
- return {
958
- ngModule: LogicalDeleteModule_1,
959
- providers: [
960
- {
961
- provide: ProjectConfigsInjectionToken,
962
- useValue: config
963
- }
964
- ]
965
- };
966
- };
967
- var LogicalDeleteModule_1;
968
- LogicalDeleteModule = LogicalDeleteModule_1 = __decorate([
969
- NgModule({
970
- providers: [LogicalDeleteService, LogicalDeleteConfigService, FilterService]
971
- })
972
- ], LogicalDeleteModule);
973
- return LogicalDeleteModule;
974
- }());
975
-
976
- /**
977
- * Generated bundle index. Do not edit.
978
- */
979
-
980
- 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 };
981
- //# sourceMappingURL=seniorsistemas-exclusion-process-component.js.map