@unifylib/ui-lib 1.0.3 → 1.1.4

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 (259) hide show
  1. package/esm2022/iq-ui-lib.mjs +5 -0
  2. package/esm2022/lib/base-model/SearchStrConfig.mjs +11 -0
  3. package/esm2022/lib/base-model/api-response.mjs +2 -0
  4. package/esm2022/lib/base-model/audit-log-entry.mjs +3 -0
  5. package/esm2022/lib/base-model/button-action-settings.mjs +16 -0
  6. package/esm2022/lib/base-model/column-def.model.mjs +28 -0
  7. package/esm2022/lib/base-model/do-action-request.mjs +8 -0
  8. package/esm2022/lib/base-model/field-action.mjs +6 -0
  9. package/esm2022/lib/base-model/field-filter.model.mjs +3 -0
  10. package/esm2022/lib/base-model/field-info.mjs +57 -0
  11. package/esm2022/lib/base-model/field-predicate.model.mjs +10 -0
  12. package/esm2022/lib/base-model/filter-request.mjs +13 -0
  13. package/esm2022/lib/base-model/filter.model.mjs +25 -0
  14. package/esm2022/lib/base-model/get-items-list.mjs +10 -0
  15. package/esm2022/lib/base-model/index.mjs +12 -0
  16. package/esm2022/lib/base-model/items-total.model.mjs +8 -0
  17. package/esm2022/lib/base-model/line-item.model.mjs +11 -0
  18. package/esm2022/lib/base-model/lookupItem.mjs +16 -0
  19. package/esm2022/lib/base-model/page-info.mjs +17 -0
  20. package/esm2022/lib/base-model/report-request.model.mjs +17 -0
  21. package/esm2022/lib/base-model/response-envelop.model.mjs +10 -0
  22. package/esm2022/lib/base-model/snack-message.model.mjs +11 -0
  23. package/esm2022/lib/base-model/table-column.interface.mjs +2 -0
  24. package/esm2022/lib/base-model/table-page-user-action.interface.mjs +21 -0
  25. package/esm2022/lib/base-model/workflow/workflow-steps.model.mjs +9 -0
  26. package/esm2022/lib/base-model/workflow/workflow.model.mjs +42 -0
  27. package/esm2022/lib/components/action-comment/action-comment.component.mjs +101 -0
  28. package/esm2022/lib/components/action-confirmation/action-confirmation.component.mjs +55 -0
  29. package/esm2022/lib/components/activity-report-form/activity-report-form.component.mjs +499 -0
  30. package/esm2022/lib/components/advanced-filter/field-filter/field-filter.component.mjs +41 -0
  31. package/esm2022/lib/components/advanced-filter/filter-builder/filter-builder.component.mjs +162 -0
  32. package/esm2022/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.mjs +70 -0
  33. package/esm2022/lib/components/audit-log-list/audit-log.component.mjs +99 -0
  34. package/esm2022/lib/components/auto-complete/auto-complete.component.mjs +292 -0
  35. package/esm2022/lib/components/base-form/base-form.component.mjs +297 -0
  36. package/esm2022/lib/components/base-form-canvas/base-form-canvas.component.mjs +591 -0
  37. package/esm2022/lib/components/base-input-dialog/base-input-dialog.component.mjs +72 -0
  38. package/esm2022/lib/components/base-table/base-table.component.mjs +514 -0
  39. package/esm2022/lib/components/button-actions/button-actions.component.mjs +70 -0
  40. package/esm2022/lib/components/editable-base-table/editable-base-table.component.mjs +496 -0
  41. package/esm2022/lib/components/equation-builder/equation-builder.component.mjs +112 -0
  42. package/esm2022/lib/components/item-line-editor/item-line-editor.component.mjs +299 -0
  43. package/esm2022/lib/components/multi-auto-complete/multi-auto-complete.component.mjs +278 -0
  44. package/esm2022/lib/components/paginator/paginator.component.mjs +91 -0
  45. package/esm2022/lib/components/report-details-dialog/report-details-dialog.component.mjs +102 -0
  46. package/esm2022/lib/components/report-form/report-form.component.mjs +498 -0
  47. package/esm2022/lib/components/search-bar/search-bar.component.mjs +62 -0
  48. package/esm2022/lib/components/section-form-canvas/section-form-canvas.component.mjs +81 -0
  49. package/esm2022/lib/components/shared/action-button/action-button.component.mjs +59 -0
  50. package/esm2022/lib/components/shared/action-card/action-card.component.mjs +93 -0
  51. package/esm2022/lib/components/shared/attachment-uploader/attachment-uploader.component.mjs +70 -0
  52. package/esm2022/lib/components/shared-list/shared-list.component.mjs +47 -0
  53. package/esm2022/lib/components/snackbar-static/snackbar-static.component.mjs +43 -0
  54. package/esm2022/lib/components/title-bar/title-bar.component.mjs +119 -0
  55. package/esm2022/lib/services/backend-service.mjs +240 -0
  56. package/esm2022/lib/services/index.mjs +4 -0
  57. package/esm2022/lib/services/top-panel.mjs +22 -0
  58. package/esm2022/lib/services/trigger-form.service.mjs +17 -0
  59. package/esm2022/lib/utils/base-utils.mjs +97 -0
  60. package/esm2022/lib/validators/date-range-validator.mjs +27 -0
  61. package/esm2022/lib/validators/index.mjs +4 -0
  62. package/esm2022/lib/validators/match-list.validator.mjs +9 -0
  63. package/esm2022/lib/validators/multi-email-validator.mjs +13 -0
  64. package/esm2022/public-api.mjs +29 -0
  65. package/esm2022/q-btech-ui-lib.mjs +5 -0
  66. package/esm2022/unifylib-ui-lib.mjs +5 -0
  67. package/fesm2022/iq-ui-lib.mjs +5625 -0
  68. package/fesm2022/iq-ui-lib.mjs.map +1 -0
  69. package/fesm2022/q-btech-ui-lib.mjs +5619 -0
  70. package/fesm2022/q-btech-ui-lib.mjs.map +1 -0
  71. package/fesm2022/unifylib-ui-lib.mjs +5625 -0
  72. package/fesm2022/unifylib-ui-lib.mjs.map +1 -0
  73. package/index.d.ts +5 -0
  74. package/lib/base-model/SearchStrConfig.d.ts +8 -0
  75. package/{src/lib/base-model/api-response.ts → lib/base-model/api-response.d.ts} +5 -7
  76. package/lib/base-model/audit-log-entry.d.ts +7 -0
  77. package/lib/base-model/button-action-settings.d.ts +15 -0
  78. package/lib/base-model/column-def.model.d.ts +11 -0
  79. package/lib/base-model/do-action-request.d.ts +10 -0
  80. package/lib/base-model/field-action.d.ts +6 -0
  81. package/lib/base-model/field-filter.model.d.ts +7 -0
  82. package/lib/base-model/field-info.d.ts +53 -0
  83. package/lib/base-model/field-predicate.model.d.ts +7 -0
  84. package/lib/base-model/filter-request.d.ts +15 -0
  85. package/lib/base-model/filter.model.d.ts +22 -0
  86. package/lib/base-model/get-items-list.d.ts +21 -0
  87. package/lib/base-model/index.d.ts +11 -0
  88. package/lib/base-model/items-total.model.d.ts +6 -0
  89. package/lib/base-model/line-item.model.d.ts +9 -0
  90. package/lib/base-model/lookupItem.d.ts +13 -0
  91. package/{src/lib/base-model/page-info.ts → lib/base-model/page-info.d.ts} +25 -24
  92. package/lib/base-model/report-request.model.d.ts +18 -0
  93. package/lib/base-model/response-envelop.model.d.ts +8 -0
  94. package/lib/base-model/snack-message.model.d.ts +7 -0
  95. package/lib/base-model/table-column.interface.d.ts +28 -0
  96. package/lib/base-model/table-page-user-action.interface.d.ts +14 -0
  97. package/lib/base-model/workflow/workflow-steps.model.d.ts +7 -0
  98. package/lib/base-model/workflow/workflow.model.d.ts +13 -0
  99. package/lib/components/action-comment/action-comment.component.d.ts +32 -0
  100. package/lib/components/action-confirmation/action-confirmation.component.d.ts +19 -0
  101. package/lib/components/activity-report-form/activity-report-form.component.d.ts +93 -0
  102. package/lib/components/advanced-filter/field-filter/field-filter.component.d.ts +20 -0
  103. package/lib/components/advanced-filter/filter-builder/filter-builder.component.d.ts +28 -0
  104. package/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.d.ts +25 -0
  105. package/lib/components/audit-log-list/audit-log.component.d.ts +36 -0
  106. package/lib/components/auto-complete/auto-complete.component.d.ts +51 -0
  107. package/lib/components/base-form/base-form.component.d.ts +59 -0
  108. package/lib/components/base-form-canvas/base-form-canvas.component.d.ts +124 -0
  109. package/lib/components/base-input-dialog/base-input-dialog.component.d.ts +23 -0
  110. package/lib/components/base-table/base-table.component.d.ts +128 -0
  111. package/lib/components/button-actions/button-actions.component.d.ts +17 -0
  112. package/lib/components/editable-base-table/editable-base-table.component.d.ts +106 -0
  113. package/lib/components/equation-builder/equation-builder.component.d.ts +23 -0
  114. package/lib/components/item-line-editor/item-line-editor.component.d.ts +64 -0
  115. package/lib/components/multi-auto-complete/multi-auto-complete.component.d.ts +51 -0
  116. package/lib/components/paginator/paginator.component.d.ts +26 -0
  117. package/lib/components/report-details-dialog/report-details-dialog.component.d.ts +34 -0
  118. package/lib/components/report-form/report-form.component.d.ts +92 -0
  119. package/lib/components/search-bar/search-bar.component.d.ts +29 -0
  120. package/lib/components/section-form-canvas/section-form-canvas.component.d.ts +27 -0
  121. package/lib/components/shared/action-button/action-button.component.d.ts +17 -0
  122. package/lib/components/shared/action-card/action-card.component.d.ts +37 -0
  123. package/lib/components/shared/attachment-uploader/attachment-uploader.component.d.ts +16 -0
  124. package/lib/components/shared-list/shared-list.component.d.ts +21 -0
  125. package/lib/components/snackbar-static/snackbar-static.component.d.ts +15 -0
  126. package/lib/components/title-bar/title-bar.component.d.ts +42 -0
  127. package/lib/services/backend-service.d.ts +59 -0
  128. package/{src/lib/services/index.ts → lib/services/index.d.ts} +1 -1
  129. package/lib/services/top-panel.d.ts +8 -0
  130. package/lib/services/trigger-form.service.d.ts +7 -0
  131. package/lib/utils/base-utils.d.ts +13 -0
  132. package/lib/validators/date-range-validator.d.ts +2 -0
  133. package/lib/validators/match-list.validator.d.ts +4 -0
  134. package/lib/validators/multi-email-validator.d.ts +6 -0
  135. package/package.json +19 -4
  136. package/{src/public-api.ts → public-api.d.ts} +22 -18
  137. package/ng-package.json +0 -7
  138. package/src/lib/base-model/SearchStrConfig.ts +0 -12
  139. package/src/lib/base-model/audit-log-entry.ts +0 -7
  140. package/src/lib/base-model/button-action-settings.ts +0 -25
  141. package/src/lib/base-model/column-def.model.ts +0 -34
  142. package/src/lib/base-model/do-action-request.ts +0 -11
  143. package/src/lib/base-model/field-action.ts +0 -7
  144. package/src/lib/base-model/field-filter.model.ts +0 -14
  145. package/src/lib/base-model/field-info.ts +0 -98
  146. package/src/lib/base-model/field-predicate.model.ts +0 -7
  147. package/src/lib/base-model/filter-request.ts +0 -27
  148. package/src/lib/base-model/filter.model.ts +0 -49
  149. package/src/lib/base-model/get-items-list.ts +0 -24
  150. package/src/lib/base-model/index.ts +0 -11
  151. package/src/lib/base-model/lookupItem.ts +0 -21
  152. package/src/lib/base-model/null-snackmessage.ts +0 -9
  153. package/src/lib/base-model/report-request.model.ts +0 -33
  154. package/src/lib/base-model/response-envelop.model.ts +0 -15
  155. package/src/lib/base-model/snack-message.model.ts +0 -14
  156. package/src/lib/base-model/snackmessage-interface.ts +0 -7
  157. package/src/lib/base-model/table-column.interface.ts +0 -29
  158. package/src/lib/base-model/table-page-user-action.interface.ts +0 -33
  159. package/src/lib/base-model/workflow/workflow-steps.model.ts +0 -9
  160. package/src/lib/base-model/workflow/workflow.model.ts +0 -52
  161. package/src/lib/components/action-confirmation/action-confirmation.component.css +0 -34
  162. package/src/lib/components/action-confirmation/action-confirmation.component.html +0 -18
  163. package/src/lib/components/action-confirmation/action-confirmation.component.spec.ts +0 -23
  164. package/src/lib/components/action-confirmation/action-confirmation.component.ts +0 -58
  165. package/src/lib/components/activity-report-form/activity-report-form.component.html +0 -109
  166. package/src/lib/components/activity-report-form/activity-report-form.component.scss +0 -0
  167. package/src/lib/components/activity-report-form/activity-report-form.component.spec.ts +0 -25
  168. package/src/lib/components/activity-report-form/activity-report-form.component.ts +0 -605
  169. package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.css +0 -51
  170. package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.html +0 -23
  171. package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.spec.ts +0 -23
  172. package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.ts +0 -69
  173. package/src/lib/components/audit-log-list/audit-log.component.html +0 -23
  174. package/src/lib/components/audit-log-list/audit-log.component.scss +0 -0
  175. package/src/lib/components/audit-log-list/audit-log.component.spec.ts +0 -25
  176. package/src/lib/components/audit-log-list/audit-log.component.ts +0 -116
  177. package/src/lib/components/auto-complete/auto-complete.component.css +0 -14
  178. package/src/lib/components/auto-complete/auto-complete.component.html +0 -29
  179. package/src/lib/components/auto-complete/auto-complete.component.spec.ts +0 -23
  180. package/src/lib/components/auto-complete/auto-complete.component.ts +0 -330
  181. package/src/lib/components/base-form/base-form.component.html +0 -58
  182. package/src/lib/components/base-form/base-form.component.scss +0 -0
  183. package/src/lib/components/base-form/base-form.component.spec.ts +0 -25
  184. package/src/lib/components/base-form/base-form.component.ts +0 -305
  185. package/src/lib/components/base-form-canvas/base-form-canvas.component.css +0 -22
  186. package/src/lib/components/base-form-canvas/base-form-canvas.component.html +0 -1006
  187. package/src/lib/components/base-form-canvas/base-form-canvas.component.spec.ts +0 -23
  188. package/src/lib/components/base-form-canvas/base-form-canvas.component.ts +0 -573
  189. package/src/lib/components/base-input-dialog/base-input-dialog.component.css +0 -0
  190. package/src/lib/components/base-input-dialog/base-input-dialog.component.html +0 -42
  191. package/src/lib/components/base-input-dialog/base-input-dialog.component.spec.ts +0 -23
  192. package/src/lib/components/base-input-dialog/base-input-dialog.component.ts +0 -78
  193. package/src/lib/components/base-table/base-table.component.html +0 -242
  194. package/src/lib/components/base-table/base-table.component.scss +0 -31
  195. package/src/lib/components/base-table/base-table.component.spec.ts +0 -25
  196. package/src/lib/components/base-table/base-table.component.ts +0 -568
  197. package/src/lib/components/button-actions/button-actions.component.html +0 -28
  198. package/src/lib/components/button-actions/button-actions.component.scss +0 -6
  199. package/src/lib/components/button-actions/button-actions.component.spec.ts +0 -23
  200. package/src/lib/components/button-actions/button-actions.component.ts +0 -72
  201. package/src/lib/components/editable-base-table/editable-base-table.component.html +0 -372
  202. package/src/lib/components/editable-base-table/editable-base-table.component.scss +0 -44
  203. package/src/lib/components/editable-base-table/editable-base-table.component.spec.ts +0 -25
  204. package/src/lib/components/editable-base-table/editable-base-table.component.ts +0 -570
  205. package/src/lib/components/equation-builder/equation-builder.component.css +0 -0
  206. package/src/lib/components/equation-builder/equation-builder.component.html +0 -31
  207. package/src/lib/components/equation-builder/equation-builder.component.spec.ts +0 -23
  208. package/src/lib/components/equation-builder/equation-builder.component.ts +0 -121
  209. package/src/lib/components/multi-auto-complete/multi-auto-complete.component.css +0 -11
  210. package/src/lib/components/multi-auto-complete/multi-auto-complete.component.html +0 -38
  211. package/src/lib/components/multi-auto-complete/multi-auto-complete.component.spec.ts +0 -23
  212. package/src/lib/components/multi-auto-complete/multi-auto-complete.component.ts +0 -317
  213. package/src/lib/components/paginator/paginator.component.css +0 -25
  214. package/src/lib/components/paginator/paginator.component.html +0 -34
  215. package/src/lib/components/paginator/paginator.component.ts +0 -94
  216. package/src/lib/components/rejection-comment/action-comment.component.css +0 -33
  217. package/src/lib/components/rejection-comment/action-comment.component.html +0 -46
  218. package/src/lib/components/rejection-comment/action-comment.component.spec.ts +0 -23
  219. package/src/lib/components/rejection-comment/action-comment.component.ts +0 -86
  220. package/src/lib/components/report-details-dialog/report-details-dialog.component.css +0 -17
  221. package/src/lib/components/report-details-dialog/report-details-dialog.component.html +0 -16
  222. package/src/lib/components/report-details-dialog/report-details-dialog.component.spec.ts +0 -23
  223. package/src/lib/components/report-details-dialog/report-details-dialog.component.ts +0 -113
  224. package/src/lib/components/report-form/report-form.component.html +0 -94
  225. package/src/lib/components/report-form/report-form.component.scss +0 -0
  226. package/src/lib/components/report-form/report-form.component.spec.ts +0 -25
  227. package/src/lib/components/report-form/report-form.component.ts +0 -588
  228. package/src/lib/components/search-bar/search-bar.component.html +0 -62
  229. package/src/lib/components/search-bar/search-bar.component.scss +0 -8
  230. package/src/lib/components/search-bar/search-bar.component.spec.ts +0 -25
  231. package/src/lib/components/search-bar/search-bar.component.ts +0 -70
  232. package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.css +0 -54
  233. package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.html +0 -22
  234. package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.spec.ts +0 -23
  235. package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.ts +0 -45
  236. package/src/lib/components/shared-list/shared-list.component.css +0 -0
  237. package/src/lib/components/shared-list/shared-list.component.html +0 -17
  238. package/src/lib/components/shared-list/shared-list.component.spec.ts +0 -23
  239. package/src/lib/components/shared-list/shared-list.component.ts +0 -53
  240. package/src/lib/components/title-bar/title-bar.component.css +0 -0
  241. package/src/lib/components/title-bar/title-bar.component.css.map +0 -1
  242. package/src/lib/components/title-bar/title-bar.component.html +0 -31
  243. package/src/lib/components/title-bar/title-bar.component.scss +0 -23
  244. package/src/lib/components/title-bar/title-bar.component.spec.ts +0 -23
  245. package/src/lib/components/title-bar/title-bar.component.ts +0 -119
  246. package/src/lib/services/backend-service.ts +0 -286
  247. package/src/lib/services/top-panel.ts +0 -17
  248. package/src/lib/services/trigger-form.service.ts +0 -11
  249. package/src/lib/share-module/shared-module.ts +0 -10
  250. package/src/lib/styles/invoiceq-theme.scss +0 -252
  251. package/src/lib/styles/styles.scss +0 -1723
  252. package/src/lib/utils/base-utils.ts +0 -102
  253. package/src/lib/validators/date-range-validator.ts +0 -31
  254. package/src/lib/validators/match-list.validator.ts +0 -10
  255. package/src/lib/validators/multi-email-validator.ts +0 -15
  256. package/tsconfig.lib.json +0 -15
  257. package/tsconfig.lib.prod.json +0 -11
  258. package/tsconfig.spec.json +0 -15
  259. /package/{src/lib/validators/index.ts → lib/validators/index.d.ts} +0 -0
@@ -1,605 +0,0 @@
1
- import {
2
- Component,
3
- EventEmitter,
4
- Injector,
5
- Input,
6
- OnInit,
7
- Output
8
- } from '@angular/core';
9
- import {FieldInfo} from "../../base-model/field-info";
10
- import {EMPTY_PAGE_INFO, PageInfo} from "../../base-model/page-info";
11
- import {TableColumn} from "../../base-model/table-column.interface";
12
- import {FieldMessage} from "../../base-model/api-response";
13
- import {TranslateModule, TranslateService} from "@ngx-translate/core";
14
- import {BackendService} from "../../services/backend-service";
15
- import {ActivatedRoute, Router} from "@angular/router";
16
- import {FormBuilder, FormGroup} from "@angular/forms";
17
- import {formatDate, NgForOf, NgIf} from "@angular/common";
18
- import {FlexLayoutModule} from "@angular/flex-layout";
19
- import {MatMenu, MatMenuItem, MatMenuTrigger} from "@angular/material/menu";
20
- import {MatButton, MatButtonModule} from "@angular/material/button";
21
- import {BaseTableComponent} from "../base-table/base-table.component";
22
- import {MatIconModule} from "@angular/material/icon";
23
- import {FilterRequest} from "../../base-model/filter-request";
24
- import {ReportRequest} from "../../base-model/report-request.model";
25
- import {Filter} from "../../base-model/filter.model";
26
- import {TitleBarComponent} from "../title-bar/title-bar.component";
27
- import {BaseFormCanvasComponent} from "../base-form-canvas/base-form-canvas.component";
28
- import {DRILL_DOWN_ACTION, JUNIOR_DOWN_ACTION, SnackMessage, TablePageUserAction} from "../../base-model";
29
- import {} from "../audit-log-details-dialog/audit-log-details-dialog.component";
30
- import {MatDialog} from "@angular/material/dialog";
31
- import {ReportDetailsDialogComponent} from "../report-details-dialog/report-details-dialog.component";
32
- import { cloneDeep } from 'lodash';
33
- import {Directionality} from "@angular/cdk/bidi";
34
- import {MatTooltip} from "@angular/material/tooltip";
35
-
36
-
37
- const NON_REPORT_COLUMNS = ['listAction', 'button', 'checkbox'];
38
-
39
- @Component({
40
- selector: 'app-report-form',
41
- standalone: true,
42
- imports: [
43
- FlexLayoutModule,
44
- TitleBarComponent,
45
- BaseFormCanvasComponent,
46
- MatMenu,
47
- MatMenuItem,
48
- NgForOf,
49
- MatMenuTrigger,
50
- MatButtonModule,
51
- TranslateModule,
52
- BaseTableComponent,
53
- NgIf,
54
- MatIconModule,
55
- MatButton,
56
- MatTooltip
57
- ],
58
- templateUrl: './activity-report-form.component.html',
59
- styleUrl: './activity-report-form.component.scss'
60
- })
61
- export class ActivityReportFormComponent implements OnInit{
62
- @Input()
63
- showDetails : any = [];
64
-
65
- @Input()
66
- showExtractButton: boolean = true;
67
-
68
- @Input()
69
- columns: TableColumn<any>[] =[];
70
- private originalColumns: any[] = [];
71
-
72
-
73
- @Input() actionRequestCallback!: (actionRequest: TablePageUserAction) => TablePageUserAction;
74
- @Input() enrichDrillDownReportRequest!: (actionRequest: TablePageUserAction, reportRequest: ReportRequest) => TablePageUserAction;
75
- @Input() enrichHyperLinkReportRequest!: (actionRequest: TablePageUserAction, reportRequest: ReportRequest) => TablePageUserAction;
76
- @Input() enrichJuniorReportRequest!: (actionRequest: TablePageUserAction, reportRequest: ReportRequest) => TablePageUserAction;
77
-
78
- @Output()
79
- userAction: EventEmitter<TablePageUserAction> = new EventEmitter<TablePageUserAction>();
80
- activeLevel: number = 1;
81
- items = [4, 5,6,7];
82
- private filterRequest: FilterRequest;
83
- x: any;
84
- isEditable: boolean = true;
85
- fields: FieldInfo[] = [];
86
- pageInfo: PageInfo = EMPTY_PAGE_INFO;
87
- drillDownPageInfo: PageInfo = EMPTY_PAGE_INFO;
88
- drillDownColumns: TableColumn<any>[] = [];
89
- hideDrillDownButton: false;
90
-
91
- juniorPageInfo: PageInfo = EMPTY_PAGE_INFO;
92
- juniorColumns: TableColumn<any>[] = [];
93
-
94
- columnsDefinition: TableColumn<any>[] = [];
95
- types: string[] = ["pdf", "csv", "xlsx"]
96
- searchStr: string = '';
97
-
98
- errors: FieldMessage[] = [];
99
-
100
- reloadData: boolean = false;
101
- drillDownRequestStack: any[] = [];
102
- reportRequest: ReportRequest = new ReportRequest({});
103
- childReportRequest: ReportRequest = new ReportRequest({});
104
- juniorReportRequest: ReportRequest = new ReportRequest({});
105
- public reportForm: FormGroup;
106
- readyToSearch = false;
107
- private pageSize: any;
108
- private dialogReportRequest: any;
109
- currentDirection: 'ltr' | 'rtl';
110
- protected isComparisonReport: boolean = false;
111
- constructor(private translateService: TranslateService,
112
- public backendService: BackendService,
113
- private activatedRoute: ActivatedRoute,
114
- private injector: Injector,
115
- private router: Router,
116
- private route: ActivatedRoute,
117
- public dialog: MatDialog,
118
- private directionality: Directionality,
119
- private fb: FormBuilder) {
120
- }
121
-
122
- ngOnInit(): void {
123
-
124
- this.currentDirection = this.directionality.value;
125
- this.directionality.change.subscribe((value) => {
126
- this.currentDirection = value;
127
- })
128
-
129
- this.activatedRoute.data.subscribe(data => {
130
- this.pageInfo = data['pageInfo'];
131
- this.pageSize = this.pageInfo.pageSize ?? 10;
132
- this.filterRequest= new FilterRequest(this.pageSize);
133
- data['pageInfo'].lazyLoadData = true;
134
- this.drillDownPageInfo = data['drillDownPageInfo'];
135
- this.drillDownColumns = data['drillDownColumns'];
136
- this.originalColumns = [...this.drillDownColumns];
137
- this.hideDrillDownButton = data['hideDrillDownButton'] ?? false;
138
- this.juniorPageInfo = data['juniorPageInfo'];
139
- this.juniorColumns = data['juniorColumns'];
140
- this.columnsDefinition = data['columnsDefinition'].filter(c => (this.drillDownPageInfo && this.drillDownColumns || (!NON_REPORT_COLUMNS.includes(c.type))));
141
- this.fields = data['fields'];
142
- if (data['enrichDrillDownReportRequest']) {
143
- this.enrichDrillDownReportRequest = data['enrichDrillDownReportRequest'](this.injector);
144
- }
145
- if (data['enrichJuniorReportRequest']) {
146
- this.enrichJuniorReportRequest = data['enrichJuniorReportRequest'](this.injector);
147
- }
148
-
149
- if (data['enrichHyperLinkReportRequest']) {
150
- this.enrichHyperLinkReportRequest = data['enrichHyperLinkReportRequest'](this.injector);
151
- }
152
- });
153
-
154
- this.route.queryParamMap.subscribe(params => {
155
- this.isComparisonReport = params.get('comparisonReport') === 'true';
156
- if (!this.isComparisonReport) return;
157
-
158
- const comparisonStr = sessionStorage.getItem('comparisonReportPageInfo');
159
- if (!comparisonStr) return;
160
-
161
- const comparisonData = JSON.parse(comparisonStr);
162
- this.initializeComparisonReport(comparisonData);
163
- });
164
- }
165
-
166
- private initializeComparisonReport(data: any): void {
167
- this.pageInfo.lazyLoadData = data.lazyLoadData ?? false;
168
- this.activeLevel = data.activeLevel ?? 2;
169
- this.isEditable = false;
170
- this.drillDownPageInfo = data.drillDownPageInfo;
171
- this.drillDownColumns = data.drillDownColumns;
172
-
173
- const reportRequest = data.reportRequest;
174
-
175
- this.reportRequest = this.backendService.buildReportRequest(
176
- this.drillDownColumns,
177
- `${this.drillDownPageInfo.labelsSection}.${this.drillDownPageInfo.id}`,
178
- reportRequest,
179
- '',
180
- this.drillDownPageInfo,
181
- 'LANDSCAPE'
182
- );
183
-
184
- this.setupForm(data.form);
185
- this.removeCheckboxFields();
186
- this.setupFilters(data.reportRequest, data.item);
187
- this.setupJuniorReportRequest();
188
- }
189
-
190
- private setupForm(formData: any): void {
191
- this.reportForm = this.fb.group({
192
- directorate: [[]],
193
- fromDate: [''],
194
- toDate: [''],
195
- sector: {},
196
- });
197
-
198
- if (formData) {
199
- this.reportForm.patchValue(formData);
200
- }
201
- }
202
-
203
- private removeCheckboxFields(): void {
204
- this.fields = this.fields.filter(field => field.type !== 'checkbox');
205
- }
206
-
207
- private setupFilters(reportRequest: any, item: any): void {
208
- this.filterRequest.filters = [];
209
-
210
- this.addOrUpdateFilter(reportRequest, {
211
- key: 'iSecLevel',
212
- fieldName: 'iSecLevel',
213
- value: this.activeLevel
214
- });
215
-
216
- this.addOrUpdateFilter(reportRequest, {
217
- id: 'iSecValue',
218
- key: 'iSecValue',
219
- fieldName: 'iSecValue',
220
- value: item?.isec_value
221
- });
222
-
223
- this.addOrUpdateFilter(reportRequest, {
224
- id: 'period',
225
- key: 'period',
226
- fieldName: 'period',
227
- value: item?.period
228
- });
229
-
230
- this.addOrUpdateFilter(reportRequest, {
231
- id: 'year',
232
- key: 'year',
233
- fieldName: 'year',
234
- value: item?.year
235
- });
236
-
237
- this.reportRequest.filterRequest = reportRequest;
238
- }
239
-
240
- private setupJuniorReportRequest(): void {
241
- this.juniorReportRequest = this.backendService.buildReportRequest(
242
- this.juniorColumns,
243
- `${this.juniorPageInfo.labelsSection}.${this.juniorPageInfo.id}`,
244
- this.reportRequest.filterRequest,
245
- '',
246
- this.juniorPageInfo,
247
- 'LANDSCAPE'
248
- );
249
-
250
- this.juniorReportRequest.filterRequest.pageSize = 500;
251
- }
252
-
253
- isMatchHeight() {
254
- return this.pageInfo.pageHeight === 'match';
255
- }
256
-
257
-
258
- doAction(type: string) {
259
- if (this.backendService.parentForm.valid) {
260
- this.reloadData = !this.reloadData;
261
- const filterRequest: FilterRequest = new FilterRequest(this.pageSize);
262
- filterRequest.filters = [];
263
- this.addOrUpdateFilter(filterRequest, {
264
- key: 'iSecLevel',
265
- fieldName: 'iSecLevel',
266
- value: this.activeLevel
267
- });
268
- let paramsString: string[] = [];
269
- this.fields.filter(x => x.type !== 'spacer').forEach(f => {
270
- if (this.getParamValue(f) != null && this.getParamValue(f).toString().trim() !== '')
271
- {
272
- if (f.type === 'multi-select' || f.type === 'lookup') {
273
- // do not filter if this field as cascading for another one and the other one got selected values
274
- const childFieldIdx = this.fields.findIndex(field => field.cascadedBy === f.property);
275
- if (childFieldIdx > -1 && this.backendService.parentForm.get(this.fields[childFieldIdx].property)?.value?.length > 0) {
276
- return;
277
- }
278
- const idz: number[] = [];
279
- const param: string[] = [];
280
- if (this.backendService.parentForm.get(f.property)?.value && Array.isArray(this.backendService.parentForm.get(f.property)?.value)
281
- && this.backendService.parentForm.get(f.property)?.value.length > 0) {
282
- this.backendService.parentForm.get(f.property)?.value.forEach((a: {
283
- channelId: number;
284
- englishName: string;
285
- id: number;
286
- }) => {
287
- if (f.flattenBySubAttribute) {
288
- idz.push(a[f.flattenBySubAttribute]);
289
- param.push(a[f.flattenBySubAttribute]);
290
- } else if (this.fields.find(s => s.property === 'terminalId')) {
291
- idz.push(a.channelId);
292
- param.push(a.englishName);
293
- } else {
294
- idz.push(a.id);
295
- param.push(a.englishName);
296
- }
297
- })
298
- filterRequest.filters?.push(new Filter({
299
- id: f.property, fieldName: f.property, label: this.translateService.instant(f.label),
300
- filterType: 'FILED_FILTER', operator: f.filterOperator,
301
- valueObject: idz
302
- }));
303
- paramsString.push(this.translateService.instant(f.label) + ' : ' + param.join(','));
304
- } else if (this.backendService.parentForm.get(f.property)?.value && f.flattenBySubAttribute) {
305
- filterRequest.filters?.push(new Filter({
306
- id: f.property, fieldName: f.property, label: this.translateService.instant(f.label),
307
- filterType: 'FILED_FILTER', operator: f.filterOperator,
308
- valueObject: this.getParamValue(f)[f.flattenBySubAttribute]
309
- }));
310
- }
311
- } else {
312
- if (this.backendService.parentForm.get(f.property)?.value !== null &&
313
- this.backendService.parentForm.get(f.property)?.value !== undefined &&
314
- this.backendService.parentForm.get(f.property)?.value !== "") {
315
- filterRequest.filters?.push(new Filter({
316
- id: f.property, fieldName: f.property, label: this.translateService.instant(f.label),
317
- filterType: 'FILED_FILTER', operator: f.filterOperator,
318
- valueObject: this.getParamValue(f)
319
- }));
320
- }
321
- paramsString.push(this.translateService.instant(f.label) + ' : ' + this.getParamValueLabel(f));
322
- }
323
- }})
324
- const reportRequest = this.backendService.buildReportRequest(this.columnsDefinition, this.pageInfo.labelsSection + '.' + this.pageInfo.id,
325
- filterRequest, type, this.pageInfo, 'LANDSCAPE');
326
- reportRequest.searchStr = paramsString.join(' , ');
327
- this.reportRequest = reportRequest;
328
- // this.activeLevel = 1;
329
- } else {
330
- this.backendService.topPanelMessage$.next(new SnackMessage('INVALID_REPORT_FORM', true, 'error'));
331
- }
332
- }
333
-
334
- private getParamValue(f: FieldInfo) {
335
- if (f.type === 'date' && this.backendService.parentForm.get(f.property)?.value) {
336
- return formatDate(this.backendService.parentForm.get(f.property)?.value, 'yyyy-MM-dd', 'en_US')
337
- }else if (f.type === 'checkbox') {
338
- return !!this.backendService.parentForm.get(f.property)?.value;
339
- }else {
340
- return this.backendService.parentForm.get(f.property)?.value;
341
- }
342
- }
343
-
344
- private getParamValueLabel(f: FieldInfo) {
345
- if (f.type === 'checkbox') {
346
- return this.backendService.parentForm.get(f.property)?.value ? this.translateService.instant('yes') : this.translateService.instant('no');
347
- }else {
348
- return this.backendService.parentForm.get(f.property)?.value;
349
- }
350
- }
351
-
352
- getTitle() {
353
- const pageInfoMap = {
354
- 1: this.pageInfo,
355
- 2: this.drillDownPageInfo,
356
- 3: this.juniorPageInfo
357
- };
358
-
359
- const currentInfo = pageInfoMap[this.activeLevel] || this.pageInfo;
360
- return `${currentInfo.labelsSection}.${currentInfo.id}`;
361
- }
362
-
363
- updateForm($event: FormGroup) {
364
- this.reportForm = $event;
365
- this.backendService.parentForm = $event;
366
- this.backendService.parentForm.valueChanges.subscribe(x => {
367
- this.readyToSearch = this.backendService.parentForm.valid;
368
- }
369
-
370
- );
371
- }
372
-
373
- isValidForm() {
374
- return this.readyToSearch ;
375
-
376
- }
377
-
378
-
379
-
380
- emitUserAction($event: TablePageUserAction) {
381
- $event.pageInfo = this.pageInfo;
382
- this.doADrillDownAction($event);
383
- }
384
-
385
- emitHyperLinkAction($event: TablePageUserAction) {
386
- if (this.shouldProcessEventItem($event.item)) {
387
- this.dialogReportRequest = cloneDeep(this.reportRequest);
388
- const reportRequest1 = this.backendService.buildReportRequest(
389
- this.juniorColumns,
390
- this.juniorPageInfo.labelsSection + '.' + this.juniorPageInfo.id,
391
- { ...this.dialogReportRequest.filterRequest },
392
- '',
393
- this.juniorPageInfo,
394
- 'LANDSCAPE'
395
- );
396
- reportRequest1.filterRequest.pageIndex = 0
397
- const dialogRef = this.dialog.open(ReportDetailsDialogComponent, {
398
- data: {
399
- pageInfo: this.juniorPageInfo,
400
- request: reportRequest1,
401
- columns: this.juniorColumns,
402
- item :$event.item
403
- },
404
- height: '50vw',
405
- maxWidth: '120vw',
406
- direction: this.currentDirection,
407
- disableClose: false,
408
- });
409
-
410
- dialogRef.afterOpened().subscribe(() => {
411
- this.doHyperLinkAction($event);
412
- });
413
-
414
- dialogRef.afterClosed().subscribe(() => {
415
- });
416
- }
417
- }
418
-
419
-
420
-
421
- emitJuniorAction($event: TablePageUserAction) {
422
- console.log('$event call junior', $event);
423
- const juniorAction = JUNIOR_DOWN_ACTION;
424
- juniorAction.pageInfo = this.drillDownPageInfo;
425
- this.doJuniorAction($event);
426
- }
427
-
428
- drillDown() {
429
- const drilldownaction = DRILL_DOWN_ACTION;
430
- drilldownaction.pageInfo = this.drillDownPageInfo;
431
- this.doADrillDownAction(drilldownaction);
432
- }
433
-
434
- private doJuniorAction($event: TablePageUserAction) {
435
- this.juniorColumns = this.originalColumns
436
- if (this.juniorColumns && this.juniorPageInfo) {
437
- if (this.enrichJuniorReportRequest) {
438
-
439
- this.isEditable = false;
440
- this.juniorReportRequest = this.backendService.buildReportRequest(this.juniorColumns,
441
- this.juniorPageInfo.labelsSection + '.' + this.juniorPageInfo.id,
442
- this.reportRequest.filterRequest, '', this.juniorPageInfo, 'LANDSCAPE');
443
- this.enrichJuniorReportRequest($event, this.juniorReportRequest);
444
- }
445
- this.activeLevel = this.activeLevel +1;
446
- this.addOrUpdateFilter(this.reportRequest.filterRequest, {
447
- key: 'iSecLevel',
448
- fieldName: 'iSecLevel',
449
- value: this.activeLevel
450
- });
451
- }
452
- }
453
- private doADrillDownAction($event: TablePageUserAction) {
454
-
455
- if (this.drillDownColumns && this.drillDownPageInfo) {
456
- this.drillDownRequestStack.push(cloneDeep(this.reportRequest));
457
- if (this.enrichDrillDownReportRequest) {
458
- this.isEditable = false;
459
- this.childReportRequest = this.backendService.buildReportRequest(this.drillDownColumns,
460
- this.drillDownPageInfo.labelsSection + '.' + this.drillDownPageInfo.id,
461
- this.reportRequest.filterRequest, '', this.drillDownPageInfo, 'LANDSCAPE');
462
- this.enrichDrillDownReportRequest($event, this.childReportRequest);
463
-
464
- }
465
- this.childReportRequest.filterRequest.pageSize = 500
466
- this.activeLevel = this.activeLevel +1;
467
- this.addOrUpdateFilter(this.reportRequest.filterRequest, {
468
- key: 'iSecLevel',
469
- fieldName: 'iSecLevel',
470
- value: this.activeLevel
471
- });
472
- if (this.isComparisonReport){
473
- this.addOrUpdateFilter(this.reportRequest.filterRequest, {
474
- id: 'iSecValue',
475
- key: 'iSecValue',
476
- fieldName: 'iSecValue',
477
- value: $event.item.isec_value
478
- });
479
-
480
- }
481
- if (this.activeLevel === 4) {
482
- this.drillDownColumns = this.drillDownColumns.filter(item => item.type !== 'button');
483
- }
484
- this.reloadData = true
485
- }
486
- }
487
-
488
- private addOrUpdateFilter(
489
- filterRequest: FilterRequest,
490
- options: {
491
- id?: string;
492
- key: string;
493
- fieldName: string;
494
- value: any;
495
- }
496
- ): void {
497
- const { id, key, fieldName, value } = options;
498
-
499
- const existingFilterIndex = filterRequest.filters.findIndex((filter: Filter) =>
500
- id ? filter.id === id : filter.key === key
501
- );
502
-
503
- const newFilter = new Filter({
504
- ...(id && { id }),
505
- key,
506
- fieldName,
507
- label: '',
508
- filterType: 'FILED_FILTER',
509
- operator: 'EQUALS',
510
- valueObject: value
511
- });
512
-
513
- if (existingFilterIndex !== -1) {
514
- filterRequest.filters[existingFilterIndex] = newFilter;
515
- } else {
516
- filterRequest.filters.push(newFilter);
517
- }
518
- }
519
-
520
- private doHyperLinkAction($event: TablePageUserAction) {
521
- if (this.enrichHyperLinkReportRequest) {
522
- this.juniorReportRequest = this.backendService.buildReportRequest(this.juniorColumns,
523
- this.juniorPageInfo.labelsSection + '.' + this.juniorPageInfo.id,
524
- this.dialogReportRequest.filterRequest, '', this.juniorPageInfo, 'LANDSCAPE');
525
- this.enrichHyperLinkReportRequest($event, this.juniorReportRequest);
526
- }
527
- }
528
-
529
- extractReport(reportType: any) {
530
- this.reportRequest.reportType = reportType;
531
- this.backendService.downloadReport(this.reportRequest, this.drillDownPageInfo.apiUri );
532
-
533
- }
534
-
535
- goUp() {
536
- Object.keys(this.reportForm.controls).forEach(controlName => {
537
- const control = this.reportForm.get(controlName);
538
- control?.clearValidators();
539
- control?.updateValueAndValidity();
540
- });
541
- this.isEditable = true;
542
- this.activeLevel = this.activeLevel - 1;
543
- if (this.activeLevel > 1 ) {
544
- this.isEditable = false;
545
- }
546
- this.doAction(this.x);
547
- this.reportRequest = this.drillDownRequestStack.pop();
548
- this.addOrUpdateFilter(this.reportRequest.filterRequest, {
549
- key: 'iSecLevel',
550
- fieldName: 'iSecLevel',
551
- value: this.activeLevel
552
- });
553
- this.reloadData = true;
554
- if (this.activeLevel !== 4) {
555
- this.drillDownColumns = [...this.originalColumns];
556
- }
557
- }
558
-
559
-
560
- drillDownEnabled() {
561
- return this.drillDownPageInfo && !this.hideDrillDownButton && !this.getIsEmptyList();
562
- }
563
-
564
- drillDownLabel() {
565
- return `${this.pageInfo.labelsSection}.drillDownLabel` ;
566
- }
567
- getIsEmptyList() {
568
- return this.backendService.isEmptyItems;
569
- }
570
- clear() {
571
- const currentUrl = this.router.url;
572
- this.router.navigateByUrl('/', { skipLocationChange: true }).then(() => {
573
- this.router.navigate([currentUrl]);
574
- });
575
- }
576
-
577
-
578
- isFormEmpty(): boolean {
579
- if (!this.reportForm || !this.reportForm.value) {
580
- return true;
581
- }
582
-
583
- return Object.values(this.reportForm.value).every(value => {
584
- if (value === null || value === undefined || value === '') {
585
- return true;
586
- }
587
- return Array.isArray(value) && value.length === 0;
588
-
589
- });
590
- }
591
-
592
- shouldProcessEventItem(item: any): boolean {
593
- const groupByProp = this.pageInfo?.groupByProperty;
594
- const groupByValues = this.pageInfo?.groupByValue;
595
-
596
- if (!groupByProp || !groupByValues || !item[groupByProp]) {
597
- return true;
598
- }
599
-
600
- const value = item[groupByProp].toString();
601
-
602
- return !groupByValues.some(v => value.includes(v) && value.length >= v.length);
603
- }
604
-
605
- }
@@ -1,51 +0,0 @@
1
- .m-0{
2
- margin: 0 !important;
3
- }
4
- .w-100{
5
- width: 100%;
6
- }
7
- .form-style{
8
- min-height: 12vh !important;
9
- height: auto !important;
10
- }
11
- .text-red{
12
- color: red !important;
13
- }
14
- .modal-footer{
15
- margin-top: 5vh;
16
- }
17
- .overflow-hidden{
18
- overflow: hidden;
19
- }
20
- .pad-top{
21
- margin-top: -7px;
22
- display: block;
23
- }
24
- .action-comment {
25
- /*direction: rtl;*/
26
- display: flex;
27
- justify-content: space-between;
28
- }
29
- .material-icons {
30
- color: #E22222;
31
- }
32
- textarea#warn::placeholder {
33
- color: red;
34
- }
35
- .invoice-label {
36
- color: var(--primary-color);
37
- margin: 0px;
38
- font-weight: bold;
39
- padding-bottom: 10px !important;
40
- padding-top: 6px !important;
41
- border-bottom: none !important;
42
-
43
- }
44
-
45
- .invoice-label-text {
46
- color: var(--accent-color);
47
- font-weight: normal;
48
- word-wrap: break-word;
49
- white-space: pre-wrap;
50
- width: 100%;
51
- }
@@ -1,23 +0,0 @@
1
- <mat-dialog-content class="mat-typography overflow-hidden">
2
- <div style="'padding': '10px 30px 10px 0'">
3
- <h2 mat-dialog-title>{{ getTitle()| translate }}</h2>
4
- <app-base-form-canvas
5
- [pageInfo]="pageInfo"
6
- [fields]="fields"
7
- [editable]="false"
8
- [item]="item"
9
- ></app-base-form-canvas>
10
-
11
- <p>
12
- <span class="invoice-label">{{ 'audit-log.reason_dialog' | translate }} :</span>
13
- <span class="invoice-label-text">{{ comment }}</span>
14
- </p>
15
- <mat-divider style="width: 97%"></mat-divider>
16
- <br>
17
- <button mat-stroked-button color='accent' style="margin: 5px"
18
- (click)="cancel()" id="acceptActionLabel">
19
- {{ 'audit-log.close' | translate }}
20
- </button>
21
- <br>
22
- </div>
23
- </mat-dialog-content>
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { AuditLogDetailsDialogComponent } from './audit-log-details-dialog.component';
4
-
5
- describe('ActionCommentComponent', () => {
6
- let component: AuditLogDetailsDialogComponent;
7
- let fixture: ComponentFixture<AuditLogDetailsDialogComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- imports: [AuditLogDetailsDialogComponent]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(AuditLogDetailsDialogComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });