cat-documents-ng 0.1.8 → 0.1.10
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/README.md +1 -1
- package/Shared/constant/SHARED.d.ts +6 -0
- package/fesm2022/cat-documents-ng.mjs +127 -225
- package/fesm2022/cat-documents-ng.mjs.map +1 -1
- package/lib/document/components/document-container/document-container.component.d.ts +1 -3
- package/lib/document/components/document-list/document-list.component.d.ts +18 -1
- package/lib/document/components/document-viewer/document-viewer.component.d.ts +1 -7
- package/lib/document/document.module.d.ts +18 -19
- package/lib/document/models/document.model.d.ts +3 -2
- package/lib/document/services/document-http.service.d.ts +10 -1
- package/lib/document/state/document.query.d.ts +0 -6
- package/lib/document/state/document.state.d.ts +0 -1
- package/lib/document/state/document.store.d.ts +0 -2
- package/package.json +1 -1
- package/Shared/interceptor/error-interceptor.interceptor.d.ts +0 -15
- package/lib/document/components/linked-document/linked-document.component.d.ts +0 -14
|
@@ -2,11 +2,11 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Injectable, Component, Input, EventEmitter, Output, ViewEncapsulation, ViewChild, Directive, APP_INITIALIZER, NgModule } from '@angular/core';
|
|
3
3
|
import * as i5 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
-
import { firstValueFrom, tap, catchError, throwError, BehaviorSubject, Subscription } from 'rxjs';
|
|
5
|
+
import { firstValueFrom, tap, EMPTY, catchError, throwError, BehaviorSubject, Subscription } from 'rxjs';
|
|
6
6
|
import { __decorate } from 'tslib';
|
|
7
7
|
import { EntityStore, StoreConfig, QueryEntity } from '@datorama/akita';
|
|
8
8
|
import * as i2 from '@angular/common/http';
|
|
9
|
-
import { HttpClientModule
|
|
9
|
+
import { HttpClientModule } from '@angular/common/http';
|
|
10
10
|
import * as i3 from 'primeng/api';
|
|
11
11
|
import { MessageService } from 'primeng/api';
|
|
12
12
|
import * as i5$1 from 'primeng/accordion';
|
|
@@ -22,6 +22,8 @@ import * as i11 from 'primeng/dialog';
|
|
|
22
22
|
import { DialogModule } from 'primeng/dialog';
|
|
23
23
|
import * as i12 from 'primeng/dropdown';
|
|
24
24
|
import { DropdownModule } from 'primeng/dropdown';
|
|
25
|
+
import * as i13 from 'primeng/inputtext';
|
|
26
|
+
import { InputTextModule } from 'primeng/inputtext';
|
|
25
27
|
import * as i7$1 from 'primeng/fileupload';
|
|
26
28
|
import { FileUploadModule } from 'primeng/fileupload';
|
|
27
29
|
import * as i8 from 'primeng/progressbar';
|
|
@@ -34,8 +36,6 @@ import { ListboxModule } from 'primeng/listbox';
|
|
|
34
36
|
import { TimelineModule } from 'primeng/timeline';
|
|
35
37
|
import { CheckboxModule } from 'primeng/checkbox';
|
|
36
38
|
import { InputTextareaModule } from 'primeng/inputtextarea';
|
|
37
|
-
import { InputTextModule } from 'primeng/inputtext';
|
|
38
|
-
import { catchError as catchError$1 } from 'rxjs/operators';
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* The `SHARED` class contains shared constants used across the application.
|
|
@@ -174,6 +174,12 @@ class SHARED {
|
|
|
174
174
|
* @type {string}
|
|
175
175
|
*/
|
|
176
176
|
static UPLOAD_ERROR_DETAILS = 'Required form data is missing. Please ensure the document and all required fields are provided.';
|
|
177
|
+
/**
|
|
178
|
+
* Represents the message prefix for a successful document name update.
|
|
179
|
+
* @static
|
|
180
|
+
* @type {string}
|
|
181
|
+
*/
|
|
182
|
+
static UPDATE_DOCUMENT_NAME = 'Document name updated for ID:';
|
|
177
183
|
}
|
|
178
184
|
/**
|
|
179
185
|
* `DUMMYDOCUMENTLIST` is a mock list of document objects used for testing and development purposes.
|
|
@@ -352,6 +358,67 @@ class ERRORS {
|
|
|
352
358
|
static ERROR_DOCUMENT_TYPES = "Error fetching document types:";
|
|
353
359
|
}
|
|
354
360
|
|
|
361
|
+
/**
|
|
362
|
+
* Class that holds the URLs used throughout the application.
|
|
363
|
+
* These URLs are typically used for making API requests and accessing various resources.
|
|
364
|
+
* @class URLS
|
|
365
|
+
* @typedef {URLS}
|
|
366
|
+
*/
|
|
367
|
+
class URLS {
|
|
368
|
+
/**
|
|
369
|
+
* The URL to fetch the application configuration file.
|
|
370
|
+
* This JSON file typically contains settings and options for the application.
|
|
371
|
+
* @static
|
|
372
|
+
* @type {string}
|
|
373
|
+
*/
|
|
374
|
+
static CONFIGFILEURL = "assets/config/api.config.json";
|
|
375
|
+
/**
|
|
376
|
+
* The URL endpoint for document uploads.
|
|
377
|
+
* Used to send documents to the server for storage or processing.
|
|
378
|
+
* @static
|
|
379
|
+
* @type {string}
|
|
380
|
+
*/
|
|
381
|
+
static DOCUMENT_UPLOAD = "Documents";
|
|
382
|
+
/**
|
|
383
|
+
* The query parameter to pass a context ID in API requests.
|
|
384
|
+
* Used to specify the context for certain API calls, such as filtering or scoping the request.
|
|
385
|
+
* @static
|
|
386
|
+
* @type {string}
|
|
387
|
+
*/
|
|
388
|
+
static CONTEXT = "?contextId=";
|
|
389
|
+
/**
|
|
390
|
+
* The query parameter to pass a document ID in API requests.
|
|
391
|
+
* @static
|
|
392
|
+
* @type {string}
|
|
393
|
+
*/
|
|
394
|
+
static DOCUMENT_TYPES = "documentTypes";
|
|
395
|
+
/**
|
|
396
|
+
* The query parameter to pass a context ID in API requests.
|
|
397
|
+
* @static
|
|
398
|
+
* @type {string}
|
|
399
|
+
*/
|
|
400
|
+
static FOLDERS = "/folders?contextId=";
|
|
401
|
+
/**
|
|
402
|
+
* The query parameter to pass a document ID in API requests.
|
|
403
|
+
* @static
|
|
404
|
+
* @type {string}
|
|
405
|
+
*/
|
|
406
|
+
static ALERT_BY_DOCUMENT_ID = "alerts?documentId=";
|
|
407
|
+
/**
|
|
408
|
+
* The query parameter to pass a document ID in API requests.
|
|
409
|
+
* @static
|
|
410
|
+
* @type {string}
|
|
411
|
+
*/
|
|
412
|
+
static PARENT_DOCUMENT_TYPE_ID = "parentDocumentType?parentDocumentTypeId=";
|
|
413
|
+
/**
|
|
414
|
+
* The query parameter to pass a context ID in API requests.
|
|
415
|
+
* Used to specify the context for certain API calls, such as filtering or scoping the request.
|
|
416
|
+
* @static
|
|
417
|
+
* @type {string}
|
|
418
|
+
*/
|
|
419
|
+
static CONTEXT_ID = "&contextId=";
|
|
420
|
+
}
|
|
421
|
+
|
|
355
422
|
/**
|
|
356
423
|
* Creates the initial state for the `DocumentState` store.
|
|
357
424
|
* This function provides default values for all properties in the `DocumentState` interface,
|
|
@@ -369,8 +436,7 @@ function createInitialState() {
|
|
|
369
436
|
parentDocumentTypeId: null,
|
|
370
437
|
documentAlert: { _id: '' },
|
|
371
438
|
folders: [],
|
|
372
|
-
messages: []
|
|
373
|
-
documentList: []
|
|
439
|
+
messages: []
|
|
374
440
|
};
|
|
375
441
|
}
|
|
376
442
|
|
|
@@ -406,9 +472,6 @@ let DocumentStore = class DocumentStore extends EntityStore {
|
|
|
406
472
|
setMessage(message) {
|
|
407
473
|
this.update({ messages: message });
|
|
408
474
|
}
|
|
409
|
-
setDocumentList(documents) {
|
|
410
|
-
this.update({ documents: documents });
|
|
411
|
-
}
|
|
412
475
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
413
476
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentStore, providedIn: 'root' });
|
|
414
477
|
};
|
|
@@ -420,67 +483,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
420
483
|
args: [{ providedIn: 'root' }]
|
|
421
484
|
}], ctorParameters: () => [] });
|
|
422
485
|
|
|
423
|
-
/**
|
|
424
|
-
* Class that holds the URLs used throughout the application.
|
|
425
|
-
* These URLs are typically used for making API requests and accessing various resources.
|
|
426
|
-
* @class URLS
|
|
427
|
-
* @typedef {URLS}
|
|
428
|
-
*/
|
|
429
|
-
class URLS {
|
|
430
|
-
/**
|
|
431
|
-
* The URL to fetch the application configuration file.
|
|
432
|
-
* This JSON file typically contains settings and options for the application.
|
|
433
|
-
* @static
|
|
434
|
-
* @type {string}
|
|
435
|
-
*/
|
|
436
|
-
static CONFIGFILEURL = "assets/config/api.config.json";
|
|
437
|
-
/**
|
|
438
|
-
* The URL endpoint for document uploads.
|
|
439
|
-
* Used to send documents to the server for storage or processing.
|
|
440
|
-
* @static
|
|
441
|
-
* @type {string}
|
|
442
|
-
*/
|
|
443
|
-
static DOCUMENT_UPLOAD = "Documents";
|
|
444
|
-
/**
|
|
445
|
-
* The query parameter to pass a context ID in API requests.
|
|
446
|
-
* Used to specify the context for certain API calls, such as filtering or scoping the request.
|
|
447
|
-
* @static
|
|
448
|
-
* @type {string}
|
|
449
|
-
*/
|
|
450
|
-
static CONTEXT = "?contextId=";
|
|
451
|
-
/**
|
|
452
|
-
* The query parameter to pass a document ID in API requests.
|
|
453
|
-
* @static
|
|
454
|
-
* @type {string}
|
|
455
|
-
*/
|
|
456
|
-
static DOCUMENT_TYPES = "documentTypes";
|
|
457
|
-
/**
|
|
458
|
-
* The query parameter to pass a context ID in API requests.
|
|
459
|
-
* @static
|
|
460
|
-
* @type {string}
|
|
461
|
-
*/
|
|
462
|
-
static FOLDERS = "/folders?contextId=";
|
|
463
|
-
/**
|
|
464
|
-
* The query parameter to pass a document ID in API requests.
|
|
465
|
-
* @static
|
|
466
|
-
* @type {string}
|
|
467
|
-
*/
|
|
468
|
-
static ALERT_BY_DOCUMENT_ID = "alerts?documentId=";
|
|
469
|
-
/**
|
|
470
|
-
* The query parameter to pass a document ID in API requests.
|
|
471
|
-
* @static
|
|
472
|
-
* @type {string}
|
|
473
|
-
*/
|
|
474
|
-
static PARENT_DOCUMENT_TYPE_ID = "parentDocumentType?parentDocumentTypeId=";
|
|
475
|
-
/**
|
|
476
|
-
* The query parameter to pass a context ID in API requests.
|
|
477
|
-
* Used to specify the context for certain API calls, such as filtering or scoping the request.
|
|
478
|
-
* @static
|
|
479
|
-
* @type {string}
|
|
480
|
-
*/
|
|
481
|
-
static CONTEXT_ID = "&contextId=";
|
|
482
|
-
}
|
|
483
|
-
|
|
484
486
|
/**
|
|
485
487
|
* Service that handles loading and providing configuration settings for the application.
|
|
486
488
|
* It fetches configuration data from a remote server and exposes various configuration options.
|
|
@@ -665,13 +667,6 @@ class DocumentQuery extends QueryEntity {
|
|
|
665
667
|
selectMessages() {
|
|
666
668
|
return this.select((state) => state.messages);
|
|
667
669
|
}
|
|
668
|
-
/**
|
|
669
|
-
* Selects the set documents.
|
|
670
|
-
* @returns {Observable<documentModel[]>} Observable that emits the documets.
|
|
671
|
-
*/
|
|
672
|
-
selectDocumets() {
|
|
673
|
-
return this.select((state) => state.documentList);
|
|
674
|
-
}
|
|
675
670
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentQuery, deps: [{ token: DocumentStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
676
671
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentQuery, providedIn: 'root' });
|
|
677
672
|
}
|
|
@@ -715,6 +710,8 @@ class DocumentHttpService {
|
|
|
715
710
|
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
716
711
|
*/
|
|
717
712
|
getFoldersData(contextId) {
|
|
713
|
+
if (!contextId)
|
|
714
|
+
return EMPTY;
|
|
718
715
|
return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}${URLS.FOLDERS}${contextId}`).pipe(tap((folders) => {
|
|
719
716
|
this.documentStore.setFolders(folders);
|
|
720
717
|
}), catchError((error) => {
|
|
@@ -758,6 +755,19 @@ class DocumentHttpService {
|
|
|
758
755
|
return throwError(() => new Error(error));
|
|
759
756
|
}));
|
|
760
757
|
}
|
|
758
|
+
/**
|
|
759
|
+
* Updates the name of a document.
|
|
760
|
+
* This method sends an HTTP PUT request to update the document's file name using the provided document ID and payload.
|
|
761
|
+
* In case of an error, it will return an observable that throws an Error.
|
|
762
|
+
* @param {string} documentId - The unique identifier of the document to update.
|
|
763
|
+
* @param {any} payload - The payload containing the updated document data (e.g., fileName).
|
|
764
|
+
* @returns {Observable<DocumentModel>} An observable that emits the updated DocumentModel.
|
|
765
|
+
*/
|
|
766
|
+
updateDocumentName(documentId, payload) {
|
|
767
|
+
return this.http.put(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${documentId}`, payload).pipe(catchError((error) => {
|
|
768
|
+
return throwError(() => new Error(error));
|
|
769
|
+
}));
|
|
770
|
+
}
|
|
761
771
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentHttpService, deps: [{ token: DocumentStore }, { token: i2.HttpClient }, { token: AppConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
762
772
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentHttpService, providedIn: 'root' });
|
|
763
773
|
}
|
|
@@ -1256,41 +1266,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
1256
1266
|
}]
|
|
1257
1267
|
}] });
|
|
1258
1268
|
|
|
1259
|
-
class LinkedDocumentComponent {
|
|
1260
|
-
selectedDocument;
|
|
1261
|
-
documentList;
|
|
1262
|
-
selectedDocumentChange = new EventEmitter();
|
|
1263
|
-
filteredDocuments = [];
|
|
1264
|
-
ngOnChanges() {
|
|
1265
|
-
this.updateFilteredDocuments();
|
|
1266
|
-
}
|
|
1267
|
-
updateFilteredDocuments() {
|
|
1268
|
-
if (this.documentList && this.selectedDocument) {
|
|
1269
|
-
this.filteredDocuments = this.documentList.filter((doc) => doc._id !== this.selectedDocument?._id);
|
|
1270
|
-
}
|
|
1271
|
-
else {
|
|
1272
|
-
this.filteredDocuments = this.documentList || [];
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
handleDocumentClick(document) {
|
|
1276
|
-
this.selectedDocument = document;
|
|
1277
|
-
this.selectedDocumentChange.emit(this.selectedDocument);
|
|
1278
|
-
this.updateFilteredDocuments();
|
|
1279
|
-
}
|
|
1280
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: LinkedDocumentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1281
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: LinkedDocumentComponent, isStandalone: false, selector: "app-linked-document", inputs: { selectedDocument: "selectedDocument", documentList: "documentList" }, outputs: { selectedDocumentChange: "selectedDocumentChange" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"summary-card mb-4 pb-1\">\r\n <div class=\"card p-0 mb-0\"\r\n style=\"border-bottom: 1px solid;border-color: rgba(68, 72, 109, 0.2); border-bottom-right-radius: 0px;border-bottom-left-radius: 0px; background-color: #F9fafb;\">\r\n <div class=\"p-0\">\r\n <h4 class=\"m-0 pt-3 pl-3 mb-3\" style=\"font-size: 21px; font-weight: bold; \">Linked Documents</h4>\r\n </div>\r\n </div>\r\n <div class=\"card mb-0\" style=\"border-top-right-radius: 0px;border-top-left-radius: 0px;\">\r\n @for(document of filteredDocuments; track document){\r\n <div class=\"linkedDocument documentName m-2\">\r\n <div class=\"documentName\" (click)=\"handleDocumentClick(document)\">\r\n <span class=\"pi pi-link\"></span>\r\n {{document.fileName}}\r\n </div>\r\n </div>\r\n }\r\n\r\n </div>\r\n \r\n \r\n </div>\r\n ", styles: [".documentName{font-family:inherit;text-decoration:underline;cursor:pointer}\n"] });
|
|
1282
|
-
}
|
|
1283
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: LinkedDocumentComponent, decorators: [{
|
|
1284
|
-
type: Component,
|
|
1285
|
-
args: [{ selector: 'app-linked-document', standalone: false, template: "<div class=\"summary-card mb-4 pb-1\">\r\n <div class=\"card p-0 mb-0\"\r\n style=\"border-bottom: 1px solid;border-color: rgba(68, 72, 109, 0.2); border-bottom-right-radius: 0px;border-bottom-left-radius: 0px; background-color: #F9fafb;\">\r\n <div class=\"p-0\">\r\n <h4 class=\"m-0 pt-3 pl-3 mb-3\" style=\"font-size: 21px; font-weight: bold; \">Linked Documents</h4>\r\n </div>\r\n </div>\r\n <div class=\"card mb-0\" style=\"border-top-right-radius: 0px;border-top-left-radius: 0px;\">\r\n @for(document of filteredDocuments; track document){\r\n <div class=\"linkedDocument documentName m-2\">\r\n <div class=\"documentName\" (click)=\"handleDocumentClick(document)\">\r\n <span class=\"pi pi-link\"></span>\r\n {{document.fileName}}\r\n </div>\r\n </div>\r\n }\r\n\r\n </div>\r\n \r\n \r\n </div>\r\n ", styles: [".documentName{font-family:inherit;text-decoration:underline;cursor:pointer}\n"] }]
|
|
1286
|
-
}], propDecorators: { selectedDocument: [{
|
|
1287
|
-
type: Input
|
|
1288
|
-
}], documentList: [{
|
|
1289
|
-
type: Input
|
|
1290
|
-
}], selectedDocumentChange: [{
|
|
1291
|
-
type: Output
|
|
1292
|
-
}] } });
|
|
1293
|
-
|
|
1294
1269
|
/**
|
|
1295
1270
|
* Component for viewing and managing document details.
|
|
1296
1271
|
* @class DocumentViewerComponent
|
|
@@ -1304,11 +1279,6 @@ class DocumentViewerComponent {
|
|
|
1304
1279
|
* @type {*}
|
|
1305
1280
|
*/
|
|
1306
1281
|
selectedDocument; // <-- Made optional to prevent undefined issues
|
|
1307
|
-
/**
|
|
1308
|
-
* Get the selected document by user.
|
|
1309
|
-
* @type {*}
|
|
1310
|
-
*/
|
|
1311
|
-
documentList; // <-- Made optional to prevent undefined issues
|
|
1312
1282
|
/**
|
|
1313
1283
|
* Indicates whether a checkbox is selected.
|
|
1314
1284
|
* @type {boolean}
|
|
@@ -1352,10 +1322,6 @@ class DocumentViewerComponent {
|
|
|
1352
1322
|
this.alertData = DocumentAlertList.find((res) => res.status === this.selectedDocument?.status);
|
|
1353
1323
|
}
|
|
1354
1324
|
}
|
|
1355
|
-
handleSelectedDocument(document) {
|
|
1356
|
-
this.selectedDocument = document;
|
|
1357
|
-
this.documentService.set(this.selectedDocument);
|
|
1358
|
-
}
|
|
1359
1325
|
/**
|
|
1360
1326
|
* Determines if the given content type is an image.
|
|
1361
1327
|
* @param {string | undefined} contentType - The MIME type of the content.
|
|
@@ -1368,15 +1334,13 @@ class DocumentViewerComponent {
|
|
|
1368
1334
|
this.subscription.unsubscribe();
|
|
1369
1335
|
}
|
|
1370
1336
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentViewerComponent, deps: [{ token: DocumentHttpService }, { token: DocumentService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1371
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DocumentViewerComponent, isStandalone: false, selector: "document-viewer", inputs: { selectedDocument: "selectedDocument"
|
|
1337
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DocumentViewerComponent, isStandalone: false, selector: "document-viewer", inputs: { selectedDocument: "selectedDocument" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"grid\">\r\n <div class=\"col-12\">\r\n <div class=\"p-fluid p-formgrid grid m-0\">\r\n <div class=\"col-12 md:col-12 md:flex justify-content-evenly\">\r\n @if(selectedDocument){\r\n <div id=\"outerContainer col-12 md:col-7\">\r\n <div\r\n *ngIf=\"isImage(selectedDocument?.contentType)\"\r\n class=\"img-container\"\r\n >\r\n <img\r\n [src]=\"selectedDocument?.documentUrl || ''\"\r\n class=\"uploadedImages\"\r\n alt=\"Document Image\"\r\n />\r\n </div>\r\n @if(selectedDocument?.contentType && selectedDocument?.contentType === \"application/pdf\"){\r\n <div class=\"pdf-container\">\r\n <pdf-viewer\r\n [src]=\"selectedDocument?.documentUrl || ''\"\r\n [rotation]=\"0\"\r\n [original-size]=\"false\"\r\n [show-all]=\"true\"\r\n [fit-to-page]=\"false\"\r\n [zoom]=\"1\"\r\n [zoom-scale]=\"'page-width'\"\r\n [stick-to-page]=\"false\"\r\n [render-text]=\"true\"\r\n [external-link-target]=\"'blank'\"\r\n [autoresize]=\"true\"\r\n [show-borders]=\"false\"\r\n style=\"width: 50vw; height: 75vh\"\r\n ></pdf-viewer>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <div class=\"left-part col-12 md:col-3 pt-0\">\r\n <div class=\"alerts mb-4 pb-1\">\r\n <button\r\n type=\"button\"\r\n *ngIf=\"\r\n (alertData?.status !== 'Pending' && !!alertData?.status) ||\r\n alertData?.isAlert === false\r\n \"\r\n class=\"bg-green-500 border-none border-round-md flex align-items-center mb-3 p-2 px-3\"\r\n >\r\n <i\r\n class=\"pi pi-verified mr-2 cursor-pointer\"\r\n [ngStyle]=\"{\r\n color:\r\n alertData?.status === 'Pending' &&\r\n alertData?.isAlert !== false\r\n ? '#FFFFFF'\r\n : '#8A8EA6'\r\n }\"\r\n style=\"font-size: 20px\"\r\n ></i>\r\n <span class=\"font-semibold text-white\">Verified</span>\r\n </button>\r\n <div\r\n class=\"card mb-0\"\r\n [ngClass]=\"\r\n (alertData?.status === 'Pending' || !alertData?.status) &&\r\n alertData?.isAlert !== false\r\n ? 'alert-card'\r\n : 'success-alert'\r\n \"\r\n >\r\n <div class=\"flex align-items-center mb-2 pb-1\" *ngIf=\"alertData?.status !== 'Verified'\">\r\n <h4 class=\"mr-3 mt-0 mb-0 text-color font-bold\" style=\"font-size: 21px; font-weight: bold; border-color: rgba(68, 72, 109, 0.2) ;\" >Alerts</h4>\r\n <i\r\n class=\"pi pi-exclamation-triangle\"\r\n style=\"font-size: 20px\"\r\n [ngStyle]=\"{\r\n color:\r\n (alertData?.status === 'Pending' || !alertData?.status) &&\r\n alertData?.isAlert !== false\r\n ? '#FB392D'\r\n : '#8A8EA6'\r\n }\"\r\n ></i>\r\n </div>\r\n <p class=\"text-color mb-0\">{{ alertData?.alertMessage }}</p>\r\n </div>\r\n </div>\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".alert-card{background-color:#fb392d1a}.success-alert{border-radius:10px;border:1px solid rgba(251,57,45,.1);background:linear-gradient(0deg,#dedede 0% 100%),#fff}.p-timeline-event-opposite{display:none}.decription{color:#676b89}.textAreaControl textarea{width:100%;resize:vertical;max-width:100%}.document-btn-wrapper .p-button-outlined{color:#f57c00}.document-viewer .p-dialog{width:100%;height:100%;max-height:100%!important;box-shadow:none!important}.document-viewer .p-dialog-header-close-icon{height:20px;width:20px}.document-viewer .p-dialog-header,.document-viewer .p-dialog-content{background-color:#fff;border-radius:0}.uploadedImages{width:95%;height:100%;object-fit:contain}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i4.PdfViewerComponent, selector: "pdf-viewer", inputs: ["src", "c-maps-url", "page", "render-text", "render-text-mode", "original-size", "show-all", "stick-to-page", "zoom", "zoom-scale", "rotation", "external-link-target", "autoresize", "fit-to-page", "show-borders"], outputs: ["after-load-complete", "page-rendered", "pages-initialized", "text-layer-rendered", "error", "on-progress", "pageChange"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
1372
1338
|
}
|
|
1373
1339
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentViewerComponent, decorators: [{
|
|
1374
1340
|
type: Component,
|
|
1375
|
-
args: [{ selector: 'document-viewer', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"grid\">\r\n <div class=\"col-12\">\r\n <div class=\"p-fluid p-formgrid grid m-0\">\r\n <div class=\"col-12 md:col-12 md:flex justify-content-evenly\">\r\n @if(selectedDocument){\r\n <div id=\"outerContainer col-12 md:col-7\">\r\n <div\r\n *ngIf=\"isImage(selectedDocument?.contentType)\"\r\n class=\"img-container\"\r\n >\r\n <img\r\n [src]=\"selectedDocument?.documentUrl || ''\"\r\n class=\"uploadedImages\"\r\n alt=\"Document Image\"\r\n />\r\n </div>\r\n @if(selectedDocument?.contentType && selectedDocument?.contentType === \"application/pdf\"){\r\n <div class=\"pdf-container\">\r\n <pdf-viewer\r\n [src]=\"selectedDocument?.documentUrl || ''\"\r\n [rotation]=\"0\"\r\n [original-size]=\"false\"\r\n [show-all]=\"true\"\r\n [fit-to-page]=\"false\"\r\n [zoom]=\"1\"\r\n [zoom-scale]=\"'page-width'\"\r\n [stick-to-page]=\"false\"\r\n [render-text]=\"true\"\r\n [external-link-target]=\"'blank'\"\r\n [autoresize]=\"true\"\r\n [show-borders]=\"false\"\r\n style=\"width: 50vw; height: 75vh\"\r\n ></pdf-viewer>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <div class=\"left-part col-12 md:col-3 pt-0\">\r\n <div class=\"alerts mb-4 pb-1\">\r\n <button\r\n type=\"button\"\r\n *ngIf=\"\r\n (alertData?.status !== 'Pending' && !!alertData?.status) ||\r\n alertData?.isAlert === false\r\n \"\r\n class=\"bg-green-500 border-none border-round-md flex align-items-center mb-3 p-2 px-3\"\r\n >\r\n <i\r\n class=\"pi pi-verified mr-2 cursor-pointer\"\r\n [ngStyle]=\"{\r\n color:\r\n alertData?.status === 'Pending' &&\r\n alertData?.isAlert !== false\r\n ? '#FFFFFF'\r\n : '#8A8EA6'\r\n }\"\r\n style=\"font-size: 20px\"\r\n ></i>\r\n <span class=\"font-semibold text-white\">Verified</span>\r\n </button>\r\n <div\r\n class=\"card mb-0\"\r\n [ngClass]=\"\r\n (alertData?.status === 'Pending' || !alertData?.status) &&\r\n alertData?.isAlert !== false\r\n ? 'alert-card'\r\n : 'success-alert'\r\n \"\r\n >\r\n <div class=\"flex align-items-center mb-2 pb-1\" *ngIf=\"alertData?.status !== 'Verified'\">\r\n <h4 class=\"mr-3 mt-0 mb-0 text-color font-bold\" style=\"font-size: 21px; font-weight: bold; border-color: rgba(68, 72, 109, 0.2) ;\" >Alerts</h4>\r\n <i\r\n class=\"pi pi-exclamation-triangle\"\r\n style=\"font-size: 20px\"\r\n [ngStyle]=\"{\r\n color:\r\n (alertData?.status === 'Pending' || !alertData?.status) &&\r\n alertData?.isAlert !== false\r\n ? '#FB392D'\r\n : '#8A8EA6'\r\n }\"\r\n ></i>\r\n </div>\r\n <p class=\"text-color mb-0\">{{ alertData?.alertMessage }}</p>\r\n </div>\r\n </div>\r\n <ng-content></ng-content>\r\n
|
|
1341
|
+
args: [{ selector: 'document-viewer', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"grid\">\r\n <div class=\"col-12\">\r\n <div class=\"p-fluid p-formgrid grid m-0\">\r\n <div class=\"col-12 md:col-12 md:flex justify-content-evenly\">\r\n @if(selectedDocument){\r\n <div id=\"outerContainer col-12 md:col-7\">\r\n <div\r\n *ngIf=\"isImage(selectedDocument?.contentType)\"\r\n class=\"img-container\"\r\n >\r\n <img\r\n [src]=\"selectedDocument?.documentUrl || ''\"\r\n class=\"uploadedImages\"\r\n alt=\"Document Image\"\r\n />\r\n </div>\r\n @if(selectedDocument?.contentType && selectedDocument?.contentType === \"application/pdf\"){\r\n <div class=\"pdf-container\">\r\n <pdf-viewer\r\n [src]=\"selectedDocument?.documentUrl || ''\"\r\n [rotation]=\"0\"\r\n [original-size]=\"false\"\r\n [show-all]=\"true\"\r\n [fit-to-page]=\"false\"\r\n [zoom]=\"1\"\r\n [zoom-scale]=\"'page-width'\"\r\n [stick-to-page]=\"false\"\r\n [render-text]=\"true\"\r\n [external-link-target]=\"'blank'\"\r\n [autoresize]=\"true\"\r\n [show-borders]=\"false\"\r\n style=\"width: 50vw; height: 75vh\"\r\n ></pdf-viewer>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <div class=\"left-part col-12 md:col-3 pt-0\">\r\n <div class=\"alerts mb-4 pb-1\">\r\n <button\r\n type=\"button\"\r\n *ngIf=\"\r\n (alertData?.status !== 'Pending' && !!alertData?.status) ||\r\n alertData?.isAlert === false\r\n \"\r\n class=\"bg-green-500 border-none border-round-md flex align-items-center mb-3 p-2 px-3\"\r\n >\r\n <i\r\n class=\"pi pi-verified mr-2 cursor-pointer\"\r\n [ngStyle]=\"{\r\n color:\r\n alertData?.status === 'Pending' &&\r\n alertData?.isAlert !== false\r\n ? '#FFFFFF'\r\n : '#8A8EA6'\r\n }\"\r\n style=\"font-size: 20px\"\r\n ></i>\r\n <span class=\"font-semibold text-white\">Verified</span>\r\n </button>\r\n <div\r\n class=\"card mb-0\"\r\n [ngClass]=\"\r\n (alertData?.status === 'Pending' || !alertData?.status) &&\r\n alertData?.isAlert !== false\r\n ? 'alert-card'\r\n : 'success-alert'\r\n \"\r\n >\r\n <div class=\"flex align-items-center mb-2 pb-1\" *ngIf=\"alertData?.status !== 'Verified'\">\r\n <h4 class=\"mr-3 mt-0 mb-0 text-color font-bold\" style=\"font-size: 21px; font-weight: bold; border-color: rgba(68, 72, 109, 0.2) ;\" >Alerts</h4>\r\n <i\r\n class=\"pi pi-exclamation-triangle\"\r\n style=\"font-size: 20px\"\r\n [ngStyle]=\"{\r\n color:\r\n (alertData?.status === 'Pending' || !alertData?.status) &&\r\n alertData?.isAlert !== false\r\n ? '#FB392D'\r\n : '#8A8EA6'\r\n }\"\r\n ></i>\r\n </div>\r\n <p class=\"text-color mb-0\">{{ alertData?.alertMessage }}</p>\r\n </div>\r\n </div>\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".alert-card{background-color:#fb392d1a}.success-alert{border-radius:10px;border:1px solid rgba(251,57,45,.1);background:linear-gradient(0deg,#dedede 0% 100%),#fff}.p-timeline-event-opposite{display:none}.decription{color:#676b89}.textAreaControl textarea{width:100%;resize:vertical;max-width:100%}.document-btn-wrapper .p-button-outlined{color:#f57c00}.document-viewer .p-dialog{width:100%;height:100%;max-height:100%!important;box-shadow:none!important}.document-viewer .p-dialog-header-close-icon{height:20px;width:20px}.document-viewer .p-dialog-header,.document-viewer .p-dialog-content{background-color:#fff;border-radius:0}.uploadedImages{width:95%;height:100%;object-fit:contain}\n"] }]
|
|
1376
1342
|
}], ctorParameters: () => [{ type: DocumentHttpService }, { type: DocumentService }], propDecorators: { selectedDocument: [{
|
|
1377
1343
|
type: Input
|
|
1378
|
-
}], documentList: [{
|
|
1379
|
-
type: Input
|
|
1380
1344
|
}] } });
|
|
1381
1345
|
|
|
1382
1346
|
/**
|
|
@@ -1592,7 +1556,16 @@ class DocumentListComponent {
|
|
|
1592
1556
|
* @memberof DocumentListComponent
|
|
1593
1557
|
*/
|
|
1594
1558
|
selectedOption = null;
|
|
1559
|
+
/**
|
|
1560
|
+
* The set of permissions available for this component.
|
|
1561
|
+
*/
|
|
1595
1562
|
PERMISSION = PERMISSIONS;
|
|
1563
|
+
/**
|
|
1564
|
+
* The file name associated with the document.
|
|
1565
|
+
* It may be undefined until a file is selected or loaded.
|
|
1566
|
+
* @type {string | undefined}
|
|
1567
|
+
*/
|
|
1568
|
+
fileName;
|
|
1596
1569
|
/**
|
|
1597
1570
|
* Creates an instance of DocumentListComponent.
|
|
1598
1571
|
* @class
|
|
@@ -1633,14 +1606,30 @@ class DocumentListComponent {
|
|
|
1633
1606
|
handleClickForDocument(document) {
|
|
1634
1607
|
this.isdialogVisible = SHARED.TRUE;
|
|
1635
1608
|
this.selectedDocument = document;
|
|
1609
|
+
this.fileName = document.fileName;
|
|
1610
|
+
}
|
|
1611
|
+
/**
|
|
1612
|
+
* Handles the save click event to update the document's file name.
|
|
1613
|
+
* This method creates a payload with the updated file name and calls the
|
|
1614
|
+
* updateDocumentName() method from the documentHttpService. On a successful update,
|
|
1615
|
+
* it logs a message with the document's ID.
|
|
1616
|
+
* @returns {void}
|
|
1617
|
+
*/
|
|
1618
|
+
handleSaveClick() {
|
|
1619
|
+
const payload = { fileName: this.fileName };
|
|
1620
|
+
this.documentHttpService.updateDocumentName(this.selectedDocument._id, payload)
|
|
1621
|
+
.subscribe((res) => {
|
|
1622
|
+
console.log(`${SHARED.UPDATE_DOCUMENT_NAME} ${this.selectedDocument._id}`);
|
|
1623
|
+
});
|
|
1636
1624
|
}
|
|
1637
1625
|
/**
|
|
1638
1626
|
* Closes the dialog and resets the selected document.
|
|
1639
1627
|
* @memberof DocumentListComponent
|
|
1640
1628
|
*/
|
|
1641
|
-
|
|
1642
|
-
this.selectedDocument = { _id: SHARED.
|
|
1629
|
+
handleCloseModal() {
|
|
1630
|
+
this.selectedDocument = { _id: SHARED.EMPTY };
|
|
1643
1631
|
this.isdialogVisible = SHARED.FALSE;
|
|
1632
|
+
this.onRefresh.emit();
|
|
1644
1633
|
}
|
|
1645
1634
|
/**
|
|
1646
1635
|
* Handles the upload action for a document.
|
|
@@ -1703,11 +1692,11 @@ class DocumentListComponent {
|
|
|
1703
1692
|
this.isSidebarVisible = isVisible;
|
|
1704
1693
|
}
|
|
1705
1694
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentListComponent, deps: [{ token: DocumentUploadService }, { token: DocumentHttpService }, { token: DocumentQuery }, { token: DocumentStore }], target: i0.ɵɵFactoryTarget.Component });
|
|
1706
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DocumentListComponent, isStandalone: false, selector: "lib-document-list", inputs: { contextId: "contextId", isUploadButtonVisible: "isUploadButtonVisible", documentList: "documentList" }, outputs: { onRefresh: "onRefresh" }, ngImport: i0, template: "<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" (onHide)=\"
|
|
1695
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DocumentListComponent, isStandalone: false, selector: "lib-document-list", inputs: { contextId: "contextId", isUploadButtonVisible: "isUploadButtonVisible", documentList: "documentList" }, outputs: { onRefresh: "onRefresh" }, ngImport: i0, template: "\r\n<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" (onHide)=\"handleCloseModal()\"\r\n class=\"w-full h-full document-dailog-wrapper\"\r\n [draggable]=\"false\" [closable]=\"true\">\r\n\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"w-full flex align-items-center justify-content-between\">\r\n <input \r\n type=\"text\" \r\n class=\"w-full border-none bg-white h-3rem file-input-wrapper\"\r\n pInputText \r\n [(ngModel)]=\"fileName\" />\r\n <button \r\n pButton \r\n pRipple \r\n class=\"mx-3 h-3rem\"\r\n label=\"Save\"\r\n (click)=\"handleSaveClick()\">\r\n </button>\r\n </div>\r\n </ng-template>\r\n\r\n <document-viewer [selectedDocument]=\"selectedDocument\">\r\n <ng-content></ng-content>\r\n </document-viewer>\r\n </p-dialog>\r\n</div>\r\n\r\n<div class=\"col-12 p-0\">\r\n <div class=\"card p-0 mb-0 document-list-wrapper\">\r\n <p-accordion>\r\n <p-accordionTab [selected]=\"true\" class=\"line-height-2 m-0\">\r\n <ng-template pTemplate=\"header\" let-active=\"active\">\r\n <div class=\"flex align-items-center justify-content-between w-full\">\r\n <span class=\"flex align-items-center gap-2 document-title-wrapper\">\r\n Documents\r\n </span>\r\n @if(isUploadButtonVisible){\r\n <button pButton pRipple class=\"p-button-raised col-3\" [permission]=\"PERMISSION.DOCUMENT_POST\" type=\"button\" label=\"Upload File\"\r\n style=\"border-radius: 10px;\" (click)=\"handleFileUploadClick($event)\"></button>\r\n }\r\n </div>\r\n </ng-template>\r\n @for(document of documentList; track document){\r\n <lib-document-list-item [document]=\"document\"\r\n (documentClick)=\"handleClickForDocument($event)\"></lib-document-list-item>\r\n }\r\n </p-accordionTab>\r\n </p-accordion>\r\n </div>\r\n</div>\r\n<div class=\"grid m-0\">\r\n <div class=\"col-12 p-0\">\r\n <p-sidebar [(visible)]=\"isSidebarVisible\" position=\"right\" [styleClass]=\"'right-sidebar'\" class=\"relative\">\r\n <ng-template pTemplate=\"header\">\r\n <p-messages [(value)]=\"messages\" [enableService]=\"false\" />\r\n </ng-template>\r\n <ng-template pTemplate=\"content\">\r\n <div class=\"side-bar-con\">\r\n <lib-document-upload [contextId]=\"contextId\"></lib-document-upload>\r\n <div class=\"p-fluid\">\r\n <div class=\"field\">\r\n <label for=\"city\">Select Folder</label>\r\n <p-dropdown id=\"city\" optionLabel=\"label\" optionValue=\"value\" [options]=\"options\"\r\n placeholder=\"Select a Folder\" [(ngModel)]=\"selectedOption\"></p-dropdown>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"footer\" class=\"bg-gray-100 p-0\">\r\n <div class=\"bg-gray-100 p-4\">\r\n <p-button label=\"Save\" class=\"p-button-rounded p-button-success save-btn\" (click)=\"handleUploadDocument()\"\r\n [disabled]=\"!selectedOption\">\r\n </p-button>\r\n </div>\r\n </ng-template>\r\n </p-sidebar>\r\n </div>\r\n</div>", styles: [".document-list-wrapper .p-accordion-header-link{padding:.5rem}.document-list-wrapper .p-sidebar-right,.right-sidebar{width:35%}.document-title-wrapper{font-size:20px;font-weight:700;color:var(--text-color)}.document-input-field{display:flex;flex-direction:column}.document-input-field input{width:100%;height:46px;padding:10px 15px;gap:10px;border-radius:10px;outline:none;border:1px solid rgba(76,98,146,.1019607843);font-size:15px}label{color:#0f1729;font-weight:600}.document-list-dropDown .p-element{padding:10px 0 10px 15px}.document-list-dropDown .p-dropdown{border-radius:10px!important}.side-bar-con{display:flex;flex-direction:column}.save-btn-con{width:100%;border-top:1px solid rgba(76,98,146,.2);background:#4c629214;padding:13px 40px}.save-btn .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}:host ::ng-deep .file-input-wrapper .p-inputtext:enabled:focus{box-shadow:0 0 0 .2rem #a6d5fa!important}::ng-deep .file-input-wrapper .p-inputtext:enabled:focus{box-shadow:0 0 0 .2rem #a6d5fa!important}\n"], dependencies: [{ kind: "component", type: i5$1.Accordion, selector: "p-accordion", inputs: ["multiple", "style", "styleClass", "expandIcon", "collapseIcon", "activeIndex", "selectOnFocus", "headerAriaLevel"], outputs: ["onClose", "onOpen", "activeIndexChange"] }, { kind: "component", type: i5$1.AccordionTab, selector: "p-accordionTab", inputs: ["id", "header", "headerStyle", "tabStyle", "contentStyle", "tabStyleClass", "headerStyleClass", "contentStyleClass", "disabled", "cache", "transitionOptions", "iconPos", "selected", "headerAriaLevel"], outputs: ["selectedChange"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: i7.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "style", "styleClass", "badgeClass", "ariaLabel", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i8$1.Sidebar, selector: "p-sidebar", inputs: ["appendTo", "blockScroll", "style", "styleClass", "ariaCloseLabel", "autoZIndex", "baseZIndex", "modal", "dismissible", "showCloseIcon", "closeOnEscape", "transitionOptions", "visible", "position", "fullScreen"], outputs: ["onShow", "onHide", "visibleChange"] }, { kind: "component", type: i9.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange", "onClose"] }, { kind: "directive", type: i10.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: i10.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i10.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i11.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "component", type: i12.Dropdown, selector: "p-dropdown", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "autoShowPanelOnPrintableCharacterKeyDown", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "directive", type: i13.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "component", type: DocumentListItemComponent, selector: "lib-document-list-item", inputs: ["document"], outputs: ["documentClick"] }, { kind: "component", type: DocumentUploadComponent, selector: "lib-document-upload", inputs: ["contextId"] }, { kind: "component", type: DocumentViewerComponent, selector: "document-viewer", inputs: ["selectedDocument"] }, { kind: "directive", type: HasPermissionDirective, selector: "[permission]", inputs: ["permission"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
1707
1696
|
}
|
|
1708
1697
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentListComponent, decorators: [{
|
|
1709
1698
|
type: Component,
|
|
1710
|
-
args: [{ selector: 'lib-document-list', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" (onHide)=\"
|
|
1699
|
+
args: [{ selector: 'lib-document-list', standalone: false, encapsulation: ViewEncapsulation.None, template: "\r\n<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" (onHide)=\"handleCloseModal()\"\r\n class=\"w-full h-full document-dailog-wrapper\"\r\n [draggable]=\"false\" [closable]=\"true\">\r\n\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"w-full flex align-items-center justify-content-between\">\r\n <input \r\n type=\"text\" \r\n class=\"w-full border-none bg-white h-3rem file-input-wrapper\"\r\n pInputText \r\n [(ngModel)]=\"fileName\" />\r\n <button \r\n pButton \r\n pRipple \r\n class=\"mx-3 h-3rem\"\r\n label=\"Save\"\r\n (click)=\"handleSaveClick()\">\r\n </button>\r\n </div>\r\n </ng-template>\r\n\r\n <document-viewer [selectedDocument]=\"selectedDocument\">\r\n <ng-content></ng-content>\r\n </document-viewer>\r\n </p-dialog>\r\n</div>\r\n\r\n<div class=\"col-12 p-0\">\r\n <div class=\"card p-0 mb-0 document-list-wrapper\">\r\n <p-accordion>\r\n <p-accordionTab [selected]=\"true\" class=\"line-height-2 m-0\">\r\n <ng-template pTemplate=\"header\" let-active=\"active\">\r\n <div class=\"flex align-items-center justify-content-between w-full\">\r\n <span class=\"flex align-items-center gap-2 document-title-wrapper\">\r\n Documents\r\n </span>\r\n @if(isUploadButtonVisible){\r\n <button pButton pRipple class=\"p-button-raised col-3\" [permission]=\"PERMISSION.DOCUMENT_POST\" type=\"button\" label=\"Upload File\"\r\n style=\"border-radius: 10px;\" (click)=\"handleFileUploadClick($event)\"></button>\r\n }\r\n </div>\r\n </ng-template>\r\n @for(document of documentList; track document){\r\n <lib-document-list-item [document]=\"document\"\r\n (documentClick)=\"handleClickForDocument($event)\"></lib-document-list-item>\r\n }\r\n </p-accordionTab>\r\n </p-accordion>\r\n </div>\r\n</div>\r\n<div class=\"grid m-0\">\r\n <div class=\"col-12 p-0\">\r\n <p-sidebar [(visible)]=\"isSidebarVisible\" position=\"right\" [styleClass]=\"'right-sidebar'\" class=\"relative\">\r\n <ng-template pTemplate=\"header\">\r\n <p-messages [(value)]=\"messages\" [enableService]=\"false\" />\r\n </ng-template>\r\n <ng-template pTemplate=\"content\">\r\n <div class=\"side-bar-con\">\r\n <lib-document-upload [contextId]=\"contextId\"></lib-document-upload>\r\n <div class=\"p-fluid\">\r\n <div class=\"field\">\r\n <label for=\"city\">Select Folder</label>\r\n <p-dropdown id=\"city\" optionLabel=\"label\" optionValue=\"value\" [options]=\"options\"\r\n placeholder=\"Select a Folder\" [(ngModel)]=\"selectedOption\"></p-dropdown>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"footer\" class=\"bg-gray-100 p-0\">\r\n <div class=\"bg-gray-100 p-4\">\r\n <p-button label=\"Save\" class=\"p-button-rounded p-button-success save-btn\" (click)=\"handleUploadDocument()\"\r\n [disabled]=\"!selectedOption\">\r\n </p-button>\r\n </div>\r\n </ng-template>\r\n </p-sidebar>\r\n </div>\r\n</div>", styles: [".document-list-wrapper .p-accordion-header-link{padding:.5rem}.document-list-wrapper .p-sidebar-right,.right-sidebar{width:35%}.document-title-wrapper{font-size:20px;font-weight:700;color:var(--text-color)}.document-input-field{display:flex;flex-direction:column}.document-input-field input{width:100%;height:46px;padding:10px 15px;gap:10px;border-radius:10px;outline:none;border:1px solid rgba(76,98,146,.1019607843);font-size:15px}label{color:#0f1729;font-weight:600}.document-list-dropDown .p-element{padding:10px 0 10px 15px}.document-list-dropDown .p-dropdown{border-radius:10px!important}.side-bar-con{display:flex;flex-direction:column}.save-btn-con{width:100%;border-top:1px solid rgba(76,98,146,.2);background:#4c629214;padding:13px 40px}.save-btn .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}:host ::ng-deep .file-input-wrapper .p-inputtext:enabled:focus{box-shadow:0 0 0 .2rem #a6d5fa!important}::ng-deep .file-input-wrapper .p-inputtext:enabled:focus{box-shadow:0 0 0 .2rem #a6d5fa!important}\n"] }]
|
|
1711
1700
|
}], ctorParameters: () => [{ type: DocumentUploadService }, { type: DocumentHttpService }, { type: DocumentQuery }, { type: DocumentStore }], propDecorators: { onRefresh: [{
|
|
1712
1701
|
type: Output
|
|
1713
1702
|
}], contextId: [{
|
|
@@ -1724,7 +1713,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
1724
1713
|
* @typedef {DocumentContainerComponent}
|
|
1725
1714
|
*/
|
|
1726
1715
|
class DocumentContainerComponent {
|
|
1727
|
-
documentStore;
|
|
1728
1716
|
documentService;
|
|
1729
1717
|
documentQuery;
|
|
1730
1718
|
documentHttpService;
|
|
@@ -1734,8 +1722,7 @@ class DocumentContainerComponent {
|
|
|
1734
1722
|
* @param {DocumentQuery} documentQuery - Query service to manage document-related state.
|
|
1735
1723
|
* @param {DocumentHttpService} documentHttpService - Service to make HTTP requests related to documents.
|
|
1736
1724
|
*/
|
|
1737
|
-
constructor(
|
|
1738
|
-
this.documentStore = documentStore;
|
|
1725
|
+
constructor(documentService, documentQuery, documentHttpService) {
|
|
1739
1726
|
this.documentService = documentService;
|
|
1740
1727
|
this.documentQuery = documentQuery;
|
|
1741
1728
|
this.documentHttpService = documentHttpService;
|
|
@@ -1841,9 +1828,9 @@ class DocumentContainerComponent {
|
|
|
1841
1828
|
* @param {DocumentModel[]} documentList - The list of documents returned by the API.
|
|
1842
1829
|
*/
|
|
1843
1830
|
next: (documentList) => {
|
|
1831
|
+
console.log(documentList);
|
|
1844
1832
|
if (documentList) {
|
|
1845
1833
|
this.documentList = documentList;
|
|
1846
|
-
this.documentStore.setDocumentList(documentList);
|
|
1847
1834
|
}
|
|
1848
1835
|
else {
|
|
1849
1836
|
console.error(ERRORS.ERROR_FETCHING_DOCUMENTS);
|
|
@@ -1865,13 +1852,13 @@ class DocumentContainerComponent {
|
|
|
1865
1852
|
ngOnDestroy() {
|
|
1866
1853
|
this.subscription.unsubscribe();
|
|
1867
1854
|
}
|
|
1868
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentContainerComponent, deps: [{ token:
|
|
1855
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentContainerComponent, deps: [{ token: DocumentService$1 }, { token: DocumentQuery }, { token: DocumentHttpService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1869
1856
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DocumentContainerComponent, isStandalone: false, selector: "lib-document-container", inputs: { contextId: "contextId", showFolderList: "showFolderList", isUploadButtonVisible: "isUploadButtonVisible" }, ngImport: i0, template: "<div class=\"grid m-0 h-full\">\r\n <div class=\"col-12 md:col-12 lg:col-12 p-0 h-full\" [ngClass]=\"showFolderList ? 'custom-scroll' : ''\">\r\n @if(showFolderList){\r\n <div>\r\n <lib-folder-container [documentList]=\"documentList\" [folderList]=\"folderList\" [contextId]=\"contextId\"></lib-folder-container>\r\n </div>\r\n }\r\n <div [ngClass]=\"showFolderList ? 'mt-3' : ''\">\r\n <lib-document-list [documentList]=\"documentList\" [contextId]=\"contextId\" [isUploadButtonVisible]=\"isUploadButtonVisible\" (onRefresh)=\"fetchFolder()\">\r\n <ng-content></ng-content>\r\n </lib-document-list>\r\n </div>\r\n </div>\r\n</div>", styles: [".custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: FolderContainerComponent, selector: "lib-folder-container", inputs: ["documentList", "folderList", "contextId"] }, { kind: "component", type: DocumentListComponent, selector: "lib-document-list", inputs: ["contextId", "isUploadButtonVisible", "documentList"], outputs: ["onRefresh"] }] });
|
|
1870
1857
|
}
|
|
1871
1858
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentContainerComponent, decorators: [{
|
|
1872
1859
|
type: Component,
|
|
1873
1860
|
args: [{ selector: 'lib-document-container', standalone: false, template: "<div class=\"grid m-0 h-full\">\r\n <div class=\"col-12 md:col-12 lg:col-12 p-0 h-full\" [ngClass]=\"showFolderList ? 'custom-scroll' : ''\">\r\n @if(showFolderList){\r\n <div>\r\n <lib-folder-container [documentList]=\"documentList\" [folderList]=\"folderList\" [contextId]=\"contextId\"></lib-folder-container>\r\n </div>\r\n }\r\n <div [ngClass]=\"showFolderList ? 'mt-3' : ''\">\r\n <lib-document-list [documentList]=\"documentList\" [contextId]=\"contextId\" [isUploadButtonVisible]=\"isUploadButtonVisible\" (onRefresh)=\"fetchFolder()\">\r\n <ng-content></ng-content>\r\n </lib-document-list>\r\n </div>\r\n </div>\r\n</div>", styles: [".custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}\n"] }]
|
|
1874
|
-
}], ctorParameters: () => [{ type:
|
|
1861
|
+
}], ctorParameters: () => [{ type: DocumentService$1 }, { type: DocumentQuery }, { type: DocumentHttpService }], propDecorators: { contextId: [{
|
|
1875
1862
|
type: Input
|
|
1876
1863
|
}], showFolderList: [{
|
|
1877
1864
|
type: Input
|
|
@@ -1947,73 +1934,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
1947
1934
|
}]
|
|
1948
1935
|
}], ctorParameters: () => [{ type: DocumentService }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }] });
|
|
1949
1936
|
|
|
1950
|
-
class ErrorInterceptor {
|
|
1951
|
-
router;
|
|
1952
|
-
sessionService;
|
|
1953
|
-
appconfigService;
|
|
1954
|
-
constructor(router, sessionService, appconfigService) {
|
|
1955
|
-
this.router = router;
|
|
1956
|
-
this.sessionService = sessionService;
|
|
1957
|
-
this.appconfigService = appconfigService;
|
|
1958
|
-
}
|
|
1959
|
-
intercept(request, next) {
|
|
1960
|
-
const token = "118c9918-dd59-4faa-a031-513d53210ca4";
|
|
1961
|
-
const loginUrl = `${this.appconfigService.apiBaseUrl}Auth/login`;
|
|
1962
|
-
if (token && request.url !== loginUrl) {
|
|
1963
|
-
request = request.clone({
|
|
1964
|
-
setHeaders: {
|
|
1965
|
-
Authorization: `Bearer ${token}`,
|
|
1966
|
-
},
|
|
1967
|
-
});
|
|
1968
|
-
}
|
|
1969
|
-
return next.handle(request).pipe(catchError$1((error) => {
|
|
1970
|
-
// const errorMessage = {
|
|
1971
|
-
// status: error.status,
|
|
1972
|
-
// url: request.url,
|
|
1973
|
-
// message: error?.error?.message ?? error?.error?.error?.message,
|
|
1974
|
-
// statusText : error.statusText
|
|
1975
|
-
// };
|
|
1976
|
-
// if (error.status >= 400 && error.status < 500) {
|
|
1977
|
-
// this.baseStore.errors = [errorMessage]
|
|
1978
|
-
// this.baseStore.errorMessage$.next(this.baseStore.errors);
|
|
1979
|
-
// }
|
|
1980
|
-
// if (request.url === loginUrl && error.status === 401) {
|
|
1981
|
-
// this.baseStore.errors.push( errorMessage );
|
|
1982
|
-
// this.baseStore.errorMessage$.next(this.baseStore.errors);
|
|
1983
|
-
// }
|
|
1984
|
-
// if (error.status === 0) {
|
|
1985
|
-
// console.error(ERROR.NETWORK_ERROR,error?.error?.error?.message);
|
|
1986
|
-
// } else if (error.status >= 500) {
|
|
1987
|
-
// console.error(ERROR.SERVER_ERROR, error?.error?.error?.message);
|
|
1988
|
-
// this.router.navigate([ROUTES.ERROR]);
|
|
1989
|
-
// } else if (error.status === 401) {
|
|
1990
|
-
// localStorage.clear()
|
|
1991
|
-
// this.baseStore.errorMessage$.next([]);
|
|
1992
|
-
// this.router.navigate([ROUTES.HOME]);
|
|
1993
|
-
// } else if (error.status === 401 && request.url !== loginUrl) {
|
|
1994
|
-
// localStorage.clear()
|
|
1995
|
-
// this.baseStore.errorMessage$.next([]);
|
|
1996
|
-
// this.router.navigate([ROUTES.HOME]);
|
|
1997
|
-
// }else if (error.status === 403) {
|
|
1998
|
-
// localStorage.clear()
|
|
1999
|
-
// this.baseStore.errorMessage$.next([]);
|
|
2000
|
-
// this.router.navigate([ROUTES.ERROR]);
|
|
2001
|
-
// } else {
|
|
2002
|
-
// console.error(error?.error?.error?.message);
|
|
2003
|
-
// }
|
|
2004
|
-
return throwError(() => new Error(error?.error?.error?.message));
|
|
2005
|
-
}));
|
|
2006
|
-
}
|
|
2007
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ErrorInterceptor, deps: [{ token: i1.Router }, { token: SessionService }, { token: AppConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2008
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ErrorInterceptor, providedIn: "root" });
|
|
2009
|
-
}
|
|
2010
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ErrorInterceptor, decorators: [{
|
|
2011
|
-
type: Injectable,
|
|
2012
|
-
args: [{
|
|
2013
|
-
providedIn: "root",
|
|
2014
|
-
}]
|
|
2015
|
-
}], ctorParameters: () => [{ type: i1.Router }, { type: SessionService }, { type: AppConfigService }] });
|
|
2016
|
-
|
|
2017
1937
|
/**
|
|
2018
1938
|
* @module DocumentModule
|
|
2019
1939
|
*
|
|
@@ -2062,13 +1982,9 @@ class DocumentModule {
|
|
|
2062
1982
|
*/
|
|
2063
1983
|
DocumentDirective,
|
|
2064
1984
|
/**
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
HasPermissionDirective,
|
|
2068
|
-
/**
|
|
2069
|
-
* A component which have linked documents.
|
|
2070
|
-
*/
|
|
2071
|
-
LinkedDocumentComponent], imports: [
|
|
1985
|
+
* A directive to give permission.
|
|
1986
|
+
*/
|
|
1987
|
+
HasPermissionDirective], imports: [
|
|
2072
1988
|
/**
|
|
2073
1989
|
* Angular's CommonModule is imported to access common directives like `ngIf` and `ngFor`.
|
|
2074
1990
|
*/
|
|
@@ -2188,11 +2104,6 @@ class DocumentModule {
|
|
|
2188
2104
|
}),
|
|
2189
2105
|
deps: [AppConfigService],
|
|
2190
2106
|
multi: true,
|
|
2191
|
-
},
|
|
2192
|
-
{
|
|
2193
|
-
provide: HTTP_INTERCEPTORS,
|
|
2194
|
-
useClass: ErrorInterceptor,
|
|
2195
|
-
multi: true
|
|
2196
2107
|
}
|
|
2197
2108
|
], imports: [
|
|
2198
2109
|
/**
|
|
@@ -2306,13 +2217,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
2306
2217
|
*/
|
|
2307
2218
|
DocumentDirective,
|
|
2308
2219
|
/**
|
|
2309
|
-
|
|
2310
|
-
|
|
2220
|
+
* A directive to give permission.
|
|
2221
|
+
*/
|
|
2311
2222
|
HasPermissionDirective,
|
|
2312
|
-
/**
|
|
2313
|
-
* A component which have linked documents.
|
|
2314
|
-
*/
|
|
2315
|
-
LinkedDocumentComponent,
|
|
2316
2223
|
],
|
|
2317
2224
|
imports: [
|
|
2318
2225
|
/**
|
|
@@ -2437,11 +2344,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
2437
2344
|
}),
|
|
2438
2345
|
deps: [AppConfigService],
|
|
2439
2346
|
multi: true,
|
|
2440
|
-
},
|
|
2441
|
-
{
|
|
2442
|
-
provide: HTTP_INTERCEPTORS,
|
|
2443
|
-
useClass: ErrorInterceptor,
|
|
2444
|
-
multi: true
|
|
2445
2347
|
}
|
|
2446
2348
|
]
|
|
2447
2349
|
}]
|