cat-documents-ng 0.2.44 → 0.2.47
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/Shared/constant/ERROR.d.ts +13 -0
- package/Shared/constant/SHARED.d.ts +12 -0
- package/fesm2022/cat-documents-ng.mjs +543 -338
- package/fesm2022/cat-documents-ng.mjs.map +1 -1
- package/lib/document/components/document-container/document-container.component.d.ts +15 -3
- package/lib/document/components/document-history/document-history.component.d.ts +12 -13
- package/lib/document/components/document-list/document-list.component.d.ts +17 -67
- package/lib/document/components/document-status/document-status.component.d.ts +5 -3
- package/lib/document/components/documents-menu/documents-menu.component.d.ts +10 -0
- package/lib/document/services/document-history.service.d.ts +42 -0
- package/lib/document/services/document-http.service.d.ts +1 -4
- package/lib/document/services/document-list.service.d.ts +78 -0
- package/lib/document/services/document.service.d.ts +7 -0
- package/package.json +1 -1
- package/Shared/constant/PERMISSIONS.d.ts +0 -14
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable, EventEmitter, Output, Input, Component, ViewChild, ViewEncapsulation, Directive, NgModule, APP_INITIALIZER } from '@angular/core';
|
|
3
|
-
import * as
|
|
3
|
+
import * as i2$1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import { firstValueFrom, tap, EMPTY, catchError, throwError, of, combineLatest, Subscription, Subject, takeUntil, debounceTime as debounceTime$1, distinctUntilChanged as distinctUntilChanged$1 } from 'rxjs';
|
|
6
6
|
import { __decorate } from 'tslib';
|
|
@@ -16,18 +16,18 @@ import { MessageService } from 'primeng/api';
|
|
|
16
16
|
import * as i1 from '@angular/router';
|
|
17
17
|
import * as i4 from 'primeng/button';
|
|
18
18
|
import { ButtonModule } from 'primeng/button';
|
|
19
|
-
import * as
|
|
19
|
+
import * as i5$2 from 'primeng/sidebar';
|
|
20
20
|
import { SidebarModule } from 'primeng/sidebar';
|
|
21
21
|
import * as i6 from 'primeng/messages';
|
|
22
22
|
import * as i7$1 from 'primeng/dialog';
|
|
23
23
|
import { DialogModule } from 'primeng/dialog';
|
|
24
|
-
import * as
|
|
24
|
+
import * as i9 from 'primeng/dropdown';
|
|
25
25
|
import { DropdownModule } from 'primeng/dropdown';
|
|
26
|
-
import * as
|
|
26
|
+
import * as i10 from 'primeng/inputtext';
|
|
27
27
|
import { InputTextModule } from 'primeng/inputtext';
|
|
28
|
-
import * as i2$
|
|
28
|
+
import * as i2$2 from 'primeng/table';
|
|
29
29
|
import { TableModule } from 'primeng/table';
|
|
30
|
-
import * as i5
|
|
30
|
+
import * as i5 from 'primeng/ripple';
|
|
31
31
|
import { RippleModule } from 'primeng/ripple';
|
|
32
32
|
import * as i7 from 'primeng/fileupload';
|
|
33
33
|
import { FileUploadModule } from 'primeng/fileupload';
|
|
@@ -37,13 +37,13 @@ import * as i7$2 from 'ng2-pdf-viewer';
|
|
|
37
37
|
import { PdfViewerModule } from 'ng2-pdf-viewer';
|
|
38
38
|
import * as i3$2 from 'primeng/accordion';
|
|
39
39
|
import { AccordionModule } from 'primeng/accordion';
|
|
40
|
-
import * as i5$
|
|
40
|
+
import * as i5$1 from 'primeng/inputtextarea';
|
|
41
41
|
import { InputTextareaModule } from 'primeng/inputtextarea';
|
|
42
42
|
import * as i7$3 from 'primeng/badge';
|
|
43
43
|
import { BadgeModule } from 'primeng/badge';
|
|
44
44
|
import * as i8$1 from 'primeng/menu';
|
|
45
45
|
import { MenuModule } from 'primeng/menu';
|
|
46
|
-
import * as i9 from 'primeng/card';
|
|
46
|
+
import * as i9$1 from 'primeng/card';
|
|
47
47
|
import { CardModule } from 'primeng/card';
|
|
48
48
|
import { ListboxModule } from 'primeng/listbox';
|
|
49
49
|
import { TimelineModule } from 'primeng/timeline';
|
|
@@ -237,6 +237,18 @@ class SHARED {
|
|
|
237
237
|
* @type {string}
|
|
238
238
|
*/
|
|
239
239
|
static DOCUMENT_TYPE_ID = 'documentTypeId';
|
|
240
|
+
/**
|
|
241
|
+
* Represent blob.
|
|
242
|
+
* @static
|
|
243
|
+
* @type {string}
|
|
244
|
+
*/
|
|
245
|
+
static DOCUMENT = 'document';
|
|
246
|
+
/**
|
|
247
|
+
* Represent none.
|
|
248
|
+
* @static
|
|
249
|
+
* @type {string}
|
|
250
|
+
*/
|
|
251
|
+
static NONE = 'none';
|
|
240
252
|
/**
|
|
241
253
|
* Represent upload summery.
|
|
242
254
|
* @static
|
|
@@ -772,6 +784,57 @@ const DUMMY_DOCUMENT_SECTIONS = [
|
|
|
772
784
|
}
|
|
773
785
|
];
|
|
774
786
|
|
|
787
|
+
/**
|
|
788
|
+
* A utility class containing common error messages.
|
|
789
|
+
* @class ERRORS
|
|
790
|
+
*/
|
|
791
|
+
class ERRORS {
|
|
792
|
+
/**
|
|
793
|
+
* Error message for invalid recipient.
|
|
794
|
+
* @static
|
|
795
|
+
* @type {string}
|
|
796
|
+
*/
|
|
797
|
+
static INVALID_RECIPIENT = "Invalid recipient: The recipient cannot be empty.";
|
|
798
|
+
static NO_VALUE_FOUND = "No value found";
|
|
799
|
+
/**
|
|
800
|
+
* Error message for invalid document.
|
|
801
|
+
* @static
|
|
802
|
+
* @type {string}
|
|
803
|
+
*/
|
|
804
|
+
static ERROR_FETCHING_DOCUMENTS = "Error fetching documents:";
|
|
805
|
+
/**
|
|
806
|
+
* Error message for invalid document.
|
|
807
|
+
* @static
|
|
808
|
+
* @type {string}
|
|
809
|
+
*/
|
|
810
|
+
static ERROR_FETCHING_FOLDERS = "Error fetching folders:";
|
|
811
|
+
/**
|
|
812
|
+
* Error message for invalid document.
|
|
813
|
+
* @static
|
|
814
|
+
* @type {string}
|
|
815
|
+
*/
|
|
816
|
+
static ERROR_ALLDOCUMENT_MISSING = "allDocumentTypes is missing in the response:";
|
|
817
|
+
/**
|
|
818
|
+
* Error message for invalid document.
|
|
819
|
+
* @static
|
|
820
|
+
* @type {string}
|
|
821
|
+
*/
|
|
822
|
+
static ERROR_DOCUMENT_TYPES = "Error fetching document types:";
|
|
823
|
+
static ERROR_DOCUMENT_CATAGORY = 'Error fetching document categories:';
|
|
824
|
+
static NO_DOCUMENT_URL = 'No document URL provided for download';
|
|
825
|
+
static DOWNLOAD_FAIL = 'Download failed:';
|
|
826
|
+
static ERROR_DELETING_DOCUMENT = 'Error deleting document:';
|
|
827
|
+
static ERROR_RECEIVING_DOCUMENT_LIST = 'Error receiving document list response:';
|
|
828
|
+
static CONTEXT_ID_REQUIRED = 'Context ID is required to fetch status data';
|
|
829
|
+
static ERROR_FETCHING_STATUS_DATA = 'Error fetching status data:';
|
|
830
|
+
static ERROR_FETCHING_USER_LIST = 'Error fetching user list with filters:';
|
|
831
|
+
static ERROR_FETCHING_DOCUMENT_LIST = 'Error fetching document list:';
|
|
832
|
+
static ERROR_FETCHING_DOCUMENT_CATEGORIES = 'Error fetching document categories:';
|
|
833
|
+
static ERROR_FETCHING_DOCUMENTS_BY_STATUS = 'Error fetching documents by status:';
|
|
834
|
+
static ERROR_FETCHING_DOCUMENTS_BY_CATEGORY = 'Error fetching documents by category:';
|
|
835
|
+
static ERROR_CALLING_API_WITH_SELECTION = 'Error calling API with selection:';
|
|
836
|
+
}
|
|
837
|
+
|
|
775
838
|
/**
|
|
776
839
|
* Creates the initial state for the `DocumentState` store.
|
|
777
840
|
* This function provides default values for all properties in the `DocumentState` interface,
|
|
@@ -1571,8 +1634,11 @@ class DocumentHttpService {
|
|
|
1571
1634
|
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
1572
1635
|
*/
|
|
1573
1636
|
getDocumentCatagories(contextId) {
|
|
1574
|
-
return this.http.get(`${this.apiUrl}${URLS.DOCUMENTS_CATAGORIES}/${contextId}`).pipe(tap((
|
|
1575
|
-
|
|
1637
|
+
return this.http.get(`${this.apiUrl}${URLS.DOCUMENTS_CATAGORIES}/${contextId}`).pipe(tap((response) => {
|
|
1638
|
+
// Store only the categories array, not the entire response
|
|
1639
|
+
if (response && response.categories) {
|
|
1640
|
+
this.documentStore.setDocumentCategories(response.categories);
|
|
1641
|
+
}
|
|
1576
1642
|
}), catchError((error) => {
|
|
1577
1643
|
return throwError(() => new Error(error));
|
|
1578
1644
|
}));
|
|
@@ -1582,13 +1648,16 @@ class DocumentHttpService {
|
|
|
1582
1648
|
* Includes error handling for failed API requests.
|
|
1583
1649
|
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
1584
1650
|
*/
|
|
1585
|
-
getDocumentTypes() {
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1651
|
+
// getDocumentTypes(): Observable<DocumentTypeModel[]> {
|
|
1652
|
+
// return this.http.get<DocumentTypeModel[]>(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${URLS.DOCUMENT_TYPES}`).pipe(
|
|
1653
|
+
// tap((documentTypes: DocumentTypeModel[]) => {
|
|
1654
|
+
// this.documentStore.setDocumentTypes(documentTypes);
|
|
1655
|
+
// }),
|
|
1656
|
+
// catchError((error) => {
|
|
1657
|
+
// return throwError(() => new Error(error));
|
|
1658
|
+
// })
|
|
1659
|
+
// );
|
|
1660
|
+
// }
|
|
1592
1661
|
/**
|
|
1593
1662
|
* Fetches a document by its path name and transforms the response for dropdown options.
|
|
1594
1663
|
* @param {string} documentId - The document ID to fetch the document.
|
|
@@ -1802,7 +1871,7 @@ class DocumentHelperService {
|
|
|
1802
1871
|
this.documentStore.setDocumentListResponse(response);
|
|
1803
1872
|
},
|
|
1804
1873
|
error: (error) => {
|
|
1805
|
-
console.error(
|
|
1874
|
+
console.error(ERRORS.ERROR_CALLING_API_WITH_SELECTION, error);
|
|
1806
1875
|
}
|
|
1807
1876
|
});
|
|
1808
1877
|
}
|
|
@@ -1811,14 +1880,16 @@ class DocumentHelperService {
|
|
|
1811
1880
|
* @param contextId - The context ID to use for API calls
|
|
1812
1881
|
*/
|
|
1813
1882
|
initializeSelectionWatcherWithInitialLoad(contextId) {
|
|
1814
|
-
|
|
1883
|
+
// Make initial API call to load documents
|
|
1884
|
+
this.documentHttpService.getDocumentsBySelection(contextId, null, null, null, null).subscribe({
|
|
1815
1885
|
next: (response) => {
|
|
1816
1886
|
this.documentStore.setDocumentListResponse(response);
|
|
1817
1887
|
},
|
|
1818
1888
|
error: (error) => {
|
|
1819
|
-
console.error(
|
|
1889
|
+
console.error(ERRORS.ERROR_CALLING_API_WITH_SELECTION, error);
|
|
1820
1890
|
}
|
|
1821
1891
|
});
|
|
1892
|
+
// Initialize the selection watcher for future updates
|
|
1822
1893
|
this.initializeSelectionWatcher(contextId);
|
|
1823
1894
|
}
|
|
1824
1895
|
/**
|
|
@@ -1957,6 +2028,22 @@ class DocumentHelperService {
|
|
|
1957
2028
|
}
|
|
1958
2029
|
});
|
|
1959
2030
|
}
|
|
2031
|
+
/**
|
|
2032
|
+
* Refresh status data for a specific context
|
|
2033
|
+
* @param contextId - The context ID to use for the API call
|
|
2034
|
+
* @param statusContextId - The status context ID (usually userId)
|
|
2035
|
+
* @param categoryId - The category ID (usually menuItem)
|
|
2036
|
+
*/
|
|
2037
|
+
refreshStatusData(contextId, statusContextId, categoryId) {
|
|
2038
|
+
this.documentHttpService.getStatusDocumentCount(contextId, statusContextId, categoryId).subscribe({
|
|
2039
|
+
next: (statusData) => {
|
|
2040
|
+
this.documentStore.setStatusData(statusData);
|
|
2041
|
+
},
|
|
2042
|
+
error: (error) => {
|
|
2043
|
+
console.error('Error refreshing status data:', error);
|
|
2044
|
+
}
|
|
2045
|
+
});
|
|
2046
|
+
}
|
|
1960
2047
|
/**
|
|
1961
2048
|
* Refresh all data with current filters after accept/reject/delete operations
|
|
1962
2049
|
* This includes document categories, status data, user list, and document list
|
|
@@ -1981,8 +2068,9 @@ class DocumentHelperService {
|
|
|
1981
2068
|
const categoryId = currentState.menuItem || null;
|
|
1982
2069
|
// Refresh document categories
|
|
1983
2070
|
this.documentHttpService.getDocumentCatagories(contextId).subscribe({
|
|
1984
|
-
next: (
|
|
1985
|
-
|
|
2071
|
+
next: (response) => {
|
|
2072
|
+
// The HTTP service already stores categories in the store via tap operator
|
|
2073
|
+
// No need to store them again here
|
|
1986
2074
|
},
|
|
1987
2075
|
error: (error) => {
|
|
1988
2076
|
console.error('Error refreshing document categories after action:', error);
|
|
@@ -2006,7 +2094,6 @@ class DocumentHelperService {
|
|
|
2006
2094
|
console.error('Error refreshing user list after action:', error);
|
|
2007
2095
|
}
|
|
2008
2096
|
});
|
|
2009
|
-
// Refresh document list
|
|
2010
2097
|
this.refreshDocumentsWithCurrentSelection(contextId);
|
|
2011
2098
|
}
|
|
2012
2099
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHelperService, deps: [{ token: DocumentStore }, { token: DocumentQuery }, { token: DocumentHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -2198,7 +2285,7 @@ class UserListComponent {
|
|
|
2198
2285
|
}
|
|
2199
2286
|
}
|
|
2200
2287
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UserListComponent, deps: [{ token: DocumentHelperService }, { token: DocumentStore }, { token: DocumentQuery }, { token: UserListService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2201
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: UserListComponent, isStandalone: false, selector: "lib-user-list", inputs: { userList: "userList", categories: "categories" }, outputs: { userSelected: "userSelected" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"user-list-container\" [@slideInFromTop]>\r\n <div class=\"user-cards\">\r\n <div \r\n *ngFor=\"let user of filteredUserData\" \r\n class=\"user-card\"\r\n [class.selected]=\"selectedUser === user.name\"\r\n [style.border-color]=\"selectedUser === user.name ? '#f97316' : 'transparent'\"\r\n (click)=\"onUserSelect(user.name, user._id)\"\r\n >\r\n <div class=\"user-avatar\" [ngClass]=\"'avatar-' + user.color\">\r\n <span class=\"initials\">{{ user.initials }}</span>\r\n </div>\r\n <div class=\"user-info\">\r\n <div class=\"username\">{{ user.name }}</div>\r\n <div class=\"document-counts\">\r\n {{ user.approved }} approved / {{ user.pending }} pending\r\n </div>\r\n </div>\r\n <div class=\"selection-indicator\" *ngIf=\"selectedUser === user.name\" [@fadeIn]>\r\n <i class=\"ri-check-line\"></i>\r\n </div>\r\n </div>\r\n \r\n <!-- Show message when filtered list is empty -->\r\n <div *ngIf=\"filteredUserData.length === 0 && shouldShowContainer\" class=\"no-users-message\" [@slideInFromTop]>\r\n <p>No users available for this category.</p>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".user-list-container{padding:1rem}.user-cards{display:flex;flex-wrap:wrap;gap:1rem;transition:all .3s ease-in-out}.user-card{display:flex;align-items:center;gap:.75rem;padding:1rem;border:2px solid transparent;border-radius:8px;cursor:pointer;transition:all .2s ease;background:#fff;box-shadow:0 2px 4px #0000001a;min-width:330px;position:relative}.user-card:hover{box-shadow:0 4px 8px #00000026}.user-card.selected{background-color:#f8fafc;box-shadow:0 4px 8px #00000026;border-width:2px}.user-avatar{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;color:#fff;font-size:14px}.avatar-orange{background-color:#f97316}.avatar-blue{background-color:#3b82f6}.avatar-green{background-color:#10b981}.avatar-grey{background-color:#6b7280}.avatar-purple{background-color:#8b5cf6}.user-info{flex:1}.username{font-weight:600;color:#1f2937;margin-bottom:.25rem}.document-counts{font-size:.875rem;color:#6b7280}.selection-indicator{position:absolute;top:8px;right:8px;width:20px;height:20px;background-color:#10b981;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-size:12px}.no-users-message{display:flex;justify-content:center;align-items:center;padding:2rem;background:#f8fafc;border-radius:8px;border:2px dashed #d1d5db;margin:1rem 0}.no-users-message p{color:#6b7280;font-size:.875rem;font-weight:500;margin:0;text-align:center}\n"], dependencies: [{ kind: "directive", type:
|
|
2288
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: UserListComponent, isStandalone: false, selector: "lib-user-list", inputs: { userList: "userList", categories: "categories" }, outputs: { userSelected: "userSelected" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"user-list-container\" [@slideInFromTop]>\r\n <div class=\"user-cards\">\r\n <div \r\n *ngFor=\"let user of filteredUserData\" \r\n class=\"user-card\"\r\n [class.selected]=\"selectedUser === user.name\"\r\n [style.border-color]=\"selectedUser === user.name ? '#f97316' : 'transparent'\"\r\n (click)=\"onUserSelect(user.name, user._id)\"\r\n >\r\n <div class=\"user-avatar\" [ngClass]=\"'avatar-' + user.color\">\r\n <span class=\"initials\">{{ user.initials }}</span>\r\n </div>\r\n <div class=\"user-info\">\r\n <div class=\"username\">{{ user.name }}</div>\r\n <div class=\"document-counts\">\r\n {{ user.approved }} approved / {{ user.pending }} pending\r\n </div>\r\n </div>\r\n <div class=\"selection-indicator\" *ngIf=\"selectedUser === user.name\" [@fadeIn]>\r\n <i class=\"ri-check-line\"></i>\r\n </div>\r\n </div>\r\n \r\n <!-- Show message when filtered list is empty -->\r\n <div *ngIf=\"filteredUserData.length === 0 && shouldShowContainer\" class=\"no-users-message\" [@slideInFromTop]>\r\n <p>No users available for this category.</p>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".user-list-container{padding:1rem}.user-cards{display:flex;flex-wrap:wrap;gap:1rem;transition:all .3s ease-in-out}.user-card{display:flex;align-items:center;gap:.75rem;padding:1rem;border:2px solid transparent;border-radius:8px;cursor:pointer;transition:all .2s ease;background:#fff;box-shadow:0 2px 4px #0000001a;min-width:330px;position:relative}.user-card:hover{box-shadow:0 4px 8px #00000026}.user-card.selected{background-color:#f8fafc;box-shadow:0 4px 8px #00000026;border-width:2px}.user-avatar{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;color:#fff;font-size:14px}.avatar-orange{background-color:#f97316}.avatar-blue{background-color:#3b82f6}.avatar-green{background-color:#10b981}.avatar-grey{background-color:#6b7280}.avatar-purple{background-color:#8b5cf6}.user-info{flex:1}.username{font-weight:600;color:#1f2937;margin-bottom:.25rem}.document-counts{font-size:.875rem;color:#6b7280}.selection-indicator{position:absolute;top:8px;right:8px;width:20px;height:20px;background-color:#10b981;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-size:12px}.no-users-message{display:flex;justify-content:center;align-items:center;padding:2rem;background:#f8fafc;border-radius:8px;border:2px dashed #d1d5db;margin:1rem 0}.no-users-message p{color:#6b7280;font-size:.875rem;font-weight:500;margin:0;text-align:center}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [
|
|
2202
2289
|
trigger('slideInFromTop', [
|
|
2203
2290
|
state('void', style({
|
|
2204
2291
|
opacity: 0,
|
|
@@ -2305,6 +2392,12 @@ class DocumentStatusComponent {
|
|
|
2305
2392
|
this.documentService = documentService;
|
|
2306
2393
|
this.statusCalculatorService = statusCalculatorService;
|
|
2307
2394
|
}
|
|
2395
|
+
ngOnChanges(changes) {
|
|
2396
|
+
if (changes['contextId'] && !changes['contextId'].firstChange) {
|
|
2397
|
+
// When contextId changes, refetch status data for the new context
|
|
2398
|
+
this.refetchStatusData();
|
|
2399
|
+
}
|
|
2400
|
+
}
|
|
2308
2401
|
ngOnInit() {
|
|
2309
2402
|
this.subscription.add(this.documentQuery.selectSelectedStatus().subscribe(status => {
|
|
2310
2403
|
this.selectedStatus = status;
|
|
@@ -2316,9 +2409,18 @@ class DocumentStatusComponent {
|
|
|
2316
2409
|
this.updateCalculatedStatusData();
|
|
2317
2410
|
}
|
|
2318
2411
|
}));
|
|
2412
|
+
if (this.contextId && this.contextId !== SHARED.EMPTY) {
|
|
2413
|
+
this.refetchStatusData();
|
|
2414
|
+
}
|
|
2319
2415
|
}
|
|
2320
|
-
|
|
2321
|
-
this.
|
|
2416
|
+
refetchStatusData() {
|
|
2417
|
+
if (this.contextId && this.contextId !== SHARED.EMPTY) {
|
|
2418
|
+
const currentState = this.documentQuery.getSelectionState();
|
|
2419
|
+
const statusContextId = currentState.userId || null;
|
|
2420
|
+
const categoryId = currentState.menuItem || null;
|
|
2421
|
+
// Use the document service to refresh status data for the new context
|
|
2422
|
+
this.documentService.refreshStatusData(this.contextId, statusContextId, categoryId);
|
|
2423
|
+
}
|
|
2322
2424
|
}
|
|
2323
2425
|
selectStatus(status) {
|
|
2324
2426
|
const newStatus = this.selectedStatus === status ? null : status;
|
|
@@ -2327,8 +2429,11 @@ class DocumentStatusComponent {
|
|
|
2327
2429
|
updateCalculatedStatusData() {
|
|
2328
2430
|
this.statusDataWithPercentages = this.statusCalculatorService.calculateStatusDataWithPercentages(this.statusData, this.selectedStatus);
|
|
2329
2431
|
}
|
|
2432
|
+
ngOnDestroy() {
|
|
2433
|
+
this.subscription.unsubscribe();
|
|
2434
|
+
}
|
|
2330
2435
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentStatusComponent, deps: [{ token: DocumentQuery }, { token: DocumentHelperService }, { token: StatusCalculatorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2331
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentStatusComponent, isStandalone: false, selector: "lib-document-status", inputs: { contextId: "contextId", statusData: "statusData" }, ngImport: i0, template: "<div class=\"status-summary-container\">\r\n <div class=\"status-cards\">\r\n \r\n <div \r\n *ngFor=\"let status of statusDataWithPercentages\" \r\n class=\"status-card {{ status.statusClass }}\"\r\n [class.selected]=\"status.isSelected\"\r\n (click)=\"selectStatus(status.status || '')\"\r\n >\r\n <div class=\"status-icon {{ status.iconClass }}\">\r\n <i [class]=\"status.icon\"></i>\r\n </div>\r\n <div class=\"status-info\">\r\n <div class=\"status-count\">{{ status.count }}</div>\r\n <div class=\"status-name\">{{ status.status }}</div>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n \r\n <div class=\"progress-bar-container\">\r\n <div class=\"progress-bar\">\r\n <div \r\n *ngFor=\"let status of statusDataWithPercentages\" \r\n class=\"progress-segment\"\r\n [style.width.%]=\"status.percentage\"\r\n [style.background-color]=\"status.color\"\r\n ></div>\r\n </div>\r\n </div>\r\n</div>", styles: [".status-summary-container{padding:1rem}.status-cards{display:flex;flex-wrap:wrap;gap:1rem;margin-bottom:1.5rem}.status-card{display:flex;align-items:center;gap:.75rem;padding:1rem;border-radius:8px;background:#fff;box-shadow:0 2px 4px #0000001a;min-width:150px;flex:1;cursor:pointer;transition:all .2s ease;border:2px solid transparent}.status-card:hover{transform:translateY(-2px);box-shadow:0 4px 8px #00000026}.status-card.selected{border-width:3px!important;border-style:solid!important;box-shadow:0 4px 12px #0003}.status-card.selected.status-approved{border-color:#10b981!important;background:#ecfdf5!important}.status-card.selected.status-pending{border-color:#6b7280!important;background:#f8fafc!important}.status-card.selected.status-reviewing{border-color:#f59e0b!important;background:#fffbeb!important}.status-card.selected.status-rejected{border-color:#ef4444!important;background:#fff1f2!important}.status-card.selected.status-alert{border-color:#dc2626!important;background:#ef4444!important}.status-icon{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:18px;color:#fff}.icon-approved{background-color:#10b981}.icon-pending{background-color:#6b7280}.icon-reviewing{background-color:#f59e0b}.icon-rejected{background-color:#ef4444}.icon-alert{background-color:#dc2626}.status-info{flex:1}.status-name{font-weight:600;color:#1f2937;margin-bottom:.25rem}.status-count{font-size:1.5rem;font-weight:700;color:#374151}.progress-bar-container{margin-top:1rem}.progress-bar{height:8px;background-color:#e5e7eb;border-radius:4px;overflow:hidden;display:flex}.progress-segment{height:100%;transition:width .3s ease}\n"], dependencies: [{ kind: "directive", type:
|
|
2436
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentStatusComponent, isStandalone: false, selector: "lib-document-status", inputs: { contextId: "contextId", statusData: "statusData" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"status-summary-container\">\r\n <div class=\"status-cards\">\r\n \r\n <div \r\n *ngFor=\"let status of statusDataWithPercentages\" \r\n class=\"status-card {{ status.statusClass }}\"\r\n [class.selected]=\"status.isSelected\"\r\n (click)=\"selectStatus(status.status || '')\"\r\n >\r\n <div class=\"status-icon {{ status.iconClass }}\">\r\n <i [class]=\"status.icon\"></i>\r\n </div>\r\n <div class=\"status-info\">\r\n <div class=\"status-count\">{{ status.count }}</div>\r\n <div class=\"status-name\">{{ status.status }}</div>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n \r\n <div class=\"progress-bar-container\">\r\n <div class=\"progress-bar\">\r\n <div \r\n *ngFor=\"let status of statusDataWithPercentages\" \r\n class=\"progress-segment\"\r\n [style.width.%]=\"status.percentage\"\r\n [style.background-color]=\"status.color\"\r\n ></div>\r\n </div>\r\n </div>\r\n</div>", styles: [".status-summary-container{padding:1rem}.status-cards{display:flex;flex-wrap:wrap;gap:1rem;margin-bottom:1.5rem}.status-card{display:flex;align-items:center;gap:.75rem;padding:1rem;border-radius:8px;background:#fff;box-shadow:0 2px 4px #0000001a;min-width:150px;flex:1;cursor:pointer;transition:all .2s ease;border:2px solid transparent}.status-card:hover{transform:translateY(-2px);box-shadow:0 4px 8px #00000026}.status-card.selected{border-width:3px!important;border-style:solid!important;box-shadow:0 4px 12px #0003}.status-card.selected.status-approved{border-color:#10b981!important;background:#ecfdf5!important}.status-card.selected.status-pending{border-color:#6b7280!important;background:#f8fafc!important}.status-card.selected.status-reviewing{border-color:#f59e0b!important;background:#fffbeb!important}.status-card.selected.status-rejected{border-color:#ef4444!important;background:#fff1f2!important}.status-card.selected.status-alert{border-color:#dc2626!important;background:#ef4444!important}.status-icon{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:18px;color:#fff}.icon-approved{background-color:#10b981}.icon-pending{background-color:#6b7280}.icon-reviewing{background-color:#f59e0b}.icon-rejected{background-color:#ef4444}.icon-alert{background-color:#dc2626}.status-info{flex:1}.status-name{font-weight:600;color:#1f2937;margin-bottom:.25rem}.status-count{font-size:1.5rem;font-weight:700;color:#374151}.progress-bar-container{margin-top:1rem}.progress-bar{height:8px;background-color:#e5e7eb;border-radius:4px;overflow:hidden;display:flex}.progress-segment{height:100%;transition:width .3s ease}\n"], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
2332
2437
|
}
|
|
2333
2438
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentStatusComponent, decorators: [{
|
|
2334
2439
|
type: Component,
|
|
@@ -2396,7 +2501,7 @@ class DocumentSearchComponent {
|
|
|
2396
2501
|
// Subject for handling search input changes
|
|
2397
2502
|
searchSubject = new Subject();
|
|
2398
2503
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentSearchComponent, deps: [{ token: DocumentHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2399
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentSearchComponent, isStandalone: false, selector: "document-search", inputs: { contextId: "contextId" }, ngImport: i0, template: "<div class=\"search-container\">\r\n <div class=\"search-input-wrapper\">\r\n <i class=\"pi pi-search search-icon\"></i>\r\n <input \r\n type=\"text\" \r\n [(ngModel)]=\"searchTerm\"\r\n (ngModelChange)=\"onSearchInputChange($event)\"\r\n class=\"search-input\"\r\n placeholder=\"Search by document name, category, type, status or applicant name...\"\r\n [attr.aria-label]=\"'Search documents'\"\r\n />\r\n <button \r\n *ngIf=\"searchTerm\"\r\n type=\"button\"\r\n class=\"clear-button\"\r\n (click)=\"onClearSearch()\"\r\n [attr.aria-label]=\"'Clear search'\"\r\n >\r\n <i class=\"pi pi-times\"></i>\r\n </button>\r\n </div>\r\n</div> ", styles: [".search-container{padding:1rem}.search-input-wrapper{position:relative;width:40%;display:flex;align-items:center;background:#fff;border:1px solid #d1d5db;border-radius:8px;padding:.75rem 1rem;transition:all .2s ease;box-shadow:0 1px 3px #0000001a}.search-input-wrapper:focus-within{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.search-icon{color:#6b7280;margin-right:.75rem;font-size:1rem}.search-input{flex:1;border:none;outline:none;background:transparent;color:#374151}.search-input::placeholder{color:#9ca3af}.search-input:focus{outline:none}.clear-button{background:none;border:none;color:#6b7280;cursor:pointer;padding:.25rem;border-radius:4px;transition:all .2s ease;display:flex;align-items:center;justify-content:center}.clear-button:hover{background-color:#f3f4f6;color:#374151}.clear-button:focus{outline:none;box-shadow:0 0 0 2px #3b82f633}.clear-button i{font-size:.875rem}@media (max-width: 768px){.search-container{padding:.75rem}.search-input-wrapper{padding:.5rem .75rem}.search-input{font-size:.8rem}}\n"], dependencies: [{ kind: "directive", type:
|
|
2504
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentSearchComponent, isStandalone: false, selector: "document-search", inputs: { contextId: "contextId" }, ngImport: i0, template: "<div class=\"search-container\">\r\n <div class=\"search-input-wrapper\">\r\n <i class=\"pi pi-search search-icon\"></i>\r\n <input \r\n type=\"text\" \r\n [(ngModel)]=\"searchTerm\"\r\n (ngModelChange)=\"onSearchInputChange($event)\"\r\n class=\"search-input\"\r\n placeholder=\"Search by document name, category, type, status or applicant name...\"\r\n [attr.aria-label]=\"'Search documents'\"\r\n />\r\n <button \r\n *ngIf=\"searchTerm\"\r\n type=\"button\"\r\n class=\"clear-button\"\r\n (click)=\"onClearSearch()\"\r\n [attr.aria-label]=\"'Clear search'\"\r\n >\r\n <i class=\"pi pi-times\"></i>\r\n </button>\r\n </div>\r\n</div> ", styles: [".search-container{padding:1rem}.search-input-wrapper{position:relative;width:40%;display:flex;align-items:center;background:#fff;border:1px solid #d1d5db;border-radius:8px;padding:.75rem 1rem;transition:all .2s ease;box-shadow:0 1px 3px #0000001a}.search-input-wrapper:focus-within{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.search-icon{color:#6b7280;margin-right:.75rem;font-size:1rem}.search-input{flex:1;border:none;outline:none;background:transparent;color:#374151}.search-input::placeholder{color:#9ca3af}.search-input:focus{outline:none}.clear-button{background:none;border:none;color:#6b7280;cursor:pointer;padding:.25rem;border-radius:4px;transition:all .2s ease;display:flex;align-items:center;justify-content:center}.clear-button:hover{background-color:#f3f4f6;color:#374151}.clear-button:focus{outline:none;box-shadow:0 0 0 2px #3b82f633}.clear-button i{font-size:.875rem}@media (max-width: 768px){.search-container{padding:.75rem}.search-input-wrapper{padding:.5rem .75rem}.search-input{font-size:.8rem}}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
2400
2505
|
}
|
|
2401
2506
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentSearchComponent, decorators: [{
|
|
2402
2507
|
type: Component,
|
|
@@ -2530,59 +2635,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2530
2635
|
type: Input
|
|
2531
2636
|
}] } });
|
|
2532
2637
|
|
|
2533
|
-
/**
|
|
2534
|
-
* A utility class containing common error messages.
|
|
2535
|
-
* @class ERRORS
|
|
2536
|
-
*/
|
|
2537
|
-
class ERRORS {
|
|
2538
|
-
/**
|
|
2539
|
-
* Error message for invalid recipient.
|
|
2540
|
-
* @static
|
|
2541
|
-
* @type {string}
|
|
2542
|
-
*/
|
|
2543
|
-
static INVALID_RECIPIENT = "Invalid recipient: The recipient cannot be empty.";
|
|
2544
|
-
/**
|
|
2545
|
-
* Error message for invalid document.
|
|
2546
|
-
* @static
|
|
2547
|
-
* @type {string}
|
|
2548
|
-
*/
|
|
2549
|
-
static ERROR_FETCHING_DOCUMENTS = "Error fetching documents:";
|
|
2550
|
-
/**
|
|
2551
|
-
* Error message for invalid document.
|
|
2552
|
-
* @static
|
|
2553
|
-
* @type {string}
|
|
2554
|
-
*/
|
|
2555
|
-
static ERROR_FETCHING_FOLDERS = "Error fetching folders:";
|
|
2556
|
-
/**
|
|
2557
|
-
* Error message for invalid document.
|
|
2558
|
-
* @static
|
|
2559
|
-
* @type {string}
|
|
2560
|
-
*/
|
|
2561
|
-
static ERROR_ALLDOCUMENT_MISSING = "allDocumentTypes is missing in the response:";
|
|
2562
|
-
/**
|
|
2563
|
-
* Error message for invalid document.
|
|
2564
|
-
* @static
|
|
2565
|
-
* @type {string}
|
|
2566
|
-
*/
|
|
2567
|
-
static ERROR_DOCUMENT_TYPES = "Error fetching document types:";
|
|
2568
|
-
static ERROR_DOCUMENT_CATAGORY = 'Error fetching document categories:';
|
|
2569
|
-
}
|
|
2570
|
-
|
|
2571
|
-
/**
|
|
2572
|
-
* Storing all permission properties.
|
|
2573
|
-
* @export
|
|
2574
|
-
* @class PERMISSIONS
|
|
2575
|
-
* @typedef {PERMISSIONS}
|
|
2576
|
-
*/
|
|
2577
|
-
class PERMISSIONS {
|
|
2578
|
-
/**
|
|
2579
|
-
* Access permission.
|
|
2580
|
-
* @static
|
|
2581
|
-
* @type {string}
|
|
2582
|
-
*/
|
|
2583
|
-
static DOCUMENT_POST = 'Documents-POST';
|
|
2584
|
-
}
|
|
2585
|
-
|
|
2586
2638
|
/**
|
|
2587
2639
|
* Service for handling document uploads.
|
|
2588
2640
|
* @class DocumentUploadService
|
|
@@ -2863,6 +2915,155 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2863
2915
|
}]
|
|
2864
2916
|
}], ctorParameters: () => [{ type: SessionService }] });
|
|
2865
2917
|
|
|
2918
|
+
class DocumentListService {
|
|
2919
|
+
documentUploadService;
|
|
2920
|
+
documentHttpService;
|
|
2921
|
+
documentQuery;
|
|
2922
|
+
documentStore;
|
|
2923
|
+
documentTableBuilder;
|
|
2924
|
+
documentHelperService;
|
|
2925
|
+
constructor(documentUploadService, documentHttpService, documentQuery, documentStore, documentTableBuilder, documentHelperService) {
|
|
2926
|
+
this.documentUploadService = documentUploadService;
|
|
2927
|
+
this.documentHttpService = documentHttpService;
|
|
2928
|
+
this.documentQuery = documentQuery;
|
|
2929
|
+
this.documentStore = documentStore;
|
|
2930
|
+
this.documentTableBuilder = documentTableBuilder;
|
|
2931
|
+
this.documentHelperService = documentHelperService;
|
|
2932
|
+
}
|
|
2933
|
+
/**
|
|
2934
|
+
* Handle file upload click event
|
|
2935
|
+
*/
|
|
2936
|
+
handleFileUploadClick() {
|
|
2937
|
+
this.documentStore.setMessage(SHARED.EMPTY_ARRAY);
|
|
2938
|
+
}
|
|
2939
|
+
/**
|
|
2940
|
+
* Handle save click to update document name
|
|
2941
|
+
*/
|
|
2942
|
+
handleSaveClick(fileName, selectedDocument) {
|
|
2943
|
+
const payload = { fileName };
|
|
2944
|
+
return this.documentHttpService.updateDocumentName(selectedDocument._id, payload);
|
|
2945
|
+
}
|
|
2946
|
+
/**
|
|
2947
|
+
* Handle document upload
|
|
2948
|
+
*/
|
|
2949
|
+
handleUploadDocument(selectedOption) {
|
|
2950
|
+
if (!selectedOption) {
|
|
2951
|
+
return throwError(() => new Error(ERRORS.INVALID_RECIPIENT));
|
|
2952
|
+
}
|
|
2953
|
+
this.documentUploadService.getDocumentNameAndType(selectedOption);
|
|
2954
|
+
this.documentUploadService.handleTemplatedUpload();
|
|
2955
|
+
return this.documentQuery.selectMessages();
|
|
2956
|
+
}
|
|
2957
|
+
/**
|
|
2958
|
+
* Get completion count for a category
|
|
2959
|
+
*/
|
|
2960
|
+
getCompletionCount(category) {
|
|
2961
|
+
return this.documentTableBuilder.getCompletionCount(category);
|
|
2962
|
+
}
|
|
2963
|
+
/**
|
|
2964
|
+
* Get pending document count for a category
|
|
2965
|
+
*/
|
|
2966
|
+
getPendingDocumentCount(category) {
|
|
2967
|
+
return this.documentTableBuilder.getPendingDocumentCount(category);
|
|
2968
|
+
}
|
|
2969
|
+
/**
|
|
2970
|
+
* Get approved document count for a category
|
|
2971
|
+
*/
|
|
2972
|
+
getApprovedDocumentCount(category) {
|
|
2973
|
+
return this.documentTableBuilder.getApprovedDocumentCount(category);
|
|
2974
|
+
}
|
|
2975
|
+
/**
|
|
2976
|
+
* Build document categories from API response
|
|
2977
|
+
*/
|
|
2978
|
+
buildDocumentCategories(documentListResponse) {
|
|
2979
|
+
if (!documentListResponse) {
|
|
2980
|
+
return {
|
|
2981
|
+
documentCategories: SHARED.EMPTY_ARRAY,
|
|
2982
|
+
categoryTables: SHARED.EMPTY_ARRAY,
|
|
2983
|
+
categoryCompletionCounts: SHARED.EMPTY_ARRAY
|
|
2984
|
+
};
|
|
2985
|
+
}
|
|
2986
|
+
// Handle empty response - create a default category to show "No records found"
|
|
2987
|
+
if (documentListResponse.length === 0) {
|
|
2988
|
+
const defaultCategory = {
|
|
2989
|
+
label: SHARED.EMPTY,
|
|
2990
|
+
categoryDescription: SHARED.NO_DOCUMENTS_FOUND,
|
|
2991
|
+
list: SHARED.EMPTY_ARRAY,
|
|
2992
|
+
totalDocs: 0,
|
|
2993
|
+
acceptedDocs: 0,
|
|
2994
|
+
completed: '0/0'
|
|
2995
|
+
};
|
|
2996
|
+
return {
|
|
2997
|
+
documentCategories: [defaultCategory],
|
|
2998
|
+
categoryTables: [this.documentTableBuilder.buildDocumentTable([])],
|
|
2999
|
+
categoryCompletionCounts: ['0/0']
|
|
3000
|
+
};
|
|
3001
|
+
}
|
|
3002
|
+
const documentCategories = [...documentListResponse];
|
|
3003
|
+
const categoryTables = documentListResponse.map(category => this.documentTableBuilder.buildDocumentTable(category.list));
|
|
3004
|
+
const categoryCompletionCounts = documentListResponse.map(category => this.getCompletionCount(category));
|
|
3005
|
+
return {
|
|
3006
|
+
documentCategories,
|
|
3007
|
+
categoryTables,
|
|
3008
|
+
categoryCompletionCounts
|
|
3009
|
+
};
|
|
3010
|
+
}
|
|
3011
|
+
/**
|
|
3012
|
+
* Handle table row click
|
|
3013
|
+
*/
|
|
3014
|
+
handleTableRowClick(rowData) {
|
|
3015
|
+
return rowData;
|
|
3016
|
+
}
|
|
3017
|
+
/**
|
|
3018
|
+
* Handle delete action
|
|
3019
|
+
*/
|
|
3020
|
+
handleDeleteAction(rowData, contextId) {
|
|
3021
|
+
if (!rowData._id || !contextId) {
|
|
3022
|
+
return throwError(() => new Error('Missing required parameters for delete'));
|
|
3023
|
+
}
|
|
3024
|
+
return this.documentHttpService.deleteDocument(rowData._id, contextId);
|
|
3025
|
+
}
|
|
3026
|
+
/**
|
|
3027
|
+
* Refresh document list for new context
|
|
3028
|
+
*/
|
|
3029
|
+
refreshDocumentListForNewContext(contextId) {
|
|
3030
|
+
if (contextId && contextId !== SHARED.EMPTY) {
|
|
3031
|
+
// Clear current document list response
|
|
3032
|
+
this.documentStore.setDocumentListResponse(null);
|
|
3033
|
+
// Refresh documents for the new context
|
|
3034
|
+
this.documentHelperService.refreshDocumentsWithoutFilters(contextId);
|
|
3035
|
+
}
|
|
3036
|
+
}
|
|
3037
|
+
/**
|
|
3038
|
+
* Refresh document list after status update
|
|
3039
|
+
*/
|
|
3040
|
+
refreshDocumentList(contextId) {
|
|
3041
|
+
if (contextId) {
|
|
3042
|
+
this.documentHelperService.refreshDocumentsWithCurrentSelection(contextId);
|
|
3043
|
+
}
|
|
3044
|
+
}
|
|
3045
|
+
/**
|
|
3046
|
+
* Setup subscription to document list response
|
|
3047
|
+
*/
|
|
3048
|
+
setupDocumentListSubscription() {
|
|
3049
|
+
return this.documentQuery.selectDocumentListResponse();
|
|
3050
|
+
}
|
|
3051
|
+
/**
|
|
3052
|
+
* Refresh all data with current filters
|
|
3053
|
+
*/
|
|
3054
|
+
refreshAllDataWithCurrentFilters(contextId) {
|
|
3055
|
+
this.documentHelperService.refreshAllDataWithCurrentFilters(contextId);
|
|
3056
|
+
}
|
|
3057
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentListService, deps: [{ token: DocumentUploadService }, { token: DocumentHttpService }, { token: DocumentQuery }, { token: DocumentStore }, { token: DocumentTableBuilderService }, { token: DocumentHelperService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3058
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentListService, providedIn: 'root' });
|
|
3059
|
+
}
|
|
3060
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentListService, decorators: [{
|
|
3061
|
+
type: Injectable,
|
|
3062
|
+
args: [{
|
|
3063
|
+
providedIn: 'root'
|
|
3064
|
+
}]
|
|
3065
|
+
}], ctorParameters: () => [{ type: DocumentUploadService }, { type: DocumentHttpService }, { type: DocumentQuery }, { type: DocumentStore }, { type: DocumentTableBuilderService }, { type: DocumentHelperService }] });
|
|
3066
|
+
|
|
2866
3067
|
class TablePrimaryComponent {
|
|
2867
3068
|
tableData = { columns: [], data: [] };
|
|
2868
3069
|
showHeader = true;
|
|
@@ -2944,7 +3145,7 @@ class TablePrimaryComponent {
|
|
|
2944
3145
|
this.rowClick.emit(rowData);
|
|
2945
3146
|
}
|
|
2946
3147
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TablePrimaryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2947
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: TablePrimaryComponent, isStandalone: false, selector: "lib-table-primary", inputs: { tableData: "tableData", showHeader: "showHeader", tableStyle: "tableStyle" }, outputs: { rowClick: "rowClick", deleteAction: "deleteAction" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"card\">\r\n <p-table [value]=\"processedData\" [tableStyle]=\"tableStyle\">\r\n <ng-template pTemplate=\"header\" *ngIf=\"showHeader\">\r\n <tr>\r\n <th *ngFor=\"let col of tableData.columns\" [style.width]=\"col.width\">\r\n {{ col.header }}\r\n </th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-rowData>\r\n <tr (click)=\"onRowClick(rowData)\" class=\"clickable-row\">\r\n <td *ngFor=\"let col of tableData.columns\" [style.width]=\"col.width\">\r\n <!-- Document Cell -->\r\n <div *ngIf=\"col.type === SHARED.CELL_TYPE_DOCUMENT\" class=\"document-cell\">\r\n <div class=\"document-info\">\r\n <div class=\"document-icon\">\r\n <i [class]=\"SHARED.ICON_FILE_PDF\" *ngIf=\"rowData._isPdfFile\"></i>\r\n <i [class]=\"SHARED.ICON_IMAGE\" *ngIf=\"rowData._isImageFile\"></i>\r\n <i [class]=\"SHARED.ICON_FILE_EXCEL\" *ngIf=\"rowData._isExcelFile\"></i>\r\n <i [class]=\"SHARED.ICON_FILE\" *ngIf=\"rowData._isOtherFile\"></i>\r\n </div>\r\n <div class=\"document-details\">\r\n <div class=\"document-name\">{{ rowData.docName }}</div>\r\n <div class=\"file-info\">{{ rowData.fileName }} - {{ rowData.fileSize }}</div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Status Cell -->\r\n \r\n <div *ngIf=\"col.type === SHARED.CELL_TYPE_STATUS\" class=\"status-cell\">\r\n <span class=\"status-pill\" [ngClass]=\"rowData._statusClass\">\r\n <i [class]=\"rowData._statusIcon\"></i>\r\n {{ rowData[col.field] }}\r\n </span>\r\n </div>\r\n\r\n <!-- Actions Cell -->\r\n <div *ngIf=\"col.type === SHARED.CELL_TYPE_ACTIONS\" class=\"actions-cell\">\r\n @if(rowData.isUploaded){\r\n <button pButton pRipple type=\"button\" [icon]=\"SHARED.ICON_DELETE\" \r\n class=\"p-button-text p-button-rounded\" \r\n (click)=\"onActionClick($event, rowData)\">\r\n </button>\r\n } \r\n </div>\r\n\r\n <!-- Default Text Cell -->\r\n <div *ngIf=\"!col.type || col.type === SHARED.CELL_TYPE_TEXT\" class=\"text-cell\">\r\n {{ rowData[col.field] }}\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n \r\n <!-- No Records Template -->\r\n <ng-template pTemplate=\"emptymessage\">\r\n <tr>\r\n <td [attr.colspan]=\"tableData.columns.length\" class=\"no-records-cell\">\r\n <div class=\"no-records-content\">\r\n <i class=\"pi pi-inbox\" style=\"font-size: 2rem; color: #6c757d;\"></i>\r\n <p class=\"no-records-text\">No records found</p>\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n</div>", styles: [".document-cell .document-info{display:flex;align-items:center;gap:.75rem;text-align:left}.document-cell .document-info .document-icon{width:40px;height:40px;background-color:#e3f2fd;border-radius:6px;display:flex;align-items:center;justify-content:center;color:#1976d2;font-size:1.25rem;flex-shrink:0}.document-cell .document-info .document-details{flex:1;min-width:0}.document-cell .document-info .document-details .document-name{font-weight:400;color:#334155;line-height:20px;font-size:14px;margin-bottom:.25rem;text-align:left;word-break:break-word}.document-cell .document-info .document-details .file-info{font-size:.75rem;color:#6c757d;text-align:left}.status-cell .status-pill{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;padding:.375rem .75rem;border-radius:20px;font-size:.75rem;font-weight:500;white-space:nowrap;min-width:80px}.status-cell .status-pill i{font-size:.875rem}.status-cell .status-pill.status-pending{background-color:#f3f4f6;color:#6b7280}.status-cell .status-pill.status-approved{background-color:#d1fae5;color:#065f46}.status-cell .status-pill.status-alert{background-color:#fee2e2;color:#dc2626}.status-cell .status-pill.status-uploaded{background-color:#dbeafe;color:#1d4ed8}.status-cell .status-pill.status-reviewing{background-color:#fef3c7;color:#d97706}.status-cell .status-pill.status-rejected{background-color:#fee2e2;color:#dc2626}.actions-cell{text-align:left}.actions-cell .p-button{width:2rem;height:2rem;border-radius:50%;background-color:transparent;border:none;color:#6c757d}.actions-cell .p-button:hover{background-color:#f8f9fa;color:#495057}.text-cell{font-weight:500;color:#475569;font-size:14px;line-height:20px;text-align:left}.clickable-row{cursor:pointer;transition:background-color .2s ease}.clickable-row:hover{background-color:#f8f9fa!important}.clickable-row:active{background-color:#e9ecef!important}::ng-deep .p-datatable .p-datatable-wrapper{border:1px solid #E2E8F0;border-radius:10px}::ng-deep .p-datatable .p-datatable-thead>tr>th{background-color:#f8f9fa;border:none;border-bottom:1px solid #dee2e6;padding:1rem 1.5rem;font-weight:600;color:#64748b;font-size:.875rem;text-transform:capitalize;letter-spacing:.5px;text-align:left;border-radius:8px 8px 0 0}::ng-deep .p-datatable .p-datatable-thead>tr>th:first-child{border-top-left-radius:8px}::ng-deep .p-datatable .p-datatable-thead>tr>th:last-child{border-top-right-radius:8px}::ng-deep .p-datatable .p-datatable-tbody>tr{border-bottom:1px solid #f1f3f4}::ng-deep .p-datatable .p-datatable-tbody>tr:hover{background-color:#f8f9fa}::ng-deep .p-datatable .p-datatable-tbody>tr:last-child>td:first-child{border-bottom-left-radius:8px}::ng-deep .p-datatable .p-datatable-tbody>tr:last-child>td:last-child{border-bottom-right-radius:8px}::ng-deep .p-datatable .p-datatable-tbody>tr>td{border:none;padding:1rem 1.5rem;vertical-align:middle;text-align:left}.no-records-cell{text-align:center;padding:3rem 1.5rem!important;border:none}.no-records-cell .no-records-content{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem}.no-records-cell .no-records-content .no-records-text{margin:0;color:#6c757d;font-size:1rem;font-weight:500}\n"], dependencies: [{ kind: "directive", type:
|
|
3148
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: TablePrimaryComponent, isStandalone: false, selector: "lib-table-primary", inputs: { tableData: "tableData", showHeader: "showHeader", tableStyle: "tableStyle" }, outputs: { rowClick: "rowClick", deleteAction: "deleteAction" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"card\">\r\n <p-table [value]=\"processedData\" [tableStyle]=\"tableStyle\">\r\n <ng-template pTemplate=\"header\" *ngIf=\"showHeader\">\r\n <tr>\r\n <th *ngFor=\"let col of tableData.columns\" [style.width]=\"col.width\">\r\n {{ col.header }}\r\n </th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-rowData>\r\n <tr (click)=\"onRowClick(rowData)\" class=\"clickable-row\">\r\n <td *ngFor=\"let col of tableData.columns\" [style.width]=\"col.width\">\r\n <!-- Document Cell -->\r\n <div *ngIf=\"col.type === SHARED.CELL_TYPE_DOCUMENT\" class=\"document-cell\">\r\n <div class=\"document-info\">\r\n <div class=\"document-icon\">\r\n <i [class]=\"SHARED.ICON_FILE_PDF\" *ngIf=\"rowData._isPdfFile\"></i>\r\n <i [class]=\"SHARED.ICON_IMAGE\" *ngIf=\"rowData._isImageFile\"></i>\r\n <i [class]=\"SHARED.ICON_FILE_EXCEL\" *ngIf=\"rowData._isExcelFile\"></i>\r\n <i [class]=\"SHARED.ICON_FILE\" *ngIf=\"rowData._isOtherFile\"></i>\r\n </div>\r\n <div class=\"document-details\">\r\n <div class=\"document-name\">{{ rowData.docName }}</div>\r\n <div class=\"file-info\">{{ rowData.fileName }} - {{ rowData.fileSize }}</div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Status Cell -->\r\n \r\n <div *ngIf=\"col.type === SHARED.CELL_TYPE_STATUS\" class=\"status-cell\">\r\n <span class=\"status-pill\" [ngClass]=\"rowData._statusClass\">\r\n <i [class]=\"rowData._statusIcon\"></i>\r\n {{ rowData[col.field] }}\r\n </span>\r\n </div>\r\n\r\n <!-- Actions Cell -->\r\n <div *ngIf=\"col.type === SHARED.CELL_TYPE_ACTIONS\" class=\"actions-cell\">\r\n @if(rowData.isUploaded){\r\n <button pButton pRipple type=\"button\" [icon]=\"SHARED.ICON_DELETE\" \r\n class=\"p-button-text p-button-rounded\" \r\n (click)=\"onActionClick($event, rowData)\">\r\n </button>\r\n } \r\n </div>\r\n\r\n <!-- Default Text Cell -->\r\n <div *ngIf=\"!col.type || col.type === SHARED.CELL_TYPE_TEXT\" class=\"text-cell\">\r\n {{ rowData[col.field] }}\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n \r\n <!-- No Records Template -->\r\n <ng-template pTemplate=\"emptymessage\">\r\n <tr>\r\n <td [attr.colspan]=\"tableData.columns.length\" class=\"no-records-cell\">\r\n <div class=\"no-records-content\">\r\n <i class=\"pi pi-inbox\" style=\"font-size: 2rem; color: #6c757d;\"></i>\r\n <p class=\"no-records-text\">No records found</p>\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n</div>", styles: [".document-cell .document-info{display:flex;align-items:center;gap:.75rem;text-align:left}.document-cell .document-info .document-icon{width:40px;height:40px;background-color:#e3f2fd;border-radius:6px;display:flex;align-items:center;justify-content:center;color:#1976d2;font-size:1.25rem;flex-shrink:0}.document-cell .document-info .document-details{flex:1;min-width:0}.document-cell .document-info .document-details .document-name{font-weight:400;color:#334155;line-height:20px;font-size:14px;margin-bottom:.25rem;text-align:left;word-break:break-word}.document-cell .document-info .document-details .file-info{font-size:.75rem;color:#6c757d;text-align:left}.status-cell .status-pill{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;padding:.375rem .75rem;border-radius:20px;font-size:.75rem;font-weight:500;white-space:nowrap;min-width:80px}.status-cell .status-pill i{font-size:.875rem}.status-cell .status-pill.status-pending{background-color:#f3f4f6;color:#6b7280}.status-cell .status-pill.status-approved{background-color:#d1fae5;color:#065f46}.status-cell .status-pill.status-alert{background-color:#fee2e2;color:#dc2626}.status-cell .status-pill.status-uploaded{background-color:#dbeafe;color:#1d4ed8}.status-cell .status-pill.status-reviewing{background-color:#fef3c7;color:#d97706}.status-cell .status-pill.status-rejected{background-color:#fee2e2;color:#dc2626}.actions-cell{text-align:left}.actions-cell .p-button{width:2rem;height:2rem;border-radius:50%;background-color:transparent;border:none;color:#6c757d}.actions-cell .p-button:hover{background-color:#f8f9fa;color:#495057}.text-cell{font-weight:500;color:#475569;font-size:14px;line-height:20px;text-align:left}.clickable-row{cursor:pointer;transition:background-color .2s ease}.clickable-row:hover{background-color:#f8f9fa!important}.clickable-row:active{background-color:#e9ecef!important}::ng-deep .p-datatable .p-datatable-wrapper{border:1px solid #E2E8F0;border-radius:10px}::ng-deep .p-datatable .p-datatable-thead>tr>th{background-color:#f8f9fa;border:none;border-bottom:1px solid #dee2e6;padding:1rem 1.5rem;font-weight:600;color:#64748b;font-size:.875rem;text-transform:capitalize;letter-spacing:.5px;text-align:left;border-radius:8px 8px 0 0}::ng-deep .p-datatable .p-datatable-thead>tr>th:first-child{border-top-left-radius:8px}::ng-deep .p-datatable .p-datatable-thead>tr>th:last-child{border-top-right-radius:8px}::ng-deep .p-datatable .p-datatable-tbody>tr{border-bottom:1px solid #f1f3f4}::ng-deep .p-datatable .p-datatable-tbody>tr:hover{background-color:#f8f9fa}::ng-deep .p-datatable .p-datatable-tbody>tr:last-child>td:first-child{border-bottom-left-radius:8px}::ng-deep .p-datatable .p-datatable-tbody>tr:last-child>td:last-child{border-bottom-right-radius:8px}::ng-deep .p-datatable .p-datatable-tbody>tr>td{border:none;padding:1rem 1.5rem;vertical-align:middle;text-align:left}.no-records-cell{text-align:center;padding:3rem 1.5rem!important;border:none}.no-records-cell .no-records-content{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem}.no-records-cell .no-records-content .no-records-text{margin:0;color:#6c757d;font-size:1rem;font-weight:500}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$2.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll", "virtualRowHeight"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i3$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i4.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "directive", type: i5.Ripple, selector: "[pRipple]" }] });
|
|
2948
3149
|
}
|
|
2949
3150
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TablePrimaryComponent, decorators: [{
|
|
2950
3151
|
type: Component,
|
|
@@ -3144,7 +3345,7 @@ class DocumentUploadComponent {
|
|
|
3144
3345
|
this.fileUploader.choose();
|
|
3145
3346
|
}
|
|
3146
3347
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentUploadComponent, deps: [{ token: DocumentUploadService }, { token: DocumentService }, { token: i3$1.PrimeNGConfig }, { token: FileFormatService }, { token: i3$1.MessageService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3147
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentUploadComponent, isStandalone: false, selector: "lib-document-upload", inputs: { contextId: "contextId" }, viewQueries: [{ propertyName: "fileUploader", first: true, predicate: ["fileUploader"], descendants: true }], ngImport: i0, template: "<div class=\"grid\">\r\n <div class=\"col-12 md:col-12\">\r\n <p-fileUpload #fileUploader [multiple]=\"true\" auto=\"true\" accept=\"image/png,application/pdf\" maxFileSize=\"26214400\"\r\n (onSelect)=\"onSelectedFiles($event)\">\r\n <ng-template pTemplate=\"header\" let-chooseCallback=\"chooseCallback\" let-clearCallback=\"clearCallback\">\r\n <div class=\"docHeader p-2 flex flex-wrap justify-content-between align-items-center flex-1 gap-2\">\r\n <div class=\"flex gap-2\">\r\n <p-button (onClick)=\"choose($event, chooseCallback)\" icon=\"pi pi-images\" [rounded]=\"true\"\r\n [outlined]=\"true\" />\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"content\" let-removeFileCallback=\"removeFileCallback\"\r\n let-removeUploadedFileCallback=\"removeUploadedFileCallback\">\r\n <div class=\"col-12 md:col-12 p-0\">\r\n <div class=\"col-12 md:col-12 p-0\" *ngIf=\"uploadedFiles.length > 0\">\r\n <div *ngFor=\"let uploadedFile of uploadedFiles; let i = index\"\r\n class=\"m-0 flex flex-column align-items-center gap-1 mt-3\">\r\n <div class=\"col-12 md:col-12 p-0 flex documentInfo\">\r\n <div class=\"documentImage\">\r\n <img src=\"../../../../assets/images/document.png\" [alt]=\"uploadedFile.file.name\" width=\"45\" height=\"50\"\r\n class=\"object-contain\" />\r\n </div>\r\n <div class=\"flex w-full flex-column mt-2 ml-2\">\r\n <div class=\"flex justify-content-between\">\r\n <div style=\" font-weight: bold;font-size: 14px\">\r\n {{ uploadedFile.file.name }}\r\n </div>\r\n <i class=\"pi pi-times cursor-pointer\" (click)=\"handleDocumentRemove(uploadedFile.file,i)\"></i>\r\n </div>\r\n <div class=\"flex justify-content-between mt-1\">\r\n <div style=\"color: #676B89; font-size: 12px; color: green;\" class=\"pi pi-verified \"> {{ uploadedFile.formattedSize }}</div>\r\n <div class=\"white-space-nowrap\" style=\"color: #0F8BFD; font-family: 14px;\"> {{ uploadedFile.progress }} %</div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 md:col-12 p-0\">\r\n <p-progressBar [value]=\"totalSizePercent\" [showValue]=\"false\" styleClass=\"h-1/2rem md:ml-auto relative\"\r\n [ngClass]=\"{ 'exceeded-progress-bar': totalSizePercent > 100 }\">\r\n </p-progressBar>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"empty\" let-chooseCallback=\"chooseCallback\">\r\n <div *ngIf=\"!uploadedFiles.length\" class=\"flex align-items-center justify-content-center flex-column\"\r\n (click)=\"triggerFileUpload()\">\r\n <i class=\"pi pi-cloud-upload border-2 border-circle p-5 text-8xl text-400 border-400\"></i>\r\n <p class=\"mt-4 mb-0\">Drag and drop files here to upload.</p>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"file\"> </ng-template>\r\n </p-fileUpload>\r\n </div>\r\n</div>", styles: [".flex{display:flex}.items-center{align-items:center}.justify-center{justify-content:center}.flex-col{flex-direction:column}.text-muted-color{color:#6c757d}.p-fileupload-buttonbar{padding:0}.p-fileupload-content{background-color:#0f8bfd1a}.p-fileupload .p-fileupload-content{padding:1rem}.docHeader .p-button-icon{padding:.5rem}\n"], dependencies: [{ kind: "directive", type:
|
|
3348
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentUploadComponent, isStandalone: false, selector: "lib-document-upload", inputs: { contextId: "contextId" }, viewQueries: [{ propertyName: "fileUploader", first: true, predicate: ["fileUploader"], descendants: true }], ngImport: i0, template: "<div class=\"grid\">\r\n <div class=\"col-12 md:col-12\">\r\n <p-fileUpload #fileUploader [multiple]=\"true\" auto=\"true\" accept=\"image/png,application/pdf\" maxFileSize=\"26214400\"\r\n (onSelect)=\"onSelectedFiles($event)\">\r\n <ng-template pTemplate=\"header\" let-chooseCallback=\"chooseCallback\" let-clearCallback=\"clearCallback\">\r\n <div class=\"docHeader p-2 flex flex-wrap justify-content-between align-items-center flex-1 gap-2\">\r\n <div class=\"flex gap-2\">\r\n <p-button (onClick)=\"choose($event, chooseCallback)\" icon=\"pi pi-images\" [rounded]=\"true\"\r\n [outlined]=\"true\" />\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"content\" let-removeFileCallback=\"removeFileCallback\"\r\n let-removeUploadedFileCallback=\"removeUploadedFileCallback\">\r\n <div class=\"col-12 md:col-12 p-0\">\r\n <div class=\"col-12 md:col-12 p-0\" *ngIf=\"uploadedFiles.length > 0\">\r\n <div *ngFor=\"let uploadedFile of uploadedFiles; let i = index\"\r\n class=\"m-0 flex flex-column align-items-center gap-1 mt-3\">\r\n <div class=\"col-12 md:col-12 p-0 flex documentInfo\">\r\n <div class=\"documentImage\">\r\n <img src=\"../../../../assets/images/document.png\" [alt]=\"uploadedFile.file.name\" width=\"45\" height=\"50\"\r\n class=\"object-contain\" />\r\n </div>\r\n <div class=\"flex w-full flex-column mt-2 ml-2\">\r\n <div class=\"flex justify-content-between\">\r\n <div style=\" font-weight: bold;font-size: 14px\">\r\n {{ uploadedFile.file.name }}\r\n </div>\r\n <i class=\"pi pi-times cursor-pointer\" (click)=\"handleDocumentRemove(uploadedFile.file,i)\"></i>\r\n </div>\r\n <div class=\"flex justify-content-between mt-1\">\r\n <div style=\"color: #676B89; font-size: 12px; color: green;\" class=\"pi pi-verified \"> {{ uploadedFile.formattedSize }}</div>\r\n <div class=\"white-space-nowrap\" style=\"color: #0F8BFD; font-family: 14px;\"> {{ uploadedFile.progress }} %</div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 md:col-12 p-0\">\r\n <p-progressBar [value]=\"totalSizePercent\" [showValue]=\"false\" styleClass=\"h-1/2rem md:ml-auto relative\"\r\n [ngClass]=\"{ 'exceeded-progress-bar': totalSizePercent > 100 }\">\r\n </p-progressBar>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"empty\" let-chooseCallback=\"chooseCallback\">\r\n <div *ngIf=\"!uploadedFiles.length\" class=\"flex align-items-center justify-content-center flex-column\"\r\n (click)=\"triggerFileUpload()\">\r\n <i class=\"pi pi-cloud-upload border-2 border-circle p-5 text-8xl text-400 border-400\"></i>\r\n <p class=\"mt-4 mb-0\">Drag and drop files here to upload.</p>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"file\"> </ng-template>\r\n </p-fileUpload>\r\n </div>\r\n</div>", styles: [".flex{display:flex}.items-center{align-items:center}.justify-center{justify-content:center}.flex-col{flex-direction:column}.text-muted-color{color:#6c757d}.p-fileupload-buttonbar{padding:0}.p-fileupload-content{background-color:#0f8bfd1a}.p-fileupload .p-fileupload-content{padding:1rem}.docHeader .p-button-icon{padding:.5rem}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i4.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "style", "styleClass", "badgeClass", "ariaLabel", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i7.FileUpload, selector: "p-fileUpload", inputs: ["name", "url", "method", "multiple", "accept", "disabled", "auto", "withCredentials", "maxFileSize", "invalidFileSizeMessageSummary", "invalidFileSizeMessageDetail", "invalidFileTypeMessageSummary", "invalidFileTypeMessageDetail", "invalidFileLimitMessageDetail", "invalidFileLimitMessageSummary", "style", "styleClass", "previewWidth", "chooseLabel", "uploadLabel", "cancelLabel", "chooseIcon", "uploadIcon", "cancelIcon", "showUploadButton", "showCancelButton", "mode", "headers", "customUpload", "fileLimit", "uploadStyleClass", "cancelStyleClass", "removeStyleClass", "chooseStyleClass", "files"], outputs: ["onBeforeUpload", "onSend", "onUpload", "onError", "onClear", "onRemove", "onSelect", "onProgress", "uploadHandler", "onImageError", "onRemoveUploadedFile"] }, { kind: "component", type: i8.ProgressBar, selector: "p-progressBar", inputs: ["value", "showValue", "styleClass", "style", "unit", "mode", "color"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
3148
3349
|
}
|
|
3149
3350
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentUploadComponent, decorators: [{
|
|
3150
3351
|
type: Component,
|
|
@@ -3294,9 +3495,11 @@ class DocumentViewerService {
|
|
|
3294
3495
|
}
|
|
3295
3496
|
this.documentStore.setIsActionLoading(true);
|
|
3296
3497
|
this.documentHttpService.deleteDocument(documentId, contextId).subscribe({
|
|
3297
|
-
next: () => {
|
|
3298
|
-
|
|
3299
|
-
|
|
3498
|
+
next: (res) => {
|
|
3499
|
+
if (res) {
|
|
3500
|
+
this.documentService.refreshAllDataWithCurrentFilters(contextId);
|
|
3501
|
+
this.documentStore.clearDocumentViewerState();
|
|
3502
|
+
}
|
|
3300
3503
|
},
|
|
3301
3504
|
error: (error) => {
|
|
3302
3505
|
console.error('Error deleting document:', error);
|
|
@@ -3558,54 +3761,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
3558
3761
|
}]
|
|
3559
3762
|
}], ctorParameters: () => [] });
|
|
3560
3763
|
|
|
3561
|
-
|
|
3562
|
-
* Component for displaying document history in a timeline format.
|
|
3563
|
-
*/
|
|
3564
|
-
class DocumentHistoryComponent {
|
|
3764
|
+
class DocumentHistoryService {
|
|
3565
3765
|
documentHistoryStyleService;
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
*/
|
|
3569
|
-
historyData = [];
|
|
3570
|
-
/**
|
|
3571
|
-
* Whether to show the history component
|
|
3572
|
-
*/
|
|
3573
|
-
showHistory = false;
|
|
3574
|
-
/**
|
|
3575
|
-
* Active accordion index for controlling expand/collapse
|
|
3576
|
-
*/
|
|
3577
|
-
activeAccordionIndex = 0;
|
|
3578
|
-
/**
|
|
3579
|
-
* Whether the accordion is expanded
|
|
3580
|
-
*/
|
|
3581
|
-
isAccordionExpanded = true;
|
|
3582
|
-
constructor(documentHistoryStyleService) {
|
|
3766
|
+
http;
|
|
3767
|
+
constructor(documentHistoryStyleService, http) {
|
|
3583
3768
|
this.documentHistoryStyleService = documentHistoryStyleService;
|
|
3584
|
-
|
|
3585
|
-
/**
|
|
3586
|
-
* Handle accordion open event
|
|
3587
|
-
*/
|
|
3588
|
-
onAccordionOpen() {
|
|
3589
|
-
this.isAccordionExpanded = true;
|
|
3590
|
-
this.activeAccordionIndex = 0;
|
|
3591
|
-
}
|
|
3592
|
-
/**
|
|
3593
|
-
* Handle accordion close event
|
|
3594
|
-
*/
|
|
3595
|
-
onAccordionClose() {
|
|
3596
|
-
this.isAccordionExpanded = false;
|
|
3597
|
-
this.activeAccordionIndex = -1;
|
|
3598
|
-
}
|
|
3599
|
-
/**
|
|
3600
|
-
* Toggle accordion state
|
|
3601
|
-
*/
|
|
3602
|
-
toggleAccordion() {
|
|
3603
|
-
if (this.isAccordionExpanded) {
|
|
3604
|
-
this.onAccordionClose();
|
|
3605
|
-
}
|
|
3606
|
-
else {
|
|
3607
|
-
this.onAccordionOpen();
|
|
3608
|
-
}
|
|
3769
|
+
this.http = http;
|
|
3609
3770
|
}
|
|
3610
3771
|
/**
|
|
3611
3772
|
* Get the CSS class for accordion styling based on the section's label
|
|
@@ -3640,14 +3801,16 @@ class DocumentHistoryComponent {
|
|
|
3640
3801
|
/**
|
|
3641
3802
|
* Process history data to add computed properties
|
|
3642
3803
|
*/
|
|
3643
|
-
|
|
3644
|
-
|
|
3804
|
+
processHistoryData(historyData) {
|
|
3805
|
+
if (!historyData) {
|
|
3806
|
+
return SHARED.EMPTY_ARRAY;
|
|
3807
|
+
}
|
|
3808
|
+
return historyData.map(section => {
|
|
3645
3809
|
const processedSection = {
|
|
3646
3810
|
...section,
|
|
3647
3811
|
list: section.list.map(item => ({
|
|
3648
3812
|
...item,
|
|
3649
|
-
|
|
3650
|
-
dateTime: item.dateTime || 'No date available',
|
|
3813
|
+
dateTime: item.dateTime || ERRORS.NO_VALUE_FOUND,
|
|
3651
3814
|
actionIcon: this.documentHistoryStyleService.getActionIcon(item.label),
|
|
3652
3815
|
actionColor: this.documentHistoryStyleService.getActionColor(item.label),
|
|
3653
3816
|
actionBgColor: this.documentHistoryStyleService.getActionBgColor(item.label),
|
|
@@ -3669,26 +3832,106 @@ class DocumentHistoryComponent {
|
|
|
3669
3832
|
*/
|
|
3670
3833
|
downloadDocument(documentUrl, docName) {
|
|
3671
3834
|
if (!documentUrl) {
|
|
3672
|
-
console.warn(
|
|
3835
|
+
console.warn(ERRORS.NO_DOCUMENT_URL);
|
|
3673
3836
|
return;
|
|
3674
3837
|
}
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentHistoryComponent, isStandalone: false, selector: "document-history", inputs: { historyData: "historyData", showHistory: "showHistory" }, ngImport: i0, template: "<div class=\"document-history-container\" *ngIf=\"showHistory && historyData.length > 0\">\r\n <div class=\"history-sections\">\r\n <div class=\"history-section\" *ngFor=\"let section of processedHistoryData\">\r\n <div *ngIf=\"section.header === 'Initial Request' && section.hasValidContent\" \r\n class=\"initial-request-section\"\r\n [ngClass]=\"section.accordionClass\">\r\n <p-accordion [activeIndex]=\"activeAccordionIndex\" \r\n (onOpen)=\"onAccordionOpen()\" \r\n (onClose)=\"onAccordionClose()\">\r\n <p-accordionTab [header]=\"section.header\">\r\n <div class=\"history-timeline\" *ngIf=\"section.hasValidContent\">\r\n <div class=\"timeline-item\" *ngFor=\"let item of section.list; let i = index\">\r\n <div class=\"timeline-card\" [ngClass]=\"item.actionBgColor\">\r\n <div class=\"card-header\">\r\n <div class=\"action-info\">\r\n <div class=\"action-icon\" [ngClass]=\"item.actionIconBgColor\">\r\n <i [class]=\"item.actionIcon\"></i>\r\n </div>\r\n <span class=\"action-label\" [ngClass]=\"item.actionColor\">\r\n {{ item.label }}\r\n </span>\r\n </div>\r\n <div class=\"timestamp\">\r\n {{ item.dateTime }}\r\n </div>\r\n </div>\r\n \r\n <!-- Description -->\r\n <div class=\"card-description\" *ngIf=\"item.requestDescription\">\r\n <p class=\"description-text\">{{ item.requestDescription ?? 'No Request' }}</p>\r\n </div>\r\n \r\n <!-- Document details if URL exists -->\r\n <div class=\"document-details\" *ngIf=\"item.documentUrl\">\r\n <div class=\"document-card\">\r\n <div class=\"document-info\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <div class=\"document-text\">\r\n <div class=\"document-title\">Document</div>\r\n <div class=\"document-filename clickable\" \r\n (click)=\"downloadDocument(item.documentUrl!, item.docName)\"\r\n title=\"Click to download\">\r\n {{ item.docName || 'Document' }}\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"document-actions\">\r\n <button class=\"action-btn download-btn\" \r\n title=\"Download\"\r\n (click)=\"downloadDocument(item.documentUrl!, item.docName)\">\r\n <i class=\"pi pi-download\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <!-- User information -->\r\n <div class=\"user-info\">\r\n <span class=\"user-name\">{{ item.userName }}</span>\r\n <span class=\"user-role\">({{ item.userRole }})</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <!-- Show message if no valid content -->\r\n <div class=\"no-content-message\" *ngIf=\"!section.hasValidContent\">\r\n <p>No initial request details available.</p>\r\n </div>\r\n </p-accordionTab>\r\n </p-accordion>\r\n </div>\r\n \r\n <!-- Document History as regular timeline -->\r\n <div *ngIf=\"section.header !== 'Initial Request'\" class=\"document-history-section\">\r\n <div class=\"section-header\" *ngIf=\"section.header\">\r\n <h4 class=\"section-title\">{{ section.header }}</h4>\r\n </div>\r\n \r\n <div class=\"history-timeline\">\r\n <div class=\"timeline-item\" *ngFor=\"let item of section.list; let i = index\">\r\n <div class=\"timeline-card\" [ngClass]=\"item.actionBgColor\">\r\n <!-- Header with icon and timestamp -->\r\n <div class=\"card-header\">\r\n <div class=\"action-info\">\r\n <div class=\"action-icon\" [ngClass]=\"item.actionIconBgColor\">\r\n <i [class]=\"item.actionIcon\"></i>\r\n </div>\r\n <span class=\"action-label\" [ngClass]=\"item.actionColor\">\r\n {{ item.label }}\r\n </span>\r\n </div>\r\n <div class=\"timestamp\">\r\n {{ item.dateTime }}\r\n </div>\r\n </div>\r\n \r\n <!-- Description -->\r\n <div class=\"card-description\" *ngIf=\"item.requestDescription\">\r\n <p class=\"description-text\">{{ item.requestDescription }}</p>\r\n </div>\r\n \r\n <!-- Document details if URL exists -->\r\n <div class=\"document-details\" *ngIf=\"item.documentUrl\">\r\n <div class=\"document-card\">\r\n <div class=\"document-info\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <div class=\"document-text\">\r\n <div class=\"document-title\">Document</div>\r\n <div class=\"document-filename clickable\" \r\n (click)=\"downloadDocument(item.documentUrl!, item.docName)\"\r\n title=\"Click to download\">\r\n {{ item.docName || 'Document' }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <!-- User information -->\r\n <div class=\"user-info\">\r\n <span class=\"user-name\">{{ item.userName }}</span>\r\n <span class=\"user-role\">({{ item.userRole }})</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>", styles: [".document-history-container{padding:1rem;background:#fff;border-radius:8px;box-shadow:0 2px 4px #0000001a;max-height:70vh;overflow-y:auto}.document-history-container .history-header{margin-bottom:1.5rem}.document-history-container .history-header .history-title{font-size:1.5rem;font-weight:600;color:#374151;margin:0}.document-history-container .history-sections .history-section{margin-bottom:2rem}.document-history-container .history-sections .history-section .initial-request-section{margin-bottom:1.5rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{background:#fff;border:1px solid;border-radius:8px;padding:1rem 1.5rem;font-weight:600;color:#1f2937;font-size:1rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link:focus{box-shadow:none}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link .p-accordion-header-icon{color:#6b7280;font-size:.875rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header.p-highlight .p-accordion-header-link{background:#fff}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content{background:#fff;border:1px solid;border-top:none;border-radius:0 0 8px 8px;padding:1.5rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item{margin-bottom:0}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:1rem;border-right:3px solid}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon{background:#7d879b;color:#fff;width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon i{font-size:14px}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-label{color:#1f2937;font-weight:600}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .timestamp{color:#6b7280;font-size:.75rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-description .description-text{color:#374151;line-height:1.5}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .user-info .user-name{color:#1f2937;font-weight:500}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .user-info .user-role{color:#6b7280}.document-history-container .history-sections .history-section .initial-request-section.document-requested ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#d1d5db}.document-history-container .history-sections .history-section .initial-request-section.document-requested ::ng-deep .p-accordion .p-accordion-content{border-color:#d1d5db}.document-history-container .history-sections .history-section .initial-request-section.document-uploaded ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-uploaded ::ng-deep .p-accordion .p-accordion-content{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-rejected ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#fca5a5}.document-history-container .history-sections .history-section .initial-request-section.document-rejected ::ng-deep .p-accordion .p-accordion-content{border-color:#fca5a5}.document-history-container .history-sections .history-section .initial-request-section.document-accepted ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-accepted ::ng-deep .p-accordion .p-accordion-content{border-color:#86efac}.document-history-container .history-sections .history-section .document-history-section .section-header{margin-bottom:1rem}.document-history-container .history-sections .history-section .document-history-section .section-header .section-title{font-size:1.25rem;font-weight:500;color:#374151;margin:0}.document-history-container .history-sections .history-section .history-timeline .timeline-item{margin-bottom:1rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card{border-radius:8px;border:1px solid;padding:1rem;position:relative;border-right:3px solid}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-green-50{background-color:#f0fdf4;border-color:#bbf7d0;border-right-color:#10b981}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-red-50{background-color:#fef2f2;border-color:#fecaca;border-right-color:#ef4444}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-blue-50{background-color:#eff6ff;border-color:#bfdbfe;border-right-color:#3b82f6}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-gray-50{background-color:#f8fafc;border-color:#e2e8f0;border-right-color:#6b7280}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info{display:flex;align-items:center;gap:.5rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon i{font-size:14px}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-label{font-weight:600;font-size:.875rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .timestamp{font-size:.75rem;color:#6b7280}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-description{margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-description .description-text{margin:0;color:#374151;font-size:.875rem;line-height:1.4}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details{margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card{background:#fff;border-radius:6px;padding:.75rem;display:flex;justify-content:space-between;align-items:center;border:1px solid #e5e7eb}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info{display:flex;align-items:center;gap:.5rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-icon{color:#3b82f6;font-size:1.25rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-title{font-weight:500;color:#374151;font-size:.875rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename{color:#3b82f6;font-size:.75rem;word-break:break-word}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename.clickable{cursor:pointer;text-decoration:underline}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename.clickable:hover{color:#2563eb;text-decoration:none}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions{display:flex;gap:.25rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn{width:24px;height:24px;border:none;border-radius:4px;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.edit-btn{background:#3b82f6;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.edit-btn:hover{background:#2563eb}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.delete-btn{background:#ef4444;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.delete-btn:hover{background:#dc2626}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.download-btn{background:#10b981;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.download-btn:hover{background:#059669}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info{text-align:right;font-size:.75rem;color:#374151}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info .user-name{font-weight:500}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info .user-role{color:#6b7280}.text-green-600{color:#059669}.text-red-600{color:#dc2626}.text-blue-600{color:#2563eb}.text-gray-600{color:#4b5563}.bg-green-50{background-color:#f0fdf4}.bg-red-50{background-color:#fef2f2}.bg-blue-50{background-color:#eff6ff}.bg-gray-50{background-color:#f8fafc}.border-green-200{border-color:#bbf7d0}.border-red-200{border-color:#fecaca}.border-blue-200{border-color:#bfdbfe}.border-gray-200{border-color:#e2e8f0}.icon-bg-green{background-color:#10b981}.icon-bg-red{background-color:#ef4444}.icon-bg-blue{background-color:#3b82f6}.icon-bg-gray{background-color:#6b7280}.no-content-message{text-align:center;padding:2rem;color:#6b7280;font-style:italic}.no-content-message p{margin:0;font-size:.875rem}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$2.Accordion, selector: "p-accordion", inputs: ["multiple", "style", "styleClass", "expandIcon", "collapseIcon", "activeIndex", "selectOnFocus", "headerAriaLevel"], outputs: ["onClose", "onOpen", "activeIndexChange"] }, { kind: "component", type: i3$2.AccordionTab, selector: "p-accordionTab", inputs: ["id", "header", "headerStyle", "tabStyle", "contentStyle", "tabStyleClass", "headerStyleClass", "contentStyleClass", "disabled", "cache", "transitionOptions", "iconPos", "selected", "headerAriaLevel"], outputs: ["selectedChange"] }] });
|
|
3838
|
+
this.http.get(documentUrl, { responseType: 'blob' }).subscribe({
|
|
3839
|
+
next: (blob) => {
|
|
3840
|
+
const blobUrl = window.URL.createObjectURL(blob);
|
|
3841
|
+
const a = document.createElement('a');
|
|
3842
|
+
a.href = blobUrl;
|
|
3843
|
+
a.download = docName ?? SHARED.DOCUMENT;
|
|
3844
|
+
a.style.display = SHARED.NONE;
|
|
3845
|
+
document.body.appendChild(a);
|
|
3846
|
+
a.click();
|
|
3847
|
+
a.remove();
|
|
3848
|
+
window.URL.revokeObjectURL(blobUrl);
|
|
3849
|
+
},
|
|
3850
|
+
error: (err) => {
|
|
3851
|
+
console.error(ERRORS.DOWNLOAD_FAIL, err);
|
|
3852
|
+
}
|
|
3853
|
+
});
|
|
3854
|
+
}
|
|
3855
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHistoryService, deps: [{ token: DocumentHistoryStyleService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3856
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHistoryService, providedIn: 'root' });
|
|
3857
|
+
}
|
|
3858
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHistoryService, decorators: [{
|
|
3859
|
+
type: Injectable,
|
|
3860
|
+
args: [{
|
|
3861
|
+
providedIn: 'root'
|
|
3862
|
+
}]
|
|
3863
|
+
}], ctorParameters: () => [{ type: DocumentHistoryStyleService }, { type: i2.HttpClient }] });
|
|
3864
|
+
|
|
3865
|
+
/**
|
|
3866
|
+
* Component for displaying document history in a timeline format.
|
|
3867
|
+
*/
|
|
3868
|
+
class DocumentHistoryComponent {
|
|
3869
|
+
documentHistoryService;
|
|
3870
|
+
/**
|
|
3871
|
+
* Input data for document history sections
|
|
3872
|
+
*/
|
|
3873
|
+
historyData = SHARED.EMPTY_ARRAY;
|
|
3874
|
+
/**
|
|
3875
|
+
* Whether to show the history component
|
|
3876
|
+
*/
|
|
3877
|
+
showHistory = false;
|
|
3878
|
+
/**
|
|
3879
|
+
* Active accordion index for controlling expand/collapse
|
|
3880
|
+
*/
|
|
3881
|
+
activeAccordionIndex = 0;
|
|
3882
|
+
/**
|
|
3883
|
+
* Whether the accordion is expanded
|
|
3884
|
+
*/
|
|
3885
|
+
isAccordionExpanded = true;
|
|
3886
|
+
constructor(documentHistoryService) {
|
|
3887
|
+
this.documentHistoryService = documentHistoryService;
|
|
3888
|
+
}
|
|
3889
|
+
/**
|
|
3890
|
+
* Handle accordion open event
|
|
3891
|
+
*/
|
|
3892
|
+
onAccordionOpen() {
|
|
3893
|
+
this.isAccordionExpanded = true;
|
|
3894
|
+
this.activeAccordionIndex = 0;
|
|
3895
|
+
}
|
|
3896
|
+
/**
|
|
3897
|
+
* Handle accordion close event
|
|
3898
|
+
*/
|
|
3899
|
+
onAccordionClose() {
|
|
3900
|
+
this.isAccordionExpanded = false;
|
|
3901
|
+
this.activeAccordionIndex = -1;
|
|
3902
|
+
}
|
|
3903
|
+
/**
|
|
3904
|
+
* Toggle accordion state
|
|
3905
|
+
*/
|
|
3906
|
+
toggleAccordion() {
|
|
3907
|
+
if (this.isAccordionExpanded) {
|
|
3908
|
+
this.onAccordionClose();
|
|
3909
|
+
}
|
|
3910
|
+
else {
|
|
3911
|
+
this.onAccordionOpen();
|
|
3912
|
+
}
|
|
3913
|
+
}
|
|
3914
|
+
/**
|
|
3915
|
+
* Process history data to add computed properties
|
|
3916
|
+
*/
|
|
3917
|
+
get processedHistoryData() {
|
|
3918
|
+
return this.documentHistoryService.processHistoryData(this.historyData);
|
|
3919
|
+
}
|
|
3920
|
+
/**
|
|
3921
|
+
* Downloads a document when clicked
|
|
3922
|
+
* @param documentUrl - The URL of the document to download
|
|
3923
|
+
* @param docName - The name of the document
|
|
3924
|
+
*/
|
|
3925
|
+
downloadDocument(documentUrl, docName) {
|
|
3926
|
+
this.documentHistoryService.downloadDocument(documentUrl, docName);
|
|
3927
|
+
}
|
|
3928
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHistoryComponent, deps: [{ token: DocumentHistoryService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3929
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentHistoryComponent, isStandalone: false, selector: "document-history", inputs: { historyData: "historyData", showHistory: "showHistory" }, ngImport: i0, template: "<div class=\"document-history-container\" *ngIf=\"showHistory && historyData.length > 0\">\r\n <div class=\"history-sections\">\r\n <div class=\"history-section\" *ngFor=\"let section of processedHistoryData\">\r\n <div *ngIf=\"section.header === 'Initial Request' && section.hasValidContent\" \r\n class=\"initial-request-section\"\r\n [ngClass]=\"section.accordionClass\">\r\n <p-accordion [activeIndex]=\"activeAccordionIndex\" \r\n (onOpen)=\"onAccordionOpen()\" \r\n (onClose)=\"onAccordionClose()\">\r\n <p-accordionTab [header]=\"section.header\">\r\n <div class=\"history-timeline\" *ngIf=\"section.hasValidContent\">\r\n <div class=\"timeline-item\" *ngFor=\"let item of section.list; let i = index\">\r\n <div class=\"timeline-card\" [ngClass]=\"item.actionBgColor\">\r\n <div class=\"card-header\">\r\n <div class=\"action-info\">\r\n <div class=\"action-icon\" [ngClass]=\"item.actionIconBgColor\">\r\n <i [class]=\"item.actionIcon\"></i>\r\n </div>\r\n <span class=\"action-label\" [ngClass]=\"item.actionColor\">\r\n {{ item.label }}\r\n </span>\r\n </div>\r\n <div class=\"timestamp\">\r\n {{ item.dateTime }}\r\n </div>\r\n </div>\r\n \r\n <!-- Description -->\r\n <div class=\"card-description\" *ngIf=\"item.requestDescription\">\r\n <p class=\"description-text\">{{ item.requestDescription ?? 'No Request' }}</p>\r\n </div>\r\n \r\n <!-- Document details if URL exists -->\r\n <div class=\"document-details\" *ngIf=\"item.documentUrl\">\r\n <div class=\"document-card\">\r\n <div class=\"document-info\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <div class=\"document-text\">\r\n <div class=\"document-title\">Document</div>\r\n <div class=\"document-filename clickable\" \r\n (click)=\"downloadDocument(item.documentUrl!, item.docName)\"\r\n title=\"Click to download\">\r\n {{ item.docName || 'Document' }}\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"document-actions\">\r\n <button class=\"action-btn download-btn\" \r\n title=\"Download\"\r\n (click)=\"downloadDocument(item.documentUrl!, item.docName)\">\r\n <i class=\"pi pi-download\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <!-- User information -->\r\n <div class=\"user-info\">\r\n <span class=\"user-name\">{{ item.userName }}</span>\r\n <span class=\"user-role\">({{ item.userRole }})</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <!-- Show message if no valid content -->\r\n <div class=\"no-content-message\" *ngIf=\"!section.hasValidContent\">\r\n <p>No initial request details available.</p>\r\n </div>\r\n </p-accordionTab>\r\n </p-accordion>\r\n </div>\r\n \r\n <!-- Document History as regular timeline -->\r\n <div *ngIf=\"section.header !== 'Initial Request'\" class=\"document-history-section\">\r\n <div class=\"section-header\" *ngIf=\"section.header\">\r\n <h4 class=\"section-title\">{{ section.header }}</h4>\r\n </div>\r\n \r\n <div class=\"history-timeline\">\r\n <div class=\"timeline-item\" *ngFor=\"let item of section.list; let i = index\">\r\n <div class=\"timeline-card\" [ngClass]=\"item.actionBgColor\">\r\n <!-- Header with icon and timestamp -->\r\n <div class=\"card-header\">\r\n <div class=\"action-info\">\r\n <div class=\"action-icon\" [ngClass]=\"item.actionIconBgColor\">\r\n <i [class]=\"item.actionIcon\"></i>\r\n </div>\r\n <span class=\"action-label\" [ngClass]=\"item.actionColor\">\r\n {{ item.label }}\r\n </span>\r\n </div>\r\n <div class=\"timestamp\">\r\n {{ item.dateTime }}\r\n </div>\r\n </div>\r\n \r\n <!-- Description -->\r\n <div class=\"card-description\" *ngIf=\"item.requestDescription\">\r\n <p class=\"description-text\">{{ item.requestDescription }}</p>\r\n </div>\r\n \r\n <!-- Document details if URL exists -->\r\n <div class=\"document-details\" *ngIf=\"item.documentUrl\">\r\n <div class=\"document-card\">\r\n <div class=\"document-info\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <div class=\"document-text\">\r\n <div class=\"document-title\">Document</div>\r\n <div class=\"document-filename clickable\" \r\n (click)=\"downloadDocument(item.documentUrl!, item.docName)\"\r\n title=\"Click to download\">\r\n {{ item.docName || 'Document' }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <!-- User information -->\r\n <div class=\"user-info\">\r\n <span class=\"user-name\">{{ item.userName }}</span>\r\n <span class=\"user-role\">({{ item.userRole }})</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>", styles: [".document-history-container{padding:1rem;background:#fff;border-radius:8px;box-shadow:0 2px 4px #0000001a;max-height:70vh;overflow-y:auto}.document-history-container .history-header{margin-bottom:1.5rem}.document-history-container .history-header .history-title{font-size:1.5rem;font-weight:600;color:#374151;margin:0}.document-history-container .history-sections .history-section{margin-bottom:2rem}.document-history-container .history-sections .history-section .initial-request-section{margin-bottom:1.5rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{background:#fff;border:1px solid;border-radius:8px;padding:1rem 1.5rem;font-weight:600;color:#1f2937;font-size:1rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link:focus{box-shadow:none}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link .p-accordion-header-icon{color:#6b7280;font-size:.875rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header.p-highlight .p-accordion-header-link{background:#fff}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content{background:#fff;border:1px solid;border-top:none;border-radius:0 0 8px 8px;padding:1.5rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item{margin-bottom:0}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:1rem;border-right:3px solid}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon{background:#7d879b;color:#fff;width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon i{font-size:14px}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-label{color:#1f2937;font-weight:600}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .timestamp{color:#6b7280;font-size:.75rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-description .description-text{color:#374151;line-height:1.5}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .user-info .user-name{color:#1f2937;font-weight:500}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .user-info .user-role{color:#6b7280}.document-history-container .history-sections .history-section .initial-request-section.document-requested ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#d1d5db}.document-history-container .history-sections .history-section .initial-request-section.document-requested ::ng-deep .p-accordion .p-accordion-content{border-color:#d1d5db}.document-history-container .history-sections .history-section .initial-request-section.document-uploaded ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-uploaded ::ng-deep .p-accordion .p-accordion-content{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-rejected ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#fca5a5}.document-history-container .history-sections .history-section .initial-request-section.document-rejected ::ng-deep .p-accordion .p-accordion-content{border-color:#fca5a5}.document-history-container .history-sections .history-section .initial-request-section.document-accepted ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-accepted ::ng-deep .p-accordion .p-accordion-content{border-color:#86efac}.document-history-container .history-sections .history-section .document-history-section .section-header{margin-bottom:1rem}.document-history-container .history-sections .history-section .document-history-section .section-header .section-title{font-size:1.25rem;font-weight:500;color:#374151;margin:0}.document-history-container .history-sections .history-section .history-timeline .timeline-item{margin-bottom:1rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card{border-radius:8px;border:1px solid;padding:1rem;position:relative;border-right:3px solid}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-green-50{background-color:#f0fdf4;border-color:#bbf7d0;border-right-color:#10b981}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-red-50{background-color:#fef2f2;border-color:#fecaca;border-right-color:#ef4444}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-blue-50{background-color:#eff6ff;border-color:#bfdbfe;border-right-color:#3b82f6}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-gray-50{background-color:#f8fafc;border-color:#e2e8f0;border-right-color:#6b7280}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info{display:flex;align-items:center;gap:.5rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon i{font-size:14px}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-label{font-weight:600;font-size:.875rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .timestamp{font-size:.75rem;color:#6b7280}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-description{margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-description .description-text{margin:0;color:#374151;font-size:.875rem;line-height:1.4}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details{margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card{background:#fff;border-radius:6px;padding:.75rem;display:flex;justify-content:space-between;align-items:center;border:1px solid #e5e7eb}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info{display:flex;align-items:center;gap:.5rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-icon{color:#3b82f6;font-size:1.25rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-title{font-weight:500;color:#374151;font-size:.875rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename{color:#3b82f6;font-size:.75rem;word-break:break-word}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename.clickable{cursor:pointer;text-decoration:underline}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename.clickable:hover{color:#2563eb;text-decoration:none}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions{display:flex;gap:.25rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn{width:24px;height:24px;border:none;border-radius:4px;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.edit-btn{background:#3b82f6;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.edit-btn:hover{background:#2563eb}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.delete-btn{background:#ef4444;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.delete-btn:hover{background:#dc2626}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.download-btn{background:#10b981;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.download-btn:hover{background:#059669}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info{text-align:right;font-size:.75rem;color:#374151}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info .user-name{font-weight:500}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info .user-role{color:#6b7280}.text-green-600{color:#059669}.text-red-600{color:#dc2626}.text-blue-600{color:#2563eb}.text-gray-600{color:#4b5563}.bg-green-50{background-color:#f0fdf4}.bg-red-50{background-color:#fef2f2}.bg-blue-50{background-color:#eff6ff}.bg-gray-50{background-color:#f8fafc}.border-green-200{border-color:#bbf7d0}.border-red-200{border-color:#fecaca}.border-blue-200{border-color:#bfdbfe}.border-gray-200{border-color:#e2e8f0}.icon-bg-green{background-color:#10b981}.icon-bg-red{background-color:#ef4444}.icon-bg-blue{background-color:#3b82f6}.icon-bg-gray{background-color:#6b7280}.no-content-message{text-align:center;padding:2rem;color:#6b7280;font-style:italic}.no-content-message p{margin:0;font-size:.875rem}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$2.Accordion, selector: "p-accordion", inputs: ["multiple", "style", "styleClass", "expandIcon", "collapseIcon", "activeIndex", "selectOnFocus", "headerAriaLevel"], outputs: ["onClose", "onOpen", "activeIndexChange"] }, { kind: "component", type: i3$2.AccordionTab, selector: "p-accordionTab", inputs: ["id", "header", "headerStyle", "tabStyle", "contentStyle", "tabStyleClass", "headerStyleClass", "contentStyleClass", "disabled", "cache", "transitionOptions", "iconPos", "selected", "headerAriaLevel"], outputs: ["selectedChange"] }] });
|
|
3687
3930
|
}
|
|
3688
3931
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHistoryComponent, decorators: [{
|
|
3689
3932
|
type: Component,
|
|
3690
3933
|
args: [{ selector: 'document-history', standalone: false, template: "<div class=\"document-history-container\" *ngIf=\"showHistory && historyData.length > 0\">\r\n <div class=\"history-sections\">\r\n <div class=\"history-section\" *ngFor=\"let section of processedHistoryData\">\r\n <div *ngIf=\"section.header === 'Initial Request' && section.hasValidContent\" \r\n class=\"initial-request-section\"\r\n [ngClass]=\"section.accordionClass\">\r\n <p-accordion [activeIndex]=\"activeAccordionIndex\" \r\n (onOpen)=\"onAccordionOpen()\" \r\n (onClose)=\"onAccordionClose()\">\r\n <p-accordionTab [header]=\"section.header\">\r\n <div class=\"history-timeline\" *ngIf=\"section.hasValidContent\">\r\n <div class=\"timeline-item\" *ngFor=\"let item of section.list; let i = index\">\r\n <div class=\"timeline-card\" [ngClass]=\"item.actionBgColor\">\r\n <div class=\"card-header\">\r\n <div class=\"action-info\">\r\n <div class=\"action-icon\" [ngClass]=\"item.actionIconBgColor\">\r\n <i [class]=\"item.actionIcon\"></i>\r\n </div>\r\n <span class=\"action-label\" [ngClass]=\"item.actionColor\">\r\n {{ item.label }}\r\n </span>\r\n </div>\r\n <div class=\"timestamp\">\r\n {{ item.dateTime }}\r\n </div>\r\n </div>\r\n \r\n <!-- Description -->\r\n <div class=\"card-description\" *ngIf=\"item.requestDescription\">\r\n <p class=\"description-text\">{{ item.requestDescription ?? 'No Request' }}</p>\r\n </div>\r\n \r\n <!-- Document details if URL exists -->\r\n <div class=\"document-details\" *ngIf=\"item.documentUrl\">\r\n <div class=\"document-card\">\r\n <div class=\"document-info\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <div class=\"document-text\">\r\n <div class=\"document-title\">Document</div>\r\n <div class=\"document-filename clickable\" \r\n (click)=\"downloadDocument(item.documentUrl!, item.docName)\"\r\n title=\"Click to download\">\r\n {{ item.docName || 'Document' }}\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"document-actions\">\r\n <button class=\"action-btn download-btn\" \r\n title=\"Download\"\r\n (click)=\"downloadDocument(item.documentUrl!, item.docName)\">\r\n <i class=\"pi pi-download\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <!-- User information -->\r\n <div class=\"user-info\">\r\n <span class=\"user-name\">{{ item.userName }}</span>\r\n <span class=\"user-role\">({{ item.userRole }})</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <!-- Show message if no valid content -->\r\n <div class=\"no-content-message\" *ngIf=\"!section.hasValidContent\">\r\n <p>No initial request details available.</p>\r\n </div>\r\n </p-accordionTab>\r\n </p-accordion>\r\n </div>\r\n \r\n <!-- Document History as regular timeline -->\r\n <div *ngIf=\"section.header !== 'Initial Request'\" class=\"document-history-section\">\r\n <div class=\"section-header\" *ngIf=\"section.header\">\r\n <h4 class=\"section-title\">{{ section.header }}</h4>\r\n </div>\r\n \r\n <div class=\"history-timeline\">\r\n <div class=\"timeline-item\" *ngFor=\"let item of section.list; let i = index\">\r\n <div class=\"timeline-card\" [ngClass]=\"item.actionBgColor\">\r\n <!-- Header with icon and timestamp -->\r\n <div class=\"card-header\">\r\n <div class=\"action-info\">\r\n <div class=\"action-icon\" [ngClass]=\"item.actionIconBgColor\">\r\n <i [class]=\"item.actionIcon\"></i>\r\n </div>\r\n <span class=\"action-label\" [ngClass]=\"item.actionColor\">\r\n {{ item.label }}\r\n </span>\r\n </div>\r\n <div class=\"timestamp\">\r\n {{ item.dateTime }}\r\n </div>\r\n </div>\r\n \r\n <!-- Description -->\r\n <div class=\"card-description\" *ngIf=\"item.requestDescription\">\r\n <p class=\"description-text\">{{ item.requestDescription }}</p>\r\n </div>\r\n \r\n <!-- Document details if URL exists -->\r\n <div class=\"document-details\" *ngIf=\"item.documentUrl\">\r\n <div class=\"document-card\">\r\n <div class=\"document-info\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <div class=\"document-text\">\r\n <div class=\"document-title\">Document</div>\r\n <div class=\"document-filename clickable\" \r\n (click)=\"downloadDocument(item.documentUrl!, item.docName)\"\r\n title=\"Click to download\">\r\n {{ item.docName || 'Document' }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <!-- User information -->\r\n <div class=\"user-info\">\r\n <span class=\"user-name\">{{ item.userName }}</span>\r\n <span class=\"user-role\">({{ item.userRole }})</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>", styles: [".document-history-container{padding:1rem;background:#fff;border-radius:8px;box-shadow:0 2px 4px #0000001a;max-height:70vh;overflow-y:auto}.document-history-container .history-header{margin-bottom:1.5rem}.document-history-container .history-header .history-title{font-size:1.5rem;font-weight:600;color:#374151;margin:0}.document-history-container .history-sections .history-section{margin-bottom:2rem}.document-history-container .history-sections .history-section .initial-request-section{margin-bottom:1.5rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{background:#fff;border:1px solid;border-radius:8px;padding:1rem 1.5rem;font-weight:600;color:#1f2937;font-size:1rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link:focus{box-shadow:none}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link .p-accordion-header-icon{color:#6b7280;font-size:.875rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header.p-highlight .p-accordion-header-link{background:#fff}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content{background:#fff;border:1px solid;border-top:none;border-radius:0 0 8px 8px;padding:1.5rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item{margin-bottom:0}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:1rem;border-right:3px solid}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon{background:#7d879b;color:#fff;width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon i{font-size:14px}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-label{color:#1f2937;font-weight:600}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .timestamp{color:#6b7280;font-size:.75rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-description .description-text{color:#374151;line-height:1.5}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .user-info .user-name{color:#1f2937;font-weight:500}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .user-info .user-role{color:#6b7280}.document-history-container .history-sections .history-section .initial-request-section.document-requested ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#d1d5db}.document-history-container .history-sections .history-section .initial-request-section.document-requested ::ng-deep .p-accordion .p-accordion-content{border-color:#d1d5db}.document-history-container .history-sections .history-section .initial-request-section.document-uploaded ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-uploaded ::ng-deep .p-accordion .p-accordion-content{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-rejected ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#fca5a5}.document-history-container .history-sections .history-section .initial-request-section.document-rejected ::ng-deep .p-accordion .p-accordion-content{border-color:#fca5a5}.document-history-container .history-sections .history-section .initial-request-section.document-accepted ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-accepted ::ng-deep .p-accordion .p-accordion-content{border-color:#86efac}.document-history-container .history-sections .history-section .document-history-section .section-header{margin-bottom:1rem}.document-history-container .history-sections .history-section .document-history-section .section-header .section-title{font-size:1.25rem;font-weight:500;color:#374151;margin:0}.document-history-container .history-sections .history-section .history-timeline .timeline-item{margin-bottom:1rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card{border-radius:8px;border:1px solid;padding:1rem;position:relative;border-right:3px solid}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-green-50{background-color:#f0fdf4;border-color:#bbf7d0;border-right-color:#10b981}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-red-50{background-color:#fef2f2;border-color:#fecaca;border-right-color:#ef4444}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-blue-50{background-color:#eff6ff;border-color:#bfdbfe;border-right-color:#3b82f6}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-gray-50{background-color:#f8fafc;border-color:#e2e8f0;border-right-color:#6b7280}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info{display:flex;align-items:center;gap:.5rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon i{font-size:14px}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-label{font-weight:600;font-size:.875rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .timestamp{font-size:.75rem;color:#6b7280}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-description{margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-description .description-text{margin:0;color:#374151;font-size:.875rem;line-height:1.4}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details{margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card{background:#fff;border-radius:6px;padding:.75rem;display:flex;justify-content:space-between;align-items:center;border:1px solid #e5e7eb}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info{display:flex;align-items:center;gap:.5rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-icon{color:#3b82f6;font-size:1.25rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-title{font-weight:500;color:#374151;font-size:.875rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename{color:#3b82f6;font-size:.75rem;word-break:break-word}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename.clickable{cursor:pointer;text-decoration:underline}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename.clickable:hover{color:#2563eb;text-decoration:none}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions{display:flex;gap:.25rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn{width:24px;height:24px;border:none;border-radius:4px;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.edit-btn{background:#3b82f6;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.edit-btn:hover{background:#2563eb}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.delete-btn{background:#ef4444;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.delete-btn:hover{background:#dc2626}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.download-btn{background:#10b981;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.download-btn:hover{background:#059669}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info{text-align:right;font-size:.75rem;color:#374151}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info .user-name{font-weight:500}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info .user-role{color:#6b7280}.text-green-600{color:#059669}.text-red-600{color:#dc2626}.text-blue-600{color:#2563eb}.text-gray-600{color:#4b5563}.bg-green-50{background-color:#f0fdf4}.bg-red-50{background-color:#fef2f2}.bg-blue-50{background-color:#eff6ff}.bg-gray-50{background-color:#f8fafc}.border-green-200{border-color:#bbf7d0}.border-red-200{border-color:#fecaca}.border-blue-200{border-color:#bfdbfe}.border-gray-200{border-color:#e2e8f0}.icon-bg-green{background-color:#10b981}.icon-bg-red{background-color:#ef4444}.icon-bg-blue{background-color:#3b82f6}.icon-bg-gray{background-color:#6b7280}.no-content-message{text-align:center;padding:2rem;color:#6b7280;font-style:italic}.no-content-message p{margin:0;font-size:.875rem}\n"] }]
|
|
3691
|
-
}], ctorParameters: () => [{ type:
|
|
3934
|
+
}], ctorParameters: () => [{ type: DocumentHistoryService }], propDecorators: { historyData: [{
|
|
3692
3935
|
type: Input
|
|
3693
3936
|
}], showHistory: [{
|
|
3694
3937
|
type: Input
|
|
@@ -3939,7 +4182,7 @@ class DocumentActionsComponent {
|
|
|
3939
4182
|
this.rejectNote = SHARED.EMPTY;
|
|
3940
4183
|
}
|
|
3941
4184
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentActionsComponent, deps: [{ token: DocumentActionsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3942
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentActionsComponent, isStandalone: false, selector: "document-actions", inputs: { documentId: "documentId", currentStatus: "currentStatus", isLoading: "isLoading", isUploaded: "isUploaded", statusId: "statusId" }, outputs: { actionPerformed: "actionPerformed" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"document-actions-container\" *ngIf=\"isUploaded\">\r\n <div class=\"actions-card\" [ngClass]=\"cardClass\">\r\n <div class=\"actions-buttons\">\r\n <!-- Reject Button -->\r\n <button \r\n class=\"action-btn reject-btn\" \r\n [ngClass]=\"rejectButtonClass\"\r\n (click)=\"onRejectClick()\"\r\n [disabled]=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE || isLoading\">\r\n <i class=\"pi pi-times\" *ngIf=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE\"></i>\r\n <span>{{ currentStatus === SHARED.STATUS_REJECTED_LOWERCASE ? SHARED.BUTTON_LABEL_REJECTED : SHARED.BUTTON_LABEL_REJECT }}</span>\r\n </button>\r\n\r\n <!-- Accept Button -->\r\n <button \r\n class=\"action-btn accept-btn\" \r\n [ngClass]=\"acceptButtonClass\"\r\n (click)=\"onAcceptClick()\"\r\n [disabled]=\"currentStatus === SHARED.STATUS_ACCEPTED || isLoading\">\r\n <i class=\"pi pi-check\" *ngIf=\"currentStatus === SHARED.STATUS_ACCEPTED\"></i>\r\n <i class=\"pi pi-spin pi-spinner\" *ngIf=\"isLoading\"></i>\r\n <span>{{ currentStatus === SHARED.STATUS_ACCEPTED ? SHARED.BUTTON_LABEL_ACCEPTED : SHARED.BUTTON_LABEL_ACCEPT }}</span>\r\n </button>\r\n\r\n <!-- Delete Button -->\r\n <button \r\n class=\"action-btn delete-btn\" \r\n (click)=\"onDeleteClick()\"\r\n [disabled]=\"isLoading\"\r\n [permission]=\"'Documents-DELETE'\">\r\n <i class=\"pi pi-trash\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Accept Confirmation Dialog -->\r\n<p-dialog \r\n [(visible)]=\"showAcceptDialog\" \r\n [header]=\"SHARED.ACCEPT_CONFIRM_HEADER\" \r\n [modal]=\"true\" \r\n [draggable]=\"false\" \r\n [closable]=\"true\"\r\n [style]=\"{ width: '25rem', height: '25rem' }\"\r\n styleClass=\"confirmation-dialog\">\r\n <div class=\"dialog-content\">\r\n <label for=\"acceptNote\" class=\"note-label\">{{ SHARED.ACCEPT_NOTE_LABEL }}</label>\r\n <textarea \r\n id=\"acceptNote\"\r\n pInputTextarea \r\n [(ngModel)]=\"acceptNote\" \r\n [placeholder]=\"SHARED.ACCEPT_NOTE_PLACEHOLDER\"\r\n rows=\"6\"\r\n class=\"note-textarea\">\r\n </textarea>\r\n </div>\r\n <ng-template pTemplate=\"footer\">\r\n <div class=\"dialog-footer\">\r\n <button \r\n pButton \r\n [label]=\"SHARED.CANCEL_BUTTON_LABEL\" \r\n class=\"p-button-secondary\" \r\n (click)=\"onCancel()\">\r\n </button>\r\n <button \r\n pButton \r\n [label]=\"SHARED.ACCEPT_BUTTON_LABEL\" \r\n class=\"p-button-success\" \r\n (click)=\"onAcceptConfirm()\">\r\n </button>\r\n </div>\r\n </ng-template>\r\n</p-dialog>\r\n\r\n<!-- Reject Confirmation Dialog -->\r\n<p-dialog \r\n [(visible)]=\"showRejectDialog\" \r\n [header]=\"SHARED.REJECT_CONFIRM_HEADER\" \r\n [modal]=\"true\" \r\n [draggable]=\"false\" \r\n [closable]=\"true\"\r\n [style]=\"{ width: '25rem', height: '25rem' }\"\r\n styleClass=\"confirmation-dialog\">\r\n <div class=\"dialog-content\">\r\n <label for=\"rejectNote\" class=\"note-label\">{{ SHARED.REJECT_NOTE_LABEL }}</label>\r\n <textarea \r\n id=\"rejectNote\"\r\n pInputTextarea \r\n [(ngModel)]=\"rejectNote\" \r\n [placeholder]=\"SHARED.REJECT_NOTE_PLACEHOLDER\"\r\n rows=\"6\"\r\n class=\"note-textarea\">\r\n </textarea>\r\n </div>\r\n <ng-template pTemplate=\"footer\">\r\n <div class=\"dialog-footer\">\r\n <button \r\n pButton \r\n [label]=\"SHARED.CANCEL_BUTTON_LABEL\" \r\n class=\"p-button-secondary\" \r\n (click)=\"onCancel()\">\r\n </button>\r\n <button \r\n pButton \r\n [label]=\"SHARED.REJECT_BUTTON_LABEL\" \r\n class=\"p-button-danger\" \r\n [disabled]=\"isRejectNoteEmpty\"\r\n (click)=\"onRejectConfirm()\">\r\n </button>\r\n </div>\r\n </ng-template>\r\n</p-dialog> ", styles: [".document-actions-container{margin:1rem 0}.actions-card{border-radius:8px;padding:1rem;box-shadow:0 2px 4px #0000001a;transition:all .3s ease}.actions-card.pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-card.accepted-card{background-color:#d4edda;border:1px solid #28a745}.actions-card.rejected-card{background-color:#f8d7da;border:1px solid #dc3545}.actions-card[class*=status-].status-approved-card{background-color:#d4edda;border:1px solid #28a745}.actions-card[class*=status-].status-rejected-card{background-color:#f8d7da;border:1px solid #dc3545}.actions-card[class*=status-].status-pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-buttons{display:flex;gap:.5rem;align-items:center}.action-btn{padding:.5rem 1rem;border-radius:6px;border:1px solid;font-weight:500;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;gap:.5rem;min-width:80px;justify-content:center}.action-btn:disabled{opacity:.6;cursor:not-allowed}.action-btn i{font-size:.875rem}.reject-btn.default-reject{background-color:#fff5f5;border-color:#feb2b2;color:#4a5568}.reject-btn.default-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn.secondary-reject{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.reject-btn.secondary-reject:hover:not(:disabled){background-color:#edf2f7;border-color:#cbd5e0}.reject-btn.primary-reject{background-color:#dc3545;border-color:#dc3545;color:#fff}.reject-btn.primary-reject:hover:not(:disabled){background-color:#c82333;border-color:#bd2130}.reject-btn[class*=status-].status-approved-reject{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.reject-btn[class*=status-].status-approved-reject:hover:not(:disabled){background-color:#edf2f7;border-color:#cbd5e0}.reject-btn[class*=status-].status-rejected-reject{background-color:#dc3545;border-color:#dc3545;color:#fff}.reject-btn[class*=status-].status-rejected-reject:hover:not(:disabled){background-color:#c82333;border-color:#bd2130}.reject-btn[class*=status-].status-pending-reject{background-color:#fff5f5;border-color:#feb2b2;color:#4a5568}.reject-btn[class*=status-].status-pending-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.accept-btn.default-accept{background-color:#f0fff4;border-color:#9ae6b4;color:#4a5568}.accept-btn.default-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.accept-btn.secondary-accept{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.accept-btn.secondary-accept:hover:not(:disabled){background-color:#edf2f7;border-color:#cbd5e0}.accept-btn.primary-accept{background-color:#28a745;border-color:#28a745;color:#fff}.accept-btn.primary-accept:hover:not(:disabled){background-color:#218838;border-color:#1e7e34}.accept-btn[class*=status-].status-approved-accept{background-color:#28a745;border-color:#28a745;color:#fff}.accept-btn[class*=status-].status-approved-accept:hover:not(:disabled){background-color:#218838;border-color:#1e7e34}.accept-btn[class*=status-].status-rejected-accept{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.accept-btn[class*=status-].status-rejected-accept:hover:not(:disabled){background-color:#edf2f7;border-color:#cbd5e0}.accept-btn[class*=status-].status-pending-accept{background-color:#f0fff4;border-color:#9ae6b4;color:#4a5568}.accept-btn[class*=status-].status-pending-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.delete-btn{background-color:#fff;border-color:#e2e8f0;color:#e53e3e;padding:.5rem;min-width:auto;width:40px;height:40px}.delete-btn:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181;color:#c53030}.delete-btn i{font-size:1rem}:host ::ng-deep .confirmation-dialog .p-dialog{border-radius:8px;box-shadow:0 4px 12px #00000026;border:none;overflow:hidden}:host ::ng-deep .confirmation-dialog .p-dialog-header{padding:1.25rem 1.5rem;background-color:#fff;border-bottom:none;border-top-right-radius:10px;border-top-left-radius:10px}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-header-icon{display:none}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-title{font-size:1.125rem;font-weight:600;color:#2d3748;margin:0}:host ::ng-deep .confirmation-dialog .p-dialog-content{padding:1.5rem;background-color:#fff}:host ::ng-deep .confirmation-dialog .p-dialog-footer{padding:1rem 1.5rem;background-color:#f7fafc;border-top:1px solid #e2e8f0;display:flex;gap:.75rem;justify-content:flex-end;border-bottom-right-radius:10px;border-bottom-left-radius:10px}.dialog-content .note-label{display:block;margin-bottom:.75rem;font-weight:500;font-size:.875rem;color:#2d3748}.dialog-content .note-textarea{width:100%;min-height:100px;padding:.75rem;border:1px solid #e2e8f0;border-radius:6px;font-family:inherit;font-size:.875rem;line-height:1.5;resize:vertical;background-color:#fff;color:#2d3748}.dialog-content .note-textarea::placeholder{color:#a0aec0}.dialog-content .note-textarea:focus{outline:none;border-color:#3182ce;box-shadow:0 0 0 3px #3182ce1a}.dialog-footer{display:flex;gap:.75rem;justify-content:flex-end}.dialog-footer button{min-width:80px;padding:.5rem 1rem;border-radius:6px;font-weight:500;font-size:.875rem;border:1px solid;cursor:pointer;transition:all .2s ease}.dialog-footer button.p-button-secondary{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.dialog-footer button.p-button-secondary:hover{background-color:#edf2f7;border-color:#cbd5e0}.dialog-footer button.p-button-success{background-color:#38a169;border-color:#38a169;color:#fff}.dialog-footer button.p-button-success:hover{background-color:#2f855a;border-color:#2f855a}.dialog-footer button.p-button-danger{background-color:#e53e3e;border-color:#e53e3e;color:#fff}.dialog-footer button.p-button-danger:hover{background-color:#c53030;border-color:#c53030}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i4.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "directive", type: i5$2.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize", "variant"], outputs: ["onResize"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i7$1.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: HasPermissionDirective, selector: "[permission]", inputs: ["permission"] }] });
|
|
4185
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentActionsComponent, isStandalone: false, selector: "document-actions", inputs: { documentId: "documentId", currentStatus: "currentStatus", isLoading: "isLoading", isUploaded: "isUploaded", statusId: "statusId" }, outputs: { actionPerformed: "actionPerformed" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"document-actions-container\" *ngIf=\"isUploaded\">\r\n <div class=\"actions-card\" [ngClass]=\"cardClass\">\r\n <div class=\"actions-buttons\">\r\n <!-- Reject Button -->\r\n <button \r\n class=\"action-btn reject-btn\" \r\n [ngClass]=\"rejectButtonClass\"\r\n (click)=\"onRejectClick()\"\r\n [disabled]=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE || isLoading\">\r\n <i class=\"pi pi-times\" *ngIf=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE\"></i>\r\n <span>{{ currentStatus === SHARED.STATUS_REJECTED_LOWERCASE ? SHARED.BUTTON_LABEL_REJECTED : SHARED.BUTTON_LABEL_REJECT }}</span>\r\n </button>\r\n\r\n <!-- Accept Button -->\r\n <button \r\n class=\"action-btn accept-btn\" \r\n [ngClass]=\"acceptButtonClass\"\r\n (click)=\"onAcceptClick()\"\r\n [disabled]=\"currentStatus === SHARED.STATUS_ACCEPTED || isLoading\">\r\n <i class=\"pi pi-check\" *ngIf=\"currentStatus === SHARED.STATUS_ACCEPTED\"></i>\r\n <i class=\"pi pi-spin pi-spinner\" *ngIf=\"isLoading\"></i>\r\n <span>{{ currentStatus === SHARED.STATUS_ACCEPTED ? SHARED.BUTTON_LABEL_ACCEPTED : SHARED.BUTTON_LABEL_ACCEPT }}</span>\r\n </button>\r\n\r\n <!-- Delete Button -->\r\n <button \r\n class=\"action-btn delete-btn\" \r\n (click)=\"onDeleteClick()\"\r\n [disabled]=\"isLoading\"\r\n [permission]=\"'Documents-DELETE'\">\r\n <i class=\"pi pi-trash\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Accept Confirmation Dialog -->\r\n<p-dialog \r\n [(visible)]=\"showAcceptDialog\" \r\n [header]=\"SHARED.ACCEPT_CONFIRM_HEADER\" \r\n [modal]=\"true\" \r\n [draggable]=\"false\" \r\n [closable]=\"true\"\r\n [style]=\"{ width: '25rem', height: '25rem' }\"\r\n styleClass=\"confirmation-dialog\">\r\n <div class=\"dialog-content\">\r\n <label for=\"acceptNote\" class=\"note-label\">{{ SHARED.ACCEPT_NOTE_LABEL }}</label>\r\n <textarea \r\n id=\"acceptNote\"\r\n pInputTextarea \r\n [(ngModel)]=\"acceptNote\" \r\n [placeholder]=\"SHARED.ACCEPT_NOTE_PLACEHOLDER\"\r\n rows=\"6\"\r\n class=\"note-textarea\">\r\n </textarea>\r\n </div>\r\n <ng-template pTemplate=\"footer\">\r\n <div class=\"dialog-footer\">\r\n <button \r\n pButton \r\n [label]=\"SHARED.CANCEL_BUTTON_LABEL\" \r\n class=\"p-button-secondary\" \r\n (click)=\"onCancel()\">\r\n </button>\r\n <button \r\n pButton \r\n [label]=\"SHARED.ACCEPT_BUTTON_LABEL\" \r\n class=\"p-button-success\" \r\n (click)=\"onAcceptConfirm()\">\r\n </button>\r\n </div>\r\n </ng-template>\r\n</p-dialog>\r\n\r\n<!-- Reject Confirmation Dialog -->\r\n<p-dialog \r\n [(visible)]=\"showRejectDialog\" \r\n [header]=\"SHARED.REJECT_CONFIRM_HEADER\" \r\n [modal]=\"true\" \r\n [draggable]=\"false\" \r\n [closable]=\"true\"\r\n [style]=\"{ width: '25rem', height: '25rem' }\"\r\n styleClass=\"confirmation-dialog\">\r\n <div class=\"dialog-content\">\r\n <label for=\"rejectNote\" class=\"note-label\">{{ SHARED.REJECT_NOTE_LABEL }}</label>\r\n <textarea \r\n id=\"rejectNote\"\r\n pInputTextarea \r\n [(ngModel)]=\"rejectNote\" \r\n [placeholder]=\"SHARED.REJECT_NOTE_PLACEHOLDER\"\r\n rows=\"6\"\r\n class=\"note-textarea\">\r\n </textarea>\r\n </div>\r\n <ng-template pTemplate=\"footer\">\r\n <div class=\"dialog-footer\">\r\n <button \r\n pButton \r\n [label]=\"SHARED.CANCEL_BUTTON_LABEL\" \r\n class=\"p-button-secondary\" \r\n (click)=\"onCancel()\">\r\n </button>\r\n <button \r\n pButton \r\n [label]=\"SHARED.REJECT_BUTTON_LABEL\" \r\n class=\"p-button-danger\" \r\n [disabled]=\"isRejectNoteEmpty\"\r\n (click)=\"onRejectConfirm()\">\r\n </button>\r\n </div>\r\n </ng-template>\r\n</p-dialog> ", styles: [".document-actions-container{margin:1rem 0}.actions-card{border-radius:8px;padding:1rem;box-shadow:0 2px 4px #0000001a;transition:all .3s ease}.actions-card.pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-card.accepted-card{background-color:#d4edda;border:1px solid #28a745}.actions-card.rejected-card{background-color:#f8d7da;border:1px solid #dc3545}.actions-card[class*=status-].status-approved-card{background-color:#d4edda;border:1px solid #28a745}.actions-card[class*=status-].status-rejected-card{background-color:#f8d7da;border:1px solid #dc3545}.actions-card[class*=status-].status-pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-buttons{display:flex;gap:.5rem;align-items:center}.action-btn{padding:.5rem 1rem;border-radius:6px;border:1px solid;font-weight:500;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;gap:.5rem;min-width:80px;justify-content:center}.action-btn:disabled{opacity:.6;cursor:not-allowed}.action-btn i{font-size:.875rem}.reject-btn.default-reject{background-color:#fff5f5;border-color:#feb2b2;color:#4a5568}.reject-btn.default-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn.secondary-reject{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.reject-btn.secondary-reject:hover:not(:disabled){background-color:#edf2f7;border-color:#cbd5e0}.reject-btn.primary-reject{background-color:#dc3545;border-color:#dc3545;color:#fff}.reject-btn.primary-reject:hover:not(:disabled){background-color:#c82333;border-color:#bd2130}.reject-btn[class*=status-].status-approved-reject{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.reject-btn[class*=status-].status-approved-reject:hover:not(:disabled){background-color:#edf2f7;border-color:#cbd5e0}.reject-btn[class*=status-].status-rejected-reject{background-color:#dc3545;border-color:#dc3545;color:#fff}.reject-btn[class*=status-].status-rejected-reject:hover:not(:disabled){background-color:#c82333;border-color:#bd2130}.reject-btn[class*=status-].status-pending-reject{background-color:#fff5f5;border-color:#feb2b2;color:#4a5568}.reject-btn[class*=status-].status-pending-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.accept-btn.default-accept{background-color:#f0fff4;border-color:#9ae6b4;color:#4a5568}.accept-btn.default-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.accept-btn.secondary-accept{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.accept-btn.secondary-accept:hover:not(:disabled){background-color:#edf2f7;border-color:#cbd5e0}.accept-btn.primary-accept{background-color:#28a745;border-color:#28a745;color:#fff}.accept-btn.primary-accept:hover:not(:disabled){background-color:#218838;border-color:#1e7e34}.accept-btn[class*=status-].status-approved-accept{background-color:#28a745;border-color:#28a745;color:#fff}.accept-btn[class*=status-].status-approved-accept:hover:not(:disabled){background-color:#218838;border-color:#1e7e34}.accept-btn[class*=status-].status-rejected-accept{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.accept-btn[class*=status-].status-rejected-accept:hover:not(:disabled){background-color:#edf2f7;border-color:#cbd5e0}.accept-btn[class*=status-].status-pending-accept{background-color:#f0fff4;border-color:#9ae6b4;color:#4a5568}.accept-btn[class*=status-].status-pending-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.delete-btn{background-color:#fff;border-color:#e2e8f0;color:#e53e3e;padding:.5rem;min-width:auto;width:40px;height:40px}.delete-btn:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181;color:#c53030}.delete-btn i{font-size:1rem}:host ::ng-deep .confirmation-dialog .p-dialog{border-radius:8px;box-shadow:0 4px 12px #00000026;border:none;overflow:hidden}:host ::ng-deep .confirmation-dialog .p-dialog-header{padding:1.25rem 1.5rem;background-color:#fff;border-bottom:none;border-top-right-radius:10px;border-top-left-radius:10px}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-header-icon{display:none}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-title{font-size:1.125rem;font-weight:600;color:#2d3748;margin:0}:host ::ng-deep .confirmation-dialog .p-dialog-content{padding:1.5rem;background-color:#fff}:host ::ng-deep .confirmation-dialog .p-dialog-footer{padding:1rem 1.5rem;background-color:#f7fafc;border-top:1px solid #e2e8f0;display:flex;gap:.75rem;justify-content:flex-end;border-bottom-right-radius:10px;border-bottom-left-radius:10px}.dialog-content .note-label{display:block;margin-bottom:.75rem;font-weight:500;font-size:.875rem;color:#2d3748}.dialog-content .note-textarea{width:100%;min-height:100px;padding:.75rem;border:1px solid #e2e8f0;border-radius:6px;font-family:inherit;font-size:.875rem;line-height:1.5;resize:vertical;background-color:#fff;color:#2d3748}.dialog-content .note-textarea::placeholder{color:#a0aec0}.dialog-content .note-textarea:focus{outline:none;border-color:#3182ce;box-shadow:0 0 0 3px #3182ce1a}.dialog-footer{display:flex;gap:.75rem;justify-content:flex-end}.dialog-footer button{min-width:80px;padding:.5rem 1rem;border-radius:6px;font-weight:500;font-size:.875rem;border:1px solid;cursor:pointer;transition:all .2s ease}.dialog-footer button.p-button-secondary{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.dialog-footer button.p-button-secondary:hover{background-color:#edf2f7;border-color:#cbd5e0}.dialog-footer button.p-button-success{background-color:#38a169;border-color:#38a169;color:#fff}.dialog-footer button.p-button-success:hover{background-color:#2f855a;border-color:#2f855a}.dialog-footer button.p-button-danger{background-color:#e53e3e;border-color:#e53e3e;color:#fff}.dialog-footer button.p-button-danger:hover{background-color:#c53030;border-color:#c53030}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i4.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "directive", type: i5$1.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize", "variant"], outputs: ["onResize"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i7$1.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: HasPermissionDirective, selector: "[permission]", inputs: ["permission"] }] });
|
|
3943
4186
|
}
|
|
3944
4187
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentActionsComponent, decorators: [{
|
|
3945
4188
|
type: Component,
|
|
@@ -4079,7 +4322,7 @@ class DocumentViewerComponent {
|
|
|
4079
4322
|
this.subscription.unsubscribe();
|
|
4080
4323
|
}
|
|
4081
4324
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentViewerComponent, deps: [{ token: DocumentHttpService }, { token: DocumentHelperService }, { token: i3$1.MessageService }, { token: DocumentViewerService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4082
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: DocumentViewerComponent, isStandalone: false, selector: "document-viewer", inputs: { selectedDocument: "selectedDocument", documentList: "documentList", contextId: "contextId" }, outputs: { documentStatusUpdated: "documentStatusUpdated" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"grid\">\r\n <div class=\"col-12\">\r\n <p-messages [(value)]=\"messages\" [enableService]=\"false\"></p-messages>\r\n <div class=\"p-fluid p-formgrid grid m-0\">\r\n <div class=\"col-12 md:col-12 md:flex justify-content-evenly\">\r\n @if(selectedDocument){\r\n <div id=\"outerContainer col-12 md:col-9\">\r\n <div\r\n *ngIf=\"isImage(selectedDocument?.contentType)\"\r\n class=\"img-container\"\r\n >\r\n <img\r\n [src]=\"selectedDocument?.documentUrl || ''\"\r\n class=\"uploadedImages\"\r\n alt=\"Document Image\"\r\n />\r\n </div>\r\n @if(selectedDocument?.contentType && selectedDocument?.contentType === \"application/pdf\"){\r\n <div class=\"pdf-container\">\r\n <pdf-viewer\r\n [src]=\"selectedDocument?.documentUrl || ''\"\r\n [rotation]=\"0\"\r\n [original-size]=\"false\"\r\n [show-all]=\"true\"\r\n [fit-to-page]=\"false\"\r\n [zoom]=\"1\"\r\n [zoom-scale]=\"'page-width'\"\r\n [stick-to-page]=\"false\"\r\n [render-text]=\"true\"\r\n [external-link-target]=\"'blank'\"\r\n [autoresize]=\"true\"\r\n [show-borders]=\"false\"\r\n style=\"width: 50vw; height: 75vh\"\r\n ></pdf-viewer>\r\n </div>\r\n }@else{\r\n <div class=\"incorrect-docType\">\r\n ContentType is incorrect.\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <div class=\"left-part col-12 md:col-3 pt-0\">\r\n @if(!selectedDocument?.isUploaded){\r\n <document-actions\r\n [documentId]=\"selectedDocument?._id\"\r\n [currentStatus]=\"currentState.documentStatus\"\r\n [isLoading]=\"currentState.isActionLoading\"\r\n [isUploaded]=\"currentState.documentIsUploaded\"\r\n [statusId]=\"selectedDocument?.statusId\"\r\n (actionPerformed)=\"handleDocumentAction($event)\">\r\n </document-actions>\r\n }\r\n <!-- <div class=\"alerts mb-4 pb-1\">\r\n <button\r\n type=\"button\"\r\n *ngIf=\"\r\n (alertData?.status !== 'Pending' && !!alertData?.status) ||\r\n alertData?.isAlert === false\r\n \"\r\n class=\"bg-green-500 border-none border-round-md flex align-items-center mb-3 p-2 px-3\"\r\n >\r\n <i\r\n class=\"pi pi-verified mr-2 cursor-pointer\"\r\n [ngStyle]=\"{\r\n color:\r\n alertData?.status === 'Pending' &&\r\n alertData?.isAlert !== false\r\n ? '#FFFFFF'\r\n : '#8A8EA6'\r\n }\"\r\n style=\"font-size: 20px\"\r\n ></i>\r\n <span class=\"font-semibold text-white\">Verified</span>\r\n </button>\r\n <div\r\n class=\"card mb-0\"\r\n [ngClass]=\"\r\n (alertData?.status === 'Pending' || !alertData?.status) &&\r\n alertData?.isAlert !== false\r\n ? 'alert-card'\r\n : 'success-alert'\r\n \"\r\n >\r\n <div class=\"flex align-items-center mb-2 pb-1\" *ngIf=\"alertData?.status !== 'Verified'\">\r\n <h4 class=\"mr-3 mt-0 mb-0 text-color font-bold\" style=\"font-size: 21px; font-weight: bold; border-color: rgba(68, 72, 109, 0.2) ;\" >Alerts</h4>\r\n <i\r\n class=\"pi pi-exclamation-triangle\"\r\n style=\"font-size: 20px\"\r\n [ngStyle]=\"{\r\n color:\r\n (alertData?.status === 'Pending' || !alertData?.status) &&\r\n alertData?.isAlert !== false\r\n ? '#FB392D'\r\n : '#8A8EA6'\r\n }\"\r\n ></i>\r\n </div>\r\n <p class=\"text-color mb-0\">{{ alertData?.alertMessage }}</p>\r\n </div>\r\n </div>\r\n -->\r\n <document-history \r\n [historyData]=\"currentState.documentHistory\" \r\n [showHistory]=\"currentState.showDocumentHistory\">\r\n </document-history>\r\n \r\n <ng-content></ng-content>\r\n <!-- <app-linked-document (selectedDocumentChange)=\"handleSelectedDocument($event)\" [selectedDocument]=\"selectedDocument\" [documentList]=\"documentList\"></app-linked-document> -->\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".alert-card{background-color:#fb392d1a}.success-alert{border-radius:10px;border:1px solid rgba(251,57,45,.1);background:linear-gradient(0deg,#dedede 0% 100%),#fff}.p-timeline-event-opposite{display:none}.decription{color:#676b89}.textAreaControl textarea{width:100%;resize:vertical;max-width:100%}.document-btn-wrapper .p-button-outlined{color:#f57c00}.document-viewer .p-dialog{width:100%;height:100%;max-height:100%!important;box-shadow:none!important}.document-viewer .p-dialog-header-close-icon{height:20px;width:20px}.document-viewer .p-dialog-header,.document-viewer .p-dialog-content{background-color:#fff;border-radius:0}.uploadedImages{width:95%;height:100%;object-fit:contain}\n"], dependencies: [{ kind: "directive", type:
|
|
4325
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: DocumentViewerComponent, isStandalone: false, selector: "document-viewer", inputs: { selectedDocument: "selectedDocument", documentList: "documentList", contextId: "contextId" }, outputs: { documentStatusUpdated: "documentStatusUpdated" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"grid\">\r\n <div class=\"col-12\">\r\n <p-messages [(value)]=\"messages\" [enableService]=\"false\"></p-messages>\r\n <div class=\"p-fluid p-formgrid grid m-0\">\r\n <div class=\"col-12 md:col-12 md:flex justify-content-evenly\">\r\n @if(selectedDocument){\r\n <div id=\"outerContainer col-12 md:col-9\">\r\n <div\r\n *ngIf=\"isImage(selectedDocument?.contentType)\"\r\n class=\"img-container\"\r\n >\r\n <img\r\n [src]=\"selectedDocument?.documentUrl || ''\"\r\n class=\"uploadedImages\"\r\n alt=\"Document Image\"\r\n />\r\n </div>\r\n @if(selectedDocument?.contentType && selectedDocument?.contentType === \"application/pdf\"){\r\n <div class=\"pdf-container\">\r\n <pdf-viewer\r\n [src]=\"selectedDocument?.documentUrl || ''\"\r\n [rotation]=\"0\"\r\n [original-size]=\"false\"\r\n [show-all]=\"true\"\r\n [fit-to-page]=\"false\"\r\n [zoom]=\"1\"\r\n [zoom-scale]=\"'page-width'\"\r\n [stick-to-page]=\"false\"\r\n [render-text]=\"true\"\r\n [external-link-target]=\"'blank'\"\r\n [autoresize]=\"true\"\r\n [show-borders]=\"false\"\r\n style=\"width: 50vw; height: 75vh\"\r\n ></pdf-viewer>\r\n </div>\r\n }@else{\r\n <div class=\"incorrect-docType\">\r\n ContentType is incorrect.\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <div class=\"left-part col-12 md:col-3 pt-0\">\r\n @if(!selectedDocument?.isUploaded){\r\n <document-actions\r\n [documentId]=\"selectedDocument?._id\"\r\n [currentStatus]=\"currentState.documentStatus\"\r\n [isLoading]=\"currentState.isActionLoading\"\r\n [isUploaded]=\"currentState.documentIsUploaded\"\r\n [statusId]=\"selectedDocument?.statusId\"\r\n (actionPerformed)=\"handleDocumentAction($event)\">\r\n </document-actions>\r\n }\r\n <!-- <div class=\"alerts mb-4 pb-1\">\r\n <button\r\n type=\"button\"\r\n *ngIf=\"\r\n (alertData?.status !== 'Pending' && !!alertData?.status) ||\r\n alertData?.isAlert === false\r\n \"\r\n class=\"bg-green-500 border-none border-round-md flex align-items-center mb-3 p-2 px-3\"\r\n >\r\n <i\r\n class=\"pi pi-verified mr-2 cursor-pointer\"\r\n [ngStyle]=\"{\r\n color:\r\n alertData?.status === 'Pending' &&\r\n alertData?.isAlert !== false\r\n ? '#FFFFFF'\r\n : '#8A8EA6'\r\n }\"\r\n style=\"font-size: 20px\"\r\n ></i>\r\n <span class=\"font-semibold text-white\">Verified</span>\r\n </button>\r\n <div\r\n class=\"card mb-0\"\r\n [ngClass]=\"\r\n (alertData?.status === 'Pending' || !alertData?.status) &&\r\n alertData?.isAlert !== false\r\n ? 'alert-card'\r\n : 'success-alert'\r\n \"\r\n >\r\n <div class=\"flex align-items-center mb-2 pb-1\" *ngIf=\"alertData?.status !== 'Verified'\">\r\n <h4 class=\"mr-3 mt-0 mb-0 text-color font-bold\" style=\"font-size: 21px; font-weight: bold; border-color: rgba(68, 72, 109, 0.2) ;\" >Alerts</h4>\r\n <i\r\n class=\"pi pi-exclamation-triangle\"\r\n style=\"font-size: 20px\"\r\n [ngStyle]=\"{\r\n color:\r\n (alertData?.status === 'Pending' || !alertData?.status) &&\r\n alertData?.isAlert !== false\r\n ? '#FB392D'\r\n : '#8A8EA6'\r\n }\"\r\n ></i>\r\n </div>\r\n <p class=\"text-color mb-0\">{{ alertData?.alertMessage }}</p>\r\n </div>\r\n </div>\r\n -->\r\n <document-history \r\n [historyData]=\"currentState.documentHistory\" \r\n [showHistory]=\"currentState.showDocumentHistory\">\r\n </document-history>\r\n \r\n <ng-content></ng-content>\r\n <!-- <app-linked-document (selectedDocumentChange)=\"handleSelectedDocument($event)\" [selectedDocument]=\"selectedDocument\" [documentList]=\"documentList\"></app-linked-document> -->\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".alert-card{background-color:#fb392d1a}.success-alert{border-radius:10px;border:1px solid rgba(251,57,45,.1);background:linear-gradient(0deg,#dedede 0% 100%),#fff}.p-timeline-event-opposite{display:none}.decription{color:#676b89}.textAreaControl textarea{width:100%;resize:vertical;max-width:100%}.document-btn-wrapper .p-button-outlined{color:#f57c00}.document-viewer .p-dialog{width:100%;height:100%;max-height:100%!important;box-shadow:none!important}.document-viewer .p-dialog-header-close-icon{height:20px;width:20px}.document-viewer .p-dialog-header,.document-viewer .p-dialog-content{background-color:#fff;border-radius:0}.uploadedImages{width:95%;height:100%;object-fit:contain}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange", "onClose"] }, { kind: "component", type: i7$2.PdfViewerComponent, selector: "pdf-viewer", inputs: ["src", "c-maps-url", "page", "render-text", "render-text-mode", "original-size", "show-all", "stick-to-page", "zoom", "zoom-scale", "rotation", "external-link-target", "autoresize", "fit-to-page", "show-borders"], outputs: ["after-load-complete", "page-rendered", "pages-initialized", "text-layer-rendered", "error", "on-progress", "pageChange"] }, { kind: "component", type: DocumentHistoryComponent, selector: "document-history", inputs: ["historyData", "showHistory"] }, { kind: "component", type: DocumentActionsComponent, selector: "document-actions", inputs: ["documentId", "currentStatus", "isLoading", "isUploaded", "statusId"], outputs: ["actionPerformed"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
4083
4326
|
}
|
|
4084
4327
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentViewerComponent, decorators: [{
|
|
4085
4328
|
type: Component,
|
|
@@ -4100,12 +4343,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4100
4343
|
* @class DocumentListComponent
|
|
4101
4344
|
*/
|
|
4102
4345
|
class DocumentListComponent {
|
|
4103
|
-
|
|
4104
|
-
documentHttpService;
|
|
4105
|
-
documentQuery;
|
|
4106
|
-
documentStore;
|
|
4107
|
-
documentTableBuilder;
|
|
4108
|
-
documentHelperService;
|
|
4346
|
+
documentListService;
|
|
4109
4347
|
/**
|
|
4110
4348
|
* Represents the context ID for the document list.
|
|
4111
4349
|
* This value is passed from the parent component.
|
|
@@ -4123,12 +4361,6 @@ class DocumentListComponent {
|
|
|
4123
4361
|
* Subscription to document list response from store
|
|
4124
4362
|
*/
|
|
4125
4363
|
documentListSubscription = new Subscription();
|
|
4126
|
-
/**
|
|
4127
|
-
* Default visibility of the upload button.
|
|
4128
|
-
* @type {boolean}
|
|
4129
|
-
* @memberof DocumentListComponent
|
|
4130
|
-
*/
|
|
4131
|
-
isUploadButtonVisible = SHARED.TRUE;
|
|
4132
4364
|
/**
|
|
4133
4365
|
* The currently selected document.
|
|
4134
4366
|
* @type {DocumentModel}
|
|
@@ -4160,12 +4392,6 @@ class DocumentListComponent {
|
|
|
4160
4392
|
* @memberof DocumentListComponent
|
|
4161
4393
|
*/
|
|
4162
4394
|
documentList = SHARED.EMPTY_ARRAY;
|
|
4163
|
-
/**
|
|
4164
|
-
* The name of the document being uploaded or managed.
|
|
4165
|
-
* @type {string}
|
|
4166
|
-
* @memberof DocumentListComponent
|
|
4167
|
-
*/
|
|
4168
|
-
documentName = SHARED.EMPTY;
|
|
4169
4395
|
/**
|
|
4170
4396
|
* Available document types for selection.
|
|
4171
4397
|
* @type {string[]}
|
|
@@ -4178,10 +4404,6 @@ class DocumentListComponent {
|
|
|
4178
4404
|
* @memberof DocumentListComponent
|
|
4179
4405
|
*/
|
|
4180
4406
|
selectedOption = null;
|
|
4181
|
-
/**
|
|
4182
|
-
* The set of permissions available for this component.
|
|
4183
|
-
*/
|
|
4184
|
-
PERMISSION = PERMISSIONS;
|
|
4185
4407
|
/**
|
|
4186
4408
|
* The file name associated with the document.
|
|
4187
4409
|
* It may be undefined until a file is selected or loaded.
|
|
@@ -4200,45 +4422,27 @@ class DocumentListComponent {
|
|
|
4200
4422
|
* Completion counts for each category
|
|
4201
4423
|
*/
|
|
4202
4424
|
categoryCompletionCounts = [];
|
|
4203
|
-
/**
|
|
4204
|
-
* Filter properties
|
|
4205
|
-
*/
|
|
4206
|
-
status = null;
|
|
4207
|
-
category = null;
|
|
4208
|
-
searchKey = null;
|
|
4209
4425
|
/**
|
|
4210
4426
|
* Creates an instance of DocumentListComponent.
|
|
4211
4427
|
* @class
|
|
4212
|
-
* @param {
|
|
4213
|
-
* @param {DocumentHttpService} documentHttpService - The service responsible for fetching documents from the server.
|
|
4214
|
-
* @param {DocumentQuery} documentQuery - The service responsible for geting stored documents.
|
|
4215
|
-
* @param {DocumentStore} documentStore - The service responsible for storing documents.
|
|
4428
|
+
* @param {DocumentListService} documentListService - The service responsible for document list operations.
|
|
4216
4429
|
*/
|
|
4217
|
-
constructor(
|
|
4218
|
-
this.
|
|
4219
|
-
this.documentHttpService = documentHttpService;
|
|
4220
|
-
this.documentQuery = documentQuery;
|
|
4221
|
-
this.documentStore = documentStore;
|
|
4222
|
-
this.documentTableBuilder = documentTableBuilder;
|
|
4223
|
-
this.documentHelperService = documentHelperService;
|
|
4430
|
+
constructor(documentListService) {
|
|
4431
|
+
this.documentListService = documentListService;
|
|
4224
4432
|
}
|
|
4225
4433
|
/**
|
|
4226
|
-
*
|
|
4434
|
+
* Handles changes to input properties
|
|
4227
4435
|
*/
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4436
|
+
ngOnChanges(changes) {
|
|
4437
|
+
if (changes[SHARED.CONTEXT_ID] && !changes[SHARED.CONTEXT_ID].firstChange) {
|
|
4438
|
+
this.documentListService.refreshDocumentListForNewContext(this.contextId);
|
|
4439
|
+
}
|
|
4231
4440
|
}
|
|
4232
4441
|
/**
|
|
4233
|
-
*
|
|
4234
|
-
* Prevents event propagation and displays the sidebar.
|
|
4235
|
-
* @param {MouseEvent} event - The click event triggered by the user.
|
|
4236
|
-
* @memberof DocumentListComponent
|
|
4442
|
+
* Initializes the component by setting up document list subscription.
|
|
4237
4443
|
*/
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
this.documentStore.setMessage(SHARED.EMPTY_ARRAY);
|
|
4241
|
-
this.isSidebarVisible = SHARED.TRUE;
|
|
4444
|
+
ngOnInit() {
|
|
4445
|
+
this.setupDocumentListSubscription();
|
|
4242
4446
|
}
|
|
4243
4447
|
/**
|
|
4244
4448
|
* Handles the save click event to update the document's file name.
|
|
@@ -4248,11 +4452,12 @@ class DocumentListComponent {
|
|
|
4248
4452
|
* @returns {void}
|
|
4249
4453
|
*/
|
|
4250
4454
|
handleSaveClick() {
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4455
|
+
if (this.fileName && this.selectedDocument) {
|
|
4456
|
+
this.documentListService.handleSaveClick(this.fileName, this.selectedDocument)
|
|
4457
|
+
.subscribe((res) => {
|
|
4458
|
+
console.log(`${SHARED.UPDATE_DOCUMENT_NAME} ${this.selectedDocument._id}`);
|
|
4459
|
+
});
|
|
4460
|
+
}
|
|
4256
4461
|
}
|
|
4257
4462
|
/**
|
|
4258
4463
|
* Handles the upload action for a document.
|
|
@@ -4260,10 +4465,9 @@ class DocumentListComponent {
|
|
|
4260
4465
|
* @memberof DocumentListComponent
|
|
4261
4466
|
*/
|
|
4262
4467
|
handleUploadDocument() {
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
this.documentQuery.selectMessages().subscribe((message) => {
|
|
4468
|
+
this.documentListService.handleUploadDocument(this.selectedOption)
|
|
4469
|
+
.subscribe({
|
|
4470
|
+
next: (message) => {
|
|
4267
4471
|
if (message.length > 0) {
|
|
4268
4472
|
this.messages = message;
|
|
4269
4473
|
this.selectedOption = null;
|
|
@@ -4272,136 +4476,70 @@ class DocumentListComponent {
|
|
|
4272
4476
|
this.handleOpenSideBar(false);
|
|
4273
4477
|
}, 1000);
|
|
4274
4478
|
}
|
|
4275
|
-
});
|
|
4276
|
-
}
|
|
4277
|
-
else {
|
|
4278
|
-
console.error(ERRORS.INVALID_RECIPIENT);
|
|
4279
|
-
}
|
|
4280
|
-
}
|
|
4281
|
-
/**
|
|
4282
|
-
* Fetches the list of document types from the server.
|
|
4283
|
-
* Updates the options array with the available document types.
|
|
4284
|
-
* @memberof DocumentListComponent
|
|
4285
|
-
* @returns {void}
|
|
4286
|
-
*/
|
|
4287
|
-
getDocumentTypeList() {
|
|
4288
|
-
this.documentHttpService.getDocumentTypes().subscribe({
|
|
4289
|
-
/**
|
|
4290
|
-
* Handles the successful API response.
|
|
4291
|
-
* @param {DocumentTypeModel[]} documentTypes - The list of document types returned by the API.
|
|
4292
|
-
*/
|
|
4293
|
-
next: (documentTypes) => {
|
|
4294
|
-
if (documentTypes) {
|
|
4295
|
-
this.options = documentTypes.map((doc) => ({
|
|
4296
|
-
label: doc.label,
|
|
4297
|
-
value: doc._id
|
|
4298
|
-
}));
|
|
4299
|
-
}
|
|
4300
|
-
else {
|
|
4301
|
-
console.error(ERRORS.ERROR_ALLDOCUMENT_MISSING, documentTypes);
|
|
4302
|
-
}
|
|
4303
4479
|
},
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
* @param {any} err - The error object returned by the server.
|
|
4307
|
-
*/
|
|
4308
|
-
error: (err) => {
|
|
4309
|
-
console.error(ERRORS.ERROR_DOCUMENT_TYPES, err);
|
|
4480
|
+
error: (error) => {
|
|
4481
|
+
console.error(error.message);
|
|
4310
4482
|
}
|
|
4311
4483
|
});
|
|
4312
4484
|
}
|
|
4313
|
-
handleOpenSideBar(isVisible) {
|
|
4314
|
-
this.isSidebarVisible = isVisible;
|
|
4315
|
-
}
|
|
4316
|
-
/**
|
|
4317
|
-
* Gets completion count for a category
|
|
4318
|
-
*/
|
|
4319
|
-
getCompletionCount(category) {
|
|
4320
|
-
return this.documentTableBuilder.getCompletionCount(category);
|
|
4321
|
-
}
|
|
4322
|
-
/**
|
|
4323
|
-
* Gets pending document count for a category
|
|
4324
|
-
*/
|
|
4325
|
-
getPendingDocumentCount(category) {
|
|
4326
|
-
return this.documentTableBuilder.getPendingDocumentCount(category);
|
|
4327
|
-
}
|
|
4328
4485
|
/**
|
|
4329
|
-
*
|
|
4486
|
+
* Handles the visibility of the sidebar.
|
|
4487
|
+
* @param {boolean} isVisible - Indicates whether the sidebar should be visible or not.
|
|
4488
|
+
* @memberof DocumentListComponent
|
|
4330
4489
|
*/
|
|
4331
|
-
|
|
4332
|
-
|
|
4490
|
+
handleOpenSideBar(isVisible) {
|
|
4491
|
+
this.isSidebarVisible = isVisible;
|
|
4333
4492
|
}
|
|
4334
4493
|
/**
|
|
4335
4494
|
* Builds document categories from the API response
|
|
4336
4495
|
*/
|
|
4337
4496
|
buildDocumentCategories() {
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
return;
|
|
4343
|
-
}
|
|
4344
|
-
// Handle empty response - create a default category to show "No records found"
|
|
4345
|
-
if (this.documentListResponse.length === 0) {
|
|
4346
|
-
this.documentCategories = [{
|
|
4347
|
-
label: SHARED.EMPTY,
|
|
4348
|
-
categoryDescription: SHARED.NO_DOCUMENTS_FOUND,
|
|
4349
|
-
list: SHARED.EMPTY_ARRAY,
|
|
4350
|
-
totalDocs: 0,
|
|
4351
|
-
acceptedDocs: 0,
|
|
4352
|
-
completed: '0/0'
|
|
4353
|
-
}];
|
|
4354
|
-
this.categoryTables = [this.documentTableBuilder.buildDocumentTable([])];
|
|
4355
|
-
this.categoryCompletionCounts = ['0/0'];
|
|
4356
|
-
return;
|
|
4357
|
-
}
|
|
4358
|
-
this.documentCategories = [...this.documentListResponse];
|
|
4359
|
-
this.categoryTables = this.documentListResponse.map(category => this.documentTableBuilder.buildDocumentTable(category.list));
|
|
4360
|
-
this.categoryCompletionCounts = this.documentListResponse.map(category => this.getCompletionCount(category));
|
|
4497
|
+
const result = this.documentListService.buildDocumentCategories(this.documentListResponse);
|
|
4498
|
+
this.documentCategories = result.documentCategories;
|
|
4499
|
+
this.categoryTables = result.categoryTables;
|
|
4500
|
+
this.categoryCompletionCounts = result.categoryCompletionCounts;
|
|
4361
4501
|
}
|
|
4362
4502
|
/**
|
|
4363
4503
|
* Sets up subscription to document list response from store
|
|
4364
4504
|
*/
|
|
4365
4505
|
setupDocumentListSubscription() {
|
|
4366
|
-
this.documentListSubscription.add(this.
|
|
4506
|
+
this.documentListSubscription.add(this.documentListService.setupDocumentListSubscription().subscribe({
|
|
4367
4507
|
next: (response) => {
|
|
4368
4508
|
this.documentListResponse = response;
|
|
4369
4509
|
this.buildDocumentCategories();
|
|
4370
4510
|
},
|
|
4371
4511
|
error: (error) => {
|
|
4372
|
-
console.error(
|
|
4512
|
+
console.error(ERRORS.ERROR_FETCHING_DOCUMENTS, error);
|
|
4373
4513
|
}
|
|
4374
4514
|
}));
|
|
4375
4515
|
}
|
|
4516
|
+
/**
|
|
4517
|
+
* Handles table row click event
|
|
4518
|
+
*/
|
|
4376
4519
|
handleTableRowClick(rowData) {
|
|
4377
4520
|
this.isdialogVisible = SHARED.TRUE;
|
|
4378
|
-
this.selectedDocument = rowData;
|
|
4521
|
+
this.selectedDocument = this.documentListService.handleTableRowClick(rowData);
|
|
4379
4522
|
}
|
|
4380
4523
|
/**
|
|
4381
4524
|
* Handles the delete action from the table component
|
|
4382
4525
|
* @param {any} rowData - The row data containing the document to delete
|
|
4383
4526
|
*/
|
|
4384
4527
|
handleDeleteAction(rowData) {
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
}
|
|
4395
|
-
});
|
|
4396
|
-
}
|
|
4528
|
+
this.documentListService.handleDeleteAction(rowData, this.contextId)
|
|
4529
|
+
.subscribe({
|
|
4530
|
+
next: (response) => {
|
|
4531
|
+
this.documentListService.refreshAllDataWithCurrentFilters(this.contextId);
|
|
4532
|
+
},
|
|
4533
|
+
error: (error) => {
|
|
4534
|
+
console.error(ERRORS.ERROR_FETCHING_DOCUMENTS, error);
|
|
4535
|
+
}
|
|
4536
|
+
});
|
|
4397
4537
|
}
|
|
4398
4538
|
/**
|
|
4399
4539
|
* Refreshes the document list after a status update
|
|
4400
4540
|
*/
|
|
4401
4541
|
refreshDocumentList() {
|
|
4402
|
-
|
|
4403
|
-
this.documentHelperService.refreshDocumentsWithCurrentSelection(this.contextId);
|
|
4404
|
-
}
|
|
4542
|
+
this.documentListService.refreshDocumentList(this.contextId);
|
|
4405
4543
|
}
|
|
4406
4544
|
/**
|
|
4407
4545
|
* Cleanup subscriptions on component destroy
|
|
@@ -4409,26 +4547,18 @@ class DocumentListComponent {
|
|
|
4409
4547
|
ngOnDestroy() {
|
|
4410
4548
|
this.documentListSubscription.unsubscribe();
|
|
4411
4549
|
}
|
|
4412
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentListComponent, deps: [{ token:
|
|
4413
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentListComponent, isStandalone: false, selector: "lib-document-list", inputs: { contextId: "contextId", documentListResponse: "documentListResponse", isUploadButtonVisible: "isUploadButtonVisible", documentList: "documentList", status: "status", category: "category", searchKey: "searchKey" }, ngImport: i0, template: "<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" \r\n class=\"w-full h-full document-dailog-wrapper\" [draggable]=\"false\" [closable]=\"true\">\r\n <document-viewer \r\n [selectedDocument]=\"selectedDocument\" \r\n [documentList]=\"documentList\" \r\n [contextId]=\"contextId\" \r\n (documentStatusUpdated)=\"refreshDocumentList()\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"w-full flex align-items-center justify-content-between\">\r\n <input type=\"text\" class=\"w-full border-none bg-white h-3rem file-input-wrapper\" pInputText\r\n [(ngModel)]=\"fileName\" />\r\n <button pButton pRipple class=\"mx-3 w-6rem save-btn-wrapper\" label=\"Save\" (click)=\"handleSaveClick()\">\r\n </button>\r\n </div>\r\n </ng-template>\r\n <ng-content></ng-content>\r\n </document-viewer>\r\n </p-dialog>\r\n</div>\r\n\r\n<div class=\"document-categories-container\">\r\n <div class=\"category\" *ngFor=\"let category of documentCategories; let i = index\">\r\n <div class=\"category-header\">\r\n <div class=\"category-title\">\r\n <h3>{{ category.label }} Documents</h3>\r\n <p class=\"category-description\">{{ category.categoryDescription }}</p>\r\n </div>\r\n <div class=\"completion-status\">\r\n <span class=\"status-badge\">{{ categoryCompletionCounts[i] }} Complete</span>\r\n </div>\r\n </div>\r\n\r\n <div class=\"table-container\">\r\n <lib-table-primary \r\n [tableData]=\"categoryTables[i]\" \r\n [tableStyle]=\"{ 'min-width': '100%' }\"\r\n (rowClick)=\"handleTableRowClick($event)\"\r\n (deleteAction)=\"handleDeleteAction($event)\">\r\n </lib-table-primary>\r\n </div>\r\n </div>\r\n</div>\r\n<div class=\"grid m-0\">\r\n <div class=\"col-12 p-0\">\r\n <p-sidebar [(visible)]=\"isSidebarVisible\" position=\"right\" [styleClass]=\"'right-sidebar'\" class=\"relative\">\r\n <ng-template pTemplate=\"header\">\r\n <p-messages [(value)]=\"messages\" [enableService]=\"false\" />\r\n </ng-template>\r\n <ng-template pTemplate=\"content\">\r\n <div class=\"side-bar-con\">\r\n <lib-document-upload [contextId]=\"contextId\"></lib-document-upload>\r\n <div class=\"p-fluid\">\r\n <div class=\"field\">\r\n <label for=\"city\">Select Folder</label>\r\n <p-dropdown id=\"city\" optionLabel=\"label\" optionValue=\"value\" [options]=\"options\"\r\n placeholder=\"Select a Folder\" [(ngModel)]=\"selectedOption\"></p-dropdown>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"footer\" class=\"bg-gray-100 p-0\">\r\n <div class=\"bg-gray-100 p-4\">\r\n <p-button label=\"Save\" class=\"p-button-rounded p-button-success save-btn\" (click)=\"handleUploadDocument()\"\r\n [disabled]=\"!selectedOption\">\r\n </p-button>\r\n </div>\r\n </ng-template>\r\n </p-sidebar>\r\n </div>\r\n</div>", styles: [".document-list-wrapper .p-accordion-header-link{padding:.5rem}.document-list-wrapper .p-sidebar-right,.right-sidebar{width:35%}.document-title-wrapper{font-size:20px;font-weight:700;color:var(--text-color)}.document-input-field{display:flex;flex-direction:column}.document-input-field input{width:100%;height:46px;padding:10px 15px;gap:10px;border-radius:10px;outline:none;border:1px solid rgba(76,98,146,.1019607843);font-size:15px}label{color:#0f1729;font-weight:600}.document-list-dropDown .p-element{padding:10px 0 10px 15px}.document-list-dropDown .p-dropdown{border-radius:10px!important}.side-bar-con{display:flex;flex-direction:column}.save-btn-con{width:100%;border-top:1px solid rgba(76,98,146,.2);background:#4c629214;padding:13px 40px}.save-btn-wrapper{padding:10px 4px}.save-btn .p-button{height:45px!important;width:140px;border-radius:10px}.p-sidebar-footer{padding:0}.file-input-wrapper.p-inputtext:enabled:focus{box-shadow:0 0 0 .2rem #a6d5fa!important}.document-categories-container{padding:1rem;background-color:#f8f9fa;min-height:100vh}.document-categories-container .category{background:#fff;border-radius:8px;margin-bottom:2rem;box-shadow:0 2px 4px #0000001a;overflow:hidden}.document-categories-container .category .category-header{display:flex;justify-content:space-between;align-items:flex-start;padding:1.5rem 1.5rem 1rem;border-bottom:1px solid #e9ecef}.document-categories-container .category .category-header .category-title h3{margin:0 0 .5rem;font-size:1.25rem;font-weight:600;color:#2c3e50}.document-categories-container .category .category-header .category-title .category-description{margin:0;color:#6c757d;font-size:.875rem;line-height:1.4}.document-categories-container .category .category-header .completion-status .status-badge{background-color:#fbbf24;color:#92400e;padding:.375rem .75rem;border-radius:6px;font-size:.75rem;font-weight:500;display:inline-block}.document-categories-container .category .table-container{padding:0}.document-sections-container{padding:1rem;background-color:#f8f9fa;min-height:100vh}.document-sections-container .section{background:#fff;border-radius:8px;margin-bottom:2rem;box-shadow:0 2px 4px #0000001a;overflow:hidden}.document-sections-container .section .section-header{display:flex;justify-content:space-between;align-items:flex-start;padding:1.5rem 1.5rem 1rem;border-bottom:1px solid #e9ecef}.document-sections-container .section .section-header .section-title h3{margin:0 0 .5rem;font-size:1.25rem;font-weight:600;color:#2c3e50}.document-sections-container .section .section-header .section-title .section-description{margin:0;color:#6c757d;font-size:.875rem;line-height:1.4}.document-sections-container .section .section-header .completion-status .status-badge{background-color:#fbbf24;color:#92400e;padding:.375rem .75rem;border-radius:6px;font-size:.75rem;font-weight:500;display:inline-block}.document-sections-container .section .table-container{padding:0}@media (max-width: 768px){.document-categories-container,.document-sections-container{padding:.5rem}.document-categories-container .category .category-header,.document-categories-container .category .section-header,.document-categories-container .section .category-header,.document-categories-container .section .section-header,.document-sections-container .category .category-header,.document-sections-container .category .section-header,.document-sections-container .section .category-header,.document-sections-container .section .section-header{flex-direction:column;gap:1rem;align-items:flex-start}.document-categories-container .category .category-header .completion-status,.document-categories-container .category .section-header .completion-status,.document-categories-container .section .category-header .completion-status,.document-categories-container .section .section-header .completion-status,.document-sections-container .category .category-header .completion-status,.document-sections-container .category .section-header .completion-status,.document-sections-container .section .category-header .completion-status,.document-sections-container .section .section-header .completion-status{align-self:flex-end}}\n"], dependencies: [{ kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i4.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: i4.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "style", "styleClass", "badgeClass", "ariaLabel", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i10.Sidebar, selector: "p-sidebar", inputs: ["appendTo", "blockScroll", "style", "styleClass", "ariaCloseLabel", "autoZIndex", "baseZIndex", "modal", "dismissible", "showCloseIcon", "closeOnEscape", "transitionOptions", "visible", "position", "fullScreen"], outputs: ["onShow", "onHide", "visibleChange"] }, { kind: "component", type: i6.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange", "onClose"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i7$1.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "component", type: i14.Dropdown, selector: "p-dropdown", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "autoShowPanelOnPrintableCharacterKeyDown", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "directive", type: i15.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "component", type: TablePrimaryComponent, selector: "lib-table-primary", inputs: ["tableData", "showHeader", "tableStyle"], outputs: ["rowClick", "deleteAction"] }, { kind: "component", type: DocumentUploadComponent, selector: "lib-document-upload", inputs: ["contextId"] }, { kind: "component", type: DocumentViewerComponent, selector: "document-viewer", inputs: ["selectedDocument", "documentList", "contextId"], outputs: ["documentStatusUpdated"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
4550
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentListComponent, deps: [{ token: DocumentListService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4551
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentListComponent, isStandalone: false, selector: "lib-document-list", inputs: { contextId: "contextId", documentListResponse: "documentListResponse", documentList: "documentList" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" \r\n class=\"w-full h-full document-dailog-wrapper\" [draggable]=\"false\" [closable]=\"true\">\r\n <document-viewer \r\n [selectedDocument]=\"selectedDocument\" \r\n [documentList]=\"documentList\" \r\n [contextId]=\"contextId\" \r\n (documentStatusUpdated)=\"refreshDocumentList()\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"w-full flex align-items-center justify-content-between\">\r\n <input type=\"text\" class=\"w-full border-none bg-white h-3rem file-input-wrapper\" pInputText\r\n [(ngModel)]=\"fileName\" />\r\n <button pButton pRipple class=\"mx-3 w-6rem save-btn-wrapper\" label=\"Save\" (click)=\"handleSaveClick()\">\r\n </button>\r\n </div>\r\n </ng-template>\r\n <ng-content></ng-content>\r\n </document-viewer>\r\n </p-dialog>\r\n</div>\r\n\r\n<div class=\"document-categories-container\">\r\n <div class=\"category\" *ngFor=\"let category of documentCategories; let i = index\">\r\n <div class=\"category-header\">\r\n <div class=\"category-title\">\r\n <h3>{{ category.label }} Documents</h3>\r\n <p class=\"category-description\">{{ category.categoryDescription }}</p>\r\n </div>\r\n <div class=\"completion-status\">\r\n <span class=\"status-badge\">{{ categoryCompletionCounts[i] }} Complete</span>\r\n </div>\r\n </div>\r\n\r\n <div class=\"table-container\">\r\n <lib-table-primary \r\n [tableData]=\"categoryTables[i]\" \r\n [tableStyle]=\"{ 'min-width': '100%' }\"\r\n (rowClick)=\"handleTableRowClick($event)\"\r\n (deleteAction)=\"handleDeleteAction($event)\">\r\n </lib-table-primary>\r\n </div>\r\n </div>\r\n</div>\r\n<div class=\"grid m-0\">\r\n <div class=\"col-12 p-0\">\r\n <p-sidebar [(visible)]=\"isSidebarVisible\" position=\"right\" [styleClass]=\"'right-sidebar'\" class=\"relative\">\r\n <ng-template pTemplate=\"header\">\r\n <p-messages [(value)]=\"messages\" [enableService]=\"false\" />\r\n </ng-template>\r\n <ng-template pTemplate=\"content\">\r\n <div class=\"side-bar-con\">\r\n <lib-document-upload [contextId]=\"contextId\"></lib-document-upload>\r\n <div class=\"p-fluid\">\r\n <div class=\"field\">\r\n <label for=\"city\">Select Folder</label>\r\n <p-dropdown id=\"city\" optionLabel=\"label\" optionValue=\"value\" [options]=\"options\"\r\n placeholder=\"Select a Folder\" [(ngModel)]=\"selectedOption\"></p-dropdown>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"footer\" class=\"bg-gray-100 p-0\">\r\n <div class=\"bg-gray-100 p-4\">\r\n <p-button label=\"Save\" class=\"p-button-rounded p-button-success save-btn\" (click)=\"handleUploadDocument()\"\r\n [disabled]=\"!selectedOption\">\r\n </p-button>\r\n </div>\r\n </ng-template>\r\n </p-sidebar>\r\n </div>\r\n</div>", styles: [".document-list-wrapper .p-accordion-header-link{padding:.5rem}.document-list-wrapper .p-sidebar-right,.right-sidebar{width:35%}.document-title-wrapper{font-size:20px;font-weight:700;color:var(--text-color)}.document-input-field{display:flex;flex-direction:column}.document-input-field input{width:100%;height:46px;padding:10px 15px;gap:10px;border-radius:10px;outline:none;border:1px solid rgba(76,98,146,.1019607843);font-size:15px}label{color:#0f1729;font-weight:600}.document-list-dropDown .p-element{padding:10px 0 10px 15px}.document-list-dropDown .p-dropdown{border-radius:10px!important}.side-bar-con{display:flex;flex-direction:column}.save-btn-con{width:100%;border-top:1px solid rgba(76,98,146,.2);background:#4c629214;padding:13px 40px}.save-btn-wrapper{padding:10px 4px}.save-btn .p-button{height:45px!important;width:140px;border-radius:10px}.p-sidebar-footer{padding:0}.file-input-wrapper.p-inputtext:enabled:focus{box-shadow:0 0 0 .2rem #a6d5fa!important}.document-categories-container{padding:1rem;background-color:#f8f9fa;min-height:100vh}.document-categories-container .category{background:#fff;border-radius:8px;margin-bottom:2rem;box-shadow:0 2px 4px #0000001a;overflow:hidden}.document-categories-container .category .category-header{display:flex;justify-content:space-between;align-items:flex-start;padding:1.5rem 1.5rem 1rem;border-bottom:1px solid #e9ecef}.document-categories-container .category .category-header .category-title h3{margin:0 0 .5rem;font-size:1.25rem;font-weight:600;color:#2c3e50}.document-categories-container .category .category-header .category-title .category-description{margin:0;color:#6c757d;font-size:.875rem;line-height:1.4}.document-categories-container .category .category-header .completion-status .status-badge{background-color:#fbbf24;color:#92400e;padding:.375rem .75rem;border-radius:6px;font-size:.75rem;font-weight:500;display:inline-block}.document-categories-container .category .table-container{padding:0}.document-sections-container{padding:1rem;background-color:#f8f9fa;min-height:100vh}.document-sections-container .section{background:#fff;border-radius:8px;margin-bottom:2rem;box-shadow:0 2px 4px #0000001a;overflow:hidden}.document-sections-container .section .section-header{display:flex;justify-content:space-between;align-items:flex-start;padding:1.5rem 1.5rem 1rem;border-bottom:1px solid #e9ecef}.document-sections-container .section .section-header .section-title h3{margin:0 0 .5rem;font-size:1.25rem;font-weight:600;color:#2c3e50}.document-sections-container .section .section-header .section-title .section-description{margin:0;color:#6c757d;font-size:.875rem;line-height:1.4}.document-sections-container .section .section-header .completion-status .status-badge{background-color:#fbbf24;color:#92400e;padding:.375rem .75rem;border-radius:6px;font-size:.75rem;font-weight:500;display:inline-block}.document-sections-container .section .table-container{padding:0}@media (max-width: 768px){.document-categories-container,.document-sections-container{padding:.5rem}.document-categories-container .category .category-header,.document-categories-container .category .section-header,.document-categories-container .section .category-header,.document-categories-container .section .section-header,.document-sections-container .category .category-header,.document-sections-container .category .section-header,.document-sections-container .section .category-header,.document-sections-container .section .section-header{flex-direction:column;gap:1rem;align-items:flex-start}.document-categories-container .category .category-header .completion-status,.document-categories-container .category .section-header .completion-status,.document-categories-container .section .category-header .completion-status,.document-categories-container .section .section-header .completion-status,.document-sections-container .category .category-header .completion-status,.document-sections-container .category .section-header .completion-status,.document-sections-container .section .category-header .completion-status,.document-sections-container .section .section-header .completion-status{align-self:flex-end}}\n"], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i4.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: i4.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "style", "styleClass", "badgeClass", "ariaLabel", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i5$2.Sidebar, selector: "p-sidebar", inputs: ["appendTo", "blockScroll", "style", "styleClass", "ariaCloseLabel", "autoZIndex", "baseZIndex", "modal", "dismissible", "showCloseIcon", "closeOnEscape", "transitionOptions", "visible", "position", "fullScreen"], outputs: ["onShow", "onHide", "visibleChange"] }, { kind: "component", type: i6.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange", "onClose"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i7$1.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "component", type: i9.Dropdown, selector: "p-dropdown", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "autoShowPanelOnPrintableCharacterKeyDown", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "directive", type: i10.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "component", type: TablePrimaryComponent, selector: "lib-table-primary", inputs: ["tableData", "showHeader", "tableStyle"], outputs: ["rowClick", "deleteAction"] }, { kind: "component", type: DocumentUploadComponent, selector: "lib-document-upload", inputs: ["contextId"] }, { kind: "component", type: DocumentViewerComponent, selector: "document-viewer", inputs: ["selectedDocument", "documentList", "contextId"], outputs: ["documentStatusUpdated"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
4414
4552
|
}
|
|
4415
4553
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentListComponent, decorators: [{
|
|
4416
4554
|
type: Component,
|
|
4417
4555
|
args: [{ selector: 'lib-document-list', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" \r\n class=\"w-full h-full document-dailog-wrapper\" [draggable]=\"false\" [closable]=\"true\">\r\n <document-viewer \r\n [selectedDocument]=\"selectedDocument\" \r\n [documentList]=\"documentList\" \r\n [contextId]=\"contextId\" \r\n (documentStatusUpdated)=\"refreshDocumentList()\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"w-full flex align-items-center justify-content-between\">\r\n <input type=\"text\" class=\"w-full border-none bg-white h-3rem file-input-wrapper\" pInputText\r\n [(ngModel)]=\"fileName\" />\r\n <button pButton pRipple class=\"mx-3 w-6rem save-btn-wrapper\" label=\"Save\" (click)=\"handleSaveClick()\">\r\n </button>\r\n </div>\r\n </ng-template>\r\n <ng-content></ng-content>\r\n </document-viewer>\r\n </p-dialog>\r\n</div>\r\n\r\n<div class=\"document-categories-container\">\r\n <div class=\"category\" *ngFor=\"let category of documentCategories; let i = index\">\r\n <div class=\"category-header\">\r\n <div class=\"category-title\">\r\n <h3>{{ category.label }} Documents</h3>\r\n <p class=\"category-description\">{{ category.categoryDescription }}</p>\r\n </div>\r\n <div class=\"completion-status\">\r\n <span class=\"status-badge\">{{ categoryCompletionCounts[i] }} Complete</span>\r\n </div>\r\n </div>\r\n\r\n <div class=\"table-container\">\r\n <lib-table-primary \r\n [tableData]=\"categoryTables[i]\" \r\n [tableStyle]=\"{ 'min-width': '100%' }\"\r\n (rowClick)=\"handleTableRowClick($event)\"\r\n (deleteAction)=\"handleDeleteAction($event)\">\r\n </lib-table-primary>\r\n </div>\r\n </div>\r\n</div>\r\n<div class=\"grid m-0\">\r\n <div class=\"col-12 p-0\">\r\n <p-sidebar [(visible)]=\"isSidebarVisible\" position=\"right\" [styleClass]=\"'right-sidebar'\" class=\"relative\">\r\n <ng-template pTemplate=\"header\">\r\n <p-messages [(value)]=\"messages\" [enableService]=\"false\" />\r\n </ng-template>\r\n <ng-template pTemplate=\"content\">\r\n <div class=\"side-bar-con\">\r\n <lib-document-upload [contextId]=\"contextId\"></lib-document-upload>\r\n <div class=\"p-fluid\">\r\n <div class=\"field\">\r\n <label for=\"city\">Select Folder</label>\r\n <p-dropdown id=\"city\" optionLabel=\"label\" optionValue=\"value\" [options]=\"options\"\r\n placeholder=\"Select a Folder\" [(ngModel)]=\"selectedOption\"></p-dropdown>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"footer\" class=\"bg-gray-100 p-0\">\r\n <div class=\"bg-gray-100 p-4\">\r\n <p-button label=\"Save\" class=\"p-button-rounded p-button-success save-btn\" (click)=\"handleUploadDocument()\"\r\n [disabled]=\"!selectedOption\">\r\n </p-button>\r\n </div>\r\n </ng-template>\r\n </p-sidebar>\r\n </div>\r\n</div>", styles: [".document-list-wrapper .p-accordion-header-link{padding:.5rem}.document-list-wrapper .p-sidebar-right,.right-sidebar{width:35%}.document-title-wrapper{font-size:20px;font-weight:700;color:var(--text-color)}.document-input-field{display:flex;flex-direction:column}.document-input-field input{width:100%;height:46px;padding:10px 15px;gap:10px;border-radius:10px;outline:none;border:1px solid rgba(76,98,146,.1019607843);font-size:15px}label{color:#0f1729;font-weight:600}.document-list-dropDown .p-element{padding:10px 0 10px 15px}.document-list-dropDown .p-dropdown{border-radius:10px!important}.side-bar-con{display:flex;flex-direction:column}.save-btn-con{width:100%;border-top:1px solid rgba(76,98,146,.2);background:#4c629214;padding:13px 40px}.save-btn-wrapper{padding:10px 4px}.save-btn .p-button{height:45px!important;width:140px;border-radius:10px}.p-sidebar-footer{padding:0}.file-input-wrapper.p-inputtext:enabled:focus{box-shadow:0 0 0 .2rem #a6d5fa!important}.document-categories-container{padding:1rem;background-color:#f8f9fa;min-height:100vh}.document-categories-container .category{background:#fff;border-radius:8px;margin-bottom:2rem;box-shadow:0 2px 4px #0000001a;overflow:hidden}.document-categories-container .category .category-header{display:flex;justify-content:space-between;align-items:flex-start;padding:1.5rem 1.5rem 1rem;border-bottom:1px solid #e9ecef}.document-categories-container .category .category-header .category-title h3{margin:0 0 .5rem;font-size:1.25rem;font-weight:600;color:#2c3e50}.document-categories-container .category .category-header .category-title .category-description{margin:0;color:#6c757d;font-size:.875rem;line-height:1.4}.document-categories-container .category .category-header .completion-status .status-badge{background-color:#fbbf24;color:#92400e;padding:.375rem .75rem;border-radius:6px;font-size:.75rem;font-weight:500;display:inline-block}.document-categories-container .category .table-container{padding:0}.document-sections-container{padding:1rem;background-color:#f8f9fa;min-height:100vh}.document-sections-container .section{background:#fff;border-radius:8px;margin-bottom:2rem;box-shadow:0 2px 4px #0000001a;overflow:hidden}.document-sections-container .section .section-header{display:flex;justify-content:space-between;align-items:flex-start;padding:1.5rem 1.5rem 1rem;border-bottom:1px solid #e9ecef}.document-sections-container .section .section-header .section-title h3{margin:0 0 .5rem;font-size:1.25rem;font-weight:600;color:#2c3e50}.document-sections-container .section .section-header .section-title .section-description{margin:0;color:#6c757d;font-size:.875rem;line-height:1.4}.document-sections-container .section .section-header .completion-status .status-badge{background-color:#fbbf24;color:#92400e;padding:.375rem .75rem;border-radius:6px;font-size:.75rem;font-weight:500;display:inline-block}.document-sections-container .section .table-container{padding:0}@media (max-width: 768px){.document-categories-container,.document-sections-container{padding:.5rem}.document-categories-container .category .category-header,.document-categories-container .category .section-header,.document-categories-container .section .category-header,.document-categories-container .section .section-header,.document-sections-container .category .category-header,.document-sections-container .category .section-header,.document-sections-container .section .category-header,.document-sections-container .section .section-header{flex-direction:column;gap:1rem;align-items:flex-start}.document-categories-container .category .category-header .completion-status,.document-categories-container .category .section-header .completion-status,.document-categories-container .section .category-header .completion-status,.document-categories-container .section .section-header .completion-status,.document-sections-container .category .category-header .completion-status,.document-sections-container .category .section-header .completion-status,.document-sections-container .section .category-header .completion-status,.document-sections-container .section .section-header .completion-status{align-self:flex-end}}\n"] }]
|
|
4418
|
-
}], ctorParameters: () => [{ type:
|
|
4556
|
+
}], ctorParameters: () => [{ type: DocumentListService }], propDecorators: { contextId: [{
|
|
4419
4557
|
type: Input
|
|
4420
4558
|
}], documentListResponse: [{
|
|
4421
4559
|
type: Input
|
|
4422
|
-
}], isUploadButtonVisible: [{
|
|
4423
|
-
type: Input
|
|
4424
4560
|
}], documentList: [{
|
|
4425
4561
|
type: Input
|
|
4426
|
-
}], status: [{
|
|
4427
|
-
type: Input
|
|
4428
|
-
}], category: [{
|
|
4429
|
-
type: Input
|
|
4430
|
-
}], searchKey: [{
|
|
4431
|
-
type: Input
|
|
4432
4562
|
}] } });
|
|
4433
4563
|
|
|
4434
4564
|
class DocumentMenuService {
|
|
@@ -4578,6 +4708,8 @@ class DocumentsMenuComponent {
|
|
|
4578
4708
|
contextId = SHARED.EMPTY;
|
|
4579
4709
|
selectedMenuItem = null;
|
|
4580
4710
|
selectedMenuItemId = null;
|
|
4711
|
+
// Store the categories from the store
|
|
4712
|
+
storeCategories = SHARED.EMPTY_ARRAY;
|
|
4581
4713
|
constructor(documentStore, documentQuery, documentMenuService, documentHelperService) {
|
|
4582
4714
|
this.documentStore = documentStore;
|
|
4583
4715
|
this.documentQuery = documentQuery;
|
|
@@ -4589,11 +4721,29 @@ class DocumentsMenuComponent {
|
|
|
4589
4721
|
this.selectedMenuItemId = menuItemId;
|
|
4590
4722
|
this.selectedMenuItem = this.findMenuItemLabelById(menuItemId);
|
|
4591
4723
|
});
|
|
4724
|
+
// Subscribe to document categories from the store
|
|
4725
|
+
this.documentQuery.selectDocumentCategories().subscribe(categories => {
|
|
4726
|
+
if (categories && categories.length > 0) {
|
|
4727
|
+
this.storeCategories = categories;
|
|
4728
|
+
this.updateMenuItemsData();
|
|
4729
|
+
}
|
|
4730
|
+
});
|
|
4592
4731
|
}
|
|
4593
4732
|
ngOnChanges(changes) {
|
|
4594
4733
|
if (changes['catagories'] && this.catagories) {
|
|
4595
4734
|
this.updateMenuItemsData();
|
|
4596
4735
|
}
|
|
4736
|
+
if (changes['contextId'] && !changes['contextId'].firstChange) {
|
|
4737
|
+
this.handleContextIdChange();
|
|
4738
|
+
}
|
|
4739
|
+
}
|
|
4740
|
+
/**
|
|
4741
|
+
* Gets the categories to use for the menu
|
|
4742
|
+
* Priority: Store categories > Input categories
|
|
4743
|
+
*/
|
|
4744
|
+
get categories() {
|
|
4745
|
+
const result = this.storeCategories.length > 0 ? this.storeCategories : this.catagories;
|
|
4746
|
+
return result;
|
|
4597
4747
|
}
|
|
4598
4748
|
/**
|
|
4599
4749
|
* Finds the label of a menu item by its _id
|
|
@@ -4603,7 +4753,7 @@ class DocumentsMenuComponent {
|
|
|
4603
4753
|
findMenuItemLabelById(id) {
|
|
4604
4754
|
if (!id)
|
|
4605
4755
|
return null;
|
|
4606
|
-
for (const category of this.
|
|
4756
|
+
for (const category of this.categories) {
|
|
4607
4757
|
if (category.items) {
|
|
4608
4758
|
const item = category.items.find(item => item._id === id);
|
|
4609
4759
|
if (item) {
|
|
@@ -4617,16 +4767,17 @@ class DocumentsMenuComponent {
|
|
|
4617
4767
|
* Update menu use catagories
|
|
4618
4768
|
*/
|
|
4619
4769
|
updateMenuItemsData() {
|
|
4620
|
-
this.
|
|
4770
|
+
this.categories.forEach(category => {
|
|
4621
4771
|
if (category.items) {
|
|
4622
4772
|
category.items.forEach(item => {
|
|
4623
|
-
|
|
4773
|
+
const menuData = {
|
|
4624
4774
|
totalDocuments: this.documentMenuService.getTotalDocuments(item),
|
|
4625
4775
|
completedDocuments: this.documentMenuService.getCompletedDocuments(item),
|
|
4626
4776
|
badgeValue: this.documentMenuService.getBadgeValue(item),
|
|
4627
4777
|
badgeSeverity: this.documentMenuService.getBadgeSeverity(item),
|
|
4628
4778
|
shouldShowBadge: this.documentMenuService.shouldShowBadge(item)
|
|
4629
4779
|
};
|
|
4780
|
+
item.menuData = menuData;
|
|
4630
4781
|
});
|
|
4631
4782
|
}
|
|
4632
4783
|
});
|
|
@@ -4647,7 +4798,7 @@ class DocumentsMenuComponent {
|
|
|
4647
4798
|
this.selectedMenuItem = item.label;
|
|
4648
4799
|
this.selectedMenuItemId = item._id;
|
|
4649
4800
|
this.documentStore.setSelectedMenuItem(item._id);
|
|
4650
|
-
this.documentMenuService.handleUserListVisibility(item._id, this.
|
|
4801
|
+
this.documentMenuService.handleUserListVisibility(item._id, this.categories);
|
|
4651
4802
|
}
|
|
4652
4803
|
}
|
|
4653
4804
|
onSelectMenuItem(menuItemId) {
|
|
@@ -4656,7 +4807,7 @@ class DocumentsMenuComponent {
|
|
|
4656
4807
|
this.selectedMenuItem = label;
|
|
4657
4808
|
this.selectedMenuItemId = menuItemId;
|
|
4658
4809
|
this.documentStore.setSelectedMenuItem(menuItemId);
|
|
4659
|
-
this.documentMenuService.handleUserListVisibility(menuItemId, this.
|
|
4810
|
+
this.documentMenuService.handleUserListVisibility(menuItemId, this.categories);
|
|
4660
4811
|
}
|
|
4661
4812
|
}
|
|
4662
4813
|
onUnselectMenuItem() {
|
|
@@ -4668,15 +4819,26 @@ class DocumentsMenuComponent {
|
|
|
4668
4819
|
getSelectedMenuItem() {
|
|
4669
4820
|
return this.selectedMenuItem;
|
|
4670
4821
|
}
|
|
4822
|
+
/**
|
|
4823
|
+
* Handles contextId changes by clearing current selection and refreshing data
|
|
4824
|
+
*/
|
|
4825
|
+
handleContextIdChange() {
|
|
4826
|
+
if (this.contextId && this.contextId !== SHARED.EMPTY) {
|
|
4827
|
+
this.selectedMenuItem = null;
|
|
4828
|
+
this.selectedMenuItemId = null;
|
|
4829
|
+
this.documentStore.setSelectedMenuItem(null);
|
|
4830
|
+
this.documentHelperService.refreshDocumentsWithoutFilters(this.contextId);
|
|
4831
|
+
}
|
|
4832
|
+
}
|
|
4671
4833
|
getSelectedMenuItemId() {
|
|
4672
4834
|
return this.selectedMenuItemId;
|
|
4673
4835
|
}
|
|
4674
4836
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentsMenuComponent, deps: [{ token: DocumentStore }, { token: DocumentQuery }, { token: DocumentMenuService }, { token: DocumentHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4675
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: DocumentsMenuComponent, isStandalone: false, selector: "lib-documents-menu", inputs: { catagories: "catagories", applicationNumber: "applicationNumber", contextId: "contextId" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"document-sidebar-container h-full\">\
|
|
4837
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: DocumentsMenuComponent, isStandalone: false, selector: "lib-documents-menu", inputs: { catagories: "catagories", applicationNumber: "applicationNumber", contextId: "contextId" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"document-sidebar-container h-full\">\n <p-card class=\"widget-menu-wrapper h-full\">\n @if(applicationNumber){\n <div class=\"flex align-items-center justify-content-between widget-menu-header-wrapper\">\n <p class=\"mb-0 application-title-wrapper\">ID - {{applicationNumber}}</p>\n <div class=\"expand-icon-wrapper\">\n <i class=\"ri-arrow-left-s-line text-primary flex align-items-center justify-content-center w-full h-full\"></i>\n </div>\n </div>\n }\n\n <div class=\"widget-menu-container\" >\n <div class=\"widget-menu-wrapper h-ful l custom-scroll\">\n <p-menu [model]=\"categories\" styleClass=\"w-full md:w-15rem\">\n <ng-template pTemplate=\"submenuheader\" let-item>\n <span [style]=\"{\n color : '#9EA0B3'\n }\">{{ item.label }}</span>\n </ng-template>\n <ng-template pTemplate=\"item\" let-item>\n <a pRipple \n class=\"flex align-items-center p-menuitem-link\"\n [class.selected-menu-item]=\"selectedMenuItemId === item._id\"\n (click)=\"onMenuItemClick($event, item)\">\n <span [class]=\"item.icon\" class=\"text-xl\"></span>\n <span class=\"ml-2\">{{ item.label }}</span>\n <p-badge *ngIf=\"item.menuData?.shouldShowBadge\" \n class=\"ml-auto\" \n [severity]=\"item.menuData?.badgeSeverity\" \n [value]=\"item.menuData?.badgeValue\" />\n </a>\n </ng-template>\n </p-menu>\n </div>\n </div>\n </p-card>\n</div>\n\n ", styles: [".expand-icon-wrapper{border:1px solid var(--primary-color);height:24px;width:24px;border-radius:50%;background:var(--blue-bg-light)}::ng-deep .p-badge.p-badge-success{background-color:#dcfce7;color:#16a34a;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-badge.p-badge-danger{background-color:#fee2e2;color:#dc2626;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-badge.p-badge-warning{background-color:#fef3c7;color:#d97706;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-menu .p-menuitem>.p-menuitem-content .p-menuitem-link{color:#1f2937}@media screen and (min-width: 768px){::ng-deep .md\\:w-15rem{width:100%!important}}::ng-deep .p-menu .p-menuitem:not(p-highlight):not(p-disabled)>.p-menuitem-content:hover{color:#06f!important;background:#0066ff1a!important;background-color:#0066ff1a!important}::ng-deep .p-menu{border:none}::ng-deep .custom-scroll{scrollbar-gutter:inherit}::ng-deep .selected-menu-item{background-color:#0066ff1a!important;color:var(--primary-color)!important;border:1px solid rgba(68,72,109,.1)!important;border-radius:10px!important}::ng-deep .selected-menu-item .text-xl{color:var(--primary-color)!important}::ng-deep .p-panelmenu .p-panelmenu-content{border:none!important}.application-title-wrapper{color:#9ea0b3;font-weight:500}.widget-menu-wrapper{margin-top:8px}.widget-menu-header-wrapper{padding:4px 4px 4px 16px}.widget-menu-container{height:calc(100% - 38px)}.custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}::ng-deep .document-sidebar-container .p-card{height:100%;box-shadow:none}::ng-deep .document-sidebar-container .p-card .p-card-content{height:100%;padding:0!important}::ng-deep .document-sidebar-container .p-card .p-card-body{height:100%;width:100%;padding:12px 8px;border-radius:10px;border:1px solid #e5e7eb}::ng-deep .document-sidebar-container .widget-menu-wrapper .p-panelmenu-panel .p-panelmenu-expanded .p-panelmenu-content{border:none!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content{border:none;color:var(--text-color);font-weight:400!important;background-color:var(--surface-0)!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-panelmenu-header-action{color:var(--text-color);font-weight:400!important;position:relative;padding:12px}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-panelmenu-header-action .p-icon-wrapper{position:absolute;right:0;top:16px;margin-right:7px;transform:rotate(90deg)!important;transition:none!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-panelmenu-header-action .p-menuitem-text{max-width:75%;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-menuitem-link-active{border:1px solid rgba(68,72,109,.1);border-radius:10px;padding:12px;color:var(--primary-color);background-color:#0066ff1a!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-menuitem-link-active .p-menuitem-icon{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-menuitem-link-active .p-menuitem-text{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .company-action-wrapper:not(.p-disabled).p-highlight .p-panelmenu-header-content{margin:12px 0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .no-highlight.p-panelmenu-header:not(.p-disabled).p-highlight .p-panelmenu-header-content{background-color:transparent!important;border-radius:10px;padding:12px;border-bottom:0!important;border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .no-highlight.p-panelmenu-header:not(.p-disabled).p-highlight .p-panelmenu-header-content .p-panelmenu-header-action{padding:0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .no-highlight.p-panelmenu-header:not(.p-disabled).p-highlight .p-panelmenu-header-content .p-panelmenu-header-action .p-icon-wrapper{transform:rotate(180deg)!important;transition:none!important;top:0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link{background-color:var(--surface-0)!important;color:var(--text-color);padding:12px 6px!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link .p-menuitem-text{max-width:75%;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link-active{border:1px solid rgba(68,72,109,.1);border-radius:10px;padding:12px;color:var(--primary-color);box-shadow:none!important;background-color:#0066ff1a!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link-active .p-menuitem-icon{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link-active .p-menuitem-text{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem.p-focus>.p-menuitem-content{background-color:#44486d1a!important}::ng-deep .widget-menu-wrapper .p-panelmenu-panel .p-panelmenu-expanded .p-panelmenu-content{border:1px solid rgba(68,72,109,.1)!important;border-top:0!important;border-bottom-left-radius:10px;border-bottom-right-radius:10px}::ng-deep .widget-menu-wrapper .p-panelmenu-panel .widget-separator{border-top:1px solid rgba(68,72,109,.1)!important}::ng-deep .widget-menu-wrapper .p-panelmenu-panel .widget-separator .p-panelmenu-header-content .p-panelmenu-header-action{padding:0!important}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i7$3.Badge, selector: "p-badge", inputs: ["styleClass", "style", "badgeSize", "severity", "value", "badgeDisabled", "size"] }, { kind: "component", type: i8$1.Menu, selector: "p-menu", inputs: ["model", "popup", "style", "styleClass", "appendTo", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaLabel", "ariaLabelledBy", "id", "tabindex"], outputs: ["onShow", "onHide", "onBlur", "onFocus"] }, { kind: "component", type: i9$1.Card, selector: "p-card", inputs: ["header", "subheader", "style", "styleClass"] }] });
|
|
4676
4838
|
}
|
|
4677
4839
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentsMenuComponent, decorators: [{
|
|
4678
4840
|
type: Component,
|
|
4679
|
-
args: [{ selector: 'lib-documents-menu', standalone: false, template: "<div class=\"document-sidebar-container h-full\">\
|
|
4841
|
+
args: [{ selector: 'lib-documents-menu', standalone: false, template: "<div class=\"document-sidebar-container h-full\">\n <p-card class=\"widget-menu-wrapper h-full\">\n @if(applicationNumber){\n <div class=\"flex align-items-center justify-content-between widget-menu-header-wrapper\">\n <p class=\"mb-0 application-title-wrapper\">ID - {{applicationNumber}}</p>\n <div class=\"expand-icon-wrapper\">\n <i class=\"ri-arrow-left-s-line text-primary flex align-items-center justify-content-center w-full h-full\"></i>\n </div>\n </div>\n }\n\n <div class=\"widget-menu-container\" >\n <div class=\"widget-menu-wrapper h-ful l custom-scroll\">\n <p-menu [model]=\"categories\" styleClass=\"w-full md:w-15rem\">\n <ng-template pTemplate=\"submenuheader\" let-item>\n <span [style]=\"{\n color : '#9EA0B3'\n }\">{{ item.label }}</span>\n </ng-template>\n <ng-template pTemplate=\"item\" let-item>\n <a pRipple \n class=\"flex align-items-center p-menuitem-link\"\n [class.selected-menu-item]=\"selectedMenuItemId === item._id\"\n (click)=\"onMenuItemClick($event, item)\">\n <span [class]=\"item.icon\" class=\"text-xl\"></span>\n <span class=\"ml-2\">{{ item.label }}</span>\n <p-badge *ngIf=\"item.menuData?.shouldShowBadge\" \n class=\"ml-auto\" \n [severity]=\"item.menuData?.badgeSeverity\" \n [value]=\"item.menuData?.badgeValue\" />\n </a>\n </ng-template>\n </p-menu>\n </div>\n </div>\n </p-card>\n</div>\n\n ", styles: [".expand-icon-wrapper{border:1px solid var(--primary-color);height:24px;width:24px;border-radius:50%;background:var(--blue-bg-light)}::ng-deep .p-badge.p-badge-success{background-color:#dcfce7;color:#16a34a;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-badge.p-badge-danger{background-color:#fee2e2;color:#dc2626;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-badge.p-badge-warning{background-color:#fef3c7;color:#d97706;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-menu .p-menuitem>.p-menuitem-content .p-menuitem-link{color:#1f2937}@media screen and (min-width: 768px){::ng-deep .md\\:w-15rem{width:100%!important}}::ng-deep .p-menu .p-menuitem:not(p-highlight):not(p-disabled)>.p-menuitem-content:hover{color:#06f!important;background:#0066ff1a!important;background-color:#0066ff1a!important}::ng-deep .p-menu{border:none}::ng-deep .custom-scroll{scrollbar-gutter:inherit}::ng-deep .selected-menu-item{background-color:#0066ff1a!important;color:var(--primary-color)!important;border:1px solid rgba(68,72,109,.1)!important;border-radius:10px!important}::ng-deep .selected-menu-item .text-xl{color:var(--primary-color)!important}::ng-deep .p-panelmenu .p-panelmenu-content{border:none!important}.application-title-wrapper{color:#9ea0b3;font-weight:500}.widget-menu-wrapper{margin-top:8px}.widget-menu-header-wrapper{padding:4px 4px 4px 16px}.widget-menu-container{height:calc(100% - 38px)}.custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}::ng-deep .document-sidebar-container .p-card{height:100%;box-shadow:none}::ng-deep .document-sidebar-container .p-card .p-card-content{height:100%;padding:0!important}::ng-deep .document-sidebar-container .p-card .p-card-body{height:100%;width:100%;padding:12px 8px;border-radius:10px;border:1px solid #e5e7eb}::ng-deep .document-sidebar-container .widget-menu-wrapper .p-panelmenu-panel .p-panelmenu-expanded .p-panelmenu-content{border:none!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content{border:none;color:var(--text-color);font-weight:400!important;background-color:var(--surface-0)!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-panelmenu-header-action{color:var(--text-color);font-weight:400!important;position:relative;padding:12px}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-panelmenu-header-action .p-icon-wrapper{position:absolute;right:0;top:16px;margin-right:7px;transform:rotate(90deg)!important;transition:none!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-panelmenu-header-action .p-menuitem-text{max-width:75%;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-menuitem-link-active{border:1px solid rgba(68,72,109,.1);border-radius:10px;padding:12px;color:var(--primary-color);background-color:#0066ff1a!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-menuitem-link-active .p-menuitem-icon{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-menuitem-link-active .p-menuitem-text{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .company-action-wrapper:not(.p-disabled).p-highlight .p-panelmenu-header-content{margin:12px 0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .no-highlight.p-panelmenu-header:not(.p-disabled).p-highlight .p-panelmenu-header-content{background-color:transparent!important;border-radius:10px;padding:12px;border-bottom:0!important;border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .no-highlight.p-panelmenu-header:not(.p-disabled).p-highlight .p-panelmenu-header-content .p-panelmenu-header-action{padding:0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .no-highlight.p-panelmenu-header:not(.p-disabled).p-highlight .p-panelmenu-header-content .p-panelmenu-header-action .p-icon-wrapper{transform:rotate(180deg)!important;transition:none!important;top:0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link{background-color:var(--surface-0)!important;color:var(--text-color);padding:12px 6px!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link .p-menuitem-text{max-width:75%;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link-active{border:1px solid rgba(68,72,109,.1);border-radius:10px;padding:12px;color:var(--primary-color);box-shadow:none!important;background-color:#0066ff1a!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link-active .p-menuitem-icon{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link-active .p-menuitem-text{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem.p-focus>.p-menuitem-content{background-color:#44486d1a!important}::ng-deep .widget-menu-wrapper .p-panelmenu-panel .p-panelmenu-expanded .p-panelmenu-content{border:1px solid rgba(68,72,109,.1)!important;border-top:0!important;border-bottom-left-radius:10px;border-bottom-right-radius:10px}::ng-deep .widget-menu-wrapper .p-panelmenu-panel .widget-separator{border-top:1px solid rgba(68,72,109,.1)!important}::ng-deep .widget-menu-wrapper .p-panelmenu-panel .widget-separator .p-panelmenu-header-content .p-panelmenu-header-action{padding:0!important}\n"] }]
|
|
4680
4842
|
}], ctorParameters: () => [{ type: DocumentStore }, { type: DocumentQuery }, { type: DocumentMenuService }, { type: DocumentHelperService }], propDecorators: { catagories: [{
|
|
4681
4843
|
type: Input
|
|
4682
4844
|
}], applicationNumber: [{
|
|
@@ -4740,11 +4902,26 @@ class DocumentContainerComponent {
|
|
|
4740
4902
|
* @type {Subscription}
|
|
4741
4903
|
*/
|
|
4742
4904
|
subscription = new Subscription();
|
|
4905
|
+
/**
|
|
4906
|
+
* Handles changes to input properties
|
|
4907
|
+
*/
|
|
4908
|
+
ngOnChanges(changes) {
|
|
4909
|
+
if (changes[SHARED.CONTEXT_ID] && !changes[SHARED.CONTEXT_ID].firstChange) {
|
|
4910
|
+
// When contextId changes, refetch all data for the new context
|
|
4911
|
+
this.refetchAllDataForNewContext();
|
|
4912
|
+
}
|
|
4913
|
+
}
|
|
4743
4914
|
/**
|
|
4744
4915
|
* Fetches the folder and document data on initialization.
|
|
4745
4916
|
* @returns {void}
|
|
4746
4917
|
*/
|
|
4747
4918
|
ngOnInit() {
|
|
4919
|
+
this.initializeData();
|
|
4920
|
+
}
|
|
4921
|
+
/**
|
|
4922
|
+
* Initialize all data with proper sequencing to avoid duplicate API calls
|
|
4923
|
+
*/
|
|
4924
|
+
initializeData() {
|
|
4748
4925
|
this.fetchDocumentCatagories();
|
|
4749
4926
|
this.fetchUserListWithFilters();
|
|
4750
4927
|
this.setupStatusDataSubscriptions();
|
|
@@ -4758,25 +4935,30 @@ class DocumentContainerComponent {
|
|
|
4758
4935
|
setupStatusDataSubscriptions() {
|
|
4759
4936
|
this.subscription.add(this.documentQuery.selectSelectedMenuItem().subscribe(menuItem => {
|
|
4760
4937
|
this.fetchStatusData();
|
|
4761
|
-
this.
|
|
4938
|
+
if (this.catagories.length > 0) {
|
|
4939
|
+
this.fetchUserListWithFilters();
|
|
4940
|
+
}
|
|
4762
4941
|
}));
|
|
4763
4942
|
this.subscription.add(this.documentQuery.selectSelectedUserId().subscribe(userId => {
|
|
4764
4943
|
this.fetchStatusData();
|
|
4765
|
-
this.
|
|
4944
|
+
if (this.catagories.length > 0) {
|
|
4945
|
+
this.fetchUserListWithFilters();
|
|
4946
|
+
}
|
|
4766
4947
|
}));
|
|
4767
4948
|
this.subscription.add(this.documentQuery.selectSelectedStatus().subscribe(status => {
|
|
4768
4949
|
this.fetchStatusData();
|
|
4769
|
-
this.
|
|
4950
|
+
if (this.catagories.length > 0) {
|
|
4951
|
+
this.fetchUserListWithFilters();
|
|
4952
|
+
}
|
|
4770
4953
|
}));
|
|
4771
4954
|
this.fetchStatusData();
|
|
4772
|
-
this.fetchUserListWithFilters();
|
|
4773
4955
|
}
|
|
4774
4956
|
/**
|
|
4775
4957
|
* Fetches status data based on current selections
|
|
4776
4958
|
*/
|
|
4777
4959
|
fetchStatusData() {
|
|
4778
4960
|
if (!this.contextId) {
|
|
4779
|
-
console.warn(
|
|
4961
|
+
console.warn(ERRORS.CONTEXT_ID_REQUIRED);
|
|
4780
4962
|
return;
|
|
4781
4963
|
}
|
|
4782
4964
|
const currentState = this.documentQuery.getSelectionState();
|
|
@@ -4788,7 +4970,7 @@ class DocumentContainerComponent {
|
|
|
4788
4970
|
this.documentStore.setStatusData(statusData);
|
|
4789
4971
|
},
|
|
4790
4972
|
error: (error) => {
|
|
4791
|
-
console.error(
|
|
4973
|
+
console.error(ERRORS.ERROR_FETCHING_STATUS_DATA, error);
|
|
4792
4974
|
}
|
|
4793
4975
|
});
|
|
4794
4976
|
}
|
|
@@ -4797,7 +4979,7 @@ class DocumentContainerComponent {
|
|
|
4797
4979
|
*/
|
|
4798
4980
|
fetchUserListWithFilters() {
|
|
4799
4981
|
if (!this.contextId) {
|
|
4800
|
-
console.warn(
|
|
4982
|
+
console.warn(ERRORS.CONTEXT_ID_REQUIRED);
|
|
4801
4983
|
return;
|
|
4802
4984
|
}
|
|
4803
4985
|
const currentState = this.documentQuery.getSelectionState();
|
|
@@ -4810,7 +4992,7 @@ class DocumentContainerComponent {
|
|
|
4810
4992
|
this.documentStore.setUserList(res);
|
|
4811
4993
|
},
|
|
4812
4994
|
error: (err) => {
|
|
4813
|
-
console.error(
|
|
4995
|
+
console.error(ERRORS.ERROR_FETCHING_USER_LIST, err);
|
|
4814
4996
|
}
|
|
4815
4997
|
});
|
|
4816
4998
|
}
|
|
@@ -4823,14 +5005,28 @@ class DocumentContainerComponent {
|
|
|
4823
5005
|
if (categories) {
|
|
4824
5006
|
this.catagories = categories.categories;
|
|
4825
5007
|
this.applicationNumber = categories.applicationNumber;
|
|
5008
|
+
this.documentStore.setDocumentCategories(categories.categories);
|
|
4826
5009
|
}
|
|
4827
5010
|
},
|
|
4828
5011
|
error: (err) => {
|
|
4829
|
-
console.error(
|
|
5012
|
+
console.error(ERRORS.ERROR_FETCHING_DOCUMENT_CATEGORIES, err);
|
|
4830
5013
|
}
|
|
4831
5014
|
});
|
|
4832
5015
|
this.subscription.add(categoriesSubscription);
|
|
4833
5016
|
}
|
|
5017
|
+
/**
|
|
5018
|
+
* Refetches all data when contextId changes
|
|
5019
|
+
*/
|
|
5020
|
+
refetchAllDataForNewContext() {
|
|
5021
|
+
if (this.contextId && this.contextId !== SHARED.EMPTY) {
|
|
5022
|
+
this.documentStore.clearSelectionState();
|
|
5023
|
+
this.documentStore.clearDocumentViewerState();
|
|
5024
|
+
this.fetchDocumentCatagories();
|
|
5025
|
+
this.fetchUserListWithFilters();
|
|
5026
|
+
this.fetchStatusData();
|
|
5027
|
+
this.documentHelperService.initializeSelectionWatcherWithInitialLoad(this.contextId);
|
|
5028
|
+
}
|
|
5029
|
+
}
|
|
4834
5030
|
/**
|
|
4835
5031
|
* Sets up subscription to listen for filtered document responses
|
|
4836
5032
|
*/
|
|
@@ -4840,18 +5036,27 @@ class DocumentContainerComponent {
|
|
|
4840
5036
|
this.documentListResponse = response;
|
|
4841
5037
|
},
|
|
4842
5038
|
error: (error) => {
|
|
4843
|
-
console.error(
|
|
5039
|
+
console.error(ERRORS.ERROR_RECEIVING_DOCUMENT_LIST, error);
|
|
4844
5040
|
}
|
|
4845
5041
|
}));
|
|
4846
5042
|
}
|
|
4847
5043
|
/**
|
|
4848
|
-
* Unsubscribe subscription on destroy of component .
|
|
5044
|
+
* Unsubscribe subscription on destroy of component and clean up state.
|
|
4849
5045
|
*/
|
|
4850
5046
|
ngOnDestroy() {
|
|
4851
|
-
this.subscription
|
|
5047
|
+
if (this.subscription) {
|
|
5048
|
+
this.subscription.unsubscribe();
|
|
5049
|
+
}
|
|
5050
|
+
this.documentStore.clearSelectionState();
|
|
5051
|
+
this.documentStore.clearDocumentViewerState();
|
|
5052
|
+
this.catagories = SHARED.EMPTY_ARRAY;
|
|
5053
|
+
this.userList = SHARED.EMPTY_ARRAY;
|
|
5054
|
+
this.statusData = SHARED.EMPTY_ARRAY;
|
|
5055
|
+
this.documentListResponse = null;
|
|
5056
|
+
this.applicationNumber = SHARED.EMPTY;
|
|
4852
5057
|
}
|
|
4853
5058
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentContainerComponent, deps: [{ token: DocumentStore }, { token: DocumentService }, { token: DocumentQuery }, { token: DocumentHttpService }, { token: DocumentHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4854
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentContainerComponent, isStandalone: false, selector: "lib-document-container", inputs: { contextId: "contextId" }, ngImport: i0, template: "<div class=\"grid m-0 h-full flex\">\r\n <div class=\"col-12 md:col-3 lg:col-3\">\r\n <lib-documents-menu [catagories]=\"catagories\" [applicationNumber]=\"applicationNumber\" [contextId]=\"contextId\"></lib-documents-menu>\r\n </div>\r\n <div class=\"col-12 md:col-9 lg:col-9 p-0 h-full\" [ngClass]=\"{'custom-scroll': true}\">\r\n <div>\r\n <lib-folder-container [contextId]=\"contextId\" [userList]=\"userList\" [statusData]=\"statusData\" [categories]=\"catagories\"></lib-folder-container>\r\n </div>\r\n <div >\r\n <lib-document-list [contextId]=\"contextId\" [documentListResponse]=\"documentListResponse\">\r\n <ng-content></ng-content>\r\n </lib-document-list>\r\n </div>\r\n </div>\r\n</div>", styles: [".custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}\n"], dependencies: [{ kind: "directive", type:
|
|
5059
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentContainerComponent, isStandalone: false, selector: "lib-document-container", inputs: { contextId: "contextId" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"grid m-0 h-full flex\">\r\n <div class=\"col-12 md:col-3 lg:col-3\">\r\n <lib-documents-menu [catagories]=\"catagories\" [applicationNumber]=\"applicationNumber\" [contextId]=\"contextId\"></lib-documents-menu>\r\n </div>\r\n <div class=\"col-12 md:col-9 lg:col-9 p-0 h-full\" [ngClass]=\"{'custom-scroll': true}\">\r\n <div>\r\n <lib-folder-container [contextId]=\"contextId\" [userList]=\"userList\" [statusData]=\"statusData\" [categories]=\"catagories\"></lib-folder-container>\r\n </div>\r\n <div >\r\n <lib-document-list [contextId]=\"contextId\" [documentListResponse]=\"documentListResponse\">\r\n <ng-content></ng-content>\r\n </lib-document-list>\r\n </div>\r\n </div>\r\n</div>", styles: [".custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: FolderContainerComponent, selector: "lib-folder-container", inputs: ["documentList", "folderList", "contextId", "userList", "statusData", "categories"] }, { kind: "component", type: DocumentListComponent, selector: "lib-document-list", inputs: ["contextId", "documentListResponse", "documentList"] }, { kind: "component", type: DocumentsMenuComponent, selector: "lib-documents-menu", inputs: ["catagories", "applicationNumber", "contextId"] }] });
|
|
4855
5060
|
}
|
|
4856
5061
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentContainerComponent, decorators: [{
|
|
4857
5062
|
type: Component,
|
|
@@ -4900,7 +5105,7 @@ class FolderBlockComponent {
|
|
|
4900
5105
|
return folderBlockId;
|
|
4901
5106
|
}
|
|
4902
5107
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FolderBlockComponent, deps: [{ token: DocumentStore }], target: i0.ɵɵFactoryTarget.Component });
|
|
4903
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: FolderBlockComponent, isStandalone: false, selector: "lib-folder-block", inputs: { folderList: "folderList" }, ngImport: i0, template: "<div class=\"card p-0 folder-info\">\r\n <div class=\"text-900 text-xl font-semibold ml-2 mb-1\">Folders</div>\r\n <div class=\"grid m-0\">\r\n <div *ngFor=\"let folder of folderList\" class=\"col-12 md:col-6 xl:col-4 container-wrapper\">\r\n <div\r\n class=\"p-3 border-1 h-full surface-border flex flex-column justify-content-between hover:surface-100 cursor-pointer border-round\"\r\n (click)=\"handleClickForFilter(folder._id)\"\r\n >\r\n <div class=\"icon\">\r\n <img src=\"../../../../assets/images/FolderImg.png\" alt=\"\" />\r\n </div>\r\n <div class=\"flex flex-column\">\r\n <span class=\"text-600 mt-2\"> {{ folder.documentCount }} Files </span>\r\n <span class=\"text-900 text-lg mt-2 mb-2 font-semibold font-medium\">\r\n {{ folder.folderName }}\r\n </span>\r\n </div>\r\n <hr />\r\n <div class=\"flex justify-content-between\">\r\n <div class=\"flex flex-column\">\r\n <span>Missing</span>\r\n <span\r\n [ngClass]=\"{\r\n 'text-pink-500': missingFileCount > 0,\r\n 'text-green-500': missingFileCount === 0\r\n }\"\r\n >\r\n {{ missingFileCount }}\r\n </span>\r\n </div>\r\n <div class=\"flex flex-column\">\r\n <span>Pending</span>\r\n <span\r\n [ngClass]=\"{\r\n 'text-yellow-500': pendingFileCount > 0,\r\n 'text-green-500': pendingFileCount === 0\r\n }\"\r\n >\r\n {{ pendingFileCount }}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".container-wrapper:nth-child(3n+1){padding-left:0}.container-wrapper:nth-child(3n){padding-right:0}\n"], dependencies: [{ kind: "directive", type:
|
|
5108
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: FolderBlockComponent, isStandalone: false, selector: "lib-folder-block", inputs: { folderList: "folderList" }, ngImport: i0, template: "<div class=\"card p-0 folder-info\">\r\n <div class=\"text-900 text-xl font-semibold ml-2 mb-1\">Folders</div>\r\n <div class=\"grid m-0\">\r\n <div *ngFor=\"let folder of folderList\" class=\"col-12 md:col-6 xl:col-4 container-wrapper\">\r\n <div\r\n class=\"p-3 border-1 h-full surface-border flex flex-column justify-content-between hover:surface-100 cursor-pointer border-round\"\r\n (click)=\"handleClickForFilter(folder._id)\"\r\n >\r\n <div class=\"icon\">\r\n <img src=\"../../../../assets/images/FolderImg.png\" alt=\"\" />\r\n </div>\r\n <div class=\"flex flex-column\">\r\n <span class=\"text-600 mt-2\"> {{ folder.documentCount }} Files </span>\r\n <span class=\"text-900 text-lg mt-2 mb-2 font-semibold font-medium\">\r\n {{ folder.folderName }}\r\n </span>\r\n </div>\r\n <hr />\r\n <div class=\"flex justify-content-between\">\r\n <div class=\"flex flex-column\">\r\n <span>Missing</span>\r\n <span\r\n [ngClass]=\"{\r\n 'text-pink-500': missingFileCount > 0,\r\n 'text-green-500': missingFileCount === 0\r\n }\"\r\n >\r\n {{ missingFileCount }}\r\n </span>\r\n </div>\r\n <div class=\"flex flex-column\">\r\n <span>Pending</span>\r\n <span\r\n [ngClass]=\"{\r\n 'text-yellow-500': pendingFileCount > 0,\r\n 'text-green-500': pendingFileCount === 0\r\n }\"\r\n >\r\n {{ pendingFileCount }}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".container-wrapper:nth-child(3n+1){padding-left:0}.container-wrapper:nth-child(3n){padding-right:0}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
4904
5109
|
}
|
|
4905
5110
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FolderBlockComponent, decorators: [{
|
|
4906
5111
|
type: Component,
|
|
@@ -4938,7 +5143,7 @@ class DocumentListItemComponent {
|
|
|
4938
5143
|
this.documentClick.emit(document);
|
|
4939
5144
|
}
|
|
4940
5145
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentListItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4941
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentListItemComponent, isStandalone: false, selector: "lib-document-list-item", inputs: { document: "document" }, outputs: { documentClick: "documentClick" }, ngImport: i0, template: "<div class=\"grid m-0\">\r\n <div\r\n class=\"col-12 flex align-items-center justify-content-between md:col-12 xl:col-12\"\r\n >\r\n <div\r\n class=\"col-5 flex cursor-pointer align-items-center pl-0\"\r\n (click)=\"handleOpenDocument(document)\"\r\n >\r\n <img src=\"../../../../assets/images/Frame.png\" alt=\"\" />\r\n <span class=\"ml-4 file-name-wrapper document-text-wrapper\">{{ document.fileName }}</span>\r\n </div>\r\n <div class=\"col-4 flex align-items-center justify-content-center\">\r\n <span\r\n [class]=\"'product-badge status-' + document.status?.toLowerCase()\"\r\n class=\"flex align-items-center justify-content-center pl-2 pr-2 pt-1 pb-1\"\r\n >\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'pending'\">\r\n <i class=\"pi pi-clock pr-1\" style=\"font-size: 12px;\"></i>\r\n Pending\r\n </ng-container>\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'verified'\">\r\n <i class=\"pi pi-check-circle pr-1\" style=\"font-size: 12px;\"></i>\r\n Verified\r\n </ng-container>\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'alert'\">\r\n <i class=\"pi pi-bell pr-1\" style=\"font-size: 12px;\"></i>\r\n Alert\r\n </ng-container>\r\n </span>\r\n </div>\r\n <div class=\"document-type file-name-wrapper document-text-wrapper\">\r\n {{document.documentTypeName}}\r\n </div>\r\n </div>\r\n </div>\r\n ", styles: [".product-badge.status-pending{background:#e9b127;color:#fff;border-radius:4px}.product-badge.status-verified{background:#4caf50;color:#fff;border-radius:4px}.product-badge.status-alert{background:#f57c00;color:#fff;border-radius:4px}.product-badge{text-transform:none;font-weight:500;font-size:12px}.file-name-wrapper{font-size:15px;font-weight:500}.document-text-wrapper{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}\n"], dependencies: [{ kind: "directive", type:
|
|
5146
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentListItemComponent, isStandalone: false, selector: "lib-document-list-item", inputs: { document: "document" }, outputs: { documentClick: "documentClick" }, ngImport: i0, template: "<div class=\"grid m-0\">\r\n <div\r\n class=\"col-12 flex align-items-center justify-content-between md:col-12 xl:col-12\"\r\n >\r\n <div\r\n class=\"col-5 flex cursor-pointer align-items-center pl-0\"\r\n (click)=\"handleOpenDocument(document)\"\r\n >\r\n <img src=\"../../../../assets/images/Frame.png\" alt=\"\" />\r\n <span class=\"ml-4 file-name-wrapper document-text-wrapper\">{{ document.fileName }}</span>\r\n </div>\r\n <div class=\"col-4 flex align-items-center justify-content-center\">\r\n <span\r\n [class]=\"'product-badge status-' + document.status?.toLowerCase()\"\r\n class=\"flex align-items-center justify-content-center pl-2 pr-2 pt-1 pb-1\"\r\n >\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'pending'\">\r\n <i class=\"pi pi-clock pr-1\" style=\"font-size: 12px;\"></i>\r\n Pending\r\n </ng-container>\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'verified'\">\r\n <i class=\"pi pi-check-circle pr-1\" style=\"font-size: 12px;\"></i>\r\n Verified\r\n </ng-container>\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'alert'\">\r\n <i class=\"pi pi-bell pr-1\" style=\"font-size: 12px;\"></i>\r\n Alert\r\n </ng-container>\r\n </span>\r\n </div>\r\n <div class=\"document-type file-name-wrapper document-text-wrapper\">\r\n {{document.documentTypeName}}\r\n </div>\r\n </div>\r\n </div>\r\n ", styles: [".product-badge.status-pending{background:#e9b127;color:#fff;border-radius:4px}.product-badge.status-verified{background:#4caf50;color:#fff;border-radius:4px}.product-badge.status-alert{background:#f57c00;color:#fff;border-radius:4px}.product-badge{text-transform:none;font-weight:500;font-size:12px}.file-name-wrapper{font-size:15px;font-weight:500}.document-text-wrapper{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
4942
5147
|
}
|
|
4943
5148
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentListItemComponent, decorators: [{
|
|
4944
5149
|
type: Component,
|