cat-documents-ng 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ng-package.json +10 -0
- package/package.json +5 -11
- package/src/Shared/components/confirmation-dialog/confirmation-dialog.component.html +3 -0
- package/src/Shared/components/confirmation-dialog/confirmation-dialog.component.scss +13 -0
- package/src/Shared/components/confirmation-dialog/confirmation-dialog.component.spec.ts +70 -0
- package/src/Shared/components/confirmation-dialog/confirmation-dialog.component.ts +133 -0
- package/src/Shared/components/table-primary/table-primary.component.html +66 -0
- package/src/Shared/components/table-primary/table-primary.component.scss +227 -0
- package/src/Shared/components/table-primary/table-primary.component.spec.ts +23 -0
- package/src/Shared/components/table-primary/table-primary.component.ts +143 -0
- package/src/Shared/components/table-primary/table-primary.model.ts +21 -0
- package/src/Shared/constant/ERROR.ts +55 -0
- package/src/Shared/constant/PERMISSIONS.ts +17 -0
- package/src/Shared/constant/SHARED.ts +936 -0
- package/{Shared/constant/URLS.d.ts → src/Shared/constant/URLS.ts} +31 -25
- package/src/Shared/services/app-config.service.spec.ts +19 -0
- package/src/Shared/services/app-config.service.ts +73 -0
- package/{Shared/services/global-error.handler.d.ts → src/Shared/services/global-error.handler.ts} +11 -9
- package/src/Shared/services/session.service.spec.ts +16 -0
- package/src/Shared/services/session.service.ts +76 -0
- package/src/Shared/shared.module.ts +25 -0
- package/src/lib/document/components/csv-viewer/csv-viewer.component.ts +1 -0
- package/src/lib/document/components/document-actions/document-actions.component.html +59 -0
- package/src/lib/document/components/document-actions/document-actions.component.scss +362 -0
- package/src/lib/document/components/document-actions/document-actions.component.spec.ts +297 -0
- package/src/lib/document/components/document-actions/document-actions.component.ts +163 -0
- package/src/lib/document/components/document-container/document-container.component.html +36 -0
- package/src/lib/document/components/document-container/document-container.component.scss +144 -0
- package/src/lib/document/components/document-container/document-container.component.spec.ts +110 -0
- package/src/lib/document/components/document-container/document-container.component.ts +363 -0
- package/src/lib/document/components/document-content-viewer/document-content-viewer.component.html +332 -0
- package/src/lib/document/components/document-content-viewer/document-content-viewer.component.scss +1877 -0
- package/src/lib/document/components/document-content-viewer/document-content-viewer.component.spec.ts +258 -0
- package/src/lib/document/components/document-content-viewer/document-content-viewer.component.ts +664 -0
- package/src/lib/document/components/document-history/document-history.component.html +96 -0
- package/src/lib/document/components/document-history/document-history.component.scss +392 -0
- package/src/lib/document/components/document-history/document-history.component.spec.ts +93 -0
- package/src/lib/document/components/document-history/document-history.component.ts +373 -0
- package/src/lib/document/components/document-list/document-list.component.html +46 -0
- package/src/lib/document/components/document-list/document-list.component.scss +513 -0
- package/src/lib/document/components/document-list/document-list.component.spec.ts +486 -0
- package/src/lib/document/components/document-list/document-list.component.ts +682 -0
- package/src/lib/document/components/document-list-item/document-list-item.component.html +36 -0
- package/src/lib/document/components/document-list-item/document-list-item.component.scss +34 -0
- package/src/lib/document/components/document-list-item/document-list-item.component.spec.ts +75 -0
- package/src/lib/document/components/document-list-item/document-list-item.component.ts +40 -0
- package/src/lib/document/components/document-search/document-search.component.html +64 -0
- package/src/lib/document/components/document-search/document-search.component.scss +206 -0
- package/src/lib/document/components/document-search/document-search.component.spec.ts +82 -0
- package/src/lib/document/components/document-search/document-search.component.ts +163 -0
- package/src/lib/document/components/document-status/document-status.component.html +31 -0
- package/src/lib/document/components/document-status/document-status.component.scss +192 -0
- package/src/lib/document/components/document-status/document-status.component.spec.ts +23 -0
- package/src/lib/document/components/document-status/document-status.component.ts +87 -0
- package/src/lib/document/components/document-upload/document-upload.component.html +160 -0
- package/src/lib/document/components/document-upload/document-upload.component.scss +235 -0
- package/src/lib/document/components/document-upload/document-upload.component.spec.ts +95 -0
- package/src/lib/document/components/document-upload/document-upload.component.ts +668 -0
- package/src/lib/document/components/document-viewer/document-viewer.component.html +50 -0
- package/src/lib/document/components/document-viewer/document-viewer.component.scss +187 -0
- package/src/lib/document/components/document-viewer/document-viewer.component.spec.ts +79 -0
- package/src/lib/document/components/document-viewer/document-viewer.component.ts +261 -0
- package/src/lib/document/components/document-zoom-controls/document-zoom-controls.component.html +48 -0
- package/src/lib/document/components/document-zoom-controls/document-zoom-controls.component.scss +320 -0
- package/src/lib/document/components/document-zoom-controls/document-zoom-controls.component.spec.ts +59 -0
- package/src/lib/document/components/document-zoom-controls/document-zoom-controls.component.ts +150 -0
- package/src/lib/document/components/documents-menu/documents-menu.component.html +44 -0
- package/src/lib/document/components/documents-menu/documents-menu.component.scss +363 -0
- package/src/lib/document/components/documents-menu/documents-menu.component.spec.ts +23 -0
- package/src/lib/document/components/documents-menu/documents-menu.component.ts +316 -0
- package/src/lib/document/components/folder-block/folder-block.component.html +46 -0
- package/src/lib/document/components/folder-block/folder-block.component.scss +9 -0
- package/src/lib/document/components/folder-block/folder-block.component.spec.ts +70 -0
- package/{lib/document/components/folder-block/folder-block.component.d.ts → src/lib/document/components/folder-block/folder-block.component.ts} +28 -12
- package/src/lib/document/components/folder-container/folder-container.component.html +56 -0
- package/src/lib/document/components/folder-container/folder-container.component.scss +20 -0
- package/src/lib/document/components/folder-container/folder-container.component.spec.ts +27 -0
- package/src/lib/document/components/folder-container/folder-container.component.ts +328 -0
- package/src/lib/document/components/linked-document/linked-document.component.html +23 -0
- package/src/lib/document/components/linked-document/linked-document.component.scss +10 -0
- package/src/lib/document/components/linked-document/linked-document.component.spec.ts +61 -0
- package/src/lib/document/components/linked-document/linked-document.component.ts +49 -0
- package/src/lib/document/components/request-document/request-document.component.html +86 -0
- package/src/lib/document/components/request-document/request-document.component.scss +16 -0
- package/src/lib/document/components/request-document/request-document.component.ts +278 -0
- package/src/lib/document/components/sidebar/sidebar.component.html +75 -0
- package/src/lib/document/components/sidebar/sidebar.component.scss +157 -0
- package/src/lib/document/components/sidebar/sidebar.component.spec.ts +114 -0
- package/src/lib/document/components/sidebar/sidebar.component.ts +223 -0
- package/src/lib/document/components/user-list/user-list.component.html +33 -0
- package/src/lib/document/components/user-list/user-list.component.scss +118 -0
- package/src/lib/document/components/user-list/user-list.component.spec.ts +23 -0
- package/src/lib/document/components/user-list/user-list.component.ts +181 -0
- package/src/lib/document/constant/DOCUMENT_HISTORY.ts +52 -0
- package/src/lib/document/directives/document.directive.ts +32 -0
- package/src/lib/document/directives/permission.directive.spec.ts +0 -0
- package/src/lib/document/directives/permission.directive.ts +72 -0
- package/src/lib/document/document.module.ts +351 -0
- package/{lib/document/models/document-alert.model.d.ts → src/lib/document/models/document-alert.model.ts} +11 -4
- package/src/lib/document/models/document-category.model.ts +30 -0
- package/src/lib/document/models/document-history.model.ts +109 -0
- package/src/lib/document/models/document-list-response.model.ts +37 -0
- package/src/lib/document/models/document-type.model.ts +44 -0
- package/src/lib/document/models/document.model.ts +53 -0
- package/{lib/document/models/folder.model.d.ts → src/lib/document/models/folder.model.ts} +10 -4
- package/src/lib/document/models/status-data.model.ts +31 -0
- package/src/lib/document/models/uploaded-file-response.model.ts +7 -0
- package/src/lib/document/models/user-list.model.ts +10 -0
- package/src/lib/document/services/csv-parser.service.spec.ts +97 -0
- package/src/lib/document/services/csv-parser.service.ts +303 -0
- package/src/lib/document/services/document-actions.service.ts +125 -0
- package/src/lib/document/services/document-content-type.service.ts +193 -0
- package/src/lib/document/services/document-history-style.service.ts +138 -0
- package/src/lib/document/services/document-history.service.ts +129 -0
- package/src/lib/document/services/document-http.service.spec.ts +119 -0
- package/src/lib/document/services/document-http.service.ts +497 -0
- package/src/lib/document/services/document-list.service.ts +195 -0
- package/src/lib/document/services/document-menu.service.ts +277 -0
- package/src/lib/document/services/document-scroll.service.ts +138 -0
- package/src/lib/document/services/document-severity.service.ts +98 -0
- package/src/lib/document/services/document-table-builder.service.ts +82 -0
- package/src/lib/document/services/document-upload-business.service.ts +326 -0
- package/src/lib/document/services/document-upload-data.service.ts +82 -0
- package/src/lib/document/services/document-upload-form.service.ts +149 -0
- package/src/lib/document/services/document-upload.service.spec.ts +99 -0
- package/src/lib/document/services/document-upload.service.ts +209 -0
- package/src/lib/document/services/document-viewer.service.ts +279 -0
- package/src/lib/document/services/document-zoom.service.spec.ts +56 -0
- package/src/lib/document/services/document-zoom.service.ts +164 -0
- package/src/lib/document/services/document.service.ts +356 -0
- package/src/lib/document/services/eml-parser.service.ts +444 -0
- package/src/lib/document/services/excel-parser.service.spec.ts +66 -0
- package/src/lib/document/services/excel-parser.service.ts +483 -0
- package/src/lib/document/services/file-format.service.spec.ts +16 -0
- package/src/lib/document/services/file-format.service.ts +63 -0
- package/src/lib/document/services/status-calculator.service.ts +44 -0
- package/src/lib/document/services/user-list.service.ts +77 -0
- package/src/lib/document/state/document.query.ts +378 -0
- package/{lib/document/state/document.service.d.ts → src/lib/document/state/document.service.ts} +46 -15
- package/src/lib/document/state/document.state.ts +100 -0
- package/src/lib/document/state/document.store.ts +200 -0
- package/{public-api.d.ts → src/public-api.ts} +4 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +15 -0
- package/Shared/components/confirmation-dialog/confirmation-dialog.component.d.ts +0 -44
- package/Shared/components/table-primary/table-primary.component.d.ts +0 -31
- package/Shared/components/table-primary/table-primary.model.d.ts +0 -19
- package/Shared/constant/ERROR.d.ts +0 -52
- package/Shared/constant/SHARED.d.ts +0 -546
- package/Shared/services/app-config.service.d.ts +0 -51
- package/Shared/services/session.service.d.ts +0 -46
- package/Shared/shared.module.d.ts +0 -14
- package/fesm2022/cat-documents-ng.mjs +0 -11392
- package/fesm2022/cat-documents-ng.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/document/components/document-actions/document-actions.component.d.ts +0 -78
- package/lib/document/components/document-container/document-container.component.d.ts +0 -162
- package/lib/document/components/document-content-viewer/document-content-viewer.component.d.ts +0 -291
- package/lib/document/components/document-history/document-history.component.d.ts +0 -160
- package/lib/document/components/document-list/document-list.component.d.ts +0 -299
- package/lib/document/components/document-list-item/document-list-item.component.d.ts +0 -28
- package/lib/document/components/document-search/document-search.component.d.ts +0 -77
- package/lib/document/components/document-status/document-status.component.d.ts +0 -24
- package/lib/document/components/document-upload/document-upload.component.d.ts +0 -321
- package/lib/document/components/document-viewer/document-viewer.component.d.ts +0 -137
- package/lib/document/components/document-zoom-controls/document-zoom-controls.component.d.ts +0 -33
- package/lib/document/components/documents-menu/documents-menu.component.d.ts +0 -110
- package/lib/document/components/folder-container/folder-container.component.d.ts +0 -162
- package/lib/document/components/linked-document/linked-document.component.d.ts +0 -39
- package/lib/document/components/request-document/request-document.component.d.ts +0 -69
- package/lib/document/components/sidebar/sidebar.component.d.ts +0 -109
- package/lib/document/components/user-list/user-list.component.d.ts +0 -34
- package/lib/document/constant/DOCUMENT_HISTORY.d.ts +0 -41
- package/lib/document/directives/document.directive.d.ts +0 -20
- package/lib/document/directives/permission.directive.d.ts +0 -38
- package/lib/document/document.module.d.ts +0 -60
- package/lib/document/models/document-category.model.d.ts +0 -24
- package/lib/document/models/document-history.model.d.ts +0 -94
- package/lib/document/models/document-list-response.model.d.ts +0 -33
- package/lib/document/models/document-type.model.d.ts +0 -37
- package/lib/document/models/document.model.d.ts +0 -44
- package/lib/document/models/status-data.model.d.ts +0 -27
- package/lib/document/models/uploaded-file-response.model.d.ts +0 -7
- package/lib/document/models/user-list.model.d.ts +0 -8
- package/lib/document/services/csv-parser.service.d.ts +0 -88
- package/lib/document/services/document-actions.service.d.ts +0 -48
- package/lib/document/services/document-content-type.service.d.ts +0 -85
- package/lib/document/services/document-history-style.service.d.ts +0 -34
- package/lib/document/services/document-history.service.d.ts +0 -42
- package/lib/document/services/document-http.service.d.ts +0 -179
- package/lib/document/services/document-list.service.d.ts +0 -74
- package/lib/document/services/document-menu.service.d.ts +0 -122
- package/lib/document/services/document-scroll.service.d.ts +0 -55
- package/lib/document/services/document-table-builder.service.d.ts +0 -38
- package/lib/document/services/document-upload-business.service.d.ts +0 -107
- package/lib/document/services/document-upload-data.service.d.ts +0 -40
- package/lib/document/services/document-upload-form.service.d.ts +0 -41
- package/lib/document/services/document-upload.service.d.ts +0 -99
- package/lib/document/services/document-viewer.service.d.ts +0 -97
- package/lib/document/services/document-zoom.service.d.ts +0 -81
- package/lib/document/services/document.service.d.ts +0 -161
- package/lib/document/services/eml-parser.service.d.ts +0 -116
- package/lib/document/services/excel-parser.service.d.ts +0 -169
- package/lib/document/services/file-format.service.d.ts +0 -34
- package/lib/document/services/status-calculator.service.d.ts +0 -20
- package/lib/document/services/user-list.service.d.ts +0 -29
- package/lib/document/state/document.query.d.ts +0 -243
- package/lib/document/state/document.state.d.ts +0 -61
- package/lib/document/state/document.store.d.ts +0 -56
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import { Component, Input, OnInit, OnDestroy, OnChanges, SimpleChanges, ViewChild, ElementRef, EventEmitter, Output } from '@angular/core';
|
|
2
|
+
import { SHARED } from '../../../../Shared/constant/SHARED';
|
|
3
|
+
import { DocumentService } from '../../state/document.service';
|
|
4
|
+
import { Subscription } from 'rxjs';
|
|
5
|
+
import { ERRORS } from '../../../../Shared/constant/ERROR';
|
|
6
|
+
import { DocumentHttpService } from '../../services/document-http.service';
|
|
7
|
+
import { DocumentQuery } from '../../state/document.query';
|
|
8
|
+
import { DocumentStore } from '../../state/document.store';
|
|
9
|
+
import { DocumentCategory } from '../../models/document-category.model';
|
|
10
|
+
import { UserListModel } from '../../models/user-list.model';
|
|
11
|
+
import { StatusDataModel } from '../../models/status-data.model';
|
|
12
|
+
import { DocumentListResponse } from '../../models/document-list-response.model';
|
|
13
|
+
import { DocumentHelperService } from '../../services/document.service';
|
|
14
|
+
import { DocumentMenuService } from '../../services/document-menu.service';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
*This component is responsible for managing and displaying a list of documents.
|
|
18
|
+
* @class DocumentContainerComponent
|
|
19
|
+
* @typedef {DocumentContainerComponent}
|
|
20
|
+
*/
|
|
21
|
+
@Component({
|
|
22
|
+
selector: 'lib-document-container',
|
|
23
|
+
standalone: false,
|
|
24
|
+
templateUrl: './document-container.component.html',
|
|
25
|
+
styleUrl: './document-container.component.scss'
|
|
26
|
+
})
|
|
27
|
+
export class DocumentContainerComponent implements OnInit, OnDestroy, OnChanges {
|
|
28
|
+
/**
|
|
29
|
+
* The document list response data
|
|
30
|
+
* @type {DocumentListResponse[] | null}
|
|
31
|
+
*/
|
|
32
|
+
documentListResponse: DocumentListResponse[] | null = null;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Status data for the current selection
|
|
36
|
+
* @type {StatusDataModel[]}
|
|
37
|
+
*/
|
|
38
|
+
statusData: StatusDataModel[] = []
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The currently selected menu item ID for scrolling
|
|
42
|
+
*/
|
|
43
|
+
selectedMenuItemId: string | null = null;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Additional navigation information for better scrolling
|
|
47
|
+
*/
|
|
48
|
+
navigationInfo: {
|
|
49
|
+
menuItemId: string;
|
|
50
|
+
menuItemLabel: string;
|
|
51
|
+
categoryLabel: string;
|
|
52
|
+
categoryIndex: number;
|
|
53
|
+
} | null = null;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Reference to the content scroll container
|
|
57
|
+
*/
|
|
58
|
+
@ViewChild('contentScrollContainer', { static: false }) contentScrollContainer!: ElementRef;
|
|
59
|
+
|
|
60
|
+
@Output() selectedDocument: EventEmitter<any> = new EventEmitter<any>();
|
|
61
|
+
@Output() selectedDocumentInNewTab: EventEmitter<any> = new EventEmitter<any>();
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Subscription to track selected menu item changes
|
|
65
|
+
*/
|
|
66
|
+
private selectedMenuItemSubscription: Subscription = new Subscription();
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Creates an instance of DocumentContainerComponent.
|
|
70
|
+
* @param {DocumentHttpService} documentHttpService - Service for HTTP operations
|
|
71
|
+
* @param {DocumentHelperService} documentHelperService - Service for document operations
|
|
72
|
+
* @param {DocumentQuery} documentQuery - Query service for document state
|
|
73
|
+
* @param {DocumentStore} documentStore - Store service for document state
|
|
74
|
+
* @param {DocumentMenuService} documentMenuService - Service for menu operations
|
|
75
|
+
*/
|
|
76
|
+
constructor(
|
|
77
|
+
private documentHttpService: DocumentHttpService,
|
|
78
|
+
private documentHelperService: DocumentHelperService,
|
|
79
|
+
private documentQuery: DocumentQuery,
|
|
80
|
+
private documentStore: DocumentStore,
|
|
81
|
+
private documentMenuService: DocumentMenuService
|
|
82
|
+
) {}
|
|
83
|
+
/**
|
|
84
|
+
* Get contextId in input.
|
|
85
|
+
* @type {string}
|
|
86
|
+
*/
|
|
87
|
+
@Input() contextId: string = SHARED.EMPTY;
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The list of folders.
|
|
92
|
+
* @type {Array}
|
|
93
|
+
*/
|
|
94
|
+
applicationNumber: string = SHARED.EMPTY
|
|
95
|
+
catagories: DocumentCategory[] = SHARED.EMPTY_ARRAY
|
|
96
|
+
userList: UserListModel[] = SHARED.EMPTY_ARRAY
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Holds the subscription to manage observable cleanup.
|
|
101
|
+
* @type {Subscription}
|
|
102
|
+
*/
|
|
103
|
+
subscription: Subscription = new Subscription();
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Handles changes to input properties
|
|
107
|
+
*/
|
|
108
|
+
ngOnChanges(changes: SimpleChanges): void {
|
|
109
|
+
if (changes[SHARED.CONTEXT_ID] && !changes[SHARED.CONTEXT_ID].firstChange) {
|
|
110
|
+
this.handleContextIdChange();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Initializes the component
|
|
116
|
+
*/
|
|
117
|
+
ngOnInit(): void {
|
|
118
|
+
this.clearAllState();
|
|
119
|
+
if (this.contextId && this.contextId !== SHARED.EMPTY) {
|
|
120
|
+
this.initializeData();
|
|
121
|
+
}
|
|
122
|
+
this.setupSelectedMenuItemSubscription();
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Sets up subscription to track selected menu item changes
|
|
127
|
+
*/
|
|
128
|
+
setupSelectedMenuItemSubscription(): void {
|
|
129
|
+
this.selectedMenuItemSubscription.add(
|
|
130
|
+
this.documentQuery.selectSelectedMenuItem().subscribe(menuItemId => {
|
|
131
|
+
this.selectedMenuItemId = menuItemId;
|
|
132
|
+
})
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Handles menu item selection events from the documents menu
|
|
138
|
+
* @param event - The menu item selection event
|
|
139
|
+
*/
|
|
140
|
+
onMenuItemSelected(event: {
|
|
141
|
+
item: any;
|
|
142
|
+
category: any;
|
|
143
|
+
navigationInfo?: {
|
|
144
|
+
menuItemId: string;
|
|
145
|
+
menuItemLabel: string;
|
|
146
|
+
categoryLabel: string;
|
|
147
|
+
categoryIndex: number;
|
|
148
|
+
};
|
|
149
|
+
}): void {
|
|
150
|
+
if (event && event.navigationInfo) {
|
|
151
|
+
this.navigationInfo = event.navigationInfo;
|
|
152
|
+
// Don't set selectedMenuItemId here - let the store subscription handle it
|
|
153
|
+
} else {
|
|
154
|
+
this.navigationInfo = null;
|
|
155
|
+
// Don't set selectedMenuItemId here - let the store subscription handle it
|
|
156
|
+
this.resetContentScrollToTop();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Resets the content scroll container to the top
|
|
162
|
+
*/
|
|
163
|
+
private resetContentScrollToTop(): void {
|
|
164
|
+
if (this.contentScrollContainer) {
|
|
165
|
+
this.contentScrollContainer.nativeElement.scrollTo({
|
|
166
|
+
top: 0,
|
|
167
|
+
behavior: 'smooth'
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Initialize all data with proper sequencing to avoid duplicate API calls
|
|
174
|
+
*/
|
|
175
|
+
initializeData(): void {
|
|
176
|
+
this.fetchDocumentCatagories();
|
|
177
|
+
this.fetchUserListWithFilters();
|
|
178
|
+
this.setupStatusDataSubscriptions();
|
|
179
|
+
this.setupFilteredDocumentSubscription();
|
|
180
|
+
this.documentHelperService.initializeSelectionWatcherWithInitialLoad(this.contextId);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Clears all state (store and component) comprehensively
|
|
185
|
+
*/
|
|
186
|
+
clearAllState(): void {
|
|
187
|
+
this.documentStore.clearSelectionState();
|
|
188
|
+
// Don't clear document viewer state - let the viewer handle its own cleanup
|
|
189
|
+
this.documentStore.setDocumentListResponse(null);
|
|
190
|
+
this.documentStore.setDocumentList([]);
|
|
191
|
+
this.documentStore.setDocumentCategories([]);
|
|
192
|
+
this.documentStore.setUserList([]);
|
|
193
|
+
this.documentStore.setStatusData([]);
|
|
194
|
+
this.documentStore.setCurrentDocument(null);
|
|
195
|
+
this.documentStore.setFolders([]);
|
|
196
|
+
this.documentStore.setDocumentAlert(null);
|
|
197
|
+
this.catagories = SHARED.EMPTY_ARRAY;
|
|
198
|
+
this.userList = SHARED.EMPTY_ARRAY;
|
|
199
|
+
this.statusData = [];
|
|
200
|
+
this.documentListResponse = null;
|
|
201
|
+
this.applicationNumber = SHARED.EMPTY;
|
|
202
|
+
this.selectedMenuItemId = null;
|
|
203
|
+
this.navigationInfo = null;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Handles contextId change by clearing all state and refetching data
|
|
208
|
+
*/
|
|
209
|
+
handleContextIdChange(): void {
|
|
210
|
+
if (this.contextId && this.contextId !== SHARED.EMPTY) {
|
|
211
|
+
this.subscription.unsubscribe();
|
|
212
|
+
this.subscription = new Subscription();
|
|
213
|
+
this.documentHelperService.cleanupSelectionWatcher();
|
|
214
|
+
this.clearAllState();
|
|
215
|
+
this.initializeData();
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Sets up subscriptions to monitor menu item and user selection changes
|
|
221
|
+
* to trigger status data fetching and user list refreshing
|
|
222
|
+
*/
|
|
223
|
+
setupStatusDataSubscriptions(): void {
|
|
224
|
+
|
|
225
|
+
this.subscription.add(
|
|
226
|
+
this.documentQuery.selectSelectedUserId().subscribe(userId => {
|
|
227
|
+
this.fetchStatusData();
|
|
228
|
+
if (this.catagories.length > 0) {
|
|
229
|
+
this.fetchUserListWithFilters();
|
|
230
|
+
}
|
|
231
|
+
})
|
|
232
|
+
);
|
|
233
|
+
this.subscription.add(
|
|
234
|
+
this.documentQuery.selectSelectedStatus().subscribe(status => {
|
|
235
|
+
this.fetchStatusData();
|
|
236
|
+
if (this.catagories.length > 0) {
|
|
237
|
+
this.fetchUserListWithFilters();
|
|
238
|
+
}
|
|
239
|
+
})
|
|
240
|
+
);
|
|
241
|
+
this.fetchStatusData();
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
onDocumentSelectedInNewTab(event: {
|
|
245
|
+
selectedDocument: any;
|
|
246
|
+
contextId: string;
|
|
247
|
+
documentList: any[];
|
|
248
|
+
}): void {
|
|
249
|
+
this.selectedDocumentInNewTab.emit(event);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Fetches status data based on current selections
|
|
253
|
+
*/
|
|
254
|
+
fetchStatusData(): void {
|
|
255
|
+
if (!this.contextId) {
|
|
256
|
+
console.warn(ERRORS.CONTEXT_ID_REQUIRED);
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
const currentState = this.documentQuery.getSelectionState();
|
|
261
|
+
const contextId = currentState.userId || null;
|
|
262
|
+
this.documentHttpService.getStatusDocumentCount(this.contextId, contextId, null).subscribe({
|
|
263
|
+
next: (statusData) => {
|
|
264
|
+
this.statusData = statusData;
|
|
265
|
+
this.documentStore.setStatusData(statusData);
|
|
266
|
+
},
|
|
267
|
+
error: (error) => {
|
|
268
|
+
console.error(ERRORS.ERROR_FETCHING_STATUS_DATA, error);
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Fetches userlist data with current filters applied
|
|
275
|
+
*/
|
|
276
|
+
fetchUserListWithFilters(): void {
|
|
277
|
+
if (!this.contextId) {
|
|
278
|
+
console.warn(ERRORS.CONTEXT_ID_REQUIRED);
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
const currentState = this.documentQuery.getSelectionState();
|
|
283
|
+
// If the API supports filtering by menu item or status, we can add those parameters
|
|
284
|
+
this.documentHttpService.getUserListByContextId(this.contextId).subscribe({
|
|
285
|
+
next: (res: UserListModel[]) => {
|
|
286
|
+
this.userList = res;
|
|
287
|
+
this.documentStore.setUserList(res);
|
|
288
|
+
},
|
|
289
|
+
error: (err: any) => {
|
|
290
|
+
console.error(ERRORS.ERROR_FETCHING_USER_LIST, err);
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Fetches document catagory data.
|
|
297
|
+
*/
|
|
298
|
+
fetchDocumentCatagories(): void {
|
|
299
|
+
const categoriesSubscription = this.documentHttpService.getDocumentCatagories(this.contextId).subscribe({
|
|
300
|
+
next: (categories: any) => {
|
|
301
|
+
if (categories) {
|
|
302
|
+
this.catagories = categories.categories;
|
|
303
|
+
this.applicationNumber = categories.applicationNumber;
|
|
304
|
+
this.documentStore.setDocumentCategories(categories.categories);
|
|
305
|
+
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
error: (err: any) => {
|
|
309
|
+
console.error(ERRORS.ERROR_FETCHING_DOCUMENT_CATEGORIES, err);
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
this.subscription.add(categoriesSubscription);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Refetches all data when contextId changes
|
|
317
|
+
*/
|
|
318
|
+
refetchAllDataForNewContext(): void {
|
|
319
|
+
if (this.contextId && this.contextId !== SHARED.EMPTY) {
|
|
320
|
+
this.documentStore.clearSelectionState();
|
|
321
|
+
this.documentStore.clearDocumentViewerState();
|
|
322
|
+
this.fetchDocumentCatagories();
|
|
323
|
+
this.fetchUserListWithFilters();
|
|
324
|
+
this.fetchStatusData();
|
|
325
|
+
this.documentHelperService.initializeSelectionWatcherWithInitialLoad(this.contextId);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Sets up subscription to listen for filtered document responses
|
|
331
|
+
*/
|
|
332
|
+
setupFilteredDocumentSubscription(): void {
|
|
333
|
+
this.subscription.add(
|
|
334
|
+
this.documentQuery.selectDocumentListResponse().subscribe({
|
|
335
|
+
next: (response: any) => {
|
|
336
|
+
this.documentListResponse = response;
|
|
337
|
+
},
|
|
338
|
+
error: (error: any) => {
|
|
339
|
+
console.error(ERRORS.ERROR_RECEIVING_DOCUMENT_LIST, error);
|
|
340
|
+
}
|
|
341
|
+
})
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
onDocumentSelected(document: any): void {
|
|
346
|
+
console.log('Document selected:', document);
|
|
347
|
+
this.selectedDocument.emit(document);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Unsubscribe subscription on destroy of component and clean up state.
|
|
352
|
+
*/
|
|
353
|
+
ngOnDestroy(): void {
|
|
354
|
+
if (this.subscription) {
|
|
355
|
+
this.subscription.unsubscribe();
|
|
356
|
+
}
|
|
357
|
+
if (this.selectedMenuItemSubscription) {
|
|
358
|
+
this.selectedMenuItemSubscription.unsubscribe();
|
|
359
|
+
}
|
|
360
|
+
this.documentHelperService.cleanupSelectionWatcher();
|
|
361
|
+
this.clearAllState();
|
|
362
|
+
}
|
|
363
|
+
}
|
package/src/lib/document/components/document-content-viewer/document-content-viewer.component.html
ADDED
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
<div class="document-content-viewer-container">
|
|
2
|
+
@if(documentUrl && contentType){
|
|
3
|
+
<!-- Zoom Controls -->
|
|
4
|
+
<div class="zoom-controls-wrapper">
|
|
5
|
+
<document-zoom-controls
|
|
6
|
+
[selectedDocument]="selectedDocument"
|
|
7
|
+
[contextId]="contextId"
|
|
8
|
+
[isFormHide]="isFormHide"
|
|
9
|
+
>
|
|
10
|
+
</document-zoom-controls>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<!-- PDF Viewer -->
|
|
14
|
+
@if(isPdf){
|
|
15
|
+
<div class="pdf-container">
|
|
16
|
+
<pdf-viewer
|
|
17
|
+
[src]="documentUrl"
|
|
18
|
+
[rotation]="0"
|
|
19
|
+
[original-size]="false"
|
|
20
|
+
[show-all]="true"
|
|
21
|
+
[fit-to-page]="false"
|
|
22
|
+
[zoom]="currentZoom / 100"
|
|
23
|
+
[zoom-scale]="'page-width'"
|
|
24
|
+
[stick-to-page]="false"
|
|
25
|
+
[render-text]="true"
|
|
26
|
+
[external-link-target]="'blank'"
|
|
27
|
+
[autoresize]="true"
|
|
28
|
+
[show-borders]="false"
|
|
29
|
+
style="width: 100%; height: 100%"
|
|
30
|
+
></pdf-viewer>
|
|
31
|
+
</div>
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
<!-- Image Viewer -->
|
|
35
|
+
@else if(isImage){
|
|
36
|
+
<div class="image-container">
|
|
37
|
+
<img
|
|
38
|
+
[src]="documentUrl"
|
|
39
|
+
[alt]="documentName || 'Document Image'"
|
|
40
|
+
class="document-image"
|
|
41
|
+
[style.transform]="'scale(' + (currentZoom / 100) + ')'"
|
|
42
|
+
[style.transform-origin]="'center center'"
|
|
43
|
+
/>
|
|
44
|
+
</div>
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
<!-- Excel Files -->
|
|
48
|
+
@else if(isExcel){
|
|
49
|
+
<div class="excel-container">
|
|
50
|
+
@if(isLoadingExcel){
|
|
51
|
+
<div class="loading-container">
|
|
52
|
+
<div class="loading-content">
|
|
53
|
+
<i class="pi pi-spin pi-spinner" style="font-size: 2rem; color: #3b82f6;"></i>
|
|
54
|
+
<p>Loading Excel file...</p>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
}@else if(excelError){
|
|
58
|
+
<div class="error-container">
|
|
59
|
+
<div class="error-content">
|
|
60
|
+
<i class="pi pi-exclamation-triangle" style="font-size: 3rem; color: #ef4444;"></i>
|
|
61
|
+
<h4>Error Loading Excel File</h4>
|
|
62
|
+
<p>{{ excelError }}</p>
|
|
63
|
+
<div class="error-actions">
|
|
64
|
+
<button
|
|
65
|
+
type="button"
|
|
66
|
+
class="p-button p-button-primary p-button-sm"
|
|
67
|
+
(click)="downloadDocument()"
|
|
68
|
+
>
|
|
69
|
+
<i class="pi pi-download"></i>
|
|
70
|
+
Download Instead
|
|
71
|
+
</button>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
}
|
|
76
|
+
@else if(excelData){
|
|
77
|
+
<div class="excel-container">
|
|
78
|
+
<div class="excel-zoom-wrapper"
|
|
79
|
+
[class.zoomed]="currentZoom !== 100"
|
|
80
|
+
(wheel)="onWheel($event)">
|
|
81
|
+
<ngx-doc-viewer
|
|
82
|
+
[url]="documentUrl"
|
|
83
|
+
viewer="office"
|
|
84
|
+
style="width:100%;height:97%;"
|
|
85
|
+
></ngx-doc-viewer>
|
|
86
|
+
<!-- Invisible overlay to capture wheel events over document content -->
|
|
87
|
+
<div class="wheel-capture-overlay"
|
|
88
|
+
(wheel)="onWheel($event)"></div>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
}
|
|
92
|
+
</div>
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
<!-- Word Files -->
|
|
96
|
+
@else if(isWord){
|
|
97
|
+
<div class="docx-container">
|
|
98
|
+
<div class="doc-viewer-wrapper"
|
|
99
|
+
[class.zoomed]="currentZoom !== 100"
|
|
100
|
+
(wheel)="onWheel($event)">
|
|
101
|
+
<ngx-doc-viewer
|
|
102
|
+
[url]="documentUrl"
|
|
103
|
+
viewer="office"
|
|
104
|
+
style="width:100%;height:97%;"
|
|
105
|
+
></ngx-doc-viewer>
|
|
106
|
+
<div class="wheel-capture-overlay"
|
|
107
|
+
(wheel)="onWheel($event)"></div>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
<!-- CSV Files -->
|
|
113
|
+
@else if(isCsv){
|
|
114
|
+
<div class="csv-container">
|
|
115
|
+
@if(isLoadingCsv){
|
|
116
|
+
<div class="loading-container">
|
|
117
|
+
<div class="loading-content">
|
|
118
|
+
<i class="pi pi-spin pi-spinner" style="font-size: 2rem; color: #3b82f6;"></i>
|
|
119
|
+
<p>Loading CSV file...</p>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
}@else if(csvError){
|
|
123
|
+
<div class="error-container">
|
|
124
|
+
<div class="error-content">
|
|
125
|
+
<i class="pi pi-exclamation-triangle" style="font-size: 3rem; color: #ef4444;"></i>
|
|
126
|
+
<h4>Error Loading CSV File</h4>
|
|
127
|
+
<p>{{ csvError }}</p>
|
|
128
|
+
<div class="error-actions">
|
|
129
|
+
<button
|
|
130
|
+
type="button"
|
|
131
|
+
class="p-button p-button-primary p-button-sm"
|
|
132
|
+
(click)="downloadDocument()"
|
|
133
|
+
>
|
|
134
|
+
<i class="pi pi-download"></i>
|
|
135
|
+
Download Instead
|
|
136
|
+
</button>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
}
|
|
141
|
+
@else if(csvData){
|
|
142
|
+
<div class="csv-content">
|
|
143
|
+
<div class="csv-header">
|
|
144
|
+
<div class="csv-info">
|
|
145
|
+
<p>{{ documentName || 'CSV File' }}</p>
|
|
146
|
+
<span class="csv-stats">
|
|
147
|
+
{{ csvData.totalRows }} rows × {{ csvData.totalColumns }} columns
|
|
148
|
+
</span>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
<div class="csv-table-container"
|
|
153
|
+
[style.transform-origin]="'center center'"
|
|
154
|
+
(wheel)="onWheel($event)">
|
|
155
|
+
<p-table
|
|
156
|
+
[value]="safeCsvStyledData"
|
|
157
|
+
[tableStyle]="{'min-width': '100%'}"
|
|
158
|
+
[scrollable]="true"
|
|
159
|
+
scrollHeight="67vh"
|
|
160
|
+
class="csv-table"
|
|
161
|
+
>
|
|
162
|
+
<ng-template pTemplate="body" let-row>
|
|
163
|
+
<tr>
|
|
164
|
+
<ng-container *ngFor="let cell of row.cells; trackBy: trackByCell">
|
|
165
|
+
<td [ngClass]="{'csv-header-cell': cell.isHeader}">
|
|
166
|
+
{{ cell.value }}
|
|
167
|
+
</td>
|
|
168
|
+
</ng-container>
|
|
169
|
+
</tr>
|
|
170
|
+
</ng-template>
|
|
171
|
+
</p-table>
|
|
172
|
+
</div>
|
|
173
|
+
</div>
|
|
174
|
+
}
|
|
175
|
+
</div>
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
<!-- Email Files -->
|
|
179
|
+
@else if(isEmail){
|
|
180
|
+
<div class="email-container">
|
|
181
|
+
@if(isLoadingEmail){
|
|
182
|
+
<div class="loading-container">
|
|
183
|
+
<i class="pi pi-spin pi-spinner" style="font-size: 2rem;"></i>
|
|
184
|
+
<p>Loading email...</p>
|
|
185
|
+
</div>
|
|
186
|
+
}
|
|
187
|
+
@else if(emailError){
|
|
188
|
+
<div class="error-container">
|
|
189
|
+
<div class="error-content">
|
|
190
|
+
<i class="pi pi-exclamation-circle" style="font-size: 2rem; color: #ef4444;"></i>
|
|
191
|
+
<h4>Unable to Preview Email</h4>
|
|
192
|
+
<p>{{ emailError }}</p>
|
|
193
|
+
<div class="error-actions">
|
|
194
|
+
<button
|
|
195
|
+
type="button"
|
|
196
|
+
class="p-button p-button-primary p-button-sm"
|
|
197
|
+
(click)="downloadDocument()"
|
|
198
|
+
>
|
|
199
|
+
<i class="pi pi-download"></i>
|
|
200
|
+
Download
|
|
201
|
+
</button>
|
|
202
|
+
</div>
|
|
203
|
+
</div>
|
|
204
|
+
</div>
|
|
205
|
+
}
|
|
206
|
+
@else if(emailData){
|
|
207
|
+
<div class="email-viewer ml-3">
|
|
208
|
+
<div class="email-header">
|
|
209
|
+
<h3 class="email-subject">{{ emailData.subject }}</h3>
|
|
210
|
+
<div class="email-metadata">
|
|
211
|
+
<div class="email-field">
|
|
212
|
+
<span class="field-label">From:</span>
|
|
213
|
+
<span class="field-value">{{ emailData.from }}</span>
|
|
214
|
+
</div>
|
|
215
|
+
<div class="email-field">
|
|
216
|
+
<span class="field-label">To:</span>
|
|
217
|
+
<span class="field-value">{{ emailData.to }}</span>
|
|
218
|
+
</div>
|
|
219
|
+
@if(emailData.cc){
|
|
220
|
+
<div class="email-field">
|
|
221
|
+
<span class="field-label">CC:</span>
|
|
222
|
+
<span class="field-value">{{ emailData.cc }}</span>
|
|
223
|
+
</div>
|
|
224
|
+
}
|
|
225
|
+
<div class="email-field">
|
|
226
|
+
<span class="field-label">Date:</span>
|
|
227
|
+
<span class="field-value">{{ emailData.date }}</span>
|
|
228
|
+
</div>
|
|
229
|
+
@if(emailData.attachments && emailData.attachments.length > 0){
|
|
230
|
+
<div class="email-field">
|
|
231
|
+
<span class="field-label">Attachments:</span>
|
|
232
|
+
<span class="field-value">
|
|
233
|
+
<i class="pi pi-paperclip"></i>
|
|
234
|
+
{{ emailData.attachments.length }} attachment(s)
|
|
235
|
+
</span>
|
|
236
|
+
</div>
|
|
237
|
+
}
|
|
238
|
+
</div>
|
|
239
|
+
</div>
|
|
240
|
+
<div class="email-body-container">
|
|
241
|
+
|
|
242
|
+
<div class="email-body email-body-text">
|
|
243
|
+
<pre>{{ emailData.body }}</pre>
|
|
244
|
+
</div>
|
|
245
|
+
</div>
|
|
246
|
+
@if(emailData.attachments && emailData.attachments.length > 0){
|
|
247
|
+
<div class="email-attachments">
|
|
248
|
+
<h4>Attachments</h4>
|
|
249
|
+
<div class="attachment-list">
|
|
250
|
+
@for(attachment of emailData.attachments; track attachment.filename){
|
|
251
|
+
<div class="attachment-item">
|
|
252
|
+
<i class="pi pi-file"></i>
|
|
253
|
+
<span>{{ attachment.filename }}</span>
|
|
254
|
+
</div>
|
|
255
|
+
}
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
258
|
+
}
|
|
259
|
+
</div>
|
|
260
|
+
}
|
|
261
|
+
@else {
|
|
262
|
+
<div class="no-email-data">
|
|
263
|
+
<i class="pi pi-envelope" style="font-size: 3rem; color: #6b7280;"></i>
|
|
264
|
+
<p>No email data available</p>
|
|
265
|
+
</div>
|
|
266
|
+
}
|
|
267
|
+
</div>
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
<!-- OpenDocument Files -->
|
|
271
|
+
@else if(isOpenDocument){
|
|
272
|
+
<div class="docx-container">
|
|
273
|
+
<div class="doc-viewer-wrapper"
|
|
274
|
+
[class.zoomed]="currentZoom !== 100"
|
|
275
|
+
(wheel)="onWheel($event)">
|
|
276
|
+
<ngx-doc-viewer
|
|
277
|
+
[url]="documentUrl"
|
|
278
|
+
viewer="office"
|
|
279
|
+
style="width:100%;height:800px;"
|
|
280
|
+
></ngx-doc-viewer>
|
|
281
|
+
<!-- Invisible overlay to capture wheel events over document content -->
|
|
282
|
+
<div class="wheel-capture-overlay"
|
|
283
|
+
(wheel)="onWheel($event)"></div>
|
|
284
|
+
</div>
|
|
285
|
+
</div>
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
<!-- Unsupported Files -->
|
|
289
|
+
@else if(isUnsupported){
|
|
290
|
+
<div class="unsupported-document-container">
|
|
291
|
+
<div class="document-preview">
|
|
292
|
+
<div class="document-icon">
|
|
293
|
+
<i [class]="documentIcon"></i>
|
|
294
|
+
</div>
|
|
295
|
+
<div class="document-info">
|
|
296
|
+
<h4>Unsupported Document Type</h4>
|
|
297
|
+
<p>{{ documentName || 'Document' }}</p>
|
|
298
|
+
<p class="document-note">This document type ({{ contentType }}) is not supported for preview. Please download to view.</p>
|
|
299
|
+
</div>
|
|
300
|
+
<div class="document-actions">
|
|
301
|
+
<button
|
|
302
|
+
type="button"
|
|
303
|
+
class="p-button p-button-primary p-button-sm"
|
|
304
|
+
(click)="downloadDocument()"
|
|
305
|
+
>
|
|
306
|
+
<i class="pi pi-download"></i>
|
|
307
|
+
Download
|
|
308
|
+
</button>
|
|
309
|
+
<button
|
|
310
|
+
type="button"
|
|
311
|
+
class="p-button p-button-outlined p-button-sm"
|
|
312
|
+
(click)="openInNewTab()"
|
|
313
|
+
>
|
|
314
|
+
<i class="pi pi-external-link"></i>
|
|
315
|
+
Open
|
|
316
|
+
</button>
|
|
317
|
+
</div>
|
|
318
|
+
</div>
|
|
319
|
+
</div>
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
@else {
|
|
323
|
+
<div class="no-document-container">
|
|
324
|
+
<div class="no-document-content">
|
|
325
|
+
<i class="pi pi-file-o" style="font-size: 3rem; color: #6b7280;"></i>
|
|
326
|
+
<h4>No Document Uploaded</h4>
|
|
327
|
+
<p>Please Upload a document to view its content.</p>
|
|
328
|
+
</div>
|
|
329
|
+
</div>
|
|
330
|
+
}
|
|
331
|
+
</div>
|
|
332
|
+
|