@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
@@ -0,0 +1,171 @@
1
+ import { ChangeDetectorRef, Component, ViewChild } from "@angular/core";
2
+ import { ComponentFixture, TestBed } from "@angular/core/testing";
3
+ import { RouterTestingModule } from "@angular/router/testing";
4
+ import { FormBuilder } from "@angular/forms";
5
+ import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
6
+ import { ActivatedRoute, RouterModule } from "@angular/router";
7
+ import { TranslateModule, TranslateService } from "@ngx-translate/core";
8
+ import {
9
+ AngularComponentsModule,
10
+ ButtonModule
11
+ } from "@seniorsistemas/angular-components";
12
+ import { By } from "@angular/platform-browser";
13
+ import { MessageService } from "primeng/api";
14
+ import { HttpClientTestingModule } from "@angular/common/http/testing";
15
+ import { ExclusionDetailsComponent, ExclusionDetailsModule } from ".";
16
+ import { FilterService } from "../services/filter.service";
17
+ import { LogicalDeleteConfigService } from "../services/logical-delete-config.service";
18
+ import { ProjectConfigs, ProjectConfigsInjectionToken } from "../models/project-config";
19
+ import { LogicalDeleteService } from "../services";
20
+ import { Observable } from "rxjs";
21
+
22
+ @Component({
23
+ template: `
24
+ <div>
25
+ <button id="test-button" (click)="showDetails()">open</button>
26
+ </div>
27
+ <s-exclusion-details></s-exclusion-details>
28
+ `
29
+ })
30
+ class TestComponent {
31
+ @ViewChild(ExclusionDetailsComponent)
32
+ public exclusionDetailsComponent: ExclusionDetailsComponent;
33
+
34
+ public showDetails() {
35
+ this.exclusionDetailsComponent.showDetails({
36
+ recordId: "valid record id",
37
+ entityDescription: "valid entity description",
38
+ entityName: "valid entity name"
39
+ });
40
+ }
41
+ }
42
+
43
+ describe("ExclusionsDetailsComponent", () => {
44
+ let fixture: ComponentFixture<TestComponent> = null;
45
+ let component: TestComponent = null;
46
+
47
+ let fakeActivatedRoute: any = {};
48
+ let logicalDeleteService: LogicalDeleteService;
49
+
50
+ const defaultProjectConfigs: ProjectConfigs = {
51
+ domain: "domain",
52
+ service: "service"
53
+ };
54
+
55
+ beforeEach(async () => {
56
+ fakeActivatedRoute = {
57
+ data: new Observable(subscriber => {
58
+ subscriber.next({
59
+ localeConfig: {
60
+ calendar: {},
61
+ number: {
62
+ scale: 1,
63
+ decimalSeparator: ","
64
+ }
65
+ }
66
+ });
67
+ subscriber.complete();
68
+ })
69
+ };
70
+
71
+ await TestBed.configureTestingModule({
72
+ imports: [
73
+ AngularComponentsModule.forRoot({
74
+ domain: "domain",
75
+ service: "service"
76
+ }),
77
+ ButtonModule,
78
+ TranslateModule.forRoot(),
79
+ RouterModule,
80
+ RouterTestingModule,
81
+ HttpClientTestingModule,
82
+ ExclusionDetailsModule,
83
+ BrowserAnimationsModule
84
+ ],
85
+ providers: [
86
+ TranslateService,
87
+ MessageService,
88
+ FormBuilder,
89
+ ChangeDetectorRef,
90
+ FilterService,
91
+ LogicalDeleteConfigService,
92
+ LogicalDeleteService,
93
+ {
94
+ provide: ActivatedRoute,
95
+ useValue: fakeActivatedRoute
96
+ },
97
+ {
98
+ provide: ProjectConfigsInjectionToken,
99
+ useValue: defaultProjectConfigs
100
+ }
101
+ ],
102
+ declarations: [TestComponent]
103
+ }).compileComponents();
104
+
105
+ logicalDeleteService = TestBed.inject(LogicalDeleteService);
106
+
107
+ fixture = TestBed.createComponent(TestComponent);
108
+ component = fixture.componentInstance;
109
+ fixture.detectChanges();
110
+ });
111
+
112
+ const openSidebar = () => {
113
+ const testButton = fixture.nativeElement.querySelector("#test-button");
114
+ testButton.dispatchEvent(new Event("click"));
115
+ fixture.detectChanges();
116
+ };
117
+
118
+ const getExclusionDetailsInstance = () => {
119
+ return fixture.debugElement
120
+ .query(By.directive(ExclusionDetailsComponent))
121
+ .injector.get(ExclusionDetailsComponent);
122
+ };
123
+
124
+ describe("Component constructor", () => {
125
+ it("should create component", () => {
126
+ expect(component).toBeTruthy();
127
+ });
128
+
129
+ it("should initialize as hidden", () => {
130
+ const sidebar = fixture.nativeElement.querySelector("s-sidebar");
131
+ const isVisible = sidebar.getAttribute("ng-reflect-visible");
132
+ expect(isVisible).toBe("false");
133
+ });
134
+
135
+ it("should open by calling showDetails", () => {
136
+ openSidebar();
137
+ const sidebar = fixture.nativeElement.querySelector("s-sidebar");
138
+ const isVisible = sidebar.getAttribute("ng-reflect-visible");
139
+ expect(isVisible).toBe("true");
140
+ });
141
+
142
+ it("should read locale from route data", () => {
143
+ fakeActivatedRoute.data = new Observable(subscriber => {
144
+ subscriber.next({
145
+ localeConfig: {
146
+ calendar: {},
147
+ number: {
148
+ scale: 1,
149
+ decimalSeparator: ","
150
+ }
151
+ }
152
+ });
153
+ subscriber.complete();
154
+ });
155
+
156
+ fixture.detectChanges(false);
157
+ const cmp = getExclusionDetailsInstance();
158
+ expect(cmp.locale.number.scale).toBe(1);
159
+ expect(cmp.locale.number.decimalSeparator).toBe(",");
160
+ });
161
+ });
162
+
163
+ describe("open sidebar", () => {
164
+ it("should open by calling showDetails", () => {
165
+ const getProcessDetailsSpy = spyOn(logicalDeleteService, "getProcessDetails");
166
+ openSidebar();
167
+
168
+ expect(getProcessDetailsSpy).toHaveBeenCalledWith("valid record id");
169
+ });
170
+ });
171
+ });
@@ -0,0 +1,235 @@
1
+ import * as moment from "moment";
2
+ import { Component, Output, ViewEncapsulation, OnInit, OnDestroy } from "@angular/core";
3
+ import { ActivatedRoute, Router } from "@angular/router";
4
+ import { EnumBadgeColors, EnumColumnFieldType, TableColumnLocaleOptions } from "@seniorsistemas/angular-components";
5
+ import { Subject } from "rxjs";
6
+ import { finalize, takeUntil } from "rxjs/operators";
7
+ import { EnumExclusionProcessStatus } from "../enums/enum-exclusion-process-status";
8
+ import { ExclusionDetails } from "./protocols/exclusion-details";
9
+ import { LogicalDeleteService } from "../services/logical-delete.service";
10
+ import { ExclusionProcess } from "../models/index";
11
+ import { TranslateService } from "@ngx-translate/core";
12
+ import { LogicalDeleteConfigService } from "../services/logical-delete-config.service";
13
+ import { ShowDetailsInformation } from "./protocols";
14
+
15
+ @Component({
16
+ selector: "s-exclusion-details",
17
+ templateUrl: "./exclusion-details.component.html",
18
+ styleUrls: ["./exclusion-details.component.scss"],
19
+ encapsulation: ViewEncapsulation.None
20
+ })
21
+ export class ExclusionDetailsComponent implements OnInit, OnDestroy {
22
+ public locale!: TableColumnLocaleOptions;
23
+
24
+ @Output()
25
+ get isVisible(): boolean {
26
+ return this._isVisible;
27
+ }
28
+
29
+ @Output()
30
+ get isLoading(): boolean {
31
+ return this._isLoading;
32
+ }
33
+
34
+ @Output()
35
+ get processSummaryData(): ExclusionDetails[] {
36
+ return this._processSummaryData;
37
+ }
38
+
39
+ @Output()
40
+ get processSummaryColumns(): any[] {
41
+ return this._processSummaryColumns;
42
+ }
43
+
44
+ @Output()
45
+ public processDetails: ExclusionProcess;
46
+
47
+ @Output()
48
+ public entityDescription: string;
49
+
50
+ private _entityName = "";
51
+ private _isVisible = false;
52
+ private _isLoading = false;
53
+ private _processSummaryData: ExclusionDetails[] = [];
54
+ private _processSummaryColumns: any[] = [];
55
+ private readonly ngUnsubscribe = new Subject();
56
+
57
+ constructor(
58
+ private readonly router: Router,
59
+ private readonly route: ActivatedRoute,
60
+ private readonly translate: TranslateService,
61
+ private readonly logicalDeleteService: LogicalDeleteService,
62
+ private readonly projectConfigs: LogicalDeleteConfigService
63
+ ) {
64
+ }
65
+
66
+ ngOnInit(): void {
67
+ this.route.data
68
+ .pipe(takeUntil(this.ngUnsubscribe))
69
+ .subscribe((data: { [configs: string]: any, localeConfig: TableColumnLocaleOptions }) => {
70
+ this.locale = data.localeConfig;
71
+ });
72
+ this._processSummaryColumns = this.getSummaryColumns();
73
+ }
74
+
75
+ public ngOnDestroy() {
76
+ this.ngUnsubscribe.next();
77
+ this.ngUnsubscribe.complete();
78
+ }
79
+
80
+ public showDetails(details: ShowDetailsInformation) {
81
+ this.processDetails = null;
82
+ this._entityName = details.entityName;
83
+ this._isVisible = true;
84
+ this.entityDescription = details.entityDescription;
85
+
86
+ this.loadProcessDetails(details.recordId);
87
+ }
88
+
89
+ public closeDetails() {
90
+ this._isVisible = false;
91
+ }
92
+
93
+ public openExclusions() {
94
+ this.closeDetails();
95
+ this.router.navigate(
96
+ ["exclusions-list", this._entityName],
97
+ {
98
+ queryParams: {
99
+ entityDescription: this.entityDescription
100
+ }
101
+ }
102
+ );
103
+ }
104
+
105
+ public getRecordDescription() {
106
+ if (!this.processDetails?.description) {
107
+ return "";
108
+ }
109
+
110
+ return this.processDetails.description;
111
+ }
112
+
113
+ public getInicialDate() {
114
+ if (!this.processDetails?.startDate) {
115
+ return "";
116
+ }
117
+
118
+ return moment(this.processDetails.startDate).format("DD/MM/YYYY HH:mm");
119
+ }
120
+
121
+ public getFinishDate() {
122
+ if (!this.processDetails?.finishDate) {
123
+ return "";
124
+ }
125
+
126
+ return moment(this.processDetails.finishDate).format("DD/MM/YYYY HH:mm");
127
+ }
128
+
129
+ public isFinished() {
130
+ return !!this.processDetails?.finishDate;
131
+ }
132
+
133
+ public getShowExclusionsButtonLabel() {
134
+ return this.translate.instant(`${this.projectConfigs.getTranslationPrefix()}.logical_delete_show_deletions`);
135
+ }
136
+
137
+ public getCloseButtonLabel() {
138
+ return this.translate.instant(`${this.projectConfigs.getTranslationPrefix()}.logical_delete_close`);
139
+ }
140
+
141
+ public getSummaryLabel() {
142
+ return this.translate.instant(`${this.projectConfigs.getTranslationPrefix()}.logical_delete_summary`);
143
+ }
144
+
145
+ public getStartDateLabel() {
146
+ return this.translate.instant(`${this.projectConfigs.getTranslationPrefix()}.logical_delete_start`);
147
+ }
148
+
149
+ public getFinishDateLabel() {
150
+ return this.translate.instant(`${this.projectConfigs.getTranslationPrefix()}.logical_delete_finish`);
151
+ }
152
+
153
+ public getSidebarTitle() {
154
+ return this.translate.instant(`${this.projectConfigs.getTranslationPrefix()}.logical_delete_details_title`);
155
+ }
156
+
157
+ private getSummaryColumns() {
158
+ return [
159
+ {
160
+ field: "description",
161
+ attributes: ["description"],
162
+ header: this.translate.instant(`${this.projectConfigs.getTranslationPrefix()}.logical_delete_description`),
163
+ type: EnumColumnFieldType.STRING,
164
+ style: {
165
+ width: "300px"
166
+ }
167
+ },
168
+ {
169
+ field: "status",
170
+ attributes: ["status"],
171
+ header: this.translate.instant(`${this.projectConfigs.getTranslationPrefix()}.logical_delete_status`),
172
+ type: EnumColumnFieldType.ENUM,
173
+ enumPrefix: `${this.projectConfigs.getTranslationPrefix()}.logical_delete_enum_exclusion_process_status_`,
174
+ style: {
175
+ width: "100px"
176
+ },
177
+ tooltip: this.getColumnStatusTooltip,
178
+ badgeConfigs: [
179
+ {
180
+ enumValue: EnumExclusionProcessStatus.ERROR,
181
+ color: EnumBadgeColors.RED
182
+ },
183
+ {
184
+ enumValue: EnumExclusionProcessStatus.PENDING,
185
+ color: EnumBadgeColors.YELLOW
186
+ },
187
+ {
188
+ enumValue: EnumExclusionProcessStatus.PROCESSING,
189
+ color: EnumBadgeColors.BLUE
190
+ },
191
+ {
192
+ enumValue: EnumExclusionProcessStatus.SUCCESS,
193
+ color: EnumBadgeColors.GREEN
194
+ }
195
+ ]
196
+ }
197
+ ];
198
+ }
199
+
200
+ private getColumnStatusTooltip(rowValue: ExclusionDetails) {
201
+ if (rowValue.errorMessage) {
202
+ return rowValue.errorMessage;
203
+ }
204
+
205
+ return null;
206
+ }
207
+
208
+ private loadProcessDetails(recordId: string) {
209
+ this._isLoading = true;
210
+
211
+ this.logicalDeleteService.getProcessDetails(recordId)
212
+ .pipe(takeUntil(this.ngUnsubscribe))
213
+ .pipe(finalize(() => this._isLoading = false))
214
+ .subscribe((process: ExclusionProcess) => {
215
+ this.processDetails = process;
216
+ this.loadProcessSummary(process);
217
+ });
218
+ }
219
+
220
+ private loadProcessSummary(process: ExclusionProcess) {
221
+ const stepLogs: ExclusionDetails[] = [];
222
+
223
+ process.groups.forEach(group => {
224
+ const steps = group.steps.map(step => ({
225
+ description: step.description,
226
+ status: step.status,
227
+ errorMessage: step.errorMessage
228
+ } as ExclusionDetails));
229
+
230
+ stepLogs.push(...steps);
231
+ });
232
+
233
+ this._processSummaryData = stepLogs;
234
+ }
235
+ }
@@ -0,0 +1,23 @@
1
+ import { CommonModule } from "@angular/common";
2
+ import { NgModule } from "@angular/core";
3
+ import { PanelModule } from "primeng/panel";
4
+ import { TableModule as PrimeTableModule } from "primeng/table";
5
+ import { ButtonModule, LoadingStateModule, TableModule, SidebarModule, LocaleModule } from "@seniorsistemas/angular-components";
6
+ import { ExclusionDetailsComponent } from "./exclusion-details.component";
7
+
8
+ @NgModule({
9
+ imports: [
10
+ CommonModule,
11
+ SidebarModule,
12
+ ButtonModule,
13
+ PanelModule,
14
+ PrimeTableModule,
15
+ TableModule,
16
+ LoadingStateModule,
17
+ LocaleModule
18
+ ],
19
+ declarations: [ExclusionDetailsComponent],
20
+ exports: [ExclusionDetailsComponent],
21
+ entryComponents: [ExclusionDetailsComponent]
22
+ })
23
+ export class ExclusionDetailsModule {}
@@ -1,4 +1,5 @@
1
1
  import { EnumExclusionProcessStatus } from "../../enums/enum-exclusion-process-status";
2
+
2
3
  export interface ExclusionDetails {
3
4
  description: string;
4
5
  status: EnumExclusionProcessStatus;
@@ -1,4 +1,4 @@
1
- export declare class ShowDetailsInformation {
1
+ export class ShowDetailsInformation {
2
2
  recordId: string;
3
3
  entityName: string;
4
4
  entityDescription: string;
@@ -0,0 +1,157 @@
1
+ <div>
2
+ <form [formGroup]="filterFormGroup" autocomplete="off">
3
+ <p-panel
4
+ *sLoadingState="showLoader"
5
+ styleClass="form-group"
6
+ [toggleable]="true"
7
+ [(collapsed)]="filtersPanelCollapsed"
8
+ (onAfterToggle)="focusInput('description')"
9
+ >
10
+ <p-header>
11
+ {{ 'filters' | translate }}
12
+ <s-token-list
13
+ [tokens]="searchTokens"
14
+ (tokenRemoved)="onRemoveToken($event)"
15
+ [removableTokens]="true"
16
+ ></s-token-list>
17
+ </p-header>
18
+ <div>
19
+ <s-dynamic-form
20
+ [fields]="filterFields"
21
+ [form]="filterFormGroup"
22
+ [errorMessages]="{ pattern: 'error_invalid' | translate }"
23
+ ></s-dynamic-form>
24
+ </div>
25
+ <p-footer>
26
+ <div class="ui-g">
27
+ <div class="ui-g-12">
28
+ <button
29
+ id="filter-button"
30
+ class="ui-button"
31
+ type="submit"
32
+ pButton
33
+ [label]="'filter' | translate"
34
+ (click)="onSearch()"
35
+ ></button>
36
+ <button
37
+ id="clear-button"
38
+ class="ui-button ui-button-link"
39
+ type="button"
40
+ pButton
41
+ [label]="'clear' | translate"
42
+ (click)="onClear()"
43
+ ></button>
44
+ </div>
45
+ </div>
46
+ </p-footer>
47
+ </p-panel>
48
+ </form>
49
+ <p-panel *sLoadingState="showLoader">
50
+ <p-header>
51
+ {{ getTitle() }}
52
+ </p-header>
53
+ <ng-container>
54
+ <s-empty-state
55
+ *ngIf="serverError && !showLoader"
56
+ iconClass="fa fa-exclamation-triangle"
57
+ title="{{ 'error_server_title' | translate }}"
58
+ primaryActionLabel="{{ 'error_server_try_again' | translate }}"
59
+ (primaryAction)="resetGrid()"
60
+ description="{{ 'error_server_description' | translate }}"
61
+ ></s-empty-state>
62
+
63
+ <s-empty-state
64
+ *ngIf="!showLoader && !serverError && totalRecords === 0"
65
+ [title]="getEmptyStateTitle()"
66
+ [showPrimaryAction]="false"
67
+ [description]="getEmptyStateDescription()"
68
+ ></s-empty-state>
69
+
70
+ <div class="ui-g">
71
+ <div class="ui-g-12">
72
+ <p-table
73
+ #exclusionsTable
74
+ id="exclusionsTable"
75
+ [hidden]="totalRecords === 0 || serverError"
76
+ [value]="gridData"
77
+ [columns]="gridColumns"
78
+ dataKey="id"
79
+ [lazy]="true"
80
+ [scrollable]="true"
81
+ [resizableColumns]="true"
82
+ sortMode="multiple"
83
+ [paginator]="true"
84
+ [totalRecords]="totalRecords"
85
+ [rows]="10"
86
+ rows="10"
87
+ [rowsPerPageOptions]="[10, 20, 50, 100]"
88
+ (onLazyLoad)="onGridChange($event)"
89
+ >
90
+ <ng-template pTemplate="colgroup" let-columns>
91
+ <colgroup>
92
+ <col
93
+ *ngFor="let col of columns"
94
+ [style.width]="col.width"
95
+ />
96
+ </colgroup>
97
+ </ng-template>
98
+
99
+ <ng-template
100
+ pTemplate="header"
101
+ let-columns
102
+ >
103
+ <tr>
104
+ <th *ngFor="let col of columns"
105
+ [id]="col.field"
106
+ [pSortableColumn]="col.field"
107
+ [ngStyle]="col.style"
108
+ pResizableColumn
109
+ >
110
+ <div class="senior-header">
111
+ <span class="senior-header-title">
112
+ {{ col.header }}
113
+ </span>
114
+ <p-sortIcon [field]="col.field"></p-sortIcon>
115
+ </div>
116
+ </th>
117
+ <th id="action-column" style="width: 100px">
118
+ <div class="senior-header">
119
+ <span class="senior-header-title">{{'Ações'}}</span>
120
+ </div>
121
+ </th>
122
+ </tr>
123
+ </ng-template>
124
+
125
+ <ng-template pTemplate="body" let-rowData let-columns="columns">
126
+ <tr [pSelectableRow]="rowData">
127
+ <s-table-columns
128
+ [columns]="columns"
129
+ [rowValue]="rowData"
130
+ [locale]="locale">
131
+ </s-table-columns>
132
+ <td style="width: 100px">
133
+ <s-button
134
+ id="details-button"
135
+ priority="default"
136
+ [label]="getDetailsButtonTitle()"
137
+ [auxiliary]="true"
138
+ (onClick)="onClickDetails(rowData)">
139
+ </s-button>
140
+ </td>
141
+ </tr>
142
+ </ng-template>
143
+
144
+ <ng-template pTemplate="paginatorright">
145
+ <s-table-paging
146
+ [table]="exclusionsTable"
147
+ [totalRecords]="totalRecords"
148
+ ></s-table-paging>
149
+ </ng-template>
150
+ </p-table>
151
+ </div>
152
+ </div>
153
+ </ng-container>
154
+ </p-panel>
155
+ </div>
156
+
157
+ <s-exclusion-details></s-exclusion-details>