cat-documents-ng 0.3.49 → 0.3.50
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/SHARED.d.ts +16 -3
- package/fesm2022/cat-documents-ng.mjs +298 -209
- package/fesm2022/cat-documents-ng.mjs.map +1 -1
- package/lib/document/components/document-list/document-list.component.d.ts +14 -0
- package/lib/document/components/document-viewer/document-viewer.component.d.ts +11 -1
- package/lib/document/models/document-list-response.model.d.ts +2 -0
- package/lib/document/services/document-viewer.service.d.ts +2 -0
- package/lib/document/state/document.query.d.ts +5 -1
- package/lib/document/state/document.state.d.ts +2 -0
- package/lib/document/state/document.store.d.ts +2 -0
- package/package.json +1 -1
|
@@ -37,12 +37,12 @@ import * as i6 from 'primeng/inputtext';
|
|
|
37
37
|
import { InputTextModule } from 'primeng/inputtext';
|
|
38
38
|
import * as i2$1 from 'primeng/table';
|
|
39
39
|
import { TableModule } from 'primeng/table';
|
|
40
|
-
import * as i1 from '@angular/router';
|
|
41
40
|
import * as XLSX from 'xlsx';
|
|
42
41
|
import * as i7 from 'ng2-pdf-viewer';
|
|
43
42
|
import { PdfViewerModule } from 'ng2-pdf-viewer';
|
|
44
43
|
import * as i8 from 'ngx-doc-viewer';
|
|
45
44
|
import { NgxDocViewerModule } from 'ngx-doc-viewer';
|
|
45
|
+
import * as i1 from '@angular/router';
|
|
46
46
|
import * as i6$1 from 'primeng/inputtextarea';
|
|
47
47
|
import { InputTextareaModule } from 'primeng/inputtextarea';
|
|
48
48
|
import * as i8$2 from 'primeng/menu';
|
|
@@ -345,6 +345,10 @@ class SHARED {
|
|
|
345
345
|
static ERROR_PARSING_EXCEL_FILE = 'Unable to parse Excel file';
|
|
346
346
|
static ERROR_PARSING_EXCEL_FILE_STRUCTURE = 'Unable to parse Excel file structure';
|
|
347
347
|
static NAME_UPDATE_ACTION = 'nameUpdate';
|
|
348
|
+
static REQUESTED = 'requested';
|
|
349
|
+
static ACCEPTED = 'accepted';
|
|
350
|
+
static UPLOADED = 'uploaded';
|
|
351
|
+
static REJECTED = 'rejected';
|
|
348
352
|
static Menu = [
|
|
349
353
|
{
|
|
350
354
|
label: 'Applicant',
|
|
@@ -453,11 +457,22 @@ class SHARED {
|
|
|
453
457
|
static ICON_WITH_DASH = 'icon-';
|
|
454
458
|
static SEARCH_KEY = 'searchKey';
|
|
455
459
|
static APPROVED = 'approved';
|
|
456
|
-
static UPLOADED = 'uploaded';
|
|
457
460
|
static PENDING = 'Pending';
|
|
458
461
|
static DOT = '.';
|
|
459
462
|
static PDF = 'PDF';
|
|
460
463
|
static PENDING_STATUS = 'pending';
|
|
464
|
+
static EVENT_REQUESTED = 'event-requested';
|
|
465
|
+
static EVENT_ACCEPTED = 'event-accepted';
|
|
466
|
+
static EVENT_REJECTED = 'event-rejected';
|
|
467
|
+
static EVENT_DEFAULT = 'event-default';
|
|
468
|
+
static ICON_REQUESTED = 'icon-requested';
|
|
469
|
+
static ICON_ACCEPTED = 'icon-accepted';
|
|
470
|
+
static ICON_REJECTED = 'icon-rejected';
|
|
471
|
+
static ICON_DEFAULT = 'icon-default';
|
|
472
|
+
static ICON_CHECK_CIRCLE = 'pi pi-check-circle';
|
|
473
|
+
static ICON_FOLDER_PLUS = 'pi pi-folder-plus';
|
|
474
|
+
static ICON_TIMES = 'pi pi-times';
|
|
475
|
+
static ICON_FILE = 'pi pi-file';
|
|
461
476
|
// File extension constants
|
|
462
477
|
static JPG = 'JPG';
|
|
463
478
|
static PNG = 'PNG';
|
|
@@ -481,13 +496,11 @@ class SHARED {
|
|
|
481
496
|
static ICON_EXCLAMATION_TRIANGLE = 'pi pi-exclamation-triangle';
|
|
482
497
|
static ICON_CLOUD_UPLOAD = 'pi pi-cloud-upload';
|
|
483
498
|
static ICON_EYE = 'pi pi-eye';
|
|
484
|
-
static ICON_TIMES = 'pi pi-times';
|
|
485
499
|
static ICON_CLOCK = 'pi pi-clock';
|
|
486
500
|
// File type icons
|
|
487
501
|
static ICON_FILE_PDF = 'pi pi-file-pdf';
|
|
488
502
|
static ICON_IMAGE = 'pi pi-image';
|
|
489
503
|
static ICON_FILE_EXCEL = 'pi pi-file-excel';
|
|
490
|
-
static ICON_FILE = 'pi pi-file';
|
|
491
504
|
static ICON_DELETE = 'ri-delete-bin-6-line';
|
|
492
505
|
// Cell type constants
|
|
493
506
|
static CELL_TYPE_DOCUMENT = 'document';
|
|
@@ -1110,7 +1123,9 @@ function createInitialState() {
|
|
|
1110
1123
|
isActionLoading: false,
|
|
1111
1124
|
documentStatus: 'pending',
|
|
1112
1125
|
documentIsUploaded: false,
|
|
1113
|
-
alertData: null
|
|
1126
|
+
alertData: null,
|
|
1127
|
+
deleteError: null,
|
|
1128
|
+
deleteSuccess: false
|
|
1114
1129
|
};
|
|
1115
1130
|
}
|
|
1116
1131
|
|
|
@@ -1226,6 +1241,12 @@ let DocumentStore = class DocumentStore extends EntityStore {
|
|
|
1226
1241
|
setAlertData(alertData) {
|
|
1227
1242
|
this.update({ alertData: alertData });
|
|
1228
1243
|
}
|
|
1244
|
+
setDeleteError(error) {
|
|
1245
|
+
this.update({ deleteError: error });
|
|
1246
|
+
}
|
|
1247
|
+
setDeleteSuccess(success) {
|
|
1248
|
+
this.update({ deleteSuccess: success });
|
|
1249
|
+
}
|
|
1229
1250
|
// Method to update all document viewer state at once
|
|
1230
1251
|
updateDocumentViewerState(document, history, showHistory, loading, status, uploaded, alertData) {
|
|
1231
1252
|
const updates = {};
|
|
@@ -1254,7 +1275,9 @@ let DocumentStore = class DocumentStore extends EntityStore {
|
|
|
1254
1275
|
isActionLoading: false,
|
|
1255
1276
|
documentStatus: 'pending',
|
|
1256
1277
|
documentIsUploaded: false,
|
|
1257
|
-
alertData: null
|
|
1278
|
+
alertData: null,
|
|
1279
|
+
deleteError: null,
|
|
1280
|
+
deleteSuccess: false
|
|
1258
1281
|
});
|
|
1259
1282
|
}
|
|
1260
1283
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -1390,7 +1413,7 @@ class DocumentHttpService {
|
|
|
1390
1413
|
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
1391
1414
|
*/
|
|
1392
1415
|
getDocumentCatagories(contextId) {
|
|
1393
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1416
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 0775de31-db38-432f-92b0-9ebea6d40c00` });
|
|
1394
1417
|
return this.http.get(`${this.apiUrl}${URLS.DOCUMENTS_CATAGORIES}/${contextId}`, { headers })
|
|
1395
1418
|
.pipe(tap((response) => {
|
|
1396
1419
|
if (response && response.categories) {
|
|
@@ -1434,7 +1457,7 @@ class DocumentHttpService {
|
|
|
1434
1457
|
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
1435
1458
|
*/
|
|
1436
1459
|
getDocumentByFolderID(folderId, contextId) {
|
|
1437
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1460
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 0775de31-db38-432f-92b0-9ebea6d40c00` });
|
|
1438
1461
|
return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${URLS.PARENT_DOCUMENT_TYPE_ID}${folderId}${URLS.CONTEXT_ID}${contextId}`, { headers }).pipe(tap((records) => {
|
|
1439
1462
|
this.documentStore.set(records);
|
|
1440
1463
|
}), catchError((error) => {
|
|
@@ -1450,7 +1473,7 @@ class DocumentHttpService {
|
|
|
1450
1473
|
* @returns {Observable<DocumentModel>} An observable that emits the updated DocumentModel.
|
|
1451
1474
|
*/
|
|
1452
1475
|
updateDocumentName(documentId, payload) {
|
|
1453
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1476
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 0775de31-db38-432f-92b0-9ebea6d40c00` });
|
|
1454
1477
|
return this.http.put(`${this.apiUrl}${URLS.ALIAS_NAME}${documentId}`, payload, { headers }).pipe(catchError((error) => {
|
|
1455
1478
|
return throwError(() => new Error(error));
|
|
1456
1479
|
}));
|
|
@@ -1463,7 +1486,7 @@ class DocumentHttpService {
|
|
|
1463
1486
|
getUserListByContextId(contextId) {
|
|
1464
1487
|
if (!contextId)
|
|
1465
1488
|
return EMPTY;
|
|
1466
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1489
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 0775de31-db38-432f-92b0-9ebea6d40c00` });
|
|
1467
1490
|
return this.http.get(`${this.apiUrl}${URLS.USERLIST}${contextId}`, { headers }).pipe(tap((userList) => {
|
|
1468
1491
|
this.documentStore.setUserList(userList);
|
|
1469
1492
|
}), catchError((error) => {
|
|
@@ -1489,7 +1512,7 @@ class DocumentHttpService {
|
|
|
1489
1512
|
if (categoryId) {
|
|
1490
1513
|
params = params.set(SHARED.CATEGORY, categoryId);
|
|
1491
1514
|
}
|
|
1492
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1515
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 0775de31-db38-432f-92b0-9ebea6d40c00` });
|
|
1493
1516
|
return this.http.get(url, { params, headers }).pipe(tap((statusData) => {
|
|
1494
1517
|
this.documentStore.setStatusData(statusData);
|
|
1495
1518
|
}), catchError((error) => {
|
|
@@ -1518,7 +1541,7 @@ class DocumentHttpService {
|
|
|
1518
1541
|
if (searchKey) {
|
|
1519
1542
|
params = params.set(SHARED.SEARCH_KEY, searchKey);
|
|
1520
1543
|
}
|
|
1521
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1544
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 0775de31-db38-432f-92b0-9ebea6d40c00` });
|
|
1522
1545
|
return this.http.get(`${this.apiUrl}${URLS.GETALL}/${contextId}`, { params, headers }).pipe(tap((response) => {
|
|
1523
1546
|
if (response.documents) {
|
|
1524
1547
|
this.documentStore.setDocumentList(response.documents);
|
|
@@ -1531,7 +1554,7 @@ class DocumentHttpService {
|
|
|
1531
1554
|
if (!documentId) {
|
|
1532
1555
|
return of([]);
|
|
1533
1556
|
}
|
|
1534
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1557
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 0775de31-db38-432f-92b0-9ebea6d40c00` });
|
|
1535
1558
|
return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_HISTORY}${documentId}`, { headers }).pipe(catchError((error) => {
|
|
1536
1559
|
return throwError(() => new Error(error));
|
|
1537
1560
|
}));
|
|
@@ -1544,7 +1567,7 @@ class DocumentHttpService {
|
|
|
1544
1567
|
getCategoriesBySource(source) {
|
|
1545
1568
|
if (!source)
|
|
1546
1569
|
return EMPTY;
|
|
1547
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1570
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 0775de31-db38-432f-92b0-9ebea6d40c00` });
|
|
1548
1571
|
return this.http.get(`${this.apiUrl}${URLS.GET_CATEGORIES_BY_SOURCE}${source}`, { headers }).pipe(catchError((error) => {
|
|
1549
1572
|
return throwError(() => new Error(error));
|
|
1550
1573
|
}));
|
|
@@ -1557,7 +1580,7 @@ class DocumentHttpService {
|
|
|
1557
1580
|
getDocumentTypesByCategory(categoryId) {
|
|
1558
1581
|
if (!categoryId)
|
|
1559
1582
|
return EMPTY;
|
|
1560
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1583
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 0775de31-db38-432f-92b0-9ebea6d40c00` });
|
|
1561
1584
|
return this.http.get(`${this.apiUrl}${URLS.GET_DOCUMENT_TYPES_BY_CATEGORY}${categoryId}`, { headers }).pipe(catchError((error) => {
|
|
1562
1585
|
return throwError(() => new Error(error));
|
|
1563
1586
|
}));
|
|
@@ -1568,7 +1591,7 @@ class DocumentHttpService {
|
|
|
1568
1591
|
* @returns {Observable<any>} Observable that emits the upload response.
|
|
1569
1592
|
*/
|
|
1570
1593
|
uploadFile(formData) {
|
|
1571
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1594
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 0775de31-db38-432f-92b0-9ebea6d40c00` });
|
|
1572
1595
|
return this.http.post(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD_FILE}`, formData, { headers }).pipe(catchError((error) => {
|
|
1573
1596
|
return throwError(() => new Error(error));
|
|
1574
1597
|
}));
|
|
@@ -1579,7 +1602,7 @@ class DocumentHttpService {
|
|
|
1579
1602
|
* @returns {Observable<any>} Observable that emits the save response.
|
|
1580
1603
|
*/
|
|
1581
1604
|
saveDocumentUpload(payload) {
|
|
1582
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1605
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 0775de31-db38-432f-92b0-9ebea6d40c00` });
|
|
1583
1606
|
return this.http.post(`${this.apiUrl}${URLS.SAVE_DOCUMENT_UPLOAD}`, payload, { headers }).pipe(catchError((error) => {
|
|
1584
1607
|
return throwError(() => new Error(error));
|
|
1585
1608
|
}));
|
|
@@ -1595,7 +1618,7 @@ class DocumentHttpService {
|
|
|
1595
1618
|
const payload = {
|
|
1596
1619
|
statusUpdateDescription: statusUpdateDescription
|
|
1597
1620
|
};
|
|
1598
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1621
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 0775de31-db38-432f-92b0-9ebea6d40c00` });
|
|
1599
1622
|
return this.http.put(`${this.apiUrl}${URLS.UPDATE_DOCUMENT_STATUS}${documentId}/${status}`, payload, { headers }).pipe(tap((response) => {
|
|
1600
1623
|
if (response && response.status) {
|
|
1601
1624
|
const normalizedStatus = this.normalizeStatus(response.status);
|
|
@@ -1629,7 +1652,7 @@ class DocumentHttpService {
|
|
|
1629
1652
|
* @returns {Observable<any>} Observable that emits the delete response
|
|
1630
1653
|
*/
|
|
1631
1654
|
deleteDocument(documentId, contextId) {
|
|
1632
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1655
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 0775de31-db38-432f-92b0-9ebea6d40c00` });
|
|
1633
1656
|
return this.http.delete(`${this.apiUrl}${URLS.DELETE_DOCUMENT}${documentId}`, { headers }).pipe(tap(() => {
|
|
1634
1657
|
this.getDocumentCatagories(contextId).subscribe();
|
|
1635
1658
|
this.getUserListByContextId(contextId).subscribe();
|
|
@@ -1950,7 +1973,7 @@ class DocumentQuery extends QueryEntity {
|
|
|
1950
1973
|
}
|
|
1951
1974
|
/**
|
|
1952
1975
|
* Selects all document viewer state properties.
|
|
1953
|
-
* @returns {Observable<{selectedDocument?: DocumentListItem, documentHistory: DocumentHistorySection[], showDocumentHistory: boolean, isActionLoading: boolean, documentStatus: 'pending' | 'accepted' | 'rejected', documentIsUploaded: boolean, alertData: any}>} Observable that emits the current document viewer state.
|
|
1976
|
+
* @returns {Observable<{selectedDocument?: DocumentListItem, documentHistory: DocumentHistorySection[], showDocumentHistory: boolean, isActionLoading: boolean, documentStatus: 'pending' | 'accepted' | 'rejected', documentIsUploaded: boolean, alertData: any, deleteError: any, deleteSuccess: boolean}>} Observable that emits the current document viewer state.
|
|
1954
1977
|
*/
|
|
1955
1978
|
selectDocumentViewerState() {
|
|
1956
1979
|
return this.select((state) => ({
|
|
@@ -1960,7 +1983,9 @@ class DocumentQuery extends QueryEntity {
|
|
|
1960
1983
|
isActionLoading: state.isActionLoading,
|
|
1961
1984
|
documentStatus: state.documentStatus,
|
|
1962
1985
|
documentIsUploaded: state.documentIsUploaded,
|
|
1963
|
-
alertData: state.alertData
|
|
1986
|
+
alertData: state.alertData,
|
|
1987
|
+
deleteError: state.deleteError,
|
|
1988
|
+
deleteSuccess: state.deleteSuccess
|
|
1964
1989
|
}));
|
|
1965
1990
|
}
|
|
1966
1991
|
/**
|
|
@@ -1976,7 +2001,9 @@ class DocumentQuery extends QueryEntity {
|
|
|
1976
2001
|
isActionLoading: state.isActionLoading,
|
|
1977
2002
|
documentStatus: state.documentStatus,
|
|
1978
2003
|
documentIsUploaded: state.documentIsUploaded,
|
|
1979
|
-
alertData: state.alertData
|
|
2004
|
+
alertData: state.alertData,
|
|
2005
|
+
deleteError: state.deleteError,
|
|
2006
|
+
deleteSuccess: state.deleteSuccess
|
|
1980
2007
|
};
|
|
1981
2008
|
}
|
|
1982
2009
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentQuery, deps: [{ token: DocumentStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -5200,6 +5227,7 @@ class DocumentViewerService {
|
|
|
5200
5227
|
break;
|
|
5201
5228
|
case SHARED.DELETE_ACTION:
|
|
5202
5229
|
this.deleteDocument(currentState.selectedDocument._id, contextId);
|
|
5230
|
+
// Don't emit success event here - it will be emitted only on successful delete
|
|
5203
5231
|
break;
|
|
5204
5232
|
}
|
|
5205
5233
|
}
|
|
@@ -5251,12 +5279,13 @@ class DocumentViewerService {
|
|
|
5251
5279
|
next: (res) => {
|
|
5252
5280
|
if (res) {
|
|
5253
5281
|
this.documentService.refreshAllDataWithCurrentFilters(contextId);
|
|
5282
|
+
this.documentStore.setDeleteSuccess(true);
|
|
5254
5283
|
this.documentStore.clearDocumentViewerState();
|
|
5255
5284
|
}
|
|
5256
5285
|
},
|
|
5257
5286
|
error: (error) => {
|
|
5258
|
-
console.error('Error deleting document:', error);
|
|
5259
5287
|
this.documentStore.setIsActionLoading(false);
|
|
5288
|
+
this.documentStore.setDeleteError(error.message);
|
|
5260
5289
|
}
|
|
5261
5290
|
});
|
|
5262
5291
|
}
|
|
@@ -5739,151 +5768,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
5739
5768
|
}]
|
|
5740
5769
|
}] });
|
|
5741
5770
|
|
|
5742
|
-
/**
|
|
5743
|
-
* Service for managing user session details.
|
|
5744
|
-
* @class SessionService
|
|
5745
|
-
* @typedef {SessionService}
|
|
5746
|
-
*/
|
|
5747
|
-
class SessionService {
|
|
5748
|
-
router;
|
|
5749
|
-
/**
|
|
5750
|
-
* Creates an instance of SessionService.
|
|
5751
|
-
* @param {Router} router - Angular Router for navigation.
|
|
5752
|
-
*/
|
|
5753
|
-
constructor(router) {
|
|
5754
|
-
this.router = router;
|
|
5755
|
-
}
|
|
5756
|
-
/**
|
|
5757
|
-
* Retrieves the current user's role from local storage.
|
|
5758
|
-
* @returns {string | null} The user's role, or null if not found.
|
|
5759
|
-
*/
|
|
5760
|
-
getUserRole() {
|
|
5761
|
-
return localStorage.getItem('role');
|
|
5762
|
-
}
|
|
5763
|
-
/**
|
|
5764
|
-
* Stores the user session data in local storage.
|
|
5765
|
-
* @param {any} data - The session data to store.
|
|
5766
|
-
*/
|
|
5767
|
-
setUserSession(data) {
|
|
5768
|
-
localStorage.setItem(SHARED.SESSIONKEY, JSON.stringify(data));
|
|
5769
|
-
}
|
|
5770
|
-
/**
|
|
5771
|
-
* Retrieves the stored user session data.
|
|
5772
|
-
* @returns {any | null} The parsed session data, or null if not found.
|
|
5773
|
-
*/
|
|
5774
|
-
getUserSession() {
|
|
5775
|
-
const sessionData = localStorage.getItem(SHARED.SESSIONKEY);
|
|
5776
|
-
return sessionData ? JSON.parse(sessionData) : null;
|
|
5777
|
-
}
|
|
5778
|
-
/**
|
|
5779
|
-
* Retrieves the user's permissions from the stored session data.
|
|
5780
|
-
* @returns {any | null} The user's permissions, or null if not found.
|
|
5781
|
-
*/
|
|
5782
|
-
getUserPermissions() {
|
|
5783
|
-
const sessionData = localStorage.getItem(SHARED.SESSIONKEY);
|
|
5784
|
-
return sessionData ? JSON.parse(sessionData).permissions : null;
|
|
5785
|
-
}
|
|
5786
|
-
/**
|
|
5787
|
-
* Retrieves the session ID from the stored session data.
|
|
5788
|
-
* @returns {any | null} The session ID, or null if not found.
|
|
5789
|
-
*/
|
|
5790
|
-
getSessionID() {
|
|
5791
|
-
const sessionData = localStorage.getItem(SHARED.SESSIONKEY);
|
|
5792
|
-
console.log(sessionData);
|
|
5793
|
-
if (sessionData) {
|
|
5794
|
-
const sessionId = JSON.parse(sessionData);
|
|
5795
|
-
console.log(sessionId);
|
|
5796
|
-
return sessionId;
|
|
5797
|
-
}
|
|
5798
|
-
return null;
|
|
5799
|
-
}
|
|
5800
|
-
/**
|
|
5801
|
-
* Clears all stored session data from local storage.
|
|
5802
|
-
*/
|
|
5803
|
-
clearSession() {
|
|
5804
|
-
localStorage.clear();
|
|
5805
|
-
}
|
|
5806
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SessionService, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5807
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SessionService, providedIn: 'root' });
|
|
5808
|
-
}
|
|
5809
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SessionService, decorators: [{
|
|
5810
|
-
type: Injectable,
|
|
5811
|
-
args: [{
|
|
5812
|
-
providedIn: 'root'
|
|
5813
|
-
}]
|
|
5814
|
-
}], ctorParameters: () => [{ type: i1.Router }] });
|
|
5815
|
-
|
|
5816
|
-
/**
|
|
5817
|
-
* Directive to conditionally show or hide elements based on user permissions.
|
|
5818
|
-
* @class HasPermissionDirective
|
|
5819
|
-
* @typedef {HasPermissionDirective}
|
|
5820
|
-
*/
|
|
5821
|
-
class HasPermissionDirective {
|
|
5822
|
-
el;
|
|
5823
|
-
renderer;
|
|
5824
|
-
sessionService;
|
|
5825
|
-
/**
|
|
5826
|
-
* The required permission(s) to display the element.
|
|
5827
|
-
* Accepts a single string or an array of strings.
|
|
5828
|
-
* @type {string | string[]}
|
|
5829
|
-
*/
|
|
5830
|
-
permission;
|
|
5831
|
-
/**
|
|
5832
|
-
* Creates an instance of HasPermissionDirective.
|
|
5833
|
-
* @param {ElementRef} el - Reference to the host element.
|
|
5834
|
-
* @param {Renderer2} renderer - Angular Renderer for DOM manipulation.
|
|
5835
|
-
* @param {SessionService} sessionService - Service to retrieve user permissions.
|
|
5836
|
-
*/
|
|
5837
|
-
constructor(el, renderer, sessionService) {
|
|
5838
|
-
this.el = el;
|
|
5839
|
-
this.renderer = renderer;
|
|
5840
|
-
this.sessionService = sessionService;
|
|
5841
|
-
}
|
|
5842
|
-
/**
|
|
5843
|
-
* Lifecycle hook that is called when input properties change.
|
|
5844
|
-
* @param {SimpleChanges} changes - The changes in input properties.
|
|
5845
|
-
*/
|
|
5846
|
-
ngOnChanges(changes) {
|
|
5847
|
-
if (changes['permission']) {
|
|
5848
|
-
this.checkPermission();
|
|
5849
|
-
}
|
|
5850
|
-
}
|
|
5851
|
-
/**
|
|
5852
|
-
* Checks if the user has the required permission(s).
|
|
5853
|
-
* Hides the element if the permission is not found.
|
|
5854
|
-
*/
|
|
5855
|
-
checkPermission() {
|
|
5856
|
-
// If no permission is required (empty string, null, or undefined), show the element
|
|
5857
|
-
if (!this.permission || this.permission === '' || (Array.isArray(this.permission) && this.permission.length === 0)) {
|
|
5858
|
-
this.renderer.removeStyle(this.el.nativeElement, 'display');
|
|
5859
|
-
return;
|
|
5860
|
-
}
|
|
5861
|
-
const userPermissionsObjects = this.sessionService.getUserPermissions();
|
|
5862
|
-
const userPermissionNames = userPermissionsObjects?.map((perm) => perm.name) || [];
|
|
5863
|
-
const requiredPermissions = Array.isArray(this.permission)
|
|
5864
|
-
? this.permission
|
|
5865
|
-
: [this.permission];
|
|
5866
|
-
const hasPermission = requiredPermissions.some(permission => userPermissionNames.includes(permission));
|
|
5867
|
-
if (!hasPermission) {
|
|
5868
|
-
this.renderer.setStyle(this.el.nativeElement, 'display', 'none');
|
|
5869
|
-
}
|
|
5870
|
-
else {
|
|
5871
|
-
this.renderer.removeStyle(this.el.nativeElement, 'display');
|
|
5872
|
-
}
|
|
5873
|
-
}
|
|
5874
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HasPermissionDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: SessionService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5875
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.14", type: HasPermissionDirective, isStandalone: false, selector: "[permission]", inputs: { permission: "permission" }, usesOnChanges: true, ngImport: i0 });
|
|
5876
|
-
}
|
|
5877
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HasPermissionDirective, decorators: [{
|
|
5878
|
-
type: Directive,
|
|
5879
|
-
args: [{
|
|
5880
|
-
selector: '[permission]',
|
|
5881
|
-
standalone: false
|
|
5882
|
-
}]
|
|
5883
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: SessionService }], propDecorators: { permission: [{
|
|
5884
|
-
type: Input
|
|
5885
|
-
}] } });
|
|
5886
|
-
|
|
5887
5771
|
/**
|
|
5888
5772
|
* Component for displaying document history in a timeline format.
|
|
5889
5773
|
*/
|
|
@@ -5997,33 +5881,32 @@ class DocumentHistoryComponent {
|
|
|
5997
5881
|
*/
|
|
5998
5882
|
getEventCardClass(label) {
|
|
5999
5883
|
const lowerLabel = label.toLowerCase();
|
|
6000
|
-
if (lowerLabel.includes(
|
|
6001
|
-
return
|
|
5884
|
+
if (lowerLabel.includes(SHARED.REQUESTED)) {
|
|
5885
|
+
return SHARED.EVENT_REQUESTED;
|
|
6002
5886
|
}
|
|
6003
|
-
else if (lowerLabel.includes(
|
|
6004
|
-
return
|
|
5887
|
+
else if (lowerLabel.includes(SHARED.ACCEPTED) || lowerLabel.includes(SHARED.UPLOADED)) {
|
|
5888
|
+
return SHARED.EVENT_ACCEPTED;
|
|
6005
5889
|
}
|
|
6006
|
-
else if (lowerLabel.includes(
|
|
6007
|
-
return
|
|
5890
|
+
else if (lowerLabel.includes(SHARED.REJECTED)) {
|
|
5891
|
+
return SHARED.EVENT_REJECTED;
|
|
6008
5892
|
}
|
|
6009
|
-
return
|
|
5893
|
+
return SHARED.EVENT_DEFAULT;
|
|
6010
5894
|
}
|
|
6011
5895
|
/**
|
|
6012
5896
|
* Get CSS class for event icon based on action type
|
|
6013
5897
|
*/
|
|
6014
5898
|
getEventIconClass(label) {
|
|
6015
5899
|
const lowerLabel = label.toLowerCase();
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
return 'icon-requested';
|
|
5900
|
+
if (lowerLabel.includes(SHARED.REQUESTED)) {
|
|
5901
|
+
return SHARED.ICON_REQUESTED;
|
|
6019
5902
|
}
|
|
6020
|
-
else if (lowerLabel.includes(
|
|
6021
|
-
return
|
|
5903
|
+
else if (lowerLabel.includes(SHARED.ACCEPTED) || lowerLabel.includes(SHARED.UPLOADED)) {
|
|
5904
|
+
return SHARED.ICON_ACCEPTED;
|
|
6022
5905
|
}
|
|
6023
|
-
else if (lowerLabel.includes(
|
|
6024
|
-
return
|
|
5906
|
+
else if (lowerLabel.includes(SHARED.REJECTED)) {
|
|
5907
|
+
return SHARED.ICON_REJECTED;
|
|
6025
5908
|
}
|
|
6026
|
-
return
|
|
5909
|
+
return SHARED.ICON_DEFAULT;
|
|
6027
5910
|
}
|
|
6028
5911
|
/**
|
|
6029
5912
|
* Get the appropriate icon for the event
|
|
@@ -6032,19 +5915,19 @@ class DocumentHistoryComponent {
|
|
|
6032
5915
|
*/
|
|
6033
5916
|
getEventIcon(label) {
|
|
6034
5917
|
const lowerLabel = label.toLowerCase();
|
|
6035
|
-
if (lowerLabel.includes(
|
|
6036
|
-
return
|
|
5918
|
+
if (lowerLabel.includes(SHARED.UPLOADED)) {
|
|
5919
|
+
return SHARED.ICON_CHECK_CIRCLE;
|
|
6037
5920
|
}
|
|
6038
|
-
else if (lowerLabel.includes(
|
|
6039
|
-
return
|
|
5921
|
+
else if (lowerLabel.includes(SHARED.REQUESTED)) {
|
|
5922
|
+
return SHARED.ICON_FOLDER_PLUS;
|
|
6040
5923
|
}
|
|
6041
|
-
else if (lowerLabel.includes(
|
|
6042
|
-
return
|
|
5924
|
+
else if (lowerLabel.includes(SHARED.ACCEPTED) || lowerLabel.includes(SHARED.APPROVED)) {
|
|
5925
|
+
return SHARED.ICON_CHECK_CIRCLE;
|
|
6043
5926
|
}
|
|
6044
|
-
else if (lowerLabel.includes(
|
|
6045
|
-
return
|
|
5927
|
+
else if (lowerLabel.includes(SHARED.REJECTED)) {
|
|
5928
|
+
return SHARED.ICON_TIMES;
|
|
6046
5929
|
}
|
|
6047
|
-
return
|
|
5930
|
+
return SHARED.ICON_FILE;
|
|
6048
5931
|
}
|
|
6049
5932
|
/**
|
|
6050
5933
|
* Toggle the actions dropdown menu
|
|
@@ -6067,7 +5950,7 @@ class DocumentHistoryComponent {
|
|
|
6067
5950
|
const documentName = this.selectedDocument?.docName || 'this document';
|
|
6068
5951
|
ConfirmationDialogComponent.confirmDelete(this.confirmationService, documentName, () => {
|
|
6069
5952
|
const deleteAction = this.documentActionsService.createDeleteAction();
|
|
6070
|
-
this.documentViewerService.handleDocumentAction(deleteAction, this.contextId);
|
|
5953
|
+
this.documentViewerService.handleDocumentAction(deleteAction, this.selectedDocument?.parentDocumentId ?? this.contextId);
|
|
6071
5954
|
this.deleteTaskRequested.emit();
|
|
6072
5955
|
}, () => { });
|
|
6073
5956
|
}
|
|
@@ -6125,7 +6008,7 @@ class DocumentHistoryComponent {
|
|
|
6125
6008
|
*/
|
|
6126
6009
|
shouldHideItem(item) {
|
|
6127
6010
|
return this.selectedDocument?.isUploaded &&
|
|
6128
|
-
item.label.toLowerCase().includes(
|
|
6011
|
+
item.label.toLowerCase().includes(SHARED.REQUESTED);
|
|
6129
6012
|
}
|
|
6130
6013
|
/**
|
|
6131
6014
|
* Listen for clicks outside the dropdown to close it
|
|
@@ -6140,11 +6023,11 @@ class DocumentHistoryComponent {
|
|
|
6140
6023
|
}
|
|
6141
6024
|
}
|
|
6142
6025
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHistoryComponent, deps: [{ token: DocumentHistoryService }, { token: DocumentViewerService }, { token: DocumentActionsService }, { token: i3.ConfirmationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
6143
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentHistoryComponent, isStandalone: false, selector: "document-history", inputs: { historyData: "historyData", showHistory: "showHistory", contextId: "contextId", selectedDocument: "selectedDocument" }, outputs: { deleteTaskRequested: "deleteTaskRequested", documentSelected: "documentSelected" }, host: { listeners: { "document:click": "onDocumentClickOutside($event)" } }, usesOnChanges: true, ngImport: i0, template: "<div class=\"document-review-container\" *ngIf=\"showHistory && historyData.length > 0\">\r\n <!-- Header Section -->\r\n <div class=\"review-header\">\r\n <h2 class=\"review-title\">Document Review</h2>\r\n <div class=\"actions-menu\" *ngIf=\"selectedDocument?.isUploaded || selectedDocument?.status == 'Approved'\">\r\n <button class=\"actions-btn\" (click)=\"toggleActionsMenu()\" [class.active]=\"showActionsMenu\">\r\n Actions\r\n <i class=\"pi pi-chevron-down\" [class.rotated]=\"showActionsMenu\"></i>\r\n </button>\r\n\r\n <!-- Actions Dropdown Menu -->\r\n <div class=\"actions-dropdown\" *ngIf=\"showActionsMenu\" (click)=\"$event.stopPropagation()\">\r\n <div class=\"dropdown-item\" *ngIf=\"selectedDocument?.status == 'Approved'\">\r\n <ng-content [select]=\"'action-launcher'\"></ng-content>\r\n </div>\r\n <div *ngIf=\"selectedDocument?.isUploaded\" [permission]=\"'documents-deleteDocumentByDocumentId'\" class=\"dropdown-item\" (click)=\"onDeleteTask()\">\r\n <span>Delete task</span>\r\n </div>\r\n </div>\r\n \r\n </div>\r\n </div>\r\n\r\n <!-- Document Actions Component - Below Header -->\r\n <div class=\"document-actions-section\">\r\n <ng-content select=\"[actions-component]\"></ng-content>\r\n </div>\r\n\r\n\r\n <!-- Alerts Section -->\r\n <!-- <div class=\"alerts-section\">\r\n <div class=\"alert-card\">\r\n <div class=\"alert-header\">\r\n <i class=\"pi pi-exclamation-triangle alert-icon\"></i>\r\n <span class=\"alert-text\">Alerts</span>\r\n <div class=\"alert-badge\">\r\n <span class=\"alert-count\">{{ getAlertCount() }}</span>\r\n <i class=\"pi pi-chevron-right\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div> -->\r\n\r\n <!-- Timeline Section -->\r\n <div class=\"timeline-section\">\r\n <h3 class=\"timeline-title\">Timeline</h3>\r\n <div class=\"timeline-container\">\r\n <div class=\"timeline-item\" *ngFor=\"let section of processedHistoryData\">\r\n <ng-container *ngFor=\"let item of section.list; let i = index\">\r\n <div class=\"timeline-event mb-2\" *ngIf=\"!item.shouldHide\">\r\n <div class=\"event-card\" [ngClass]=\"item.eventCardClass\">\r\n <!-- Event Header -->\r\n <div class=\"event-header\">\r\n <div class=\"event-info\">\r\n <i [class]=\"item.eventIcon\"></i>\r\n <span class=\"event-label\">{{ item.label }}</span>\r\n </div>\r\n <div class=\"event-timestamp\">{{ item.dateTime }}</div>\r\n </div>\r\n <!-- User Information -->\r\n <div class=\"event-user mb-2\">\r\n <span class=\"user-name\">{{ item.userName }}</span>\r\n <span class=\"user-role\">({{ item.userRole }})</span>\r\n </div>\r\n <!-- Event Description -->\r\n <div class=\"event-description\" *ngIf=\"item.requestDescription\">\r\n <ul class=\"event-description-list\" *ngIf=\"item.label.toLowerCase().includes('requested')\">\r\n <li class=\"event-description-item\">{{ item.requestDescription }}</li>\r\n </ul>\r\n <p *ngIf=\"!item.label.toLowerCase().includes('requested')\">{{ item.requestDescription }}</p>\r\n </div>\r\n\r\n <!-- Document Upload Cards -->\r\n <div class=\"document-uploads\" *ngIf=\"item.documentList && item.documentList.length > 0\">\r\n <div class=\"uploaded-documents\">\r\n <div class=\"document-card\" *ngFor=\"let doc of item.documentList\" (click)=\"onDocumentClick(doc)\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <span class=\"document-name\">{{ doc.docName }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- <ng-content [select]=\"'actions-component'\"></ng-content> -->\r\n</div>", styles: [".document-review-container{border-radius:8px;max-height:100%;overflow-y:auto;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.document-review-container .review-header{display:flex;justify-content:space-between;align-items:center;padding-bottom:1rem;border-bottom:1px solid #e5e7eb}.document-review-container .review-header .review-title{font-size:1.5rem;font-weight:600;color:#1f2937;margin:0}.document-review-container .review-header .actions-menu{position:relative}.document-review-container .review-header .actions-menu .actions-btn{background:#fff;border:1px solid #d1d5db;border-radius:6px;padding:.5rem 1rem;color:#374151;font-size:.875rem;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .2s}.document-review-container .review-header .actions-menu .actions-btn:hover{background:#f9fafb}.document-review-container .review-header .actions-menu .actions-btn.active{background:#f3f4f6;border-color:#9ca3af}.document-review-container .review-header .actions-menu .actions-btn i{font-size:.75rem;transition:transform .2s}.document-review-container .review-header .actions-menu .actions-btn i.rotated{transform:rotate(180deg)}.document-review-container .review-header .actions-menu .actions-dropdown{position:absolute;top:100%;right:0;background:#fff;border:1px solid #d1d5db;border-radius:8px;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f;z-index:1000;min-width:180px;margin-top:.25rem}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item{padding:.75rem 1rem;cursor:pointer;color:#374151;font-size:.875rem;border-bottom:1px solid #f3f4f6;transition:background-color .2s}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:last-child{border-bottom:none;border-radius:0 0 8px 8px}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:first-child{border-radius:8px 8px 0 0}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:hover{background:#f9fafb}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item span{display:block}.document-review-container ::ng-deep document-actions{margin-bottom:1.5rem}.document-review-container ::ng-deep document-actions .actions-card{margin:0;width:100%}.document-review-container .document-actions-section{padding:1rem 0}.document-review-container .alerts-section{margin-bottom:2rem}.document-review-container .alerts-section .alert-card{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:1rem}.document-review-container .alerts-section .alert-card .alert-header{display:flex;align-items:center;gap:.75rem}.document-review-container .alerts-section .alert-card .alert-header .alert-icon{color:#ef4444;font-size:1.25rem}.document-review-container .alerts-section .alert-card .alert-header .alert-text{font-weight:500;color:#1f2937;font-size:1rem}.document-review-container .alerts-section .alert-card .alert-header .alert-badge{margin-left:auto;display:flex;align-items:center;gap:.5rem;background:#ef4444;color:#fff;border-radius:50%;width:24px;height:24px;justify-content:center;position:relative}.document-review-container .alerts-section .alert-card .alert-header .alert-badge .alert-count{font-size:.75rem;font-weight:600}.document-review-container .alerts-section .alert-card .alert-header .alert-badge i{position:absolute;right:-8px;font-size:.75rem;color:#ef4444;background:#fff;border-radius:50%;width:16px;height:16px;display:flex;align-items:center;justify-content:center}.document-review-container .timeline-section .timeline-title{font-size:1.25rem;font-weight:600;color:#1f2937;margin:0 0 1.5rem}.document-review-container .timeline-section .timeline-container .timeline-item{margin-bottom:1.5rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:1.25rem;position:relative}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info{display:flex;align-items:center;gap:.75rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon{width:25px;height:25px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon i{font-size:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-requested{background:#3b82f6}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-accepted{background:#10b981}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-rejected{background:#ef4444}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-default{background:#6b7280}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-label{font-weight:600;color:#1f2937;font-size:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-timestamp{color:#6b7280;font-size:.875rem;font-weight:500}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-description{margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-description p{color:#374151;line-height:1.5;margin:0;font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads{margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents{display:flex;flex-direction:column;gap:.75rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:.5rem;display:flex;align-items:center;gap:.75rem;cursor:pointer;transition:all .2s ease}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card:hover{background:#e2e8f0;border-color:#3b82f6;transform:translateY(-1px);box-shadow:0 2px 4px #0000001a}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card:active{transform:translateY(0);box-shadow:0 1px 2px #0000001a}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card .document-icon{color:#3b82f6;font-size:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card .document-name{color:#1f2937;font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user{font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user .user-name{color:rgb(75,85,99,var(--tw-text-opacity, 1));font-weight:500}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user .user-role{color:#6b7280;margin-left:.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-requested{border-left:4px solid #3b82f6;background:#dbeafe;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-accepted{border-left:4px solid #10b981;background:#dcfce7;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-rejected{border-left:4px solid #ef4444;background:#fee2e2;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-default{border-left:4px solid #6b7280}@media (max-width: 768px){.document-review-container{padding:1rem}.document-review-container .review-header{flex-direction:column;gap:1rem;align-items:flex-start}.document-review-container .review-header .actions-menu{align-self:flex-end}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header{flex-direction:column;align-items:flex-start;gap:.5rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-timestamp{align-self:flex-end}}\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: "directive", type: HasPermissionDirective, selector: "[permission]", inputs: ["permission"] }] });
|
|
6026
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentHistoryComponent, isStandalone: false, selector: "document-history", inputs: { historyData: "historyData", showHistory: "showHistory", contextId: "contextId", selectedDocument: "selectedDocument" }, outputs: { deleteTaskRequested: "deleteTaskRequested", documentSelected: "documentSelected" }, host: { listeners: { "document:click": "onDocumentClickOutside($event)" } }, usesOnChanges: true, ngImport: i0, template: "<div class=\"document-review-container\" *ngIf=\"showHistory && historyData.length > 0\">\r\n <!-- Header Section -->\r\n <div class=\"review-header\">\r\n <h2 class=\"review-title\">Document Review</h2>\r\n <div class=\"actions-menu\" *ngIf=\"selectedDocument?.isUploaded || selectedDocument?.status == 'Approved'\">\r\n <button class=\"actions-btn\" (click)=\"toggleActionsMenu()\" [class.active]=\"showActionsMenu\">\r\n Actions\r\n <i class=\"pi pi-chevron-down\" [class.rotated]=\"showActionsMenu\"></i>\r\n </button>\r\n\r\n <!-- Actions Dropdown Menu -->\r\n <div class=\"actions-dropdown\" *ngIf=\"showActionsMenu\" (click)=\"$event.stopPropagation()\">\r\n <div class=\"dropdown-item\" *ngIf=\"selectedDocument?.status == 'Approved'\">\r\n <ng-content [select]=\"'action-launcher'\"></ng-content>\r\n </div>\r\n <div *ngIf=\"selectedDocument?.isUploaded\" class=\"dropdown-item\" (click)=\"onDeleteTask()\">\r\n <span>Delete task</span>\r\n </div>\r\n </div>\r\n \r\n </div>\r\n </div>\r\n\r\n <!-- Document Actions Component - Below Header -->\r\n <div class=\"document-actions-section\">\r\n <ng-content select=\"[actions-component]\"></ng-content>\r\n </div>\r\n\r\n\r\n <!-- Alerts Section -->\r\n <!-- <div class=\"alerts-section\">\r\n <div class=\"alert-card\">\r\n <div class=\"alert-header\">\r\n <i class=\"pi pi-exclamation-triangle alert-icon\"></i>\r\n <span class=\"alert-text\">Alerts</span>\r\n <div class=\"alert-badge\">\r\n <span class=\"alert-count\">{{ getAlertCount() }}</span>\r\n <i class=\"pi pi-chevron-right\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div> -->\r\n\r\n <!-- Timeline Section -->\r\n <div class=\"timeline-section\">\r\n <h3 class=\"timeline-title\">Timeline</h3>\r\n <div class=\"timeline-container\">\r\n <div class=\"timeline-item\" *ngFor=\"let section of processedHistoryData\">\r\n <ng-container *ngFor=\"let item of section.list; let i = index\">\r\n <div class=\"timeline-event mb-2\" *ngIf=\"!item.shouldHide\">\r\n <div class=\"event-card\" [ngClass]=\"item.eventCardClass\">\r\n <!-- Event Header -->\r\n <div class=\"event-header\">\r\n <div class=\"event-info\">\r\n <i [class]=\"item.eventIcon\"></i>\r\n <span class=\"event-label\">{{ item.label }}</span>\r\n </div>\r\n <div class=\"event-timestamp\">{{ item.dateTime }}</div>\r\n </div>\r\n <!-- User Information -->\r\n <div class=\"event-user mb-2\">\r\n <span class=\"user-name\">{{ item.userName }}</span>\r\n <span class=\"user-role\">({{ item.userRole }})</span>\r\n </div>\r\n <!-- Event Description -->\r\n <div class=\"event-description\" *ngIf=\"item.requestDescription\">\r\n <ul class=\"event-description-list\" *ngIf=\"item.label.toLowerCase().includes('requested')\">\r\n <li class=\"event-description-item\">{{ item.requestDescription }}</li>\r\n </ul>\r\n <p *ngIf=\"!item.label.toLowerCase().includes('requested')\">{{ item.requestDescription }}</p>\r\n </div>\r\n\r\n <!-- Document Upload Cards -->\r\n <div class=\"document-uploads\" *ngIf=\"item.documentList && item.documentList.length > 0\">\r\n <div class=\"uploaded-documents\">\r\n <div class=\"document-card\" *ngFor=\"let doc of item.documentList\" (click)=\"onDocumentClick(doc)\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <span class=\"document-name\">{{ doc.docName }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- <ng-content [select]=\"'actions-component'\"></ng-content> -->\r\n</div>", styles: [".document-review-container{border-radius:8px;max-height:100%;overflow-y:auto;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.document-review-container .review-header{display:flex;justify-content:space-between;align-items:center;padding-bottom:1rem;border-bottom:1px solid #e5e7eb}.document-review-container .review-header .review-title{font-size:1.5rem;font-weight:600;color:#1f2937;margin:0}.document-review-container .review-header .actions-menu{position:relative}.document-review-container .review-header .actions-menu .actions-btn{background:#fff;border:1px solid #d1d5db;border-radius:6px;padding:.5rem 1rem;color:#374151;font-size:.875rem;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .2s}.document-review-container .review-header .actions-menu .actions-btn:hover{background:#f9fafb}.document-review-container .review-header .actions-menu .actions-btn.active{background:#f3f4f6;border-color:#9ca3af}.document-review-container .review-header .actions-menu .actions-btn i{font-size:.75rem;transition:transform .2s}.document-review-container .review-header .actions-menu .actions-btn i.rotated{transform:rotate(180deg)}.document-review-container .review-header .actions-menu .actions-dropdown{position:absolute;top:100%;right:0;background:#fff;border:1px solid #d1d5db;border-radius:8px;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f;z-index:1000;min-width:180px;margin-top:.25rem}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item{padding:.75rem 1rem;cursor:pointer;color:#374151;font-size:.875rem;border-bottom:1px solid #f3f4f6;transition:background-color .2s}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:last-child{border-bottom:none;border-radius:0 0 8px 8px}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:first-child{border-radius:8px 8px 0 0}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:hover{background:#f9fafb}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item span{display:block}.document-review-container ::ng-deep document-actions{margin-bottom:1.5rem}.document-review-container ::ng-deep document-actions .actions-card{margin:0;width:100%}.document-review-container .document-actions-section{padding:1rem 0}.document-review-container .alerts-section{margin-bottom:2rem}.document-review-container .alerts-section .alert-card{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:1rem}.document-review-container .alerts-section .alert-card .alert-header{display:flex;align-items:center;gap:.75rem}.document-review-container .alerts-section .alert-card .alert-header .alert-icon{color:#ef4444;font-size:1.25rem}.document-review-container .alerts-section .alert-card .alert-header .alert-text{font-weight:500;color:#1f2937;font-size:1rem}.document-review-container .alerts-section .alert-card .alert-header .alert-badge{margin-left:auto;display:flex;align-items:center;gap:.5rem;background:#ef4444;color:#fff;border-radius:50%;width:24px;height:24px;justify-content:center;position:relative}.document-review-container .alerts-section .alert-card .alert-header .alert-badge .alert-count{font-size:.75rem;font-weight:600}.document-review-container .alerts-section .alert-card .alert-header .alert-badge i{position:absolute;right:-8px;font-size:.75rem;color:#ef4444;background:#fff;border-radius:50%;width:16px;height:16px;display:flex;align-items:center;justify-content:center}.document-review-container .timeline-section .timeline-title{font-size:1.25rem;font-weight:600;color:#1f2937;margin:0 0 1.5rem}.document-review-container .timeline-section .timeline-container .timeline-item{margin-bottom:1.5rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:1.25rem;position:relative}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info{display:flex;align-items:center;gap:.75rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon{width:25px;height:25px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon i{font-size:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-requested{background:#3b82f6}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-accepted{background:#10b981}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-rejected{background:#ef4444}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-default{background:#6b7280}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-label{font-weight:600;color:#1f2937;font-size:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-timestamp{color:#6b7280;font-size:.875rem;font-weight:500}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-description{margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-description p{color:#374151;line-height:1.5;margin:0;font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads{margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents{display:flex;flex-direction:column;gap:.75rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:.5rem;display:flex;align-items:center;gap:.75rem;cursor:pointer;transition:all .2s ease}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card:hover{background:#e2e8f0;border-color:#3b82f6;transform:translateY(-1px);box-shadow:0 2px 4px #0000001a}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card:active{transform:translateY(0);box-shadow:0 1px 2px #0000001a}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card .document-icon{color:#3b82f6;font-size:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card .document-name{color:#1f2937;font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user{font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user .user-name{color:rgb(75,85,99,var(--tw-text-opacity, 1));font-weight:500}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user .user-role{color:#6b7280;margin-left:.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-requested{border-left:4px solid #3b82f6;background:#dbeafe;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-accepted{border-left:4px solid #10b981;background:#dcfce7;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-rejected{border-left:4px solid #ef4444;background:#fee2e2;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-default{border-left:4px solid #6b7280}@media (max-width: 768px){.document-review-container{padding:1rem}.document-review-container .review-header{flex-direction:column;gap:1rem;align-items:flex-start}.document-review-container .review-header .actions-menu{align-self:flex-end}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header{flex-direction:column;align-items:flex-start;gap:.5rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-timestamp{align-self:flex-end}}\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"] }] });
|
|
6144
6027
|
}
|
|
6145
6028
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHistoryComponent, decorators: [{
|
|
6146
6029
|
type: Component,
|
|
6147
|
-
args: [{ selector: 'document-history', standalone: false, template: "<div class=\"document-review-container\" *ngIf=\"showHistory && historyData.length > 0\">\r\n <!-- Header Section -->\r\n <div class=\"review-header\">\r\n <h2 class=\"review-title\">Document Review</h2>\r\n <div class=\"actions-menu\" *ngIf=\"selectedDocument?.isUploaded || selectedDocument?.status == 'Approved'\">\r\n <button class=\"actions-btn\" (click)=\"toggleActionsMenu()\" [class.active]=\"showActionsMenu\">\r\n Actions\r\n <i class=\"pi pi-chevron-down\" [class.rotated]=\"showActionsMenu\"></i>\r\n </button>\r\n\r\n <!-- Actions Dropdown Menu -->\r\n <div class=\"actions-dropdown\" *ngIf=\"showActionsMenu\" (click)=\"$event.stopPropagation()\">\r\n <div class=\"dropdown-item\" *ngIf=\"selectedDocument?.status == 'Approved'\">\r\n <ng-content [select]=\"'action-launcher'\"></ng-content>\r\n </div>\r\n <div *ngIf=\"selectedDocument?.isUploaded\" [permission]=\"'documents-deleteDocumentByDocumentId'\" class=\"dropdown-item\" (click)=\"onDeleteTask()\">\r\n <span>Delete task</span>\r\n </div>\r\n </div>\r\n \r\n </div>\r\n </div>\r\n\r\n <!-- Document Actions Component - Below Header -->\r\n <div class=\"document-actions-section\">\r\n <ng-content select=\"[actions-component]\"></ng-content>\r\n </div>\r\n\r\n\r\n <!-- Alerts Section -->\r\n <!-- <div class=\"alerts-section\">\r\n <div class=\"alert-card\">\r\n <div class=\"alert-header\">\r\n <i class=\"pi pi-exclamation-triangle alert-icon\"></i>\r\n <span class=\"alert-text\">Alerts</span>\r\n <div class=\"alert-badge\">\r\n <span class=\"alert-count\">{{ getAlertCount() }}</span>\r\n <i class=\"pi pi-chevron-right\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div> -->\r\n\r\n <!-- Timeline Section -->\r\n <div class=\"timeline-section\">\r\n <h3 class=\"timeline-title\">Timeline</h3>\r\n <div class=\"timeline-container\">\r\n <div class=\"timeline-item\" *ngFor=\"let section of processedHistoryData\">\r\n <ng-container *ngFor=\"let item of section.list; let i = index\">\r\n <div class=\"timeline-event mb-2\" *ngIf=\"!item.shouldHide\">\r\n <div class=\"event-card\" [ngClass]=\"item.eventCardClass\">\r\n <!-- Event Header -->\r\n <div class=\"event-header\">\r\n <div class=\"event-info\">\r\n <i [class]=\"item.eventIcon\"></i>\r\n <span class=\"event-label\">{{ item.label }}</span>\r\n </div>\r\n <div class=\"event-timestamp\">{{ item.dateTime }}</div>\r\n </div>\r\n <!-- User Information -->\r\n <div class=\"event-user mb-2\">\r\n <span class=\"user-name\">{{ item.userName }}</span>\r\n <span class=\"user-role\">({{ item.userRole }})</span>\r\n </div>\r\n <!-- Event Description -->\r\n <div class=\"event-description\" *ngIf=\"item.requestDescription\">\r\n <ul class=\"event-description-list\" *ngIf=\"item.label.toLowerCase().includes('requested')\">\r\n <li class=\"event-description-item\">{{ item.requestDescription }}</li>\r\n </ul>\r\n <p *ngIf=\"!item.label.toLowerCase().includes('requested')\">{{ item.requestDescription }}</p>\r\n </div>\r\n\r\n <!-- Document Upload Cards -->\r\n <div class=\"document-uploads\" *ngIf=\"item.documentList && item.documentList.length > 0\">\r\n <div class=\"uploaded-documents\">\r\n <div class=\"document-card\" *ngFor=\"let doc of item.documentList\" (click)=\"onDocumentClick(doc)\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <span class=\"document-name\">{{ doc.docName }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- <ng-content [select]=\"'actions-component'\"></ng-content> -->\r\n</div>", styles: [".document-review-container{border-radius:8px;max-height:100%;overflow-y:auto;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.document-review-container .review-header{display:flex;justify-content:space-between;align-items:center;padding-bottom:1rem;border-bottom:1px solid #e5e7eb}.document-review-container .review-header .review-title{font-size:1.5rem;font-weight:600;color:#1f2937;margin:0}.document-review-container .review-header .actions-menu{position:relative}.document-review-container .review-header .actions-menu .actions-btn{background:#fff;border:1px solid #d1d5db;border-radius:6px;padding:.5rem 1rem;color:#374151;font-size:.875rem;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .2s}.document-review-container .review-header .actions-menu .actions-btn:hover{background:#f9fafb}.document-review-container .review-header .actions-menu .actions-btn.active{background:#f3f4f6;border-color:#9ca3af}.document-review-container .review-header .actions-menu .actions-btn i{font-size:.75rem;transition:transform .2s}.document-review-container .review-header .actions-menu .actions-btn i.rotated{transform:rotate(180deg)}.document-review-container .review-header .actions-menu .actions-dropdown{position:absolute;top:100%;right:0;background:#fff;border:1px solid #d1d5db;border-radius:8px;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f;z-index:1000;min-width:180px;margin-top:.25rem}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item{padding:.75rem 1rem;cursor:pointer;color:#374151;font-size:.875rem;border-bottom:1px solid #f3f4f6;transition:background-color .2s}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:last-child{border-bottom:none;border-radius:0 0 8px 8px}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:first-child{border-radius:8px 8px 0 0}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:hover{background:#f9fafb}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item span{display:block}.document-review-container ::ng-deep document-actions{margin-bottom:1.5rem}.document-review-container ::ng-deep document-actions .actions-card{margin:0;width:100%}.document-review-container .document-actions-section{padding:1rem 0}.document-review-container .alerts-section{margin-bottom:2rem}.document-review-container .alerts-section .alert-card{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:1rem}.document-review-container .alerts-section .alert-card .alert-header{display:flex;align-items:center;gap:.75rem}.document-review-container .alerts-section .alert-card .alert-header .alert-icon{color:#ef4444;font-size:1.25rem}.document-review-container .alerts-section .alert-card .alert-header .alert-text{font-weight:500;color:#1f2937;font-size:1rem}.document-review-container .alerts-section .alert-card .alert-header .alert-badge{margin-left:auto;display:flex;align-items:center;gap:.5rem;background:#ef4444;color:#fff;border-radius:50%;width:24px;height:24px;justify-content:center;position:relative}.document-review-container .alerts-section .alert-card .alert-header .alert-badge .alert-count{font-size:.75rem;font-weight:600}.document-review-container .alerts-section .alert-card .alert-header .alert-badge i{position:absolute;right:-8px;font-size:.75rem;color:#ef4444;background:#fff;border-radius:50%;width:16px;height:16px;display:flex;align-items:center;justify-content:center}.document-review-container .timeline-section .timeline-title{font-size:1.25rem;font-weight:600;color:#1f2937;margin:0 0 1.5rem}.document-review-container .timeline-section .timeline-container .timeline-item{margin-bottom:1.5rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:1.25rem;position:relative}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info{display:flex;align-items:center;gap:.75rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon{width:25px;height:25px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon i{font-size:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-requested{background:#3b82f6}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-accepted{background:#10b981}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-rejected{background:#ef4444}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-default{background:#6b7280}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-label{font-weight:600;color:#1f2937;font-size:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-timestamp{color:#6b7280;font-size:.875rem;font-weight:500}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-description{margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-description p{color:#374151;line-height:1.5;margin:0;font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads{margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents{display:flex;flex-direction:column;gap:.75rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:.5rem;display:flex;align-items:center;gap:.75rem;cursor:pointer;transition:all .2s ease}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card:hover{background:#e2e8f0;border-color:#3b82f6;transform:translateY(-1px);box-shadow:0 2px 4px #0000001a}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card:active{transform:translateY(0);box-shadow:0 1px 2px #0000001a}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card .document-icon{color:#3b82f6;font-size:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card .document-name{color:#1f2937;font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user{font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user .user-name{color:rgb(75,85,99,var(--tw-text-opacity, 1));font-weight:500}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user .user-role{color:#6b7280;margin-left:.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-requested{border-left:4px solid #3b82f6;background:#dbeafe;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-accepted{border-left:4px solid #10b981;background:#dcfce7;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-rejected{border-left:4px solid #ef4444;background:#fee2e2;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-default{border-left:4px solid #6b7280}@media (max-width: 768px){.document-review-container{padding:1rem}.document-review-container .review-header{flex-direction:column;gap:1rem;align-items:flex-start}.document-review-container .review-header .actions-menu{align-self:flex-end}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header{flex-direction:column;align-items:flex-start;gap:.5rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-timestamp{align-self:flex-end}}\n"] }]
|
|
6030
|
+
args: [{ selector: 'document-history', standalone: false, template: "<div class=\"document-review-container\" *ngIf=\"showHistory && historyData.length > 0\">\r\n <!-- Header Section -->\r\n <div class=\"review-header\">\r\n <h2 class=\"review-title\">Document Review</h2>\r\n <div class=\"actions-menu\" *ngIf=\"selectedDocument?.isUploaded || selectedDocument?.status == 'Approved'\">\r\n <button class=\"actions-btn\" (click)=\"toggleActionsMenu()\" [class.active]=\"showActionsMenu\">\r\n Actions\r\n <i class=\"pi pi-chevron-down\" [class.rotated]=\"showActionsMenu\"></i>\r\n </button>\r\n\r\n <!-- Actions Dropdown Menu -->\r\n <div class=\"actions-dropdown\" *ngIf=\"showActionsMenu\" (click)=\"$event.stopPropagation()\">\r\n <div class=\"dropdown-item\" *ngIf=\"selectedDocument?.status == 'Approved'\">\r\n <ng-content [select]=\"'action-launcher'\"></ng-content>\r\n </div>\r\n <div *ngIf=\"selectedDocument?.isUploaded\" class=\"dropdown-item\" (click)=\"onDeleteTask()\">\r\n <span>Delete task</span>\r\n </div>\r\n </div>\r\n \r\n </div>\r\n </div>\r\n\r\n <!-- Document Actions Component - Below Header -->\r\n <div class=\"document-actions-section\">\r\n <ng-content select=\"[actions-component]\"></ng-content>\r\n </div>\r\n\r\n\r\n <!-- Alerts Section -->\r\n <!-- <div class=\"alerts-section\">\r\n <div class=\"alert-card\">\r\n <div class=\"alert-header\">\r\n <i class=\"pi pi-exclamation-triangle alert-icon\"></i>\r\n <span class=\"alert-text\">Alerts</span>\r\n <div class=\"alert-badge\">\r\n <span class=\"alert-count\">{{ getAlertCount() }}</span>\r\n <i class=\"pi pi-chevron-right\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div> -->\r\n\r\n <!-- Timeline Section -->\r\n <div class=\"timeline-section\">\r\n <h3 class=\"timeline-title\">Timeline</h3>\r\n <div class=\"timeline-container\">\r\n <div class=\"timeline-item\" *ngFor=\"let section of processedHistoryData\">\r\n <ng-container *ngFor=\"let item of section.list; let i = index\">\r\n <div class=\"timeline-event mb-2\" *ngIf=\"!item.shouldHide\">\r\n <div class=\"event-card\" [ngClass]=\"item.eventCardClass\">\r\n <!-- Event Header -->\r\n <div class=\"event-header\">\r\n <div class=\"event-info\">\r\n <i [class]=\"item.eventIcon\"></i>\r\n <span class=\"event-label\">{{ item.label }}</span>\r\n </div>\r\n <div class=\"event-timestamp\">{{ item.dateTime }}</div>\r\n </div>\r\n <!-- User Information -->\r\n <div class=\"event-user mb-2\">\r\n <span class=\"user-name\">{{ item.userName }}</span>\r\n <span class=\"user-role\">({{ item.userRole }})</span>\r\n </div>\r\n <!-- Event Description -->\r\n <div class=\"event-description\" *ngIf=\"item.requestDescription\">\r\n <ul class=\"event-description-list\" *ngIf=\"item.label.toLowerCase().includes('requested')\">\r\n <li class=\"event-description-item\">{{ item.requestDescription }}</li>\r\n </ul>\r\n <p *ngIf=\"!item.label.toLowerCase().includes('requested')\">{{ item.requestDescription }}</p>\r\n </div>\r\n\r\n <!-- Document Upload Cards -->\r\n <div class=\"document-uploads\" *ngIf=\"item.documentList && item.documentList.length > 0\">\r\n <div class=\"uploaded-documents\">\r\n <div class=\"document-card\" *ngFor=\"let doc of item.documentList\" (click)=\"onDocumentClick(doc)\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <span class=\"document-name\">{{ doc.docName }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- <ng-content [select]=\"'actions-component'\"></ng-content> -->\r\n</div>", styles: [".document-review-container{border-radius:8px;max-height:100%;overflow-y:auto;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.document-review-container .review-header{display:flex;justify-content:space-between;align-items:center;padding-bottom:1rem;border-bottom:1px solid #e5e7eb}.document-review-container .review-header .review-title{font-size:1.5rem;font-weight:600;color:#1f2937;margin:0}.document-review-container .review-header .actions-menu{position:relative}.document-review-container .review-header .actions-menu .actions-btn{background:#fff;border:1px solid #d1d5db;border-radius:6px;padding:.5rem 1rem;color:#374151;font-size:.875rem;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .2s}.document-review-container .review-header .actions-menu .actions-btn:hover{background:#f9fafb}.document-review-container .review-header .actions-menu .actions-btn.active{background:#f3f4f6;border-color:#9ca3af}.document-review-container .review-header .actions-menu .actions-btn i{font-size:.75rem;transition:transform .2s}.document-review-container .review-header .actions-menu .actions-btn i.rotated{transform:rotate(180deg)}.document-review-container .review-header .actions-menu .actions-dropdown{position:absolute;top:100%;right:0;background:#fff;border:1px solid #d1d5db;border-radius:8px;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f;z-index:1000;min-width:180px;margin-top:.25rem}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item{padding:.75rem 1rem;cursor:pointer;color:#374151;font-size:.875rem;border-bottom:1px solid #f3f4f6;transition:background-color .2s}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:last-child{border-bottom:none;border-radius:0 0 8px 8px}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:first-child{border-radius:8px 8px 0 0}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:hover{background:#f9fafb}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item span{display:block}.document-review-container ::ng-deep document-actions{margin-bottom:1.5rem}.document-review-container ::ng-deep document-actions .actions-card{margin:0;width:100%}.document-review-container .document-actions-section{padding:1rem 0}.document-review-container .alerts-section{margin-bottom:2rem}.document-review-container .alerts-section .alert-card{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:1rem}.document-review-container .alerts-section .alert-card .alert-header{display:flex;align-items:center;gap:.75rem}.document-review-container .alerts-section .alert-card .alert-header .alert-icon{color:#ef4444;font-size:1.25rem}.document-review-container .alerts-section .alert-card .alert-header .alert-text{font-weight:500;color:#1f2937;font-size:1rem}.document-review-container .alerts-section .alert-card .alert-header .alert-badge{margin-left:auto;display:flex;align-items:center;gap:.5rem;background:#ef4444;color:#fff;border-radius:50%;width:24px;height:24px;justify-content:center;position:relative}.document-review-container .alerts-section .alert-card .alert-header .alert-badge .alert-count{font-size:.75rem;font-weight:600}.document-review-container .alerts-section .alert-card .alert-header .alert-badge i{position:absolute;right:-8px;font-size:.75rem;color:#ef4444;background:#fff;border-radius:50%;width:16px;height:16px;display:flex;align-items:center;justify-content:center}.document-review-container .timeline-section .timeline-title{font-size:1.25rem;font-weight:600;color:#1f2937;margin:0 0 1.5rem}.document-review-container .timeline-section .timeline-container .timeline-item{margin-bottom:1.5rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:1.25rem;position:relative}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info{display:flex;align-items:center;gap:.75rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon{width:25px;height:25px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon i{font-size:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-requested{background:#3b82f6}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-accepted{background:#10b981}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-rejected{background:#ef4444}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-default{background:#6b7280}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-label{font-weight:600;color:#1f2937;font-size:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-timestamp{color:#6b7280;font-size:.875rem;font-weight:500}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-description{margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-description p{color:#374151;line-height:1.5;margin:0;font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads{margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents{display:flex;flex-direction:column;gap:.75rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:.5rem;display:flex;align-items:center;gap:.75rem;cursor:pointer;transition:all .2s ease}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card:hover{background:#e2e8f0;border-color:#3b82f6;transform:translateY(-1px);box-shadow:0 2px 4px #0000001a}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card:active{transform:translateY(0);box-shadow:0 1px 2px #0000001a}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card .document-icon{color:#3b82f6;font-size:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card .document-name{color:#1f2937;font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user{font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user .user-name{color:rgb(75,85,99,var(--tw-text-opacity, 1));font-weight:500}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user .user-role{color:#6b7280;margin-left:.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-requested{border-left:4px solid #3b82f6;background:#dbeafe;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-accepted{border-left:4px solid #10b981;background:#dcfce7;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-rejected{border-left:4px solid #ef4444;background:#fee2e2;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-default{border-left:4px solid #6b7280}@media (max-width: 768px){.document-review-container{padding:1rem}.document-review-container .review-header{flex-direction:column;gap:1rem;align-items:flex-start}.document-review-container .review-header .actions-menu{align-self:flex-end}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header{flex-direction:column;align-items:flex-start;gap:.5rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-timestamp{align-self:flex-end}}\n"] }]
|
|
6148
6031
|
}], ctorParameters: () => [{ type: DocumentHistoryService }, { type: DocumentViewerService }, { type: DocumentActionsService }, { type: i3.ConfirmationService }], propDecorators: { historyData: [{
|
|
6149
6032
|
type: Input
|
|
6150
6033
|
}], showHistory: [{
|
|
@@ -6985,6 +6868,10 @@ class DocumentZoomControlsComponent {
|
|
|
6985
6868
|
}
|
|
6986
6869
|
// Document name editing methods
|
|
6987
6870
|
onDocumentNameClick() {
|
|
6871
|
+
// Only allow editing if the document alias is editable
|
|
6872
|
+
if (!this.selectedDocument?.isAliasEditable) {
|
|
6873
|
+
return;
|
|
6874
|
+
}
|
|
6988
6875
|
this.isEditingDocumentName = true;
|
|
6989
6876
|
if (this.selectedDocument?.aliasName && this.selectedDocument.aliasName.trim() !== SHARED.EMPTY) {
|
|
6990
6877
|
this.documentName = this.selectedDocument.aliasName;
|
|
@@ -7053,7 +6940,7 @@ class DocumentZoomControlsComponent {
|
|
|
7053
6940
|
this.documentNameUpdated.emit();
|
|
7054
6941
|
},
|
|
7055
6942
|
error: (error) => {
|
|
7056
|
-
this.fileNameError =
|
|
6943
|
+
this.fileNameError = error.message;
|
|
7057
6944
|
}
|
|
7058
6945
|
});
|
|
7059
6946
|
}
|
|
@@ -7063,11 +6950,11 @@ class DocumentZoomControlsComponent {
|
|
|
7063
6950
|
}
|
|
7064
6951
|
}
|
|
7065
6952
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentZoomControlsComponent, deps: [{ token: DocumentZoomService }, { token: DocumentHttpService }], target: i0.ɵɵFactoryTarget.Component });
|
|
7066
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentZoomControlsComponent, isStandalone: false, selector: "document-zoom-controls", inputs: { selectedDocument: "selectedDocument", contextId: "contextId" }, outputs: { documentNameUpdated: "documentNameUpdated" }, ngImport: i0, template: "<div class=\"control-container\">\r\n <div class=\"inline-flex align-items-center justify-content-center gap-2\">\r\n <!-- Document name display with hover edit icon -->\r\n <div *ngIf=\"!isEditingDocumentName\" class=\"document-name-display clickable-doc-name\" (click)=\"onDocumentNameClick()\"\r\n title=\"Click to edit document name\">\r\n <div class=\"alias-name\">\r\n {{ selectedDocument?.aliasName || selectedDocument?.docName }}\r\n <i class=\"pi pi-pencil edit-icon-small\"></i>\r\n </div>\r\n <div class=\"document-name\">{{ selectedDocument?.docName }}</div>\r\n </div>\r\n <div *ngIf=\"isEditingDocumentName\" class=\"document-edit-container\">\r\n <input #fileInput type=\"text\" class=\"h-3rem file-input-wrapper document-name-input\" pInputText\r\n [(ngModel)]=\"documentName\" (input)=\"onDocumentNameChange($event)\" (keydown.escape)=\"cancelDocumentNameEdit()\"\r\n (keydown.enter)=\"handleSaveClick()\" />\r\n <div class=\"document-name-subline\">\r\n {{ selectedDocument?.docName }}\r\n </div>\r\n </div>\r\n <div *ngIf=\"fileNameError\" class=\"error-message-wrapper\">\r\n {{ fileNameError }}\r\n </div>\r\n </div>\r\n <div class=\"zoom-controls\">\r\n <p-button type=\"button\" icon=\"pi pi-minus\" [rounded]=\"true\" severity=\"secondary\" [outlined]=\"true\" (click)=\"zoomOut()\" [disabled]=\"isZoomOutDisabled\" title=\"Zoom Out\">\r\n </p-button>\r\n <p-button type=\"button\" icon=\"pi pi-plus\" [rounded]=\"true\" severity=\"secondary\" [outlined]=\"true\" (click)=\"zoomIn()\" [disabled]=\"isZoomInDisabled\" title=\"Zoom In\">\r\n </p-button>\r\n \r\n </div>\r\n\r\n</div>", styles: ["@charset \"UTF-8\";.control-container{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:0;width:100%}.document-name-display{display:flex;flex-direction:column;gap:.25rem;cursor:pointer;padding:.75rem;border-radius:.5rem;transition:all .2s ease;border:1px solid transparent;margin-right:auto}.document-name-display:hover{background-color:#f8fafc;border-color:#e2e8f0;transform:translateY(-1px);box-shadow:0 2px 8px #00000014}.document-name-display .alias-name{font-weight:600;color:#1e293b;font-size:1.125rem;display:flex;align-items:center;gap:.5rem;line-height:1.4}.document-name-display .alias-name .edit-icon-small{font-size:.75rem;color:#64748b;opacity:.7;transition:all .2s ease;padding:.25rem;border-radius:.25rem}.document-name-display .document-name{font-size:.875rem;color:#64748b;font-weight:400;line-height:1.3;word-break:break-all}.document-name-display:hover .edit-icon-small{opacity:1;background-color:#e2e8f0;color:#475569}.document-edit-container{display:flex;flex-direction:column;gap:.375rem;padding:.5rem;background:#f8fafc;border-radius:.5rem;border:1px solid #e2e8f0}.document-edit-container .document-name-input{border:2px solid #3b82f6;border-radius:.5rem;padding:.625rem .875rem;font-size:1rem;font-weight:500;color:#1e293b;background:#fff;transition:all .2s ease;width:100%;box-sizing:border-box}.document-edit-container .document-name-input:focus{outline:none;border-color:#1d4ed8;box-shadow:0 0 0 3px #3b82f61a;transform:translateY(-1px)}.document-edit-container .document-name-input::placeholder{color:#94a3b8;font-weight:400}.document-edit-container .document-name-subline{font-size:.75rem;color:#94a3b8;font-style:italic;padding-left:.5rem;line-height:1.3}.error-message-wrapper{color:#dc2626;font-size:.875rem;font-weight:500;padding:.5rem .75rem;background-color:#fef2f2;border:1px solid #fecaca;border-radius:.5rem;margin-top:.25rem;display:flex;align-items:center;gap:.5rem}.error-message-wrapper:before{content:\"\\26a0\";font-size:1rem}.zoom-controls{display:flex;align-items:center;gap:.75rem;transition:all .2s ease;margin-left:auto;padding-right:10px}.zoom-controls .zoom-button{width:44px;height:44px;border-radius:.5rem;border:none;background:#fff;color:#475569;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s ease;font-size:1.25rem;font-weight:600;box-shadow:0 1px 3px #0000001a}.zoom-controls .zoom-button:hover:not(:disabled){background:#3b82f6;color:#fff;transform:translateY(-2px);box-shadow:0 6px 16px #3b82f666}.zoom-controls .zoom-button:active:not(:disabled){transform:translateY(0);box-shadow:0 2px 6px #3b82f64d}.zoom-controls .zoom-button:disabled{opacity:.4;cursor:not-allowed;background:#f1f5f9;color:#94a3b8;transform:none}.zoom-controls .zoom-button i{font-size:1rem;transition:transform .2s ease}.zoom-controls .zoom-button:hover:not(:disabled) i{transform:scale(1.1)}.zoom-controls .zoom-level{min-width:4.5rem;text-align:center;font-weight:700;color:#1e293b;font-size:1rem;background:#fff;padding:.75rem 1rem;border-radius:.5rem;border:1px solid #e2e8f0;box-shadow:0 1px 2px #0000000d;transition:all .2s ease;-webkit-user-select:none;user-select:none}.zoom-controls .zoom-level:hover{background:#f8fafc;border-color:#cbd5e1;transform:translateY(-1px);box-shadow:0 2px 4px #0000001a}.zoom-controls .reset-button{padding:.75rem 1.25rem;border:1px solid #cbd5e1;background:#fff;color:#64748b;border-radius:.5rem;font-size:.875rem;font-weight:500;cursor:pointer;transition:all .2s ease;box-shadow:0 1px 2px #0000000d;white-space:nowrap}.zoom-controls .reset-button:hover{background:#f8fafc;border-color:#94a3b8;color:#475569;transform:translateY(-1px);box-shadow:0 3px 6px #0000001a}.zoom-controls .reset-button:active{transform:translateY(0)}@media (max-width: 768px){.control-container{gap:.75rem;flex-direction:column;align-items:stretch;justify-content:flex-start}.document-name-display{margin-right:0;margin-bottom:.5rem}.zoom-controls{margin-left:0;align-self:flex-end}.zoom-controls{padding:.75rem;gap:.5rem;flex-wrap:wrap;justify-content:center}.zoom-controls .zoom-button{width:40px;height:40px}.zoom-controls .zoom-level{min-width:4rem;padding:.5rem .75rem}.zoom-controls .reset-button{padding:.5rem 1rem;font-size:.8rem}.document-name-display{padding:.5rem}.document-name-display .alias-name{font-size:1rem}}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i9.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: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i6.InputText, selector: "[pInputText]", inputs: ["variant"] }] });
|
|
6953
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentZoomControlsComponent, isStandalone: false, selector: "document-zoom-controls", inputs: { selectedDocument: "selectedDocument", contextId: "contextId" }, outputs: { documentNameUpdated: "documentNameUpdated" }, ngImport: i0, template: "<div class=\"control-container\">\r\n <div class=\"inline-flex align-items-center justify-content-center gap-2\">\r\n <!-- Document name display with hover edit icon -->\r\n <div *ngIf=\"!isEditingDocumentName\" class=\"document-name-display\" \r\n [class.clickable-doc-name]=\"selectedDocument?.isAliasEditable\" \r\n [class.non-clickable-doc-name]=\"!selectedDocument?.isAliasEditable\"\r\n (click)=\"selectedDocument?.isAliasEditable ? onDocumentNameClick() : null\"\r\n [title]=\"selectedDocument?.isAliasEditable ? 'Click to edit document name' : 'Document name is not editable'\">\r\n <div class=\"alias-name\">\r\n {{ selectedDocument?.aliasName || selectedDocument?.docName }}\r\n <i *ngIf=\"selectedDocument?.isAliasEditable\" class=\"pi pi-pencil edit-icon-small\"></i>\r\n </div>\r\n <div class=\"document-name\">{{ selectedDocument?.docName }}</div>\r\n </div>\r\n <div *ngIf=\"isEditingDocumentName\" class=\"document-edit-container\">\r\n <input #fileInput type=\"text\" class=\"h-3rem file-input-wrapper document-name-input\" pInputText\r\n [(ngModel)]=\"documentName\" (input)=\"onDocumentNameChange($event)\" (keydown.escape)=\"cancelDocumentNameEdit()\"\r\n (keydown.enter)=\"handleSaveClick()\" />\r\n <div class=\"document-name-subline\">\r\n {{ selectedDocument?.docName }}\r\n </div>\r\n </div>\r\n <div *ngIf=\"fileNameError\" class=\"error-message-wrapper\">\r\n {{ fileNameError }}\r\n </div>\r\n </div>\r\n <div class=\"zoom-controls\">\r\n <p-button type=\"button\" icon=\"pi pi-minus\" [rounded]=\"true\" severity=\"secondary\" [outlined]=\"true\" (click)=\"zoomOut()\" [disabled]=\"isZoomOutDisabled\" title=\"Zoom Out\">\r\n </p-button>\r\n <p-button type=\"button\" icon=\"pi pi-plus\" [rounded]=\"true\" severity=\"secondary\" [outlined]=\"true\" (click)=\"zoomIn()\" [disabled]=\"isZoomInDisabled\" title=\"Zoom In\">\r\n </p-button>\r\n \r\n </div>\r\n\r\n</div>", styles: ["@charset \"UTF-8\";.control-container{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:0;width:100%}.document-name-display{display:flex;flex-direction:column;gap:.25rem;cursor:pointer;padding:.75rem;border-radius:.5rem;transition:all .2s ease;border:1px solid transparent;margin-right:auto}.document-name-display:hover{background-color:#f8fafc;border-color:#e2e8f0;transform:translateY(-1px);box-shadow:0 2px 8px #00000014}.document-name-display .alias-name{font-weight:600;color:#1e293b;font-size:1.125rem;display:flex;align-items:center;gap:.5rem;line-height:1.4}.document-name-display .alias-name .edit-icon-small{font-size:.75rem;color:#64748b;opacity:.7;transition:all .2s ease;padding:.25rem;border-radius:.25rem}.document-name-display .document-name{font-size:.875rem;color:#64748b;font-weight:400;line-height:1.3;word-break:break-all}.document-name-display:hover .edit-icon-small{opacity:1;background-color:#e2e8f0;color:#475569}.document-edit-container{display:flex;flex-direction:column;gap:.375rem;padding:.5rem;background:#f8fafc;border-radius:.5rem;border:1px solid #e2e8f0}.document-edit-container .document-name-input{border:2px solid #3b82f6;border-radius:.5rem;padding:.625rem .875rem;font-size:1rem;font-weight:500;color:#1e293b;background:#fff;transition:all .2s ease;width:100%;box-sizing:border-box}.document-edit-container .document-name-input:focus{outline:none;border-color:#1d4ed8;box-shadow:0 0 0 3px #3b82f61a;transform:translateY(-1px)}.document-edit-container .document-name-input::placeholder{color:#94a3b8;font-weight:400}.document-edit-container .document-name-subline{font-size:.75rem;color:#94a3b8;font-style:italic;padding-left:.5rem;line-height:1.3}.error-message-wrapper{color:#dc2626;font-size:.875rem;font-weight:500;padding:.5rem .75rem;background-color:#fef2f2;border:1px solid #fecaca;border-radius:.5rem;margin-top:.25rem;display:flex;align-items:center;gap:.5rem}.error-message-wrapper:before{content:\"\\26a0\";font-size:1rem}.zoom-controls{display:flex;align-items:center;gap:.75rem;transition:all .2s ease;margin-left:auto;padding-right:10px}.zoom-controls .zoom-button{width:44px;height:44px;border-radius:.5rem;border:none;background:#fff;color:#475569;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s ease;font-size:1.25rem;font-weight:600;box-shadow:0 1px 3px #0000001a}.zoom-controls .zoom-button:hover:not(:disabled){background:#3b82f6;color:#fff;transform:translateY(-2px);box-shadow:0 6px 16px #3b82f666}.zoom-controls .zoom-button:active:not(:disabled){transform:translateY(0);box-shadow:0 2px 6px #3b82f64d}.zoom-controls .zoom-button:disabled{opacity:.4;cursor:not-allowed;background:#f1f5f9;color:#94a3b8;transform:none}.zoom-controls .zoom-button i{font-size:1rem;transition:transform .2s ease}.zoom-controls .zoom-button:hover:not(:disabled) i{transform:scale(1.1)}.zoom-controls .zoom-level{min-width:4.5rem;text-align:center;font-weight:700;color:#1e293b;font-size:1rem;background:#fff;padding:.75rem 1rem;border-radius:.5rem;border:1px solid #e2e8f0;box-shadow:0 1px 2px #0000000d;transition:all .2s ease;-webkit-user-select:none;user-select:none}.zoom-controls .zoom-level:hover{background:#f8fafc;border-color:#cbd5e1;transform:translateY(-1px);box-shadow:0 2px 4px #0000001a}.zoom-controls .reset-button{padding:.75rem 1.25rem;border:1px solid #cbd5e1;background:#fff;color:#64748b;border-radius:.5rem;font-size:.875rem;font-weight:500;cursor:pointer;transition:all .2s ease;box-shadow:0 1px 2px #0000000d;white-space:nowrap}.zoom-controls .reset-button:hover{background:#f8fafc;border-color:#94a3b8;color:#475569;transform:translateY(-1px);box-shadow:0 3px 6px #0000001a}.zoom-controls .reset-button:active{transform:translateY(0)}@media (max-width: 768px){.control-container{gap:.75rem;flex-direction:column;align-items:stretch;justify-content:flex-start}.document-name-display{margin-right:0;margin-bottom:.5rem}.zoom-controls{margin-left:0;align-self:flex-end}.zoom-controls{padding:.75rem;gap:.5rem;flex-wrap:wrap;justify-content:center}.zoom-controls .zoom-button{width:40px;height:40px}.zoom-controls .zoom-level{min-width:4rem;padding:.5rem .75rem}.zoom-controls .reset-button{padding:.5rem 1rem;font-size:.8rem}.document-name-display{padding:.5rem}.document-name-display .alias-name{font-size:1rem}}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i9.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: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i6.InputText, selector: "[pInputText]", inputs: ["variant"] }] });
|
|
7067
6954
|
}
|
|
7068
6955
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentZoomControlsComponent, decorators: [{
|
|
7069
6956
|
type: Component,
|
|
7070
|
-
args: [{ selector: 'document-zoom-controls', standalone: false, template: "<div class=\"control-container\">\r\n <div class=\"inline-flex align-items-center justify-content-center gap-2\">\r\n <!-- Document name display with hover edit icon -->\r\n <div *ngIf=\"!isEditingDocumentName\" class=\"document-name-display clickable-doc-name\" (click)=\"onDocumentNameClick()\"\r\n title=\"Click to edit document name\">\r\n <div class=\"alias-name\">\r\n {{ selectedDocument?.aliasName || selectedDocument?.docName }}\r\n <i class=\"pi pi-pencil edit-icon-small\"></i>\r\n </div>\r\n <div class=\"document-name\">{{ selectedDocument?.docName }}</div>\r\n </div>\r\n <div *ngIf=\"isEditingDocumentName\" class=\"document-edit-container\">\r\n <input #fileInput type=\"text\" class=\"h-3rem file-input-wrapper document-name-input\" pInputText\r\n [(ngModel)]=\"documentName\" (input)=\"onDocumentNameChange($event)\" (keydown.escape)=\"cancelDocumentNameEdit()\"\r\n (keydown.enter)=\"handleSaveClick()\" />\r\n <div class=\"document-name-subline\">\r\n {{ selectedDocument?.docName }}\r\n </div>\r\n </div>\r\n <div *ngIf=\"fileNameError\" class=\"error-message-wrapper\">\r\n {{ fileNameError }}\r\n </div>\r\n </div>\r\n <div class=\"zoom-controls\">\r\n <p-button type=\"button\" icon=\"pi pi-minus\" [rounded]=\"true\" severity=\"secondary\" [outlined]=\"true\" (click)=\"zoomOut()\" [disabled]=\"isZoomOutDisabled\" title=\"Zoom Out\">\r\n </p-button>\r\n <p-button type=\"button\" icon=\"pi pi-plus\" [rounded]=\"true\" severity=\"secondary\" [outlined]=\"true\" (click)=\"zoomIn()\" [disabled]=\"isZoomInDisabled\" title=\"Zoom In\">\r\n </p-button>\r\n \r\n </div>\r\n\r\n</div>", styles: ["@charset \"UTF-8\";.control-container{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:0;width:100%}.document-name-display{display:flex;flex-direction:column;gap:.25rem;cursor:pointer;padding:.75rem;border-radius:.5rem;transition:all .2s ease;border:1px solid transparent;margin-right:auto}.document-name-display:hover{background-color:#f8fafc;border-color:#e2e8f0;transform:translateY(-1px);box-shadow:0 2px 8px #00000014}.document-name-display .alias-name{font-weight:600;color:#1e293b;font-size:1.125rem;display:flex;align-items:center;gap:.5rem;line-height:1.4}.document-name-display .alias-name .edit-icon-small{font-size:.75rem;color:#64748b;opacity:.7;transition:all .2s ease;padding:.25rem;border-radius:.25rem}.document-name-display .document-name{font-size:.875rem;color:#64748b;font-weight:400;line-height:1.3;word-break:break-all}.document-name-display:hover .edit-icon-small{opacity:1;background-color:#e2e8f0;color:#475569}.document-edit-container{display:flex;flex-direction:column;gap:.375rem;padding:.5rem;background:#f8fafc;border-radius:.5rem;border:1px solid #e2e8f0}.document-edit-container .document-name-input{border:2px solid #3b82f6;border-radius:.5rem;padding:.625rem .875rem;font-size:1rem;font-weight:500;color:#1e293b;background:#fff;transition:all .2s ease;width:100%;box-sizing:border-box}.document-edit-container .document-name-input:focus{outline:none;border-color:#1d4ed8;box-shadow:0 0 0 3px #3b82f61a;transform:translateY(-1px)}.document-edit-container .document-name-input::placeholder{color:#94a3b8;font-weight:400}.document-edit-container .document-name-subline{font-size:.75rem;color:#94a3b8;font-style:italic;padding-left:.5rem;line-height:1.3}.error-message-wrapper{color:#dc2626;font-size:.875rem;font-weight:500;padding:.5rem .75rem;background-color:#fef2f2;border:1px solid #fecaca;border-radius:.5rem;margin-top:.25rem;display:flex;align-items:center;gap:.5rem}.error-message-wrapper:before{content:\"\\26a0\";font-size:1rem}.zoom-controls{display:flex;align-items:center;gap:.75rem;transition:all .2s ease;margin-left:auto;padding-right:10px}.zoom-controls .zoom-button{width:44px;height:44px;border-radius:.5rem;border:none;background:#fff;color:#475569;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s ease;font-size:1.25rem;font-weight:600;box-shadow:0 1px 3px #0000001a}.zoom-controls .zoom-button:hover:not(:disabled){background:#3b82f6;color:#fff;transform:translateY(-2px);box-shadow:0 6px 16px #3b82f666}.zoom-controls .zoom-button:active:not(:disabled){transform:translateY(0);box-shadow:0 2px 6px #3b82f64d}.zoom-controls .zoom-button:disabled{opacity:.4;cursor:not-allowed;background:#f1f5f9;color:#94a3b8;transform:none}.zoom-controls .zoom-button i{font-size:1rem;transition:transform .2s ease}.zoom-controls .zoom-button:hover:not(:disabled) i{transform:scale(1.1)}.zoom-controls .zoom-level{min-width:4.5rem;text-align:center;font-weight:700;color:#1e293b;font-size:1rem;background:#fff;padding:.75rem 1rem;border-radius:.5rem;border:1px solid #e2e8f0;box-shadow:0 1px 2px #0000000d;transition:all .2s ease;-webkit-user-select:none;user-select:none}.zoom-controls .zoom-level:hover{background:#f8fafc;border-color:#cbd5e1;transform:translateY(-1px);box-shadow:0 2px 4px #0000001a}.zoom-controls .reset-button{padding:.75rem 1.25rem;border:1px solid #cbd5e1;background:#fff;color:#64748b;border-radius:.5rem;font-size:.875rem;font-weight:500;cursor:pointer;transition:all .2s ease;box-shadow:0 1px 2px #0000000d;white-space:nowrap}.zoom-controls .reset-button:hover{background:#f8fafc;border-color:#94a3b8;color:#475569;transform:translateY(-1px);box-shadow:0 3px 6px #0000001a}.zoom-controls .reset-button:active{transform:translateY(0)}@media (max-width: 768px){.control-container{gap:.75rem;flex-direction:column;align-items:stretch;justify-content:flex-start}.document-name-display{margin-right:0;margin-bottom:.5rem}.zoom-controls{margin-left:0;align-self:flex-end}.zoom-controls{padding:.75rem;gap:.5rem;flex-wrap:wrap;justify-content:center}.zoom-controls .zoom-button{width:40px;height:40px}.zoom-controls .zoom-level{min-width:4rem;padding:.5rem .75rem}.zoom-controls .reset-button{padding:.5rem 1rem;font-size:.8rem}.document-name-display{padding:.5rem}.document-name-display .alias-name{font-size:1rem}}\n"] }]
|
|
6957
|
+
args: [{ selector: 'document-zoom-controls', standalone: false, template: "<div class=\"control-container\">\r\n <div class=\"inline-flex align-items-center justify-content-center gap-2\">\r\n <!-- Document name display with hover edit icon -->\r\n <div *ngIf=\"!isEditingDocumentName\" class=\"document-name-display\" \r\n [class.clickable-doc-name]=\"selectedDocument?.isAliasEditable\" \r\n [class.non-clickable-doc-name]=\"!selectedDocument?.isAliasEditable\"\r\n (click)=\"selectedDocument?.isAliasEditable ? onDocumentNameClick() : null\"\r\n [title]=\"selectedDocument?.isAliasEditable ? 'Click to edit document name' : 'Document name is not editable'\">\r\n <div class=\"alias-name\">\r\n {{ selectedDocument?.aliasName || selectedDocument?.docName }}\r\n <i *ngIf=\"selectedDocument?.isAliasEditable\" class=\"pi pi-pencil edit-icon-small\"></i>\r\n </div>\r\n <div class=\"document-name\">{{ selectedDocument?.docName }}</div>\r\n </div>\r\n <div *ngIf=\"isEditingDocumentName\" class=\"document-edit-container\">\r\n <input #fileInput type=\"text\" class=\"h-3rem file-input-wrapper document-name-input\" pInputText\r\n [(ngModel)]=\"documentName\" (input)=\"onDocumentNameChange($event)\" (keydown.escape)=\"cancelDocumentNameEdit()\"\r\n (keydown.enter)=\"handleSaveClick()\" />\r\n <div class=\"document-name-subline\">\r\n {{ selectedDocument?.docName }}\r\n </div>\r\n </div>\r\n <div *ngIf=\"fileNameError\" class=\"error-message-wrapper\">\r\n {{ fileNameError }}\r\n </div>\r\n </div>\r\n <div class=\"zoom-controls\">\r\n <p-button type=\"button\" icon=\"pi pi-minus\" [rounded]=\"true\" severity=\"secondary\" [outlined]=\"true\" (click)=\"zoomOut()\" [disabled]=\"isZoomOutDisabled\" title=\"Zoom Out\">\r\n </p-button>\r\n <p-button type=\"button\" icon=\"pi pi-plus\" [rounded]=\"true\" severity=\"secondary\" [outlined]=\"true\" (click)=\"zoomIn()\" [disabled]=\"isZoomInDisabled\" title=\"Zoom In\">\r\n </p-button>\r\n \r\n </div>\r\n\r\n</div>", styles: ["@charset \"UTF-8\";.control-container{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:0;width:100%}.document-name-display{display:flex;flex-direction:column;gap:.25rem;cursor:pointer;padding:.75rem;border-radius:.5rem;transition:all .2s ease;border:1px solid transparent;margin-right:auto}.document-name-display:hover{background-color:#f8fafc;border-color:#e2e8f0;transform:translateY(-1px);box-shadow:0 2px 8px #00000014}.document-name-display .alias-name{font-weight:600;color:#1e293b;font-size:1.125rem;display:flex;align-items:center;gap:.5rem;line-height:1.4}.document-name-display .alias-name .edit-icon-small{font-size:.75rem;color:#64748b;opacity:.7;transition:all .2s ease;padding:.25rem;border-radius:.25rem}.document-name-display .document-name{font-size:.875rem;color:#64748b;font-weight:400;line-height:1.3;word-break:break-all}.document-name-display:hover .edit-icon-small{opacity:1;background-color:#e2e8f0;color:#475569}.document-edit-container{display:flex;flex-direction:column;gap:.375rem;padding:.5rem;background:#f8fafc;border-radius:.5rem;border:1px solid #e2e8f0}.document-edit-container .document-name-input{border:2px solid #3b82f6;border-radius:.5rem;padding:.625rem .875rem;font-size:1rem;font-weight:500;color:#1e293b;background:#fff;transition:all .2s ease;width:100%;box-sizing:border-box}.document-edit-container .document-name-input:focus{outline:none;border-color:#1d4ed8;box-shadow:0 0 0 3px #3b82f61a;transform:translateY(-1px)}.document-edit-container .document-name-input::placeholder{color:#94a3b8;font-weight:400}.document-edit-container .document-name-subline{font-size:.75rem;color:#94a3b8;font-style:italic;padding-left:.5rem;line-height:1.3}.error-message-wrapper{color:#dc2626;font-size:.875rem;font-weight:500;padding:.5rem .75rem;background-color:#fef2f2;border:1px solid #fecaca;border-radius:.5rem;margin-top:.25rem;display:flex;align-items:center;gap:.5rem}.error-message-wrapper:before{content:\"\\26a0\";font-size:1rem}.zoom-controls{display:flex;align-items:center;gap:.75rem;transition:all .2s ease;margin-left:auto;padding-right:10px}.zoom-controls .zoom-button{width:44px;height:44px;border-radius:.5rem;border:none;background:#fff;color:#475569;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s ease;font-size:1.25rem;font-weight:600;box-shadow:0 1px 3px #0000001a}.zoom-controls .zoom-button:hover:not(:disabled){background:#3b82f6;color:#fff;transform:translateY(-2px);box-shadow:0 6px 16px #3b82f666}.zoom-controls .zoom-button:active:not(:disabled){transform:translateY(0);box-shadow:0 2px 6px #3b82f64d}.zoom-controls .zoom-button:disabled{opacity:.4;cursor:not-allowed;background:#f1f5f9;color:#94a3b8;transform:none}.zoom-controls .zoom-button i{font-size:1rem;transition:transform .2s ease}.zoom-controls .zoom-button:hover:not(:disabled) i{transform:scale(1.1)}.zoom-controls .zoom-level{min-width:4.5rem;text-align:center;font-weight:700;color:#1e293b;font-size:1rem;background:#fff;padding:.75rem 1rem;border-radius:.5rem;border:1px solid #e2e8f0;box-shadow:0 1px 2px #0000000d;transition:all .2s ease;-webkit-user-select:none;user-select:none}.zoom-controls .zoom-level:hover{background:#f8fafc;border-color:#cbd5e1;transform:translateY(-1px);box-shadow:0 2px 4px #0000001a}.zoom-controls .reset-button{padding:.75rem 1.25rem;border:1px solid #cbd5e1;background:#fff;color:#64748b;border-radius:.5rem;font-size:.875rem;font-weight:500;cursor:pointer;transition:all .2s ease;box-shadow:0 1px 2px #0000000d;white-space:nowrap}.zoom-controls .reset-button:hover{background:#f8fafc;border-color:#94a3b8;color:#475569;transform:translateY(-1px);box-shadow:0 3px 6px #0000001a}.zoom-controls .reset-button:active{transform:translateY(0)}@media (max-width: 768px){.control-container{gap:.75rem;flex-direction:column;align-items:stretch;justify-content:flex-start}.document-name-display{margin-right:0;margin-bottom:.5rem}.zoom-controls{margin-left:0;align-self:flex-end}.zoom-controls{padding:.75rem;gap:.5rem;flex-wrap:wrap;justify-content:center}.zoom-controls .zoom-button{width:40px;height:40px}.zoom-controls .zoom-level{min-width:4rem;padding:.5rem .75rem}.zoom-controls .reset-button{padding:.5rem 1rem;font-size:.8rem}.document-name-display{padding:.5rem}.document-name-display .alias-name{font-size:1rem}}\n"] }]
|
|
7071
6958
|
}], ctorParameters: () => [{ type: DocumentZoomService }, { type: DocumentHttpService }], propDecorators: { selectedDocument: [{
|
|
7072
6959
|
type: Input
|
|
7073
6960
|
}], contextId: [{
|
|
@@ -7622,6 +7509,80 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
7622
7509
|
args: ['wheel', ['$event']]
|
|
7623
7510
|
}] } });
|
|
7624
7511
|
|
|
7512
|
+
/**
|
|
7513
|
+
* Service for managing user session details.
|
|
7514
|
+
* @class SessionService
|
|
7515
|
+
* @typedef {SessionService}
|
|
7516
|
+
*/
|
|
7517
|
+
class SessionService {
|
|
7518
|
+
router;
|
|
7519
|
+
/**
|
|
7520
|
+
* Creates an instance of SessionService.
|
|
7521
|
+
* @param {Router} router - Angular Router for navigation.
|
|
7522
|
+
*/
|
|
7523
|
+
constructor(router) {
|
|
7524
|
+
this.router = router;
|
|
7525
|
+
}
|
|
7526
|
+
/**
|
|
7527
|
+
* Retrieves the current user's role from local storage.
|
|
7528
|
+
* @returns {string | null} The user's role, or null if not found.
|
|
7529
|
+
*/
|
|
7530
|
+
getUserRole() {
|
|
7531
|
+
return localStorage.getItem('role');
|
|
7532
|
+
}
|
|
7533
|
+
/**
|
|
7534
|
+
* Stores the user session data in local storage.
|
|
7535
|
+
* @param {any} data - The session data to store.
|
|
7536
|
+
*/
|
|
7537
|
+
setUserSession(data) {
|
|
7538
|
+
localStorage.setItem(SHARED.SESSIONKEY, JSON.stringify(data));
|
|
7539
|
+
}
|
|
7540
|
+
/**
|
|
7541
|
+
* Retrieves the stored user session data.
|
|
7542
|
+
* @returns {any | null} The parsed session data, or null if not found.
|
|
7543
|
+
*/
|
|
7544
|
+
getUserSession() {
|
|
7545
|
+
const sessionData = localStorage.getItem(SHARED.SESSIONKEY);
|
|
7546
|
+
return sessionData ? JSON.parse(sessionData) : null;
|
|
7547
|
+
}
|
|
7548
|
+
/**
|
|
7549
|
+
* Retrieves the user's permissions from the stored session data.
|
|
7550
|
+
* @returns {any | null} The user's permissions, or null if not found.
|
|
7551
|
+
*/
|
|
7552
|
+
getUserPermissions() {
|
|
7553
|
+
const sessionData = localStorage.getItem(SHARED.SESSIONKEY);
|
|
7554
|
+
return sessionData ? JSON.parse(sessionData).permissions : null;
|
|
7555
|
+
}
|
|
7556
|
+
/**
|
|
7557
|
+
* Retrieves the session ID from the stored session data.
|
|
7558
|
+
* @returns {any | null} The session ID, or null if not found.
|
|
7559
|
+
*/
|
|
7560
|
+
getSessionID() {
|
|
7561
|
+
const sessionData = localStorage.getItem(SHARED.SESSIONKEY);
|
|
7562
|
+
console.log(sessionData);
|
|
7563
|
+
if (sessionData) {
|
|
7564
|
+
const sessionId = JSON.parse(sessionData);
|
|
7565
|
+
console.log(sessionId);
|
|
7566
|
+
return sessionId;
|
|
7567
|
+
}
|
|
7568
|
+
return null;
|
|
7569
|
+
}
|
|
7570
|
+
/**
|
|
7571
|
+
* Clears all stored session data from local storage.
|
|
7572
|
+
*/
|
|
7573
|
+
clearSession() {
|
|
7574
|
+
localStorage.clear();
|
|
7575
|
+
}
|
|
7576
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SessionService, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
7577
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SessionService, providedIn: 'root' });
|
|
7578
|
+
}
|
|
7579
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SessionService, decorators: [{
|
|
7580
|
+
type: Injectable,
|
|
7581
|
+
args: [{
|
|
7582
|
+
providedIn: 'root'
|
|
7583
|
+
}]
|
|
7584
|
+
}], ctorParameters: () => [{ type: i1.Router }] });
|
|
7585
|
+
|
|
7625
7586
|
class DocumentActionsComponent {
|
|
7626
7587
|
documentActionsService;
|
|
7627
7588
|
sessionService;
|
|
@@ -7704,7 +7665,7 @@ class DocumentActionsComponent {
|
|
|
7704
7665
|
*/
|
|
7705
7666
|
isUserTeamLeader() {
|
|
7706
7667
|
this.userRole = this.sessionService.getUserRole();
|
|
7707
|
-
return this.userRole ===
|
|
7668
|
+
return this.userRole === SHARED.TEAM_LEADER;
|
|
7708
7669
|
}
|
|
7709
7670
|
/**
|
|
7710
7671
|
* Checks if the current user is an Underwriter
|
|
@@ -7712,7 +7673,7 @@ class DocumentActionsComponent {
|
|
|
7712
7673
|
*/
|
|
7713
7674
|
isUserUnderwriter() {
|
|
7714
7675
|
this.userRole = this.sessionService.getUserRole();
|
|
7715
|
-
return this.userRole ===
|
|
7676
|
+
return this.userRole === SHARED.UNDERWRITER_USER;
|
|
7716
7677
|
}
|
|
7717
7678
|
/**
|
|
7718
7679
|
* Updates the isRejectNoteEmpty property based on current rejectNote value
|
|
@@ -7804,6 +7765,16 @@ class DocumentViewerComponent {
|
|
|
7804
7765
|
* @type {EventEmitter<void>}
|
|
7805
7766
|
*/
|
|
7806
7767
|
documentStatusUpdated = new EventEmitter();
|
|
7768
|
+
/**
|
|
7769
|
+
* Event emitted when a delete error occurs
|
|
7770
|
+
* @type {EventEmitter<any>}
|
|
7771
|
+
*/
|
|
7772
|
+
deleteError = new EventEmitter();
|
|
7773
|
+
/**
|
|
7774
|
+
* Event emitted when a delete operation succeeds
|
|
7775
|
+
* @type {EventEmitter<void>}
|
|
7776
|
+
*/
|
|
7777
|
+
deleteSuccess = new EventEmitter();
|
|
7807
7778
|
/**
|
|
7808
7779
|
* Event emitted when the document viewer is destroyed to trigger refresh
|
|
7809
7780
|
* @type {EventEmitter<void>}
|
|
@@ -7839,7 +7810,9 @@ class DocumentViewerComponent {
|
|
|
7839
7810
|
isActionLoading: false,
|
|
7840
7811
|
documentStatus: SHARED.STATUS_PENDING,
|
|
7841
7812
|
documentIsUploaded: false,
|
|
7842
|
-
alertData: null
|
|
7813
|
+
alertData: null,
|
|
7814
|
+
deleteError: null,
|
|
7815
|
+
deleteSuccess: false
|
|
7843
7816
|
};
|
|
7844
7817
|
/**
|
|
7845
7818
|
* Holds the subscription to manage observable cleanup.
|
|
@@ -7862,6 +7835,18 @@ class DocumentViewerComponent {
|
|
|
7862
7835
|
// Subscribe to state changes from the service
|
|
7863
7836
|
this.subscription.add(this.documentViewerService.state$.subscribe(state => {
|
|
7864
7837
|
this.currentState = state;
|
|
7838
|
+
// Check for delete errors and emit them to parent
|
|
7839
|
+
if (state.deleteError) {
|
|
7840
|
+
this.deleteError.emit(state.deleteError);
|
|
7841
|
+
// Clear the error from state after emitting
|
|
7842
|
+
this.documentStore.setDeleteError(null);
|
|
7843
|
+
}
|
|
7844
|
+
// Check for delete success and emit to parent
|
|
7845
|
+
if (state.deleteSuccess) {
|
|
7846
|
+
this.deleteSuccess.emit();
|
|
7847
|
+
// Clear the success flag from state after emitting
|
|
7848
|
+
this.documentStore.setDeleteSuccess(false);
|
|
7849
|
+
}
|
|
7865
7850
|
}));
|
|
7866
7851
|
}
|
|
7867
7852
|
/**
|
|
@@ -7916,14 +7901,14 @@ class DocumentViewerComponent {
|
|
|
7916
7901
|
if (document && document.documentUrl && document.docName) {
|
|
7917
7902
|
// Create a temporary document object for the viewer
|
|
7918
7903
|
const tempDocument = {
|
|
7919
|
-
_id:
|
|
7904
|
+
_id: document._id,
|
|
7920
7905
|
docName: document.docName,
|
|
7921
7906
|
fileName: document.docName,
|
|
7922
7907
|
documentUrl: document.documentUrl,
|
|
7923
7908
|
contentType: document.contentType,
|
|
7924
|
-
status:
|
|
7909
|
+
status: document.status,
|
|
7925
7910
|
isUploaded: true,
|
|
7926
|
-
fileSize: '0',
|
|
7911
|
+
fileSize: '0',
|
|
7927
7912
|
uploadedOn: new Date().toISOString(), // Current date
|
|
7928
7913
|
ownerName: 'History Document' // Default owner
|
|
7929
7914
|
};
|
|
@@ -7948,7 +7933,7 @@ class DocumentViewerComponent {
|
|
|
7948
7933
|
this.documentStore.clearDocumentViewerState();
|
|
7949
7934
|
}
|
|
7950
7935
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentViewerComponent, deps: [{ token: DocumentHttpService }, { token: DocumentHelperService }, { token: i3.MessageService }, { token: DocumentViewerService }, { token: DocumentStore }], target: i0.ɵɵFactoryTarget.Component });
|
|
7951
|
-
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", viewerDestroyed: "viewerDestroyed" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"document-viewer-container grid p-formgrid\">\r\n <div class=\"main-content col-12 md:col-12\">\r\n @if(messages.length > 0) {\r\n <p-messages [(value)]=\"messages\" [enableService]=\"false\"></p-messages>\r\n }\r\n \r\n <div class=\"content-grid col-12 md:col-12\">\r\n @if(selectedDocument){\r\n <div class=\"document-preview col-12 md:col-9\">\r\n <document-content-viewer\r\n [documentUrl]=\"selectedDocument?.documentUrl\"\r\n [contentType]=\"selectedDocument?.contentType\"\r\n [documentName]=\"selectedDocument?.docName\"\r\n [selectedDocument]=\"selectedDocument\"\r\n [contextId]=\"contextId\"\r\n (documentNameUpdated)=\"onDocumentNameUpdated()\"\r\n ></document-content-viewer>\r\n </div>\r\n }\r\n\r\n <div class=\"sidebar col-12 md:col-3 pt-0\">\r\n <div class=\"sidebar card\">\r\n <document-history \r\n [historyData]=\"currentState.documentHistory\" \r\n [showHistory]=\"currentState.showDocumentHistory\"\r\n [contextId]=\"contextId\"\r\n [selectedDocument]=\"selectedDocument\"\r\n (deleteTaskRequested)=\"onDeleteTaskRequested()\"\r\n (documentSelected)=\"onDocumentSelected($event)\">\r\n \r\n <!-- Document Actions Component inside the history component -->\r\n <div actions-component *ngIf=\"selectedDocument?.status !=='Pending' && !selectedDocument?.isUploaded && selectedDocument?.status === 'Reviewing'\">\r\n <document-actions\r\n [document]=\"selectedDocument\"\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 </div>\r\n <ng-content [select]=\"'action-launcher'\"></ng-content>\r\n </document-history>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [":host{display:block;height:100%;width:100%;overflow:hidden;position:relative}.document-viewer-container{height:100%;width:100%;position:relative;z-index:1;overflow:hidden;display:flex;flex-direction:column}.document-viewer-container .main-content{height:100%;display:flex;flex-direction:column;overflow:hidden;min-height:0}.document-viewer-container .main-content .p-messages{margin-bottom:.5rem;flex-shrink:0}.document-viewer-container .main-content .content-grid{display:grid;grid-template-columns:1fr 400px;gap:1rem;height:0;min-height:0;overflow:hidden;flex:1}.document-viewer-container .main-content .content-grid .document-preview{background:transparent;border-radius:8px;height:100%;width:100%;min-width:0;overflow:auto;scrollbar-width:none;-ms-overflow-style:none}.document-viewer-container .main-content .content-grid .document-preview::-webkit-scrollbar{display:none}.document-viewer-container .main-content .content-grid .sidebar{display:flex;flex-direction:column;gap:.75rem;height:100%;overflow-y:auto;min-width:0;width:100%;scrollbar-width:none;-ms-overflow-style:none}.document-viewer-container .main-content .content-grid .sidebar::-webkit-scrollbar{display:none}.document-viewer-container .main-content .content-grid .sidebar ::ng-deep .document-actions-container{margin:0}.document-viewer-container .main-content .content-grid .sidebar ::ng-deep .document-history-container{padding:.75rem;max-height:none;scrollbar-width:none;-ms-overflow-style:none}.document-viewer-container .main-content .content-grid .sidebar ::ng-deep .document-history-container::-webkit-scrollbar{display:none}::ng-deep .p-dialog-content{overflow:hidden!important;height:100%!important}::ng-deep .p-dialog{overflow:hidden!important}@media (max-width: 1200px){.document-viewer-container .main-content .content-grid{grid-template-columns:1fr 380px;gap:.75rem}}@media (max-width: 768px){.document-viewer-container .main-content .content-grid{grid-template-columns:1fr;gap:.5rem}.document-viewer-container .main-content .content-grid .sidebar{order:-1}}.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{position:relative;z-index:1}.document-viewer .p-dialog{width:100%;height:100%;max-height:100%!important;box-shadow:none!important;z-index:9999!important}.document-viewer .p-dialog-header-close-icon{height:20px;width:20px}.document-viewer .p-dialog-header{background-color:#fff;border-radius:0;padding:.5rem}.document-viewer .p-dialog-content{background-color:#fff;border-radius:0;overflow:hidden}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5$1.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange", "onClose"] }, { kind: "component", type: DocumentHistoryComponent, selector: "document-history", inputs: ["historyData", "showHistory", "contextId", "selectedDocument"], outputs: ["deleteTaskRequested", "documentSelected"] }, { kind: "component", type: DocumentContentViewerComponent, selector: "document-content-viewer", inputs: ["documentUrl", "contentType", "documentName", "selectedDocument", "contextId"] }, { kind: "component", type: DocumentActionsComponent, selector: "document-actions", inputs: ["document", "documentId", "currentStatus", "isLoading", "isUploaded", "statusId"], outputs: ["actionPerformed"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
7936
|
+
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", deleteError: "deleteError", deleteSuccess: "deleteSuccess", viewerDestroyed: "viewerDestroyed" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"document-viewer-container grid p-formgrid\">\r\n <div class=\"main-content col-12 md:col-12\">\r\n @if(messages.length > 0) {\r\n <p-messages [(value)]=\"messages\" [enableService]=\"false\"></p-messages>\r\n }\r\n \r\n <div class=\"content-grid col-12 md:col-12\">\r\n @if(selectedDocument){\r\n <div class=\"document-preview col-12 md:col-9\">\r\n <document-content-viewer\r\n [documentUrl]=\"selectedDocument?.documentUrl\"\r\n [contentType]=\"selectedDocument?.contentType\"\r\n [documentName]=\"selectedDocument?.docName\"\r\n [selectedDocument]=\"selectedDocument\"\r\n [contextId]=\"contextId\"\r\n (documentNameUpdated)=\"onDocumentNameUpdated()\"\r\n ></document-content-viewer>\r\n </div>\r\n }\r\n\r\n <div class=\"sidebar col-12 md:col-3 pt-0\">\r\n <div class=\"sidebar card\">\r\n <document-history \r\n [historyData]=\"currentState.documentHistory\" \r\n [showHistory]=\"currentState.showDocumentHistory\"\r\n [contextId]=\"contextId\"\r\n [selectedDocument]=\"selectedDocument\"\r\n (deleteTaskRequested)=\"onDeleteTaskRequested()\"\r\n (documentSelected)=\"onDocumentSelected($event)\">\r\n \r\n <!-- Document Actions Component inside the history component -->\r\n <div actions-component *ngIf=\"selectedDocument?.status !=='Pending' && !selectedDocument?.isUploaded && selectedDocument?.status === 'Reviewing'\">\r\n <document-actions\r\n [document]=\"selectedDocument\"\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 </div>\r\n <ng-content [select]=\"'action-launcher'\"></ng-content>\r\n </document-history>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [":host{display:block;height:100%;width:100%;overflow:hidden;position:relative}.document-viewer-container{height:100%;width:100%;position:relative;z-index:1;overflow:hidden;display:flex;flex-direction:column}.document-viewer-container .main-content{height:100%;display:flex;flex-direction:column;overflow:hidden;min-height:0}.document-viewer-container .main-content .p-messages{margin-bottom:.5rem;flex-shrink:0}.document-viewer-container .main-content .content-grid{display:grid;grid-template-columns:1fr 400px;gap:1rem;height:0;min-height:0;overflow:hidden;flex:1}.document-viewer-container .main-content .content-grid .document-preview{background:transparent;border-radius:8px;height:100%;width:100%;min-width:0;overflow:auto;scrollbar-width:none;-ms-overflow-style:none}.document-viewer-container .main-content .content-grid .document-preview::-webkit-scrollbar{display:none}.document-viewer-container .main-content .content-grid .sidebar{display:flex;flex-direction:column;gap:.75rem;height:100%;overflow-y:auto;min-width:0;width:100%;scrollbar-width:none;-ms-overflow-style:none}.document-viewer-container .main-content .content-grid .sidebar::-webkit-scrollbar{display:none}.document-viewer-container .main-content .content-grid .sidebar ::ng-deep .document-actions-container{margin:0}.document-viewer-container .main-content .content-grid .sidebar ::ng-deep .document-history-container{padding:.75rem;max-height:none;scrollbar-width:none;-ms-overflow-style:none}.document-viewer-container .main-content .content-grid .sidebar ::ng-deep .document-history-container::-webkit-scrollbar{display:none}::ng-deep .p-dialog-content{overflow:hidden!important;height:100%!important}::ng-deep .p-dialog{overflow:hidden!important}@media (max-width: 1200px){.document-viewer-container .main-content .content-grid{grid-template-columns:1fr 380px;gap:.75rem}}@media (max-width: 768px){.document-viewer-container .main-content .content-grid{grid-template-columns:1fr;gap:.5rem}.document-viewer-container .main-content .content-grid .sidebar{order:-1}}.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{position:relative;z-index:1}.document-viewer .p-dialog{width:100%;height:100%;max-height:100%!important;box-shadow:none!important;z-index:9999!important}.document-viewer .p-dialog-header-close-icon{height:20px;width:20px}.document-viewer .p-dialog-header{background-color:#fff;border-radius:0;padding:.5rem}.document-viewer .p-dialog-content{background-color:#fff;border-radius:0;overflow:hidden}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5$1.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange", "onClose"] }, { kind: "component", type: DocumentHistoryComponent, selector: "document-history", inputs: ["historyData", "showHistory", "contextId", "selectedDocument"], outputs: ["deleteTaskRequested", "documentSelected"] }, { kind: "component", type: DocumentContentViewerComponent, selector: "document-content-viewer", inputs: ["documentUrl", "contentType", "documentName", "selectedDocument", "contextId"] }, { kind: "component", type: DocumentActionsComponent, selector: "document-actions", inputs: ["document", "documentId", "currentStatus", "isLoading", "isUploaded", "statusId"], outputs: ["actionPerformed"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
7952
7937
|
}
|
|
7953
7938
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentViewerComponent, decorators: [{
|
|
7954
7939
|
type: Component,
|
|
@@ -7961,6 +7946,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
7961
7946
|
type: Input
|
|
7962
7947
|
}], documentStatusUpdated: [{
|
|
7963
7948
|
type: Output
|
|
7949
|
+
}], deleteError: [{
|
|
7950
|
+
type: Output
|
|
7951
|
+
}], deleteSuccess: [{
|
|
7952
|
+
type: Output
|
|
7964
7953
|
}], viewerDestroyed: [{
|
|
7965
7954
|
type: Output
|
|
7966
7955
|
}] } });
|
|
@@ -8200,6 +8189,7 @@ class DocumentListComponent {
|
|
|
8200
8189
|
this.documentListService.handleDeleteAction(rowData, this.contextId)
|
|
8201
8190
|
.subscribe({
|
|
8202
8191
|
next: (response) => {
|
|
8192
|
+
console.log('response', response);
|
|
8203
8193
|
if (this.selectedDocument && this.selectedDocument._id === rowData._id) {
|
|
8204
8194
|
this.handleCloseModal();
|
|
8205
8195
|
}
|
|
@@ -8207,6 +8197,8 @@ class DocumentListComponent {
|
|
|
8207
8197
|
},
|
|
8208
8198
|
error: (error) => {
|
|
8209
8199
|
console.error(ERRORS.ERROR_FETCHING_DOCUMENTS, error);
|
|
8200
|
+
// Show error message without closing dialog
|
|
8201
|
+
this.showDeleteErrorMessage(error);
|
|
8210
8202
|
}
|
|
8211
8203
|
});
|
|
8212
8204
|
}
|
|
@@ -8240,7 +8232,8 @@ class DocumentListComponent {
|
|
|
8240
8232
|
*/
|
|
8241
8233
|
handleDocumentStatusUpdate(event) {
|
|
8242
8234
|
if (event.actionType === SHARED.DELETE_ACTION) {
|
|
8243
|
-
|
|
8235
|
+
// Delete success is now handled separately via handleDeleteSuccess()
|
|
8236
|
+
// Don't call refreshDocumentList here for delete actions
|
|
8244
8237
|
}
|
|
8245
8238
|
else if (event.actionType === SHARED.NAME_UPDATE_ACTION) {
|
|
8246
8239
|
this.handleDocumentNameUpdate();
|
|
@@ -8249,6 +8242,31 @@ class DocumentListComponent {
|
|
|
8249
8242
|
this.refreshDocumentList();
|
|
8250
8243
|
}
|
|
8251
8244
|
}
|
|
8245
|
+
/**
|
|
8246
|
+
* Shows delete error message for 2 seconds without closing dialog
|
|
8247
|
+
* @param error - The error object from the delete operation
|
|
8248
|
+
*/
|
|
8249
|
+
showDeleteErrorMessage(error) {
|
|
8250
|
+
const errorMessage = error?.error?.message || error?.message || 'Failed to delete document. Please try again.';
|
|
8251
|
+
this.deleteMessage = [{ severity: 'error', detail: errorMessage }];
|
|
8252
|
+
// Clear error message after 2 seconds
|
|
8253
|
+
setTimeout(() => {
|
|
8254
|
+
this.deleteMessage = SHARED.EMPTY_ARRAY;
|
|
8255
|
+
}, 2000);
|
|
8256
|
+
}
|
|
8257
|
+
/**
|
|
8258
|
+
* Handles delete error events from the document viewer
|
|
8259
|
+
* @param error - The error object from the delete operation
|
|
8260
|
+
*/
|
|
8261
|
+
handleDeleteError(error) {
|
|
8262
|
+
this.showDeleteErrorMessage(error);
|
|
8263
|
+
}
|
|
8264
|
+
/**
|
|
8265
|
+
* Handles delete success events from the document viewer
|
|
8266
|
+
*/
|
|
8267
|
+
handleDeleteSuccess() {
|
|
8268
|
+
this.refreshDocumentList(true);
|
|
8269
|
+
}
|
|
8252
8270
|
/**
|
|
8253
8271
|
* Handles document name update event from viewer
|
|
8254
8272
|
*/
|
|
@@ -8437,11 +8455,11 @@ class DocumentListComponent {
|
|
|
8437
8455
|
}
|
|
8438
8456
|
}
|
|
8439
8457
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentListComponent, deps: [{ token: DocumentListService }, { token: DocumentHttpService }, { token: DocumentMenuService }, { token: DocumentStore }, { token: DocumentScrollService }], target: i0.ɵɵFactoryTarget.Component });
|
|
8440
|
-
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", selectedMenuItemId: "selectedMenuItemId", navigationInfo: "navigationInfo", documentList: "documentList" }, outputs: { handleSelectedDocument: "handleSelectedDocument" }, viewQueries: [{ propertyName: "documentCategoriesContainer", first: true, predicate: ["documentCategoriesContainer"], descendants: true }], 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\" (onHide)=\"handleCloseModal()\">\r\n <p-messages [(value)]=\"deleteMessage\" [enableService]=\"false\" [closable]=\"false\" />\r\n \r\n <document-viewer [selectedDocument]=\"selectedDocument\" [documentList]=\"documentList\" [contextId]=\"contextId\"\r\n (documentStatusUpdated)=\"handleDocumentStatusUpdate($event)\"\r\n (viewerDestroyed)=\"handleViewerDestroyed()\">\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\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\" #documentCategoriesContainer>\r\n <div class=\"category\" *ngFor=\"let category of documentCategories; let i = index\"\r\n [id]=\"categoryIds[i]\">\r\n <div class=\"category-header\">\r\n <div class=\"category-title\">\r\n <h3>{{ formattedCategoryLabels[i] }}</h3>\r\n <p class=\"category-description\">{{ category.categoryDescription }}</p>\r\n </div>\r\n <div class=\"completion-status\">\r\n <p-badge \r\n [severity]=\"categorySeverities[i]\" \r\n [value]=\"categoryCompletionCounts[i] + ' Complete'\"\r\n class=\"completion-badge\">\r\n </p-badge>\r\n </div>\r\n </div>\r\n\r\n <div class=\"table-container\">\r\n <lib-table-primary [tableData]=\"categoryTables[i]\" [tableStyle]=\"{ 'min-width': '100%' }\"\r\n (rowClick)=\"handleTableRowClick($event)\" (deleteAction)=\"handleDeleteAction($event)\">\r\n </lib-table-primary>\r\n </div>\r\n </div>\r\n</div>", styles: [".document-list-wrapper .p-accordion-header-link{padding:.5rem}.document-list-wrapper .p-sidebar-right{width:35%}.error-message-wrapper{color:#dc3545}.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}.clickable-doc-name{cursor:pointer;transition:all .2s ease;padding:4px 8px;border-radius:4px}.clickable-doc-name:hover{background-color:#4c62921a;color:var(--primary-color, #4C6292)}.clickable-doc-name:active{background-color:#4c629233;transform:scale(.98)}.clickable-doc-name .edit-icon{font-size:.8em;margin-left:8px;opacity:.6;transition:opacity .2s ease}.clickable-doc-name:hover .edit-icon{opacity:1}.document-name-display{display:flex;flex-direction:column;align-items:flex-start;gap:4px;cursor:pointer;transition:all .2s ease;padding:4px 8px;border-radius:4px;width:100%}.document-name-display:hover{background-color:#4c62921a}.document-name-display:hover .alias-name{color:var(--primary-color, #4C6292)}.document-name-display:active{background-color:#4c629233;transform:scale(.98)}.document-name-display .alias-name{font-size:1.5rem;font-weight:700;color:var(--text-color, #2c3e50);line-height:1.2;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%;max-width:none;transition:color .2s ease;display:flex;align-items:center;justify-content:flex-start;gap:8px}.document-name-display .alias-name .edit-icon-small{font-size:.7em;opacity:0;visibility:hidden;transition:opacity .2s ease,visibility .2s ease;margin-left:6px}.document-name-display:hover .edit-icon-small{opacity:1;visibility:visible}.document-name-display .document-name{font-size:.875rem;color:var(--text-color-secondary, #6c757d);font-weight:400;line-height:1.2;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%;max-width:none;opacity:.8}.file-input-wrapper{transition:all .2s ease;min-width:300px!important;width:auto!important;max-width:80vw!important}.file-input-wrapper:focus{border-color:var(--primary-color, #4C6292)!important;box-shadow:0 0 0 .2rem #4c629240!important;outline:none!important}.document-name-input{min-width:400px!important;width:auto!important;max-width:70vw!important;padding:8px 12px!important;font-size:1.1rem!important;font-weight:500!important;border:2px solid var(--primary-color, #4C6292)!important;border-radius:6px!important;background-color:#fff!important}.document-name-input:focus{outline:none!important;border-color:var(--primary-color, #4C6292)!important;box-shadow:0 0 0 .2rem #4c629240!important}.document-edit-container{display:flex;flex-direction:column;align-items:flex-start;gap:6px;width:100%;max-width:70vw}.document-name-subline{font-size:.85rem;color:var(--text-color-secondary, #6c757d);line-height:1.2;padding-left:4px;opacity:.8}.document-viewer{position:relative;z-index:1}.document-viewer ::ng-deep .p-dialog{z-index:9999!important}.document-viewer ::ng-deep .p-dialog-mask{z-index:9998!important}.document-viewer ::ng-deep .p-dialog{width:100vw!important;height:100vh!important;max-width:none!important;max-height:none!important;margin:0!important;top:0!important;left:0!important;transform:none!important}.document-viewer ::ng-deep .p-dialog-content{height:calc(100vh - 60px)!important;max-height:none!important}.document-categories-container{padding:1rem;min-height:auto}.document-categories-container .category{background:#fff;border-radius:8px;margin-bottom:2rem;overflow:hidden;transition:all .3s ease}.document-categories-container .category .category-header{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding-top:.6rem;padding-bottom:1rem}.document-categories-container .category .category-header .category-title{flex:1;min-width:0}.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{display:flex;align-items:center;justify-content:center;min-width:fit-content}.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 .category-header .completion-status .completion-badge{display:flex;align-items:center;justify-content:center}.document-categories-container .category .category-header .completion-status .completion-badge .p-badge{font-size:.75rem;font-weight:500;padding:.375rem .75rem;border-radius:6px;display:flex;align-items:center;justify-content:center;min-width:fit-content;white-space:nowrap}.document-categories-container .category .category-header .completion-status .completion-badge .p-badge.p-badge-success{background-color:#d1fae5;color:#065f46;font-family:inherit;font-size:12px;padding:15px;font-weight:400}.document-categories-container .category .category-header .completion-status .completion-badge .p-badge.p-badge-info{background-color:#e5e7eb;color:#000;font-family:inherit;font-size:12px;font-weight:400;padding:15px;font-style:inherit}.document-categories-container .category .category-header .completion-status .completion-badge .p-badge.p-badge-warning{background-color:#fef3c7;color:#d97706;font-family:inherit;padding:15px;font-size:12px;font-weight:400;font-style:inherit}.document-categories-container .category .category-header .completion-status .completion-badge .p-badge.p-badge-danger{background-color:#fee2e2;color:#dc2626;font-family:inherit;font-size:12px;padding:15px;font-weight:400;font-style:inherit}.document-categories-container .category .table-container{padding:0}@keyframes highlightPulse{0%{transform:scale(1.02);box-shadow:0 4px 20px #3b82f64d}50%{transform:scale(1.03);box-shadow:0 6px 25px #3b82f680}to{transform:scale(1.02);box-shadow:0 4px 20px #3b82f64d}}.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 .section-header .completion-status .completion-badge .p-badge{font-size:.75rem;font-weight:500;padding:.375rem .75rem;border-radius:6px}.document-sections-container .section .section-header .completion-status .completion-badge .p-badge.p-badge-success{background-color:#10b981;color:#fff}.document-sections-container .section .section-header .completion-status .completion-badge .p-badge.p-badge-info{background-color:#3b82f6;color:#fff}.document-sections-container .section .section-header .completion-status .completion-badge .p-badge.p-badge-warning{background-color:#f59e0b;color:#fff}.document-sections-container .section .section-header .completion-status .completion-badge .p-badge.p-badge-danger{background-color:#ef4444;color:#fff}.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:stretch}.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:center;width:100%;justify-content:center}}\n"], dependencies: [{ kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i5$1.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange", "onClose"] }, { kind: "component", type: i9$1.Badge, selector: "p-badge", inputs: ["styleClass", "style", "badgeSize", "severity", "value", "badgeDisabled", "size"] }, { kind: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i8$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: i6.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "component", type: TablePrimaryComponent, selector: "lib-table-primary", inputs: ["tableData", "showHeader", "tableStyle"], outputs: ["rowClick"] }, { kind: "component", type: DocumentViewerComponent, selector: "document-viewer", inputs: ["selectedDocument", "documentList", "contextId"], outputs: ["documentStatusUpdated", "viewerDestroyed"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
8458
|
+
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", selectedMenuItemId: "selectedMenuItemId", navigationInfo: "navigationInfo", documentList: "documentList" }, outputs: { handleSelectedDocument: "handleSelectedDocument" }, viewQueries: [{ propertyName: "documentCategoriesContainer", first: true, predicate: ["documentCategoriesContainer"], descendants: true }], 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\" (onHide)=\"handleCloseModal()\">\r\n <p-messages [(value)]=\"deleteMessage\" [enableService]=\"false\" [closable]=\"false\" />\r\n \r\n <document-viewer [selectedDocument]=\"selectedDocument\" [documentList]=\"documentList\" [contextId]=\"contextId\"\r\n (documentStatusUpdated)=\"handleDocumentStatusUpdate($event)\"\r\n (viewerDestroyed)=\"handleViewerDestroyed()\"\r\n (deleteError)=\"handleDeleteError($event)\"\r\n (deleteSuccess)=\"handleDeleteSuccess()\">\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\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\" #documentCategoriesContainer>\r\n <div class=\"category\" *ngFor=\"let category of documentCategories; let i = index\"\r\n [id]=\"categoryIds[i]\">\r\n <div class=\"category-header\">\r\n <div class=\"category-title\">\r\n <h3>{{ formattedCategoryLabels[i] }}</h3>\r\n <p class=\"category-description\">{{ category.categoryDescription }}</p>\r\n </div>\r\n <div class=\"completion-status\">\r\n <p-badge \r\n [severity]=\"categorySeverities[i]\" \r\n [value]=\"categoryCompletionCounts[i] + ' Complete'\"\r\n class=\"completion-badge\">\r\n </p-badge>\r\n </div>\r\n </div>\r\n\r\n <div class=\"table-container\">\r\n <lib-table-primary [tableData]=\"categoryTables[i]\" [tableStyle]=\"{ 'min-width': '100%' }\"\r\n (rowClick)=\"handleTableRowClick($event)\" (deleteAction)=\"handleDeleteAction($event)\">\r\n </lib-table-primary>\r\n </div>\r\n </div>\r\n</div>", styles: [".document-list-wrapper .p-accordion-header-link{padding:.5rem}.document-list-wrapper .p-sidebar-right{width:35%}.error-message-wrapper{color:#dc3545}.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}.clickable-doc-name{cursor:pointer;transition:all .2s ease;padding:4px 8px;border-radius:4px}.clickable-doc-name:hover{background-color:#4c62921a;color:var(--primary-color, #4C6292)}.clickable-doc-name:active{background-color:#4c629233;transform:scale(.98)}.clickable-doc-name .edit-icon{font-size:.8em;margin-left:8px;opacity:.6;transition:opacity .2s ease}.clickable-doc-name:hover .edit-icon{opacity:1}.document-name-display{display:flex;flex-direction:column;align-items:flex-start;gap:4px;cursor:pointer;transition:all .2s ease;padding:4px 8px;border-radius:4px;width:100%}.document-name-display:hover{background-color:#4c62921a}.document-name-display:hover .alias-name{color:var(--primary-color, #4C6292)}.document-name-display:active{background-color:#4c629233;transform:scale(.98)}.document-name-display .alias-name{font-size:1.5rem;font-weight:700;color:var(--text-color, #2c3e50);line-height:1.2;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%;max-width:none;transition:color .2s ease;display:flex;align-items:center;justify-content:flex-start;gap:8px}.document-name-display .alias-name .edit-icon-small{font-size:.7em;opacity:0;visibility:hidden;transition:opacity .2s ease,visibility .2s ease;margin-left:6px}.document-name-display:hover .edit-icon-small{opacity:1;visibility:visible}.document-name-display .document-name{font-size:.875rem;color:var(--text-color-secondary, #6c757d);font-weight:400;line-height:1.2;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%;max-width:none;opacity:.8}.file-input-wrapper{transition:all .2s ease;min-width:300px!important;width:auto!important;max-width:80vw!important}.file-input-wrapper:focus{border-color:var(--primary-color, #4C6292)!important;box-shadow:0 0 0 .2rem #4c629240!important;outline:none!important}.document-name-input{min-width:400px!important;width:auto!important;max-width:70vw!important;padding:8px 12px!important;font-size:1.1rem!important;font-weight:500!important;border:2px solid var(--primary-color, #4C6292)!important;border-radius:6px!important;background-color:#fff!important}.document-name-input:focus{outline:none!important;border-color:var(--primary-color, #4C6292)!important;box-shadow:0 0 0 .2rem #4c629240!important}.document-edit-container{display:flex;flex-direction:column;align-items:flex-start;gap:6px;width:100%;max-width:70vw}.document-name-subline{font-size:.85rem;color:var(--text-color-secondary, #6c757d);line-height:1.2;padding-left:4px;opacity:.8}.document-viewer{position:relative;z-index:1}.document-viewer ::ng-deep .p-dialog{z-index:9999!important}.document-viewer ::ng-deep .p-dialog-mask{z-index:9998!important}.document-viewer ::ng-deep .p-dialog{width:100vw!important;height:100vh!important;max-width:none!important;max-height:none!important;margin:0!important;top:0!important;left:0!important;transform:none!important}.document-viewer ::ng-deep .p-dialog-content{height:calc(100vh - 60px)!important;max-height:none!important}.document-categories-container{padding:1rem;min-height:auto}.document-categories-container .category{background:#fff;border-radius:8px;margin-bottom:2rem;overflow:hidden;transition:all .3s ease}.document-categories-container .category .category-header{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding-top:.6rem;padding-bottom:1rem}.document-categories-container .category .category-header .category-title{flex:1;min-width:0}.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{display:flex;align-items:center;justify-content:center;min-width:fit-content}.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 .category-header .completion-status .completion-badge{display:flex;align-items:center;justify-content:center}.document-categories-container .category .category-header .completion-status .completion-badge .p-badge{font-size:.75rem;font-weight:500;padding:.375rem .75rem;border-radius:6px;display:flex;align-items:center;justify-content:center;min-width:fit-content;white-space:nowrap}.document-categories-container .category .category-header .completion-status .completion-badge .p-badge.p-badge-success{background-color:#d1fae5;color:#065f46;font-family:inherit;font-size:12px;padding:15px;font-weight:400}.document-categories-container .category .category-header .completion-status .completion-badge .p-badge.p-badge-info{background-color:#e5e7eb;color:#000;font-family:inherit;font-size:12px;font-weight:400;padding:15px;font-style:inherit}.document-categories-container .category .category-header .completion-status .completion-badge .p-badge.p-badge-warning{background-color:#fef3c7;color:#d97706;font-family:inherit;padding:15px;font-size:12px;font-weight:400;font-style:inherit}.document-categories-container .category .category-header .completion-status .completion-badge .p-badge.p-badge-danger{background-color:#fee2e2;color:#dc2626;font-family:inherit;font-size:12px;padding:15px;font-weight:400;font-style:inherit}.document-categories-container .category .table-container{padding:0}@keyframes highlightPulse{0%{transform:scale(1.02);box-shadow:0 4px 20px #3b82f64d}50%{transform:scale(1.03);box-shadow:0 6px 25px #3b82f680}to{transform:scale(1.02);box-shadow:0 4px 20px #3b82f64d}}.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 .section-header .completion-status .completion-badge .p-badge{font-size:.75rem;font-weight:500;padding:.375rem .75rem;border-radius:6px}.document-sections-container .section .section-header .completion-status .completion-badge .p-badge.p-badge-success{background-color:#10b981;color:#fff}.document-sections-container .section .section-header .completion-status .completion-badge .p-badge.p-badge-info{background-color:#3b82f6;color:#fff}.document-sections-container .section .section-header .completion-status .completion-badge .p-badge.p-badge-warning{background-color:#f59e0b;color:#fff}.document-sections-container .section .section-header .completion-status .completion-badge .p-badge.p-badge-danger{background-color:#ef4444;color:#fff}.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:stretch}.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:center;width:100%;justify-content:center}}\n"], dependencies: [{ kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i5$1.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange", "onClose"] }, { kind: "component", type: i9$1.Badge, selector: "p-badge", inputs: ["styleClass", "style", "badgeSize", "severity", "value", "badgeDisabled", "size"] }, { kind: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i8$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: i6.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "component", type: TablePrimaryComponent, selector: "lib-table-primary", inputs: ["tableData", "showHeader", "tableStyle"], outputs: ["rowClick"] }, { kind: "component", type: DocumentViewerComponent, selector: "document-viewer", inputs: ["selectedDocument", "documentList", "contextId"], outputs: ["documentStatusUpdated", "deleteError", "deleteSuccess", "viewerDestroyed"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
8441
8459
|
}
|
|
8442
8460
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentListComponent, decorators: [{
|
|
8443
8461
|
type: Component,
|
|
8444
|
-
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\" (onHide)=\"handleCloseModal()\">\r\n <p-messages [(value)]=\"deleteMessage\" [enableService]=\"false\" [closable]=\"false\" />\r\n \r\n <document-viewer [selectedDocument]=\"selectedDocument\" [documentList]=\"documentList\" [contextId]=\"contextId\"\r\n (documentStatusUpdated)=\"handleDocumentStatusUpdate($event)\"\r\n (viewerDestroyed)=\"handleViewerDestroyed()\">\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\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\" #documentCategoriesContainer>\r\n <div class=\"category\" *ngFor=\"let category of documentCategories; let i = index\"\r\n [id]=\"categoryIds[i]\">\r\n <div class=\"category-header\">\r\n <div class=\"category-title\">\r\n <h3>{{ formattedCategoryLabels[i] }}</h3>\r\n <p class=\"category-description\">{{ category.categoryDescription }}</p>\r\n </div>\r\n <div class=\"completion-status\">\r\n <p-badge \r\n [severity]=\"categorySeverities[i]\" \r\n [value]=\"categoryCompletionCounts[i] + ' Complete'\"\r\n class=\"completion-badge\">\r\n </p-badge>\r\n </div>\r\n </div>\r\n\r\n <div class=\"table-container\">\r\n <lib-table-primary [tableData]=\"categoryTables[i]\" [tableStyle]=\"{ 'min-width': '100%' }\"\r\n (rowClick)=\"handleTableRowClick($event)\" (deleteAction)=\"handleDeleteAction($event)\">\r\n </lib-table-primary>\r\n </div>\r\n </div>\r\n</div>", styles: [".document-list-wrapper .p-accordion-header-link{padding:.5rem}.document-list-wrapper .p-sidebar-right{width:35%}.error-message-wrapper{color:#dc3545}.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}.clickable-doc-name{cursor:pointer;transition:all .2s ease;padding:4px 8px;border-radius:4px}.clickable-doc-name:hover{background-color:#4c62921a;color:var(--primary-color, #4C6292)}.clickable-doc-name:active{background-color:#4c629233;transform:scale(.98)}.clickable-doc-name .edit-icon{font-size:.8em;margin-left:8px;opacity:.6;transition:opacity .2s ease}.clickable-doc-name:hover .edit-icon{opacity:1}.document-name-display{display:flex;flex-direction:column;align-items:flex-start;gap:4px;cursor:pointer;transition:all .2s ease;padding:4px 8px;border-radius:4px;width:100%}.document-name-display:hover{background-color:#4c62921a}.document-name-display:hover .alias-name{color:var(--primary-color, #4C6292)}.document-name-display:active{background-color:#4c629233;transform:scale(.98)}.document-name-display .alias-name{font-size:1.5rem;font-weight:700;color:var(--text-color, #2c3e50);line-height:1.2;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%;max-width:none;transition:color .2s ease;display:flex;align-items:center;justify-content:flex-start;gap:8px}.document-name-display .alias-name .edit-icon-small{font-size:.7em;opacity:0;visibility:hidden;transition:opacity .2s ease,visibility .2s ease;margin-left:6px}.document-name-display:hover .edit-icon-small{opacity:1;visibility:visible}.document-name-display .document-name{font-size:.875rem;color:var(--text-color-secondary, #6c757d);font-weight:400;line-height:1.2;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%;max-width:none;opacity:.8}.file-input-wrapper{transition:all .2s ease;min-width:300px!important;width:auto!important;max-width:80vw!important}.file-input-wrapper:focus{border-color:var(--primary-color, #4C6292)!important;box-shadow:0 0 0 .2rem #4c629240!important;outline:none!important}.document-name-input{min-width:400px!important;width:auto!important;max-width:70vw!important;padding:8px 12px!important;font-size:1.1rem!important;font-weight:500!important;border:2px solid var(--primary-color, #4C6292)!important;border-radius:6px!important;background-color:#fff!important}.document-name-input:focus{outline:none!important;border-color:var(--primary-color, #4C6292)!important;box-shadow:0 0 0 .2rem #4c629240!important}.document-edit-container{display:flex;flex-direction:column;align-items:flex-start;gap:6px;width:100%;max-width:70vw}.document-name-subline{font-size:.85rem;color:var(--text-color-secondary, #6c757d);line-height:1.2;padding-left:4px;opacity:.8}.document-viewer{position:relative;z-index:1}.document-viewer ::ng-deep .p-dialog{z-index:9999!important}.document-viewer ::ng-deep .p-dialog-mask{z-index:9998!important}.document-viewer ::ng-deep .p-dialog{width:100vw!important;height:100vh!important;max-width:none!important;max-height:none!important;margin:0!important;top:0!important;left:0!important;transform:none!important}.document-viewer ::ng-deep .p-dialog-content{height:calc(100vh - 60px)!important;max-height:none!important}.document-categories-container{padding:1rem;min-height:auto}.document-categories-container .category{background:#fff;border-radius:8px;margin-bottom:2rem;overflow:hidden;transition:all .3s ease}.document-categories-container .category .category-header{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding-top:.6rem;padding-bottom:1rem}.document-categories-container .category .category-header .category-title{flex:1;min-width:0}.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{display:flex;align-items:center;justify-content:center;min-width:fit-content}.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 .category-header .completion-status .completion-badge{display:flex;align-items:center;justify-content:center}.document-categories-container .category .category-header .completion-status .completion-badge .p-badge{font-size:.75rem;font-weight:500;padding:.375rem .75rem;border-radius:6px;display:flex;align-items:center;justify-content:center;min-width:fit-content;white-space:nowrap}.document-categories-container .category .category-header .completion-status .completion-badge .p-badge.p-badge-success{background-color:#d1fae5;color:#065f46;font-family:inherit;font-size:12px;padding:15px;font-weight:400}.document-categories-container .category .category-header .completion-status .completion-badge .p-badge.p-badge-info{background-color:#e5e7eb;color:#000;font-family:inherit;font-size:12px;font-weight:400;padding:15px;font-style:inherit}.document-categories-container .category .category-header .completion-status .completion-badge .p-badge.p-badge-warning{background-color:#fef3c7;color:#d97706;font-family:inherit;padding:15px;font-size:12px;font-weight:400;font-style:inherit}.document-categories-container .category .category-header .completion-status .completion-badge .p-badge.p-badge-danger{background-color:#fee2e2;color:#dc2626;font-family:inherit;font-size:12px;padding:15px;font-weight:400;font-style:inherit}.document-categories-container .category .table-container{padding:0}@keyframes highlightPulse{0%{transform:scale(1.02);box-shadow:0 4px 20px #3b82f64d}50%{transform:scale(1.03);box-shadow:0 6px 25px #3b82f680}to{transform:scale(1.02);box-shadow:0 4px 20px #3b82f64d}}.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 .section-header .completion-status .completion-badge .p-badge{font-size:.75rem;font-weight:500;padding:.375rem .75rem;border-radius:6px}.document-sections-container .section .section-header .completion-status .completion-badge .p-badge.p-badge-success{background-color:#10b981;color:#fff}.document-sections-container .section .section-header .completion-status .completion-badge .p-badge.p-badge-info{background-color:#3b82f6;color:#fff}.document-sections-container .section .section-header .completion-status .completion-badge .p-badge.p-badge-warning{background-color:#f59e0b;color:#fff}.document-sections-container .section .section-header .completion-status .completion-badge .p-badge.p-badge-danger{background-color:#ef4444;color:#fff}.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:stretch}.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:center;width:100%;justify-content:center}}\n"] }]
|
|
8462
|
+
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\" (onHide)=\"handleCloseModal()\">\r\n <p-messages [(value)]=\"deleteMessage\" [enableService]=\"false\" [closable]=\"false\" />\r\n \r\n <document-viewer [selectedDocument]=\"selectedDocument\" [documentList]=\"documentList\" [contextId]=\"contextId\"\r\n (documentStatusUpdated)=\"handleDocumentStatusUpdate($event)\"\r\n (viewerDestroyed)=\"handleViewerDestroyed()\"\r\n (deleteError)=\"handleDeleteError($event)\"\r\n (deleteSuccess)=\"handleDeleteSuccess()\">\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\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\" #documentCategoriesContainer>\r\n <div class=\"category\" *ngFor=\"let category of documentCategories; let i = index\"\r\n [id]=\"categoryIds[i]\">\r\n <div class=\"category-header\">\r\n <div class=\"category-title\">\r\n <h3>{{ formattedCategoryLabels[i] }}</h3>\r\n <p class=\"category-description\">{{ category.categoryDescription }}</p>\r\n </div>\r\n <div class=\"completion-status\">\r\n <p-badge \r\n [severity]=\"categorySeverities[i]\" \r\n [value]=\"categoryCompletionCounts[i] + ' Complete'\"\r\n class=\"completion-badge\">\r\n </p-badge>\r\n </div>\r\n </div>\r\n\r\n <div class=\"table-container\">\r\n <lib-table-primary [tableData]=\"categoryTables[i]\" [tableStyle]=\"{ 'min-width': '100%' }\"\r\n (rowClick)=\"handleTableRowClick($event)\" (deleteAction)=\"handleDeleteAction($event)\">\r\n </lib-table-primary>\r\n </div>\r\n </div>\r\n</div>", styles: [".document-list-wrapper .p-accordion-header-link{padding:.5rem}.document-list-wrapper .p-sidebar-right{width:35%}.error-message-wrapper{color:#dc3545}.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}.clickable-doc-name{cursor:pointer;transition:all .2s ease;padding:4px 8px;border-radius:4px}.clickable-doc-name:hover{background-color:#4c62921a;color:var(--primary-color, #4C6292)}.clickable-doc-name:active{background-color:#4c629233;transform:scale(.98)}.clickable-doc-name .edit-icon{font-size:.8em;margin-left:8px;opacity:.6;transition:opacity .2s ease}.clickable-doc-name:hover .edit-icon{opacity:1}.document-name-display{display:flex;flex-direction:column;align-items:flex-start;gap:4px;cursor:pointer;transition:all .2s ease;padding:4px 8px;border-radius:4px;width:100%}.document-name-display:hover{background-color:#4c62921a}.document-name-display:hover .alias-name{color:var(--primary-color, #4C6292)}.document-name-display:active{background-color:#4c629233;transform:scale(.98)}.document-name-display .alias-name{font-size:1.5rem;font-weight:700;color:var(--text-color, #2c3e50);line-height:1.2;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%;max-width:none;transition:color .2s ease;display:flex;align-items:center;justify-content:flex-start;gap:8px}.document-name-display .alias-name .edit-icon-small{font-size:.7em;opacity:0;visibility:hidden;transition:opacity .2s ease,visibility .2s ease;margin-left:6px}.document-name-display:hover .edit-icon-small{opacity:1;visibility:visible}.document-name-display .document-name{font-size:.875rem;color:var(--text-color-secondary, #6c757d);font-weight:400;line-height:1.2;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%;max-width:none;opacity:.8}.file-input-wrapper{transition:all .2s ease;min-width:300px!important;width:auto!important;max-width:80vw!important}.file-input-wrapper:focus{border-color:var(--primary-color, #4C6292)!important;box-shadow:0 0 0 .2rem #4c629240!important;outline:none!important}.document-name-input{min-width:400px!important;width:auto!important;max-width:70vw!important;padding:8px 12px!important;font-size:1.1rem!important;font-weight:500!important;border:2px solid var(--primary-color, #4C6292)!important;border-radius:6px!important;background-color:#fff!important}.document-name-input:focus{outline:none!important;border-color:var(--primary-color, #4C6292)!important;box-shadow:0 0 0 .2rem #4c629240!important}.document-edit-container{display:flex;flex-direction:column;align-items:flex-start;gap:6px;width:100%;max-width:70vw}.document-name-subline{font-size:.85rem;color:var(--text-color-secondary, #6c757d);line-height:1.2;padding-left:4px;opacity:.8}.document-viewer{position:relative;z-index:1}.document-viewer ::ng-deep .p-dialog{z-index:9999!important}.document-viewer ::ng-deep .p-dialog-mask{z-index:9998!important}.document-viewer ::ng-deep .p-dialog{width:100vw!important;height:100vh!important;max-width:none!important;max-height:none!important;margin:0!important;top:0!important;left:0!important;transform:none!important}.document-viewer ::ng-deep .p-dialog-content{height:calc(100vh - 60px)!important;max-height:none!important}.document-categories-container{padding:1rem;min-height:auto}.document-categories-container .category{background:#fff;border-radius:8px;margin-bottom:2rem;overflow:hidden;transition:all .3s ease}.document-categories-container .category .category-header{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding-top:.6rem;padding-bottom:1rem}.document-categories-container .category .category-header .category-title{flex:1;min-width:0}.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{display:flex;align-items:center;justify-content:center;min-width:fit-content}.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 .category-header .completion-status .completion-badge{display:flex;align-items:center;justify-content:center}.document-categories-container .category .category-header .completion-status .completion-badge .p-badge{font-size:.75rem;font-weight:500;padding:.375rem .75rem;border-radius:6px;display:flex;align-items:center;justify-content:center;min-width:fit-content;white-space:nowrap}.document-categories-container .category .category-header .completion-status .completion-badge .p-badge.p-badge-success{background-color:#d1fae5;color:#065f46;font-family:inherit;font-size:12px;padding:15px;font-weight:400}.document-categories-container .category .category-header .completion-status .completion-badge .p-badge.p-badge-info{background-color:#e5e7eb;color:#000;font-family:inherit;font-size:12px;font-weight:400;padding:15px;font-style:inherit}.document-categories-container .category .category-header .completion-status .completion-badge .p-badge.p-badge-warning{background-color:#fef3c7;color:#d97706;font-family:inherit;padding:15px;font-size:12px;font-weight:400;font-style:inherit}.document-categories-container .category .category-header .completion-status .completion-badge .p-badge.p-badge-danger{background-color:#fee2e2;color:#dc2626;font-family:inherit;font-size:12px;padding:15px;font-weight:400;font-style:inherit}.document-categories-container .category .table-container{padding:0}@keyframes highlightPulse{0%{transform:scale(1.02);box-shadow:0 4px 20px #3b82f64d}50%{transform:scale(1.03);box-shadow:0 6px 25px #3b82f680}to{transform:scale(1.02);box-shadow:0 4px 20px #3b82f64d}}.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 .section-header .completion-status .completion-badge .p-badge{font-size:.75rem;font-weight:500;padding:.375rem .75rem;border-radius:6px}.document-sections-container .section .section-header .completion-status .completion-badge .p-badge.p-badge-success{background-color:#10b981;color:#fff}.document-sections-container .section .section-header .completion-status .completion-badge .p-badge.p-badge-info{background-color:#3b82f6;color:#fff}.document-sections-container .section .section-header .completion-status .completion-badge .p-badge.p-badge-warning{background-color:#f59e0b;color:#fff}.document-sections-container .section .section-header .completion-status .completion-badge .p-badge.p-badge-danger{background-color:#ef4444;color:#fff}.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:stretch}.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:center;width:100%;justify-content:center}}\n"] }]
|
|
8445
8463
|
}], ctorParameters: () => [{ type: DocumentListService }, { type: DocumentHttpService }, { type: DocumentMenuService }, { type: DocumentStore }, { type: DocumentScrollService }], propDecorators: { contextId: [{
|
|
8446
8464
|
type: Input
|
|
8447
8465
|
}], documentListResponse: [{
|
|
@@ -9182,6 +9200,77 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
9182
9200
|
type: Output
|
|
9183
9201
|
}] } });
|
|
9184
9202
|
|
|
9203
|
+
/**
|
|
9204
|
+
* Directive to conditionally show or hide elements based on user permissions.
|
|
9205
|
+
* @class HasPermissionDirective
|
|
9206
|
+
* @typedef {HasPermissionDirective}
|
|
9207
|
+
*/
|
|
9208
|
+
class HasPermissionDirective {
|
|
9209
|
+
el;
|
|
9210
|
+
renderer;
|
|
9211
|
+
sessionService;
|
|
9212
|
+
/**
|
|
9213
|
+
* The required permission(s) to display the element.
|
|
9214
|
+
* Accepts a single string or an array of strings.
|
|
9215
|
+
* @type {string | string[]}
|
|
9216
|
+
*/
|
|
9217
|
+
permission;
|
|
9218
|
+
/**
|
|
9219
|
+
* Creates an instance of HasPermissionDirective.
|
|
9220
|
+
* @param {ElementRef} el - Reference to the host element.
|
|
9221
|
+
* @param {Renderer2} renderer - Angular Renderer for DOM manipulation.
|
|
9222
|
+
* @param {SessionService} sessionService - Service to retrieve user permissions.
|
|
9223
|
+
*/
|
|
9224
|
+
constructor(el, renderer, sessionService) {
|
|
9225
|
+
this.el = el;
|
|
9226
|
+
this.renderer = renderer;
|
|
9227
|
+
this.sessionService = sessionService;
|
|
9228
|
+
}
|
|
9229
|
+
/**
|
|
9230
|
+
* Lifecycle hook that is called when input properties change.
|
|
9231
|
+
* @param {SimpleChanges} changes - The changes in input properties.
|
|
9232
|
+
*/
|
|
9233
|
+
ngOnChanges(changes) {
|
|
9234
|
+
if (changes['permission']) {
|
|
9235
|
+
this.checkPermission();
|
|
9236
|
+
}
|
|
9237
|
+
}
|
|
9238
|
+
/**
|
|
9239
|
+
* Checks if the user has the required permission(s).
|
|
9240
|
+
* Hides the element if the permission is not found.
|
|
9241
|
+
*/
|
|
9242
|
+
checkPermission() {
|
|
9243
|
+
// If no permission is required (empty string, null, or undefined), show the element
|
|
9244
|
+
if (!this.permission || this.permission === '' || (Array.isArray(this.permission) && this.permission.length === 0)) {
|
|
9245
|
+
this.renderer.removeStyle(this.el.nativeElement, 'display');
|
|
9246
|
+
return;
|
|
9247
|
+
}
|
|
9248
|
+
const userPermissionsObjects = this.sessionService.getUserPermissions();
|
|
9249
|
+
const userPermissionNames = userPermissionsObjects?.map((perm) => perm.name) || [];
|
|
9250
|
+
const requiredPermissions = Array.isArray(this.permission)
|
|
9251
|
+
? this.permission
|
|
9252
|
+
: [this.permission];
|
|
9253
|
+
const hasPermission = requiredPermissions.some(permission => userPermissionNames.includes(permission));
|
|
9254
|
+
if (!hasPermission) {
|
|
9255
|
+
this.renderer.setStyle(this.el.nativeElement, 'display', 'none');
|
|
9256
|
+
}
|
|
9257
|
+
else {
|
|
9258
|
+
this.renderer.removeStyle(this.el.nativeElement, 'display');
|
|
9259
|
+
}
|
|
9260
|
+
}
|
|
9261
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HasPermissionDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: SessionService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
9262
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.14", type: HasPermissionDirective, isStandalone: false, selector: "[permission]", inputs: { permission: "permission" }, usesOnChanges: true, ngImport: i0 });
|
|
9263
|
+
}
|
|
9264
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HasPermissionDirective, decorators: [{
|
|
9265
|
+
type: Directive,
|
|
9266
|
+
args: [{
|
|
9267
|
+
selector: '[permission]',
|
|
9268
|
+
standalone: false
|
|
9269
|
+
}]
|
|
9270
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: SessionService }], propDecorators: { permission: [{
|
|
9271
|
+
type: Input
|
|
9272
|
+
}] } });
|
|
9273
|
+
|
|
9185
9274
|
class SharedModule {
|
|
9186
9275
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
9187
9276
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: SharedModule, declarations: [TablePrimaryComponent, HasPermissionDirective, ConfirmationDialogComponent], imports: [CommonModule,
|