cat-documents-ng 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ng-package.json +10 -0
- package/package.json +5 -11
- package/src/Shared/components/confirmation-dialog/confirmation-dialog.component.html +3 -0
- package/src/Shared/components/confirmation-dialog/confirmation-dialog.component.scss +13 -0
- package/src/Shared/components/confirmation-dialog/confirmation-dialog.component.spec.ts +70 -0
- package/src/Shared/components/confirmation-dialog/confirmation-dialog.component.ts +133 -0
- package/src/Shared/components/table-primary/table-primary.component.html +66 -0
- package/src/Shared/components/table-primary/table-primary.component.scss +227 -0
- package/src/Shared/components/table-primary/table-primary.component.spec.ts +23 -0
- package/src/Shared/components/table-primary/table-primary.component.ts +143 -0
- package/src/Shared/components/table-primary/table-primary.model.ts +21 -0
- package/src/Shared/constant/ERROR.ts +55 -0
- package/src/Shared/constant/PERMISSIONS.ts +17 -0
- package/src/Shared/constant/SHARED.ts +936 -0
- package/{Shared/constant/URLS.d.ts → src/Shared/constant/URLS.ts} +31 -25
- package/src/Shared/services/app-config.service.spec.ts +19 -0
- package/src/Shared/services/app-config.service.ts +73 -0
- package/{Shared/services/global-error.handler.d.ts → src/Shared/services/global-error.handler.ts} +11 -9
- package/src/Shared/services/session.service.spec.ts +16 -0
- package/src/Shared/services/session.service.ts +76 -0
- package/src/Shared/shared.module.ts +25 -0
- package/src/lib/document/components/csv-viewer/csv-viewer.component.ts +1 -0
- package/src/lib/document/components/document-actions/document-actions.component.html +59 -0
- package/src/lib/document/components/document-actions/document-actions.component.scss +362 -0
- package/src/lib/document/components/document-actions/document-actions.component.spec.ts +297 -0
- package/src/lib/document/components/document-actions/document-actions.component.ts +163 -0
- package/src/lib/document/components/document-container/document-container.component.html +36 -0
- package/src/lib/document/components/document-container/document-container.component.scss +144 -0
- package/src/lib/document/components/document-container/document-container.component.spec.ts +110 -0
- package/src/lib/document/components/document-container/document-container.component.ts +363 -0
- package/src/lib/document/components/document-content-viewer/document-content-viewer.component.html +332 -0
- package/src/lib/document/components/document-content-viewer/document-content-viewer.component.scss +1877 -0
- package/src/lib/document/components/document-content-viewer/document-content-viewer.component.spec.ts +258 -0
- package/src/lib/document/components/document-content-viewer/document-content-viewer.component.ts +664 -0
- package/src/lib/document/components/document-history/document-history.component.html +96 -0
- package/src/lib/document/components/document-history/document-history.component.scss +392 -0
- package/src/lib/document/components/document-history/document-history.component.spec.ts +93 -0
- package/src/lib/document/components/document-history/document-history.component.ts +373 -0
- package/src/lib/document/components/document-list/document-list.component.html +46 -0
- package/src/lib/document/components/document-list/document-list.component.scss +513 -0
- package/src/lib/document/components/document-list/document-list.component.spec.ts +486 -0
- package/src/lib/document/components/document-list/document-list.component.ts +682 -0
- package/src/lib/document/components/document-list-item/document-list-item.component.html +36 -0
- package/src/lib/document/components/document-list-item/document-list-item.component.scss +34 -0
- package/src/lib/document/components/document-list-item/document-list-item.component.spec.ts +75 -0
- package/src/lib/document/components/document-list-item/document-list-item.component.ts +40 -0
- package/src/lib/document/components/document-search/document-search.component.html +64 -0
- package/src/lib/document/components/document-search/document-search.component.scss +206 -0
- package/src/lib/document/components/document-search/document-search.component.spec.ts +82 -0
- package/src/lib/document/components/document-search/document-search.component.ts +163 -0
- package/src/lib/document/components/document-status/document-status.component.html +31 -0
- package/src/lib/document/components/document-status/document-status.component.scss +192 -0
- package/src/lib/document/components/document-status/document-status.component.spec.ts +23 -0
- package/src/lib/document/components/document-status/document-status.component.ts +87 -0
- package/src/lib/document/components/document-upload/document-upload.component.html +160 -0
- package/src/lib/document/components/document-upload/document-upload.component.scss +235 -0
- package/src/lib/document/components/document-upload/document-upload.component.spec.ts +95 -0
- package/src/lib/document/components/document-upload/document-upload.component.ts +668 -0
- package/src/lib/document/components/document-viewer/document-viewer.component.html +50 -0
- package/src/lib/document/components/document-viewer/document-viewer.component.scss +187 -0
- package/src/lib/document/components/document-viewer/document-viewer.component.spec.ts +79 -0
- package/src/lib/document/components/document-viewer/document-viewer.component.ts +261 -0
- package/src/lib/document/components/document-zoom-controls/document-zoom-controls.component.html +48 -0
- package/src/lib/document/components/document-zoom-controls/document-zoom-controls.component.scss +320 -0
- package/src/lib/document/components/document-zoom-controls/document-zoom-controls.component.spec.ts +59 -0
- package/src/lib/document/components/document-zoom-controls/document-zoom-controls.component.ts +150 -0
- package/src/lib/document/components/documents-menu/documents-menu.component.html +44 -0
- package/src/lib/document/components/documents-menu/documents-menu.component.scss +363 -0
- package/src/lib/document/components/documents-menu/documents-menu.component.spec.ts +23 -0
- package/src/lib/document/components/documents-menu/documents-menu.component.ts +316 -0
- package/src/lib/document/components/folder-block/folder-block.component.html +46 -0
- package/src/lib/document/components/folder-block/folder-block.component.scss +9 -0
- package/src/lib/document/components/folder-block/folder-block.component.spec.ts +70 -0
- package/{lib/document/components/folder-block/folder-block.component.d.ts → src/lib/document/components/folder-block/folder-block.component.ts} +28 -12
- package/src/lib/document/components/folder-container/folder-container.component.html +56 -0
- package/src/lib/document/components/folder-container/folder-container.component.scss +20 -0
- package/src/lib/document/components/folder-container/folder-container.component.spec.ts +27 -0
- package/src/lib/document/components/folder-container/folder-container.component.ts +328 -0
- package/src/lib/document/components/linked-document/linked-document.component.html +23 -0
- package/src/lib/document/components/linked-document/linked-document.component.scss +10 -0
- package/src/lib/document/components/linked-document/linked-document.component.spec.ts +61 -0
- package/src/lib/document/components/linked-document/linked-document.component.ts +49 -0
- package/src/lib/document/components/request-document/request-document.component.html +86 -0
- package/src/lib/document/components/request-document/request-document.component.scss +16 -0
- package/src/lib/document/components/request-document/request-document.component.ts +278 -0
- package/src/lib/document/components/sidebar/sidebar.component.html +75 -0
- package/src/lib/document/components/sidebar/sidebar.component.scss +157 -0
- package/src/lib/document/components/sidebar/sidebar.component.spec.ts +114 -0
- package/src/lib/document/components/sidebar/sidebar.component.ts +223 -0
- package/src/lib/document/components/user-list/user-list.component.html +33 -0
- package/src/lib/document/components/user-list/user-list.component.scss +118 -0
- package/src/lib/document/components/user-list/user-list.component.spec.ts +23 -0
- package/src/lib/document/components/user-list/user-list.component.ts +181 -0
- package/src/lib/document/constant/DOCUMENT_HISTORY.ts +52 -0
- package/src/lib/document/directives/document.directive.ts +32 -0
- package/src/lib/document/directives/permission.directive.spec.ts +0 -0
- package/src/lib/document/directives/permission.directive.ts +72 -0
- package/src/lib/document/document.module.ts +351 -0
- package/{lib/document/models/document-alert.model.d.ts → src/lib/document/models/document-alert.model.ts} +11 -4
- package/src/lib/document/models/document-category.model.ts +30 -0
- package/src/lib/document/models/document-history.model.ts +109 -0
- package/src/lib/document/models/document-list-response.model.ts +37 -0
- package/src/lib/document/models/document-type.model.ts +44 -0
- package/src/lib/document/models/document.model.ts +53 -0
- package/{lib/document/models/folder.model.d.ts → src/lib/document/models/folder.model.ts} +10 -4
- package/src/lib/document/models/status-data.model.ts +31 -0
- package/src/lib/document/models/uploaded-file-response.model.ts +7 -0
- package/src/lib/document/models/user-list.model.ts +10 -0
- package/src/lib/document/services/csv-parser.service.spec.ts +97 -0
- package/src/lib/document/services/csv-parser.service.ts +303 -0
- package/src/lib/document/services/document-actions.service.ts +125 -0
- package/src/lib/document/services/document-content-type.service.ts +193 -0
- package/src/lib/document/services/document-history-style.service.ts +138 -0
- package/src/lib/document/services/document-history.service.ts +129 -0
- package/src/lib/document/services/document-http.service.spec.ts +119 -0
- package/src/lib/document/services/document-http.service.ts +497 -0
- package/src/lib/document/services/document-list.service.ts +195 -0
- package/src/lib/document/services/document-menu.service.ts +277 -0
- package/src/lib/document/services/document-scroll.service.ts +138 -0
- package/src/lib/document/services/document-severity.service.ts +98 -0
- package/src/lib/document/services/document-table-builder.service.ts +82 -0
- package/src/lib/document/services/document-upload-business.service.ts +326 -0
- package/src/lib/document/services/document-upload-data.service.ts +82 -0
- package/src/lib/document/services/document-upload-form.service.ts +149 -0
- package/src/lib/document/services/document-upload.service.spec.ts +99 -0
- package/src/lib/document/services/document-upload.service.ts +209 -0
- package/src/lib/document/services/document-viewer.service.ts +279 -0
- package/src/lib/document/services/document-zoom.service.spec.ts +56 -0
- package/src/lib/document/services/document-zoom.service.ts +164 -0
- package/src/lib/document/services/document.service.ts +356 -0
- package/src/lib/document/services/eml-parser.service.ts +444 -0
- package/src/lib/document/services/excel-parser.service.spec.ts +66 -0
- package/src/lib/document/services/excel-parser.service.ts +483 -0
- package/src/lib/document/services/file-format.service.spec.ts +16 -0
- package/src/lib/document/services/file-format.service.ts +63 -0
- package/src/lib/document/services/status-calculator.service.ts +44 -0
- package/src/lib/document/services/user-list.service.ts +77 -0
- package/src/lib/document/state/document.query.ts +378 -0
- package/{lib/document/state/document.service.d.ts → src/lib/document/state/document.service.ts} +46 -15
- package/src/lib/document/state/document.state.ts +100 -0
- package/src/lib/document/state/document.store.ts +200 -0
- package/{public-api.d.ts → src/public-api.ts} +4 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +15 -0
- package/Shared/components/confirmation-dialog/confirmation-dialog.component.d.ts +0 -44
- package/Shared/components/table-primary/table-primary.component.d.ts +0 -31
- package/Shared/components/table-primary/table-primary.model.d.ts +0 -19
- package/Shared/constant/ERROR.d.ts +0 -52
- package/Shared/constant/SHARED.d.ts +0 -546
- package/Shared/services/app-config.service.d.ts +0 -51
- package/Shared/services/session.service.d.ts +0 -46
- package/Shared/shared.module.d.ts +0 -14
- package/fesm2022/cat-documents-ng.mjs +0 -11392
- package/fesm2022/cat-documents-ng.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/document/components/document-actions/document-actions.component.d.ts +0 -78
- package/lib/document/components/document-container/document-container.component.d.ts +0 -162
- package/lib/document/components/document-content-viewer/document-content-viewer.component.d.ts +0 -291
- package/lib/document/components/document-history/document-history.component.d.ts +0 -160
- package/lib/document/components/document-list/document-list.component.d.ts +0 -299
- package/lib/document/components/document-list-item/document-list-item.component.d.ts +0 -28
- package/lib/document/components/document-search/document-search.component.d.ts +0 -77
- package/lib/document/components/document-status/document-status.component.d.ts +0 -24
- package/lib/document/components/document-upload/document-upload.component.d.ts +0 -321
- package/lib/document/components/document-viewer/document-viewer.component.d.ts +0 -137
- package/lib/document/components/document-zoom-controls/document-zoom-controls.component.d.ts +0 -33
- package/lib/document/components/documents-menu/documents-menu.component.d.ts +0 -110
- package/lib/document/components/folder-container/folder-container.component.d.ts +0 -162
- package/lib/document/components/linked-document/linked-document.component.d.ts +0 -39
- package/lib/document/components/request-document/request-document.component.d.ts +0 -69
- package/lib/document/components/sidebar/sidebar.component.d.ts +0 -109
- package/lib/document/components/user-list/user-list.component.d.ts +0 -34
- package/lib/document/constant/DOCUMENT_HISTORY.d.ts +0 -41
- package/lib/document/directives/document.directive.d.ts +0 -20
- package/lib/document/directives/permission.directive.d.ts +0 -38
- package/lib/document/document.module.d.ts +0 -60
- package/lib/document/models/document-category.model.d.ts +0 -24
- package/lib/document/models/document-history.model.d.ts +0 -94
- package/lib/document/models/document-list-response.model.d.ts +0 -33
- package/lib/document/models/document-type.model.d.ts +0 -37
- package/lib/document/models/document.model.d.ts +0 -44
- package/lib/document/models/status-data.model.d.ts +0 -27
- package/lib/document/models/uploaded-file-response.model.d.ts +0 -7
- package/lib/document/models/user-list.model.d.ts +0 -8
- package/lib/document/services/csv-parser.service.d.ts +0 -88
- package/lib/document/services/document-actions.service.d.ts +0 -48
- package/lib/document/services/document-content-type.service.d.ts +0 -85
- package/lib/document/services/document-history-style.service.d.ts +0 -34
- package/lib/document/services/document-history.service.d.ts +0 -42
- package/lib/document/services/document-http.service.d.ts +0 -179
- package/lib/document/services/document-list.service.d.ts +0 -74
- package/lib/document/services/document-menu.service.d.ts +0 -122
- package/lib/document/services/document-scroll.service.d.ts +0 -55
- package/lib/document/services/document-table-builder.service.d.ts +0 -38
- package/lib/document/services/document-upload-business.service.d.ts +0 -107
- package/lib/document/services/document-upload-data.service.d.ts +0 -40
- package/lib/document/services/document-upload-form.service.d.ts +0 -41
- package/lib/document/services/document-upload.service.d.ts +0 -99
- package/lib/document/services/document-viewer.service.d.ts +0 -97
- package/lib/document/services/document-zoom.service.d.ts +0 -81
- package/lib/document/services/document.service.d.ts +0 -161
- package/lib/document/services/eml-parser.service.d.ts +0 -116
- package/lib/document/services/excel-parser.service.d.ts +0 -169
- package/lib/document/services/file-format.service.d.ts +0 -34
- package/lib/document/services/status-calculator.service.d.ts +0 -20
- package/lib/document/services/user-list.service.d.ts +0 -29
- package/lib/document/state/document.query.d.ts +0 -243
- package/lib/document/state/document.state.d.ts +0 -61
- package/lib/document/state/document.store.d.ts +0 -56
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<div class="status-summary-container">
|
|
2
|
+
<div class="status-cards">
|
|
3
|
+
|
|
4
|
+
<div
|
|
5
|
+
*ngFor="let status of statusDataWithPercentages"
|
|
6
|
+
class="status-card {{ status.statusClass }}"
|
|
7
|
+
[class.selected]="status.isSelected"
|
|
8
|
+
(click)="selectStatus(status.status || '')"
|
|
9
|
+
>
|
|
10
|
+
<div class="status-icon {{ status.iconClass }}">
|
|
11
|
+
<i [class]="status.icon"></i>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="status-info">
|
|
14
|
+
<div class="status-count">{{ status.count }}</div>
|
|
15
|
+
<div class="status-name">{{ status.status }}</div>
|
|
16
|
+
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<div class="progress-bar-container">
|
|
22
|
+
<div class="progress-bar">
|
|
23
|
+
<div
|
|
24
|
+
*ngFor="let status of statusDataWithPercentages"
|
|
25
|
+
class="progress-segment"
|
|
26
|
+
[style.width.%]="status.percentage"
|
|
27
|
+
[style.background-color]="status.color"
|
|
28
|
+
></div>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
.status-summary-container {
|
|
2
|
+
padding: 1rem;
|
|
3
|
+
padding-top: 0px;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.status-cards {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-wrap: wrap;
|
|
9
|
+
gap: 1rem;
|
|
10
|
+
margin-bottom: 1.5rem;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.status-card {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
gap: 0.75rem;
|
|
17
|
+
padding: 0.7rem;
|
|
18
|
+
border-radius: 8px;
|
|
19
|
+
background: white;
|
|
20
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
21
|
+
min-width: 150px;
|
|
22
|
+
flex: 1;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
transition: all 0.2s ease;
|
|
25
|
+
border: 2px solid transparent;
|
|
26
|
+
|
|
27
|
+
&:hover {
|
|
28
|
+
transform: translateY(-2px);
|
|
29
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&.selected {
|
|
33
|
+
border-width: 3px !important;
|
|
34
|
+
border-style: solid !important;
|
|
35
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Selection border colors based on status
|
|
39
|
+
&.selected.status-approved {
|
|
40
|
+
border-color: #10b981 !important;
|
|
41
|
+
background: #ECFDF5 !important;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.selected.status-uploaded {
|
|
45
|
+
border-color: #10b981 !important;
|
|
46
|
+
background: #ECFDF5 !important;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&.selected.status-pending {
|
|
50
|
+
border-color: #6b7280 !important;
|
|
51
|
+
background: #F8FAFC !important;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&.selected.status-reviewing {
|
|
55
|
+
border-color: #f59e0b !important;
|
|
56
|
+
background: #FFFBEB !important;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&.selected.status-rejected {
|
|
60
|
+
border-color: #ef4444 !important;
|
|
61
|
+
background: #FFF1F2 !important;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&.selected.status-alert {
|
|
65
|
+
border-color: #dc2626 !important;
|
|
66
|
+
background: #EF4444 !important;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Default background colors for each status
|
|
70
|
+
&.status-approved {
|
|
71
|
+
background: #ECFDF5;
|
|
72
|
+
|
|
73
|
+
.status-name {
|
|
74
|
+
color: #065f46;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.status-count {
|
|
78
|
+
color: #047857;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&.status-uploaded {
|
|
83
|
+
background: #ECFDF5;
|
|
84
|
+
|
|
85
|
+
.status-name {
|
|
86
|
+
color: #065f46;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.status-count {
|
|
90
|
+
color: #047857;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&.status-pending {
|
|
95
|
+
background: #F8FAFC;
|
|
96
|
+
|
|
97
|
+
.status-name {
|
|
98
|
+
color: #475569;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.status-count {
|
|
102
|
+
color: #334155;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&.status-reviewing {
|
|
107
|
+
background: #FFFBEB;
|
|
108
|
+
|
|
109
|
+
.status-name {
|
|
110
|
+
color: #92400e;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.status-count {
|
|
114
|
+
color: #a16207;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&.status-rejected {
|
|
119
|
+
background: #FFF1F2;
|
|
120
|
+
|
|
121
|
+
.status-name {
|
|
122
|
+
color: #be123c;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.status-count {
|
|
126
|
+
color: #e11d48;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&.status-alert {
|
|
131
|
+
background: #EF4444;
|
|
132
|
+
|
|
133
|
+
.status-name {
|
|
134
|
+
color: white;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.status-count {
|
|
138
|
+
color: white;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.status-icon {
|
|
144
|
+
width: 40px;
|
|
145
|
+
height: 40px;
|
|
146
|
+
border-radius: 50%;
|
|
147
|
+
display: flex;
|
|
148
|
+
align-items: center;
|
|
149
|
+
justify-content: center;
|
|
150
|
+
font-size: 18px;
|
|
151
|
+
color: white;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.icon-approved { background-color: #10b981; }
|
|
155
|
+
.icon-uploaded { background-color: #10b981; }
|
|
156
|
+
.icon-pending { background-color: #6b7280; }
|
|
157
|
+
.icon-reviewing { background-color: #f59e0b; }
|
|
158
|
+
.icon-rejected { background-color: #ef4444; }
|
|
159
|
+
.icon-alert { background-color: #dc2626; }
|
|
160
|
+
|
|
161
|
+
.status-info {
|
|
162
|
+
flex: 1;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.status-name {
|
|
166
|
+
font-weight: 600;
|
|
167
|
+
color: #1f2937;
|
|
168
|
+
margin-bottom: 0.25rem;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.status-count {
|
|
172
|
+
font-size: 1.2rem;
|
|
173
|
+
font-weight: bold;
|
|
174
|
+
color: #374151;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.progress-bar-container {
|
|
178
|
+
margin-top: 1rem;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.progress-bar {
|
|
182
|
+
height: 8px;
|
|
183
|
+
background-color: #e5e7eb;
|
|
184
|
+
border-radius: 4px;
|
|
185
|
+
overflow: hidden;
|
|
186
|
+
display: flex;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.progress-segment {
|
|
190
|
+
height: 100%;
|
|
191
|
+
transition: width 0.3s ease;
|
|
192
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { DocumentStatusComponent } from './document-status.component';
|
|
4
|
+
|
|
5
|
+
describe('DocumentStatusComponent', () => {
|
|
6
|
+
let component: DocumentStatusComponent;
|
|
7
|
+
let fixture: ComponentFixture<DocumentStatusComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [DocumentStatusComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(DocumentStatusComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Component, OnInit, OnDestroy, Input, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { StatusDataModel } from '../../models/status-data.model';
|
|
3
|
+
import { DocumentQuery } from '../../state/document.query';
|
|
4
|
+
import { StatusCalculatorService, CalculatedStatusData } from '../../services/status-calculator.service';
|
|
5
|
+
import { Subscription } from 'rxjs';
|
|
6
|
+
import { SHARED } from '../../../../Shared/constant/SHARED';
|
|
7
|
+
import { DocumentHelperService } from '../../services/document.service';
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'lib-document-status',
|
|
11
|
+
standalone: false,
|
|
12
|
+
templateUrl: './document-status.component.html',
|
|
13
|
+
styleUrl: './document-status.component.scss'
|
|
14
|
+
})
|
|
15
|
+
export class DocumentStatusComponent implements OnInit, OnDestroy, OnChanges {
|
|
16
|
+
@Input() contextId: string = SHARED.EMPTY;
|
|
17
|
+
@Input() statusData: any;
|
|
18
|
+
|
|
19
|
+
selectedStatus: string | null = null;
|
|
20
|
+
statusDataWithPercentages: CalculatedStatusData[] = [];
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
private subscription = new Subscription();
|
|
24
|
+
|
|
25
|
+
constructor(
|
|
26
|
+
private documentQuery: DocumentQuery,
|
|
27
|
+
private documentService: DocumentHelperService,
|
|
28
|
+
private statusCalculatorService: StatusCalculatorService
|
|
29
|
+
) {}
|
|
30
|
+
|
|
31
|
+
ngOnChanges(changes: SimpleChanges): void {
|
|
32
|
+
if (changes['contextId'] && !changes['contextId'].firstChange) {
|
|
33
|
+
// When contextId changes, refetch status data for the new context
|
|
34
|
+
this.refetchStatusData();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
ngOnInit(): void {
|
|
39
|
+
this.subscription.add(
|
|
40
|
+
this.documentQuery.selectSelectedStatus().subscribe(status => {
|
|
41
|
+
this.selectedStatus= status;
|
|
42
|
+
this.updateCalculatedStatusData();
|
|
43
|
+
})
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
this.subscription.add(
|
|
47
|
+
this.documentQuery.selectStatusData().subscribe(statusData => {
|
|
48
|
+
if (statusData && statusData.length > 0) {
|
|
49
|
+
this.statusData = statusData;
|
|
50
|
+
this.updateCalculatedStatusData();
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
if (this.contextId && this.contextId !== SHARED.EMPTY) {
|
|
56
|
+
this.refetchStatusData();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
private refetchStatusData(): void {
|
|
61
|
+
if (this.contextId && this.contextId !== SHARED.EMPTY) {
|
|
62
|
+
const currentState = this.documentQuery.getSelectionState();
|
|
63
|
+
const statusContextId = currentState.userId || null;
|
|
64
|
+
const categoryId = currentState.menuItem || null;
|
|
65
|
+
|
|
66
|
+
// Use the document service to refresh status data for the new context
|
|
67
|
+
this.documentService.refreshStatusData(this.contextId, statusContextId, categoryId);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
selectStatus(status: string): void {
|
|
73
|
+
const newStatus = this.selectedStatus === status ? null : status;
|
|
74
|
+
this.documentService.setSelectedStatus(newStatus);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
private updateCalculatedStatusData(): void {
|
|
78
|
+
this.statusDataWithPercentages = this.statusCalculatorService.calculateStatusDataWithPercentages(
|
|
79
|
+
this.statusData,
|
|
80
|
+
this.selectedStatus
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
ngOnDestroy(): void {
|
|
85
|
+
this.subscription.unsubscribe();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
<div class="document-upload-container">
|
|
2
|
+
<!-- Assignment Section -->
|
|
3
|
+
<div class="assignment-section" *ngIf="!isFormHide">
|
|
4
|
+
<h4>Assign to Applicant(s) or Application <span class="text-red-500">*</span> </h4>
|
|
5
|
+
<div class="radio-group">
|
|
6
|
+
<div class="radio-item">
|
|
7
|
+
<p-radioButton
|
|
8
|
+
name="assignmentType"
|
|
9
|
+
value="Applicant"
|
|
10
|
+
[(ngModel)]="selectedAssignmentType"
|
|
11
|
+
(onClick)="onAssignmentTypeChange()"
|
|
12
|
+
[inputId]="'applicant'"
|
|
13
|
+
></p-radioButton>
|
|
14
|
+
<label [for]="'applicant'" class="radio-label">Applicant(s) </label>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="radio-item">
|
|
17
|
+
<p-radioButton
|
|
18
|
+
name="assignmentType"
|
|
19
|
+
value="Application"
|
|
20
|
+
[(ngModel)]="selectedAssignmentType"
|
|
21
|
+
(onClick)="onAssignmentTypeChange()"
|
|
22
|
+
[inputId]="'application'"
|
|
23
|
+
></p-radioButton>
|
|
24
|
+
<label [for]="'application'" class="radio-label">Application</label>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<!-- Applicant Selection (only shown when Applicant is selected) -->
|
|
30
|
+
<div class="applicant-section" *ngIf="!isFormHide && selectedAssignmentType === 'Applicant'">
|
|
31
|
+
<h4>Select Applicant(s) <span class="text-red-500">*</span></h4>
|
|
32
|
+
<div class="grid">
|
|
33
|
+
<div
|
|
34
|
+
*ngFor="let applicant of filteredApplicantList"
|
|
35
|
+
class="applicant-item col-12 md:col-6"
|
|
36
|
+
>
|
|
37
|
+
<p-radioButton
|
|
38
|
+
name="selectedApplicant"
|
|
39
|
+
[value]="applicant._id"
|
|
40
|
+
[(ngModel)]="selectedApplicant"
|
|
41
|
+
[inputId]="'applicant-' + applicant._id"
|
|
42
|
+
(onClick)="onApplicantSelectionChange()"
|
|
43
|
+
></p-radioButton>
|
|
44
|
+
<label [for]="'applicant-' + applicant._id" class="applicant-label">
|
|
45
|
+
{{ applicant.name }}
|
|
46
|
+
</label>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<!-- Category Selection -->
|
|
52
|
+
<div class="category-section" *ngIf="!isFormHide">
|
|
53
|
+
<h4>Category <span class="text-red-500">*</span></h4>
|
|
54
|
+
<p-dropdown
|
|
55
|
+
[options]="categoryOptions"
|
|
56
|
+
[(ngModel)]="selectedCategory"
|
|
57
|
+
placeholder="Select Category type"
|
|
58
|
+
optionLabel="label"
|
|
59
|
+
optionValue="_id"
|
|
60
|
+
(onChange)="onCategoryChange()"
|
|
61
|
+
[disabled]="!categoryOptions.length"
|
|
62
|
+
class="w-full"
|
|
63
|
+
></p-dropdown>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<!-- Document Type Selection -->
|
|
67
|
+
<div class="document-type-section" *ngIf="!isFormHide">
|
|
68
|
+
<h4>Document Type <span class="text-red-500">*</span></h4>
|
|
69
|
+
<p-dropdown
|
|
70
|
+
[options]="documentTypeOptions"
|
|
71
|
+
[(ngModel)]="selectedDocumentType"
|
|
72
|
+
placeholder="Select Document type"
|
|
73
|
+
optionLabel="label"
|
|
74
|
+
optionValue="_id"
|
|
75
|
+
(onChange)="onDocumentTypeChange()"
|
|
76
|
+
[disabled]="!documentTypeOptions.length || !selectedCategory"
|
|
77
|
+
class="w-full"
|
|
78
|
+
></p-dropdown>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<!-- File Upload Section -->
|
|
82
|
+
<div class="file-upload-section">
|
|
83
|
+
<h4>Upload Documents <span class="text-red-500" *ngIf="!isFormHide">*</span></h4>
|
|
84
|
+
<div class="grid">
|
|
85
|
+
<div class="col-12 md:col-12">
|
|
86
|
+
<p-fileUpload
|
|
87
|
+
#fileUploader
|
|
88
|
+
[multiple]="true"
|
|
89
|
+
auto="true"
|
|
90
|
+
[accept]="getFileUploadAcceptString()"
|
|
91
|
+
maxFileSize="27295616"
|
|
92
|
+
(onSelect)="onSelectedFiles($event)"
|
|
93
|
+
>
|
|
94
|
+
<ng-template pTemplate="header" let-chooseCallback="chooseCallback" let-clearCallback="clearCallback">
|
|
95
|
+
<div class="docHeader p-2 flex flex-wrap justify-content-between align-items-center flex-1 gap-2">
|
|
96
|
+
<div class="flex gap-2">
|
|
97
|
+
<p-button
|
|
98
|
+
*ngIf="!isMultiAttachmentHidden"
|
|
99
|
+
(onClick)="choose($event, chooseCallback)"
|
|
100
|
+
icon="pi pi-images"
|
|
101
|
+
[rounded]="true"
|
|
102
|
+
[outlined]="true"
|
|
103
|
+
/>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
</ng-template>
|
|
107
|
+
<ng-template pTemplate="content" let-removeFileCallback="removeFileCallback"
|
|
108
|
+
let-removeUploadedFileCallback="removeUploadedFileCallback">
|
|
109
|
+
<div class="col-12 md:col-12 p-0">
|
|
110
|
+
<div class="col-12 md:col-12 p-0" *ngIf="uploadedFiles.length > 0">
|
|
111
|
+
<div *ngFor="let uploadedFile of uploadedFiles; let i = index"
|
|
112
|
+
class="m-0 flex flex-column align-items-center gap-1 mt-3">
|
|
113
|
+
<div class="col-12 md:col-12 p-0 flex documentInfo">
|
|
114
|
+
<div class="documentImage">
|
|
115
|
+
<img src="../../../../assets/images/document.png" [alt]="uploadedFile.file.name" width="45" height="50"
|
|
116
|
+
class="object-contain" />
|
|
117
|
+
</div>
|
|
118
|
+
<div class="flex w-full flex-column mt-2 ml-2">
|
|
119
|
+
<div class="flex justify-content-between">
|
|
120
|
+
<div style="font-weight: bold;font-size: 14px">
|
|
121
|
+
{{ uploadedFile.file.name }}
|
|
122
|
+
</div>
|
|
123
|
+
<i class="pi pi-times cursor-pointer" (click)="handleDocumentRemove(uploadedFile.file,i)"></i>
|
|
124
|
+
</div>
|
|
125
|
+
<div class="flex justify-content-between mt-1">
|
|
126
|
+
<div style="color: #676B89; font-size: 12px; color: green;" class="pi pi-verified">
|
|
127
|
+
{{ uploadedFile.formattedSize }}
|
|
128
|
+
</div>
|
|
129
|
+
<div class="white-space-nowrap" style="color: #0F8BFD; font-family: 14px;">
|
|
130
|
+
{{ uploadedFile.progress }} %
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
<div class="col-12 md:col-12 p-0">
|
|
136
|
+
<p-progressBar
|
|
137
|
+
[value]="uploadedFile.progress ?? 0"
|
|
138
|
+
[showValue]="false"
|
|
139
|
+
styleClass="h-1/2rem md:ml-auto relative"
|
|
140
|
+
[ngClass]="{ 'exceeded-progress-bar': (uploadedFile.progress ?? 0) > 100 }"
|
|
141
|
+
>
|
|
142
|
+
</p-progressBar>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
</ng-template>
|
|
148
|
+
<ng-template pTemplate="empty" let-chooseCallback="chooseCallback">
|
|
149
|
+
<div *ngIf="!uploadedFiles.length" class="flex align-items-center justify-content-center flex-column"
|
|
150
|
+
(click)="triggerFileUpload()">
|
|
151
|
+
<i class="pi pi-cloud-upload border-2 border-circle p-5 text-8xl text-400 border-400"></i>
|
|
152
|
+
<p class="mt-4 mb-0">Drag and drop files here to upload.</p>
|
|
153
|
+
</div>
|
|
154
|
+
</ng-template>
|
|
155
|
+
<ng-template pTemplate="file"> </ng-template>
|
|
156
|
+
</p-fileUpload>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|