cat-documents-ng 0.0.21 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Shared/constant/ERROR.d.ts +36 -0
- package/Shared/constant/SHARED.d.ts +44 -0
- package/Shared/constant/URLS.d.ts +18 -0
- package/fesm2022/cat-documents-ng.mjs +686 -138
- package/fesm2022/cat-documents-ng.mjs.map +1 -1
- package/lib/document/components/document-container/document-container.component.d.ts +25 -3
- package/lib/document/components/document-list/document-list.component.d.ts +72 -10
- package/lib/document/components/document-upload/document-upload.component.d.ts +22 -15
- package/lib/document/components/document-viewer/document-viewer.component.d.ts +15 -39
- package/lib/document/components/folder-block/folder-block.component.d.ts +3 -3
- package/lib/document/components/folder-container/folder-container.component.d.ts +12 -1
- package/lib/document/document.module.d.ts +3 -1
- package/lib/document/models/document-alert.model.d.ts +38 -0
- package/lib/document/models/document-type.model.d.ts +74 -0
- package/lib/document/services/document-http.service.d.ts +51 -0
- package/lib/document/services/document-upload.service.d.ts +67 -0
- package/lib/document/state/document.query.d.ts +28 -0
- package/lib/document/state/document.state.d.ts +7 -6
- package/lib/document/state/document.store.d.ts +5 -3
- package/package.json +1 -1
|
@@ -1,39 +1,42 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable, Component, Input, EventEmitter, Output, ViewEncapsulation, ViewChild, APP_INITIALIZER, NgModule } from '@angular/core';
|
|
3
|
-
import * as
|
|
3
|
+
import * as i2$1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
-
import { firstValueFrom, tap, Subscription } from 'rxjs';
|
|
5
|
+
import { firstValueFrom, tap, catchError, throwError, Subscription } from 'rxjs';
|
|
6
6
|
import { __decorate } from 'tslib';
|
|
7
|
-
import { EntityStore, StoreConfig } from '@datorama/akita';
|
|
8
|
-
import * as
|
|
7
|
+
import { EntityStore, StoreConfig, QueryEntity } from '@datorama/akita';
|
|
8
|
+
import * as i2 from '@angular/common/http';
|
|
9
9
|
import { HttpClientModule } from '@angular/common/http';
|
|
10
|
-
import * as
|
|
11
|
-
import { AccordionModule } from 'primeng/accordion';
|
|
12
|
-
import * as i2 from 'primeng/api';
|
|
10
|
+
import * as i3 from 'primeng/api';
|
|
13
11
|
import { MessageService } from 'primeng/api';
|
|
14
|
-
import * as i3 from 'primeng/
|
|
12
|
+
import * as i3$1 from 'primeng/accordion';
|
|
13
|
+
import { AccordionModule } from 'primeng/accordion';
|
|
14
|
+
import * as i5 from 'primeng/button';
|
|
15
15
|
import { ButtonModule } from 'primeng/button';
|
|
16
|
-
import * as
|
|
16
|
+
import * as i6$1 from 'primeng/sidebar';
|
|
17
17
|
import { SidebarModule } from 'primeng/sidebar';
|
|
18
|
-
import * as
|
|
18
|
+
import * as i7$2 from 'primeng/messages';
|
|
19
|
+
import * as i7$1 from '@angular/forms';
|
|
20
|
+
import { FormsModule } from '@angular/forms';
|
|
21
|
+
import * as i9 from 'primeng/dialog';
|
|
19
22
|
import { DialogModule } from 'primeng/dialog';
|
|
20
|
-
import * as
|
|
23
|
+
import * as i10 from 'primeng/dropdown';
|
|
24
|
+
import { DropdownModule } from 'primeng/dropdown';
|
|
25
|
+
import * as i11 from 'primeng/inputtext';
|
|
26
|
+
import { InputTextModule } from 'primeng/inputtext';
|
|
27
|
+
import * as i7 from 'primeng/fileupload';
|
|
21
28
|
import { FileUploadModule } from 'primeng/fileupload';
|
|
22
|
-
import * as
|
|
29
|
+
import * as i8 from 'primeng/progressbar';
|
|
23
30
|
import { ProgressBarModule } from 'primeng/progressbar';
|
|
24
|
-
import * as
|
|
25
|
-
import { ListboxModule } from 'primeng/listbox';
|
|
26
|
-
import * as i5 from 'primeng/checkbox';
|
|
27
|
-
import { CheckboxModule } from 'primeng/checkbox';
|
|
28
|
-
import * as i6$1 from 'primeng/timeline';
|
|
31
|
+
import * as i5$1 from 'primeng/timeline';
|
|
29
32
|
import { TimelineModule } from 'primeng/timeline';
|
|
30
|
-
import * as
|
|
33
|
+
import * as i6 from 'primeng/inputtextarea';
|
|
31
34
|
import { InputTextareaModule } from 'primeng/inputtextarea';
|
|
32
|
-
import * as i8 from '
|
|
33
|
-
import { FormsModule } from '@angular/forms';
|
|
34
|
-
import * as i9 from 'ng2-pdf-viewer';
|
|
35
|
+
import * as i8$1 from 'ng2-pdf-viewer';
|
|
35
36
|
import { PdfViewerModule } from 'ng2-pdf-viewer';
|
|
36
37
|
import { BadgeModule } from 'primeng/badge';
|
|
38
|
+
import { ListboxModule } from 'primeng/listbox';
|
|
39
|
+
import { CheckboxModule } from 'primeng/checkbox';
|
|
37
40
|
|
|
38
41
|
/**
|
|
39
42
|
* The `SHARED` class contains shared constants used across the application.
|
|
@@ -108,12 +111,24 @@ class SHARED {
|
|
|
108
111
|
* @type {'error'}
|
|
109
112
|
*/
|
|
110
113
|
static SEVERITY = 'error';
|
|
114
|
+
/**
|
|
115
|
+
* Show SEVERITY value.
|
|
116
|
+
* @static
|
|
117
|
+
* @type {'error'}
|
|
118
|
+
*/
|
|
119
|
+
static SUCCESS_SEVERITY = 'success';
|
|
111
120
|
/**
|
|
112
121
|
* Show upload summery if it's failed.
|
|
113
122
|
* @static
|
|
114
123
|
* @type {'Upload Failed'}
|
|
115
124
|
*/
|
|
116
125
|
static UPLOAD_SUMMERY = 'Upload Failed';
|
|
126
|
+
/**
|
|
127
|
+
* Show upload summery if it's success.
|
|
128
|
+
* @static
|
|
129
|
+
* @type {'Document uploaded successfully.'}
|
|
130
|
+
*/
|
|
131
|
+
static UPLOAD_SUCCESS = 'Document uploaded successfully.';
|
|
117
132
|
/**
|
|
118
133
|
* Represent empty array.
|
|
119
134
|
* @static
|
|
@@ -132,6 +147,30 @@ class SHARED {
|
|
|
132
147
|
* @type {string}
|
|
133
148
|
*/
|
|
134
149
|
static FILE_SIZE = 'fileSize';
|
|
150
|
+
/**
|
|
151
|
+
* Represent documentName.
|
|
152
|
+
* @static
|
|
153
|
+
* @type {string}
|
|
154
|
+
*/
|
|
155
|
+
static DOCUMENT_NAME = 'documentName';
|
|
156
|
+
/**
|
|
157
|
+
* Represent documentTypeId.
|
|
158
|
+
* @static
|
|
159
|
+
* @type {string}
|
|
160
|
+
*/
|
|
161
|
+
static DOCUMENT_TYPE_ID = 'documentTypeId';
|
|
162
|
+
/**
|
|
163
|
+
* Represent upload summery.
|
|
164
|
+
* @static
|
|
165
|
+
* @type {string}
|
|
166
|
+
*/
|
|
167
|
+
static UPLOAD_ERROR_SUMMERY = 'Form Data Missing';
|
|
168
|
+
/**
|
|
169
|
+
* Represent upload error details.
|
|
170
|
+
* @static
|
|
171
|
+
* @type {string}
|
|
172
|
+
*/
|
|
173
|
+
static UPLOAD_ERROR_DETAILS = 'Required form data is missing. Please ensure the document and all required fields are provided.';
|
|
135
174
|
}
|
|
136
175
|
/**
|
|
137
176
|
* `DUMMYDOCUMENTLIST` is a mock list of document objects used for testing and development purposes.
|
|
@@ -246,6 +285,65 @@ const COUNTRIES = [
|
|
|
246
285
|
const SUPPORTED_IMAGE_TYPES = [
|
|
247
286
|
'image/png'
|
|
248
287
|
];
|
|
288
|
+
/**
|
|
289
|
+
* @constant {Array<{label: string, value: string, files: string[]}>} DOCUMENTTYPES
|
|
290
|
+
* An array of document type objects containing labels, values, and associated files.
|
|
291
|
+
*/
|
|
292
|
+
const DOCUMENTTYPES = [
|
|
293
|
+
{
|
|
294
|
+
label: "BankStatement",
|
|
295
|
+
value: "bank_statement",
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
label: "Payslip",
|
|
299
|
+
value: "payslip",
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
label: "Selfie",
|
|
303
|
+
value: "selfie",
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
label: "Other",
|
|
307
|
+
value: "other",
|
|
308
|
+
}
|
|
309
|
+
];
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* A utility class containing common error messages.
|
|
313
|
+
* @class ERRORS
|
|
314
|
+
*/
|
|
315
|
+
class ERRORS {
|
|
316
|
+
/**
|
|
317
|
+
* Error message for invalid recipient.
|
|
318
|
+
* @static
|
|
319
|
+
* @type {string}
|
|
320
|
+
*/
|
|
321
|
+
static INVALID_RECIPIENT = "Invalid recipient: The recipient cannot be empty.";
|
|
322
|
+
/**
|
|
323
|
+
* Error message for invalid document.
|
|
324
|
+
* @static
|
|
325
|
+
* @type {string}
|
|
326
|
+
*/
|
|
327
|
+
static ERROR_FETCHING_DOCUMENTS = "Error fetching documents:";
|
|
328
|
+
/**
|
|
329
|
+
* Error message for invalid document.
|
|
330
|
+
* @static
|
|
331
|
+
* @type {string}
|
|
332
|
+
*/
|
|
333
|
+
static ERROR_FETCHING_FOLDERS = "Error fetching folders:";
|
|
334
|
+
/**
|
|
335
|
+
* Error message for invalid document.
|
|
336
|
+
* @static
|
|
337
|
+
* @type {string}
|
|
338
|
+
*/
|
|
339
|
+
static ERROR_ALLDOCUMENT_MISSING = "allDocumentTypes is missing in the response:";
|
|
340
|
+
/**
|
|
341
|
+
* Error message for invalid document.
|
|
342
|
+
* @static
|
|
343
|
+
* @type {string}
|
|
344
|
+
*/
|
|
345
|
+
static ERROR_DOCUMENT_TYPES = "Error fetching document types:";
|
|
346
|
+
}
|
|
249
347
|
|
|
250
348
|
/**
|
|
251
349
|
* Class that holds the URLs used throughout the application.
|
|
@@ -275,14 +373,30 @@ class URLS {
|
|
|
275
373
|
* @type {string}
|
|
276
374
|
*/
|
|
277
375
|
static CONTEXT = "?contextId=";
|
|
376
|
+
/**
|
|
377
|
+
* The query parameter to pass a document ID in API requests.
|
|
378
|
+
* @static
|
|
379
|
+
* @type {string}
|
|
380
|
+
*/
|
|
381
|
+
static DOCUMENT_TYPES = "documentTypes";
|
|
382
|
+
/**
|
|
383
|
+
* The query parameter to pass a document ID in API requests.
|
|
384
|
+
* @static
|
|
385
|
+
* @type {string}
|
|
386
|
+
*/
|
|
387
|
+
static ALERT_BY_DOCUMENT_ID = "alerts?documentId=";
|
|
388
|
+
/**
|
|
389
|
+
* The query parameter to pass a document ID in API requests.
|
|
390
|
+
* @static
|
|
391
|
+
* @type {string}
|
|
392
|
+
*/
|
|
393
|
+
static PARENT_DOCUMENT_TYPE_ID = "parentDocumentType?parentDocumentTypeId=";
|
|
278
394
|
}
|
|
279
395
|
|
|
280
396
|
/**
|
|
281
397
|
* Creates the initial state for the `DocumentState` store.
|
|
282
|
-
*
|
|
283
398
|
* This function provides default values for all properties in the `DocumentState` interface,
|
|
284
399
|
* ensuring the store starts with a consistent initial structure.
|
|
285
|
-
*
|
|
286
400
|
* @returns {DocumentState} The initial state of the document store.
|
|
287
401
|
*/
|
|
288
402
|
function createInitialState() {
|
|
@@ -291,17 +405,19 @@ function createInitialState() {
|
|
|
291
405
|
filteredRecords: [],
|
|
292
406
|
folderId: null,
|
|
293
407
|
isDialogOpen: false,
|
|
408
|
+
dropdownOptions: [],
|
|
409
|
+
uploadedDocumentFiles: [],
|
|
410
|
+
parentDocumentTypeId: null,
|
|
411
|
+
documentAlert: { _id: '' }
|
|
294
412
|
};
|
|
295
413
|
}
|
|
296
414
|
|
|
297
415
|
/**
|
|
298
416
|
* Store that manages the state of documents in the application.
|
|
299
|
-
*
|
|
300
417
|
* The `DocumentStore` class extends Akita's `EntityStore` to manage the entity state for documents.
|
|
301
418
|
* It uses the `createInitialState` function to initialize the store with default values and
|
|
302
419
|
* is configured with the name `'documents'`.
|
|
303
|
-
*
|
|
304
|
-
* @extends EntityStore<DocumentState>
|
|
420
|
+
* @augments EntityStore<DocumentState>
|
|
305
421
|
*/
|
|
306
422
|
let DocumentStore = class DocumentStore extends EntityStore {
|
|
307
423
|
/**
|
|
@@ -310,6 +426,18 @@ let DocumentStore = class DocumentStore extends EntityStore {
|
|
|
310
426
|
constructor() {
|
|
311
427
|
super(createInitialState());
|
|
312
428
|
}
|
|
429
|
+
setUploadedDocumentFiles(files) {
|
|
430
|
+
this.update({ uploadedDocumentFiles: files });
|
|
431
|
+
}
|
|
432
|
+
setDocumentTypes(documentType) {
|
|
433
|
+
this.update({ uploadedDocumentFiles: documentType });
|
|
434
|
+
}
|
|
435
|
+
setDocumentAlert(documentAlert) {
|
|
436
|
+
this.update({ documentAlert: documentAlert });
|
|
437
|
+
}
|
|
438
|
+
setParentDocumentTypeId(parentDocumentTypeId) {
|
|
439
|
+
this.update({ parentDocumentTypeId });
|
|
440
|
+
}
|
|
313
441
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
314
442
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentStore, providedIn: 'root' });
|
|
315
443
|
};
|
|
@@ -382,7 +510,7 @@ class AppConfigService {
|
|
|
382
510
|
get visibilityOptions() {
|
|
383
511
|
return this.appConfig?.visibilityOption;
|
|
384
512
|
}
|
|
385
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: AppConfigService, deps: [{ token:
|
|
513
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: AppConfigService, deps: [{ token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
386
514
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: AppConfigService, providedIn: 'root' });
|
|
387
515
|
}
|
|
388
516
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: AppConfigService, decorators: [{
|
|
@@ -390,7 +518,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
390
518
|
args: [{
|
|
391
519
|
providedIn: 'root'
|
|
392
520
|
}]
|
|
393
|
-
}], ctorParameters: () => [{ type:
|
|
521
|
+
}], ctorParameters: () => [{ type: i2.HttpClient }] });
|
|
394
522
|
|
|
395
523
|
/**
|
|
396
524
|
* Service for managing document-related operations.
|
|
@@ -463,13 +591,122 @@ class DocumentService {
|
|
|
463
591
|
delete(id) {
|
|
464
592
|
return this.http.delete(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${id}`).pipe(tap(() => this.documentStore.remove(id)));
|
|
465
593
|
}
|
|
466
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentService, deps: [{ token: DocumentStore }, { token:
|
|
594
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentService, deps: [{ token: DocumentStore }, { token: i2.HttpClient }, { token: AppConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
467
595
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentService, providedIn: 'root' });
|
|
468
596
|
}
|
|
469
597
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentService, decorators: [{
|
|
470
598
|
type: Injectable,
|
|
471
599
|
args: [{ providedIn: 'root' }]
|
|
472
|
-
}], ctorParameters: () => [{ type: DocumentStore }, { type:
|
|
600
|
+
}], ctorParameters: () => [{ type: DocumentStore }, { type: i2.HttpClient }, { type: AppConfigService }] });
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Query service for managing document state.
|
|
604
|
+
* This class extends Akita's `QueryEntity` to provide additional functionality for querying document data.
|
|
605
|
+
* @class DocumentQuery
|
|
606
|
+
* @typedef {DocumentQuery}
|
|
607
|
+
* @extends {QueryEntity<DocumentState>}
|
|
608
|
+
*/
|
|
609
|
+
class DocumentQuery extends QueryEntity {
|
|
610
|
+
store;
|
|
611
|
+
constructor(store) {
|
|
612
|
+
super(store);
|
|
613
|
+
this.store = store;
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* Selects the currently selected folder ID from the document state.
|
|
617
|
+
* @returns {Observable<string | null>} Observable that emits the currently selected folder ID.
|
|
618
|
+
*/
|
|
619
|
+
getParentDocumentTypeId() {
|
|
620
|
+
return this.getValue()['parentDocumentTypeId'];
|
|
621
|
+
}
|
|
622
|
+
/**
|
|
623
|
+
* Selects the currently selected folder ID from the document state.
|
|
624
|
+
* @returns {Observable<string | null>} Observable that emits the currently selected folder ID.
|
|
625
|
+
*/
|
|
626
|
+
selectParentDocumentTypeId() {
|
|
627
|
+
return this.select((state) => state['parentDocumentTypeId']);
|
|
628
|
+
}
|
|
629
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentQuery, deps: [{ token: DocumentStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
630
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentQuery, providedIn: 'root' });
|
|
631
|
+
}
|
|
632
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentQuery, decorators: [{
|
|
633
|
+
type: Injectable,
|
|
634
|
+
args: [{ providedIn: 'root' }]
|
|
635
|
+
}], ctorParameters: () => [{ type: DocumentStore }] });
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* Service for making HTTP requests related to documents.
|
|
639
|
+
* @class DocumentHttpService
|
|
640
|
+
* @typedef {DocumentHttpService}
|
|
641
|
+
*/
|
|
642
|
+
class DocumentHttpService {
|
|
643
|
+
documentStore;
|
|
644
|
+
http;
|
|
645
|
+
appConfigService;
|
|
646
|
+
/**
|
|
647
|
+
* Creates an instance of DocumentService.
|
|
648
|
+
* @param {DocumentStore} documentStore - Store managing the state of documents.
|
|
649
|
+
* @param {HttpClient} http - Angular HTTP client for making API requests.
|
|
650
|
+
* @param {AppConfigService} appConfigService - Service for retrieving application configuration, such as API base URL.
|
|
651
|
+
*/
|
|
652
|
+
constructor(documentStore, http, appConfigService) {
|
|
653
|
+
this.documentStore = documentStore;
|
|
654
|
+
this.http = http;
|
|
655
|
+
this.appConfigService = appConfigService;
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* Get api url from appConfigService.
|
|
659
|
+
* @readonly
|
|
660
|
+
* @type {string}
|
|
661
|
+
*/
|
|
662
|
+
get apiUrl() {
|
|
663
|
+
return this.appConfigService.apiBaseUrl;
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* Fetches a document by its path name and transforms the response for dropdown options.
|
|
667
|
+
* Includes error handling for failed API requests.
|
|
668
|
+
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
669
|
+
*/
|
|
670
|
+
getDocumentTypes() {
|
|
671
|
+
return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${URLS.DOCUMENT_TYPES}`).pipe(tap((documentTypes) => {
|
|
672
|
+
this.documentStore.setDocumentTypes(documentTypes);
|
|
673
|
+
}), catchError((error) => {
|
|
674
|
+
return throwError(() => new Error(error));
|
|
675
|
+
}));
|
|
676
|
+
}
|
|
677
|
+
/**
|
|
678
|
+
* Fetches a document by its path name and transforms the response for dropdown options.
|
|
679
|
+
* @param documentId - The document ID to fetch the document.
|
|
680
|
+
* @returns
|
|
681
|
+
*/
|
|
682
|
+
getAlertsByDocumentID(documentId) {
|
|
683
|
+
return this.http.get(`${this.apiUrl}${URLS.ALERT_BY_DOCUMENT_ID}${documentId}`).pipe(tap((documentAlert) => {
|
|
684
|
+
this.documentStore.setDocumentAlert(documentAlert);
|
|
685
|
+
}), catchError((error) => {
|
|
686
|
+
return throwError(() => new Error(error));
|
|
687
|
+
}));
|
|
688
|
+
}
|
|
689
|
+
/**
|
|
690
|
+
* Fetches a document by its folder ID and transforms the response for dropdown options.
|
|
691
|
+
* @param folderId - The folder ID to fetch the document.
|
|
692
|
+
* @returns
|
|
693
|
+
*/
|
|
694
|
+
getDocumentByFolderID(folderId) {
|
|
695
|
+
return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${URLS.PARENT_DOCUMENT_TYPE_ID}${folderId}`).pipe(tap((records) => {
|
|
696
|
+
this.documentStore.set(records);
|
|
697
|
+
}), catchError((error) => {
|
|
698
|
+
return throwError(() => new Error(error));
|
|
699
|
+
}));
|
|
700
|
+
}
|
|
701
|
+
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 });
|
|
702
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentHttpService, providedIn: 'root' });
|
|
703
|
+
}
|
|
704
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentHttpService, decorators: [{
|
|
705
|
+
type: Injectable,
|
|
706
|
+
args: [{
|
|
707
|
+
providedIn: 'root'
|
|
708
|
+
}]
|
|
709
|
+
}], ctorParameters: () => [{ type: DocumentStore }, { type: i2.HttpClient }, { type: AppConfigService }] });
|
|
473
710
|
|
|
474
711
|
/**
|
|
475
712
|
* The `FolderBlockComponent` is responsible for displaying a block of folders and
|
|
@@ -484,7 +721,7 @@ class FolderBlockComponent {
|
|
|
484
721
|
* Array of folder blocks data to display.
|
|
485
722
|
* Each folder is represented as a `FolderBlockModel`.
|
|
486
723
|
*/
|
|
487
|
-
|
|
724
|
+
folderList = SHARED.EMPTY_ARRAY;
|
|
488
725
|
/** Number of missing files, sourced from the `SHARED` constants. */
|
|
489
726
|
missingFileCount = SHARED.MISSINGCOUNT;
|
|
490
727
|
/** Number of pending files, sourced from the `SHARED` constants. */
|
|
@@ -507,15 +744,16 @@ class FolderBlockComponent {
|
|
|
507
744
|
if (!folderBlockId) {
|
|
508
745
|
return SHARED.EMPTY;
|
|
509
746
|
}
|
|
747
|
+
this.documentStore.setParentDocumentTypeId(folderBlockId);
|
|
510
748
|
return folderBlockId;
|
|
511
749
|
}
|
|
512
750
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FolderBlockComponent, deps: [{ token: DocumentStore }], target: i0.ɵɵFactoryTarget.Component });
|
|
513
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: FolderBlockComponent, isStandalone: false, selector: "lib-folder-block", inputs: {
|
|
751
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: FolderBlockComponent, isStandalone: false, selector: "lib-folder-block", inputs: { folderList: "folderList" }, ngImport: i0, template: "<div class=\"card folder-info my-4\">\r\n <div class=\"text-900 text-xl font-semibold mb-3\">Folders</div>\r\n <div class=\"grid\">\r\n <div *ngFor=\"let folder of folderList\" class=\"col-12 md:col-6 xl:col-4\">\r\n <div\r\n class=\"p-3 border-1 h-full surface-border flex flex-column justify-content-between surface-100 hover:surface-100 cursor-pointer border-round\"\r\n (click)=\"handleClickForFilter(folder._id)\"\r\n >\r\n <div class=\"icon\">\r\n <img src=\"../../../../assets/images/FolderImg.png\" alt=\"\" />\r\n </div>\r\n <div class=\"flex flex-column\">\r\n <span class=\"text-600 mt-2\"> {{ folder.documentCount }} Files </span>\r\n <span class=\"text-900 text-lg mt-2 mb-2 font-semibold font-medium\">\r\n {{ folder.folderName }}\r\n </span>\r\n </div>\r\n <hr />\r\n <div class=\"flex justify-content-between\">\r\n <div class=\"flex flex-column\">\r\n <span>Missing</span>\r\n <span\r\n [ngClass]=\"{\r\n 'text-pink-500': missingFileCount > 0,\r\n 'text-green-500': missingFileCount === 0\r\n }\"\r\n >\r\n {{ missingFileCount }}\r\n </span>\r\n </div>\r\n <div class=\"flex flex-column\">\r\n <span>Pending</span>\r\n <span\r\n [ngClass]=\"{\r\n 'text-yellow-500': pendingFileCount > 0,\r\n 'text-green-500': pendingFileCount === 0\r\n }\"\r\n >\r\n {{ pendingFileCount }}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
514
752
|
}
|
|
515
753
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FolderBlockComponent, decorators: [{
|
|
516
754
|
type: Component,
|
|
517
|
-
args: [{ selector: 'lib-folder-block', standalone: false, template: "<div class=\"card folder-info my-4\">\r\n <div class=\"text-900 text-xl font-semibold mb-3\">Folders</div>\r\n <div class=\"grid\">\r\n <div *ngFor=\"let folder of
|
|
518
|
-
}], ctorParameters: () => [{ type: DocumentStore }], propDecorators: {
|
|
755
|
+
args: [{ selector: 'lib-folder-block', standalone: false, template: "<div class=\"card folder-info my-4\">\r\n <div class=\"text-900 text-xl font-semibold mb-3\">Folders</div>\r\n <div class=\"grid\">\r\n <div *ngFor=\"let folder of folderList\" class=\"col-12 md:col-6 xl:col-4\">\r\n <div\r\n class=\"p-3 border-1 h-full surface-border flex flex-column justify-content-between surface-100 hover:surface-100 cursor-pointer border-round\"\r\n (click)=\"handleClickForFilter(folder._id)\"\r\n >\r\n <div class=\"icon\">\r\n <img src=\"../../../../assets/images/FolderImg.png\" alt=\"\" />\r\n </div>\r\n <div class=\"flex flex-column\">\r\n <span class=\"text-600 mt-2\"> {{ folder.documentCount }} Files </span>\r\n <span class=\"text-900 text-lg mt-2 mb-2 font-semibold font-medium\">\r\n {{ folder.folderName }}\r\n </span>\r\n </div>\r\n <hr />\r\n <div class=\"flex justify-content-between\">\r\n <div class=\"flex flex-column\">\r\n <span>Missing</span>\r\n <span\r\n [ngClass]=\"{\r\n 'text-pink-500': missingFileCount > 0,\r\n 'text-green-500': missingFileCount === 0\r\n }\"\r\n >\r\n {{ missingFileCount }}\r\n </span>\r\n </div>\r\n <div class=\"flex flex-column\">\r\n <span>Pending</span>\r\n <span\r\n [ngClass]=\"{\r\n 'text-yellow-500': pendingFileCount > 0,\r\n 'text-green-500': pendingFileCount === 0\r\n }\"\r\n >\r\n {{ pendingFileCount }}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n" }]
|
|
756
|
+
}], ctorParameters: () => [{ type: DocumentStore }], propDecorators: { folderList: [{
|
|
519
757
|
type: Input
|
|
520
758
|
}] } });
|
|
521
759
|
|
|
@@ -532,20 +770,159 @@ class FolderContainerComponent {
|
|
|
532
770
|
* Represents the document data to be displayed in the folder container.
|
|
533
771
|
*/
|
|
534
772
|
documentList;
|
|
773
|
+
/**
|
|
774
|
+
* A list of documents passed as input to the component.
|
|
775
|
+
* Represents the document data to be displayed in the folder container.
|
|
776
|
+
*/
|
|
777
|
+
folderList = SHARED.EMPTY_ARRAY;
|
|
778
|
+
/**
|
|
779
|
+
* The context ID for the folder container.
|
|
780
|
+
* @type {string}
|
|
781
|
+
*/
|
|
782
|
+
contextId = SHARED.EMPTY;
|
|
535
783
|
/**
|
|
536
784
|
* Folder blocks data, sourced from the `SHARED` constants.
|
|
537
785
|
*/
|
|
538
786
|
folderBlocks = FOLDERPANEL;
|
|
539
787
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FolderContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
540
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: FolderContainerComponent, isStandalone: false, selector: "lib-folder-container", inputs: { documentList: "documentList" }, ngImport: i0, template: "\r\n<lib-folder-block [
|
|
788
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: FolderContainerComponent, isStandalone: false, selector: "lib-folder-container", inputs: { documentList: "documentList", folderList: "folderList", contextId: "contextId" }, ngImport: i0, template: "\r\n<lib-folder-block [folderList]=\"folderList\"></lib-folder-block>", styles: [""], dependencies: [{ kind: "component", type: FolderBlockComponent, selector: "lib-folder-block", inputs: ["folderList"] }] });
|
|
541
789
|
}
|
|
542
790
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FolderContainerComponent, decorators: [{
|
|
543
791
|
type: Component,
|
|
544
|
-
args: [{ selector: 'lib-folder-container', standalone: false, template: "\r\n<lib-folder-block [
|
|
792
|
+
args: [{ selector: 'lib-folder-container', standalone: false, template: "\r\n<lib-folder-block [folderList]=\"folderList\"></lib-folder-block>" }]
|
|
545
793
|
}], propDecorators: { documentList: [{
|
|
546
794
|
type: Input
|
|
795
|
+
}], folderList: [{
|
|
796
|
+
type: Input
|
|
797
|
+
}], contextId: [{
|
|
798
|
+
type: Input
|
|
547
799
|
}] } });
|
|
548
800
|
|
|
801
|
+
/**
|
|
802
|
+
* Service for handling document uploads.
|
|
803
|
+
* @class DocumentUploadService
|
|
804
|
+
* @typedef {DocumentUploadService}
|
|
805
|
+
*/
|
|
806
|
+
class DocumentUploadService {
|
|
807
|
+
documentService;
|
|
808
|
+
documentUploadStore;
|
|
809
|
+
messageService;
|
|
810
|
+
/**
|
|
811
|
+
* The file to upload.
|
|
812
|
+
* @type {*}
|
|
813
|
+
*/
|
|
814
|
+
uploadedFile;
|
|
815
|
+
/**
|
|
816
|
+
* Represent contextId
|
|
817
|
+
* @type {string}
|
|
818
|
+
*/
|
|
819
|
+
contextId = SHARED.EMPTY;
|
|
820
|
+
/**
|
|
821
|
+
* Represent document name
|
|
822
|
+
* @type {string}
|
|
823
|
+
*/
|
|
824
|
+
docName = SHARED.EMPTY;
|
|
825
|
+
/**
|
|
826
|
+
* Represent document id
|
|
827
|
+
* @type {string}
|
|
828
|
+
*/
|
|
829
|
+
docTypeId = SHARED.EMPTY;
|
|
830
|
+
/**
|
|
831
|
+
* Creates an instance of DocumentUploadService.
|
|
832
|
+
* @param {DocumentService} documentService - Service for handling document uploads.
|
|
833
|
+
* @param {DocumentStore} documentUploadStore - Store for managing uploaded documents.
|
|
834
|
+
* @param {MessageService} messageService - Service for displaying messages.
|
|
835
|
+
* @returns {void}
|
|
836
|
+
*/
|
|
837
|
+
constructor(documentService, documentUploadStore, messageService) {
|
|
838
|
+
this.documentService = documentService;
|
|
839
|
+
this.documentUploadStore = documentUploadStore;
|
|
840
|
+
this.messageService = messageService;
|
|
841
|
+
}
|
|
842
|
+
/**
|
|
843
|
+
* Prepares the files for upload by creating a FormData object.
|
|
844
|
+
* This method appends each file to the FormData for submission.
|
|
845
|
+
* @returns {void}
|
|
846
|
+
*/
|
|
847
|
+
handleTemplatedUpload() {
|
|
848
|
+
let formsData = this.handleCreateFormData();
|
|
849
|
+
if (!formsData) {
|
|
850
|
+
this.messageService.add({ severity: SHARED.SEVERITY, summary: SHARED.UPLOAD_ERROR_SUMMERY, detail: SHARED.UPLOAD_ERROR_DETAILS });
|
|
851
|
+
return;
|
|
852
|
+
}
|
|
853
|
+
this.documentService.create(formsData)
|
|
854
|
+
.subscribe({
|
|
855
|
+
/**
|
|
856
|
+
* Handles the successful upload event.
|
|
857
|
+
* Updates the list of uploaded files and emits the file ID.
|
|
858
|
+
* @param {any} event - The event emitted by the upload service on success.
|
|
859
|
+
*/
|
|
860
|
+
next: (event) => {
|
|
861
|
+
this.documentUploadStore.setUploadedDocumentFiles(event);
|
|
862
|
+
this.messageService.add({
|
|
863
|
+
severity: SHARED.SUCCESS_SEVERITY,
|
|
864
|
+
detail: SHARED.UPLOAD_SUCCESS
|
|
865
|
+
});
|
|
866
|
+
},
|
|
867
|
+
/**
|
|
868
|
+
* Handles the error event during file upload.
|
|
869
|
+
* Updates the progress of the file to indicate failure.
|
|
870
|
+
* @param {any} error - The error object returned by the upload service.
|
|
871
|
+
*/
|
|
872
|
+
error: (error) => {
|
|
873
|
+
this.messageService.add({ severity: SHARED.SEVERITY, summary: SHARED.UPLOAD_SUMMERY, detail: error?.message, });
|
|
874
|
+
},
|
|
875
|
+
});
|
|
876
|
+
}
|
|
877
|
+
/**
|
|
878
|
+
* Get the file and contextId
|
|
879
|
+
* @param file - The file to upload.
|
|
880
|
+
* @param contextId - The contextId to upload.
|
|
881
|
+
*/
|
|
882
|
+
getUploadFileData(file, contextId) {
|
|
883
|
+
if (file && contextId) {
|
|
884
|
+
this.uploadedFile = file;
|
|
885
|
+
this.contextId = contextId;
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
/**
|
|
889
|
+
* Get the document name and document type id
|
|
890
|
+
* @param documentName - The document name to upload.
|
|
891
|
+
* @param documentTypeId - The document type id to upload.
|
|
892
|
+
*/
|
|
893
|
+
getDocumentNameAndType(documentName, documentTypeId) {
|
|
894
|
+
if (documentName && documentTypeId) {
|
|
895
|
+
this.docName = documentName;
|
|
896
|
+
this.docTypeId = documentTypeId;
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
/**
|
|
900
|
+
* Handle the creation of formdata.
|
|
901
|
+
* @returns {*} - The formdata object.
|
|
902
|
+
*/
|
|
903
|
+
handleCreateFormData() {
|
|
904
|
+
if (this.uploadedFile && this.contextId && this.docName && this.docTypeId) {
|
|
905
|
+
let formData = new FormData();
|
|
906
|
+
formData.append(SHARED.FILE, this.uploadedFile, this.uploadedFile.name);
|
|
907
|
+
formData.append(SHARED.CONTEXT_ID, this.contextId);
|
|
908
|
+
formData.append(SHARED.DOCUMENT_NAME, this.docName);
|
|
909
|
+
formData.append(SHARED.DOCUMENT_TYPE_ID, this.docTypeId);
|
|
910
|
+
return formData;
|
|
911
|
+
}
|
|
912
|
+
else {
|
|
913
|
+
return null;
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentUploadService, deps: [{ token: DocumentService }, { token: DocumentStore }, { token: i3.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
917
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentUploadService, providedIn: 'root' });
|
|
918
|
+
}
|
|
919
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentUploadService, decorators: [{
|
|
920
|
+
type: Injectable,
|
|
921
|
+
args: [{
|
|
922
|
+
providedIn: 'root'
|
|
923
|
+
}]
|
|
924
|
+
}], ctorParameters: () => [{ type: DocumentService }, { type: DocumentStore }, { type: i3.MessageService }] });
|
|
925
|
+
|
|
549
926
|
/**
|
|
550
927
|
* DocumentListItemComponent
|
|
551
928
|
*
|
|
@@ -575,7 +952,7 @@ class DocumentListItemComponent {
|
|
|
575
952
|
this.documentClick.emit(document);
|
|
576
953
|
}
|
|
577
954
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentListItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
578
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: DocumentListItemComponent, isStandalone: false, selector: "lib-document-list-item", inputs: { document: "document" }, outputs: { documentClick: "documentClick" }, ngImport: i0, template: "<div class=\"grid\">\r\n <div\r\n class=\"col-12 flex align-items-center justify-content-between md:col-6 xl:col-12\"\r\n >\r\n <div\r\n class=\"col-5 flex cursor-pointer align-items-center pl-0\"\r\n (click)=\"handleOpenDocument(document)\"\r\n >\r\n <img src=\"../../../../assets/images/Frame.png\" alt=\"\" />\r\n <span class=\"ml-4\">{{ document.fileName }}</span>\r\n </div>\r\n <div class=\"col-4 flex align-items-center justify-content-center\">\r\n <span\r\n [class]=\"'product-badge status-' + document.status?.toLowerCase()\"\r\n class=\"flex align-items-center justify-content-center pl-2 pr-2 pt-1 pb-1 \"\r\n >\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'pending'\">\r\n <i class=\"pi pi-clock pr-1\" style=\"font-size: 12px;\"></i>\r\n Pending\r\n </ng-container>\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'verified'\">\r\n <i class=\"pi pi-check-circle pr-1\" style=\"font-size: 12px;\"></i>\r\n Verified\r\n </ng-container>\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'sentreminder'\">\r\n <i class=\"pi pi-bell pr-1\" style=\"font-size: 12px;\"></i>\r\n Sent Reminder \r\n </ng-container>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n ", styles: [".product-badge.status-pending{background:#e9b127;color:#fff;border-radius:4px}.product-badge.status-verified{background:#4caf50;color:#fff;border-radius:4px}.product-badge.status-sentreminder{background:#f57c00;color:#fff;border-radius:4px}.product-badge{text-transform:none;font-weight:500;font-size:12px}\n"], dependencies: [{ kind: "directive", type:
|
|
955
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: DocumentListItemComponent, isStandalone: false, selector: "lib-document-list-item", inputs: { document: "document" }, outputs: { documentClick: "documentClick" }, ngImport: i0, template: "<div class=\"grid\">\r\n <div\r\n class=\"col-12 flex align-items-center justify-content-between md:col-6 xl:col-12\"\r\n >\r\n <div\r\n class=\"col-5 flex cursor-pointer align-items-center pl-0\"\r\n (click)=\"handleOpenDocument(document)\"\r\n >\r\n <img src=\"../../../../assets/images/Frame.png\" alt=\"\" />\r\n <span class=\"ml-4\">{{ document.fileName }}</span>\r\n </div>\r\n <div class=\"col-4 flex align-items-center justify-content-center\">\r\n <span\r\n [class]=\"'product-badge status-' + document.status?.toLowerCase()\"\r\n class=\"flex align-items-center justify-content-center pl-2 pr-2 pt-1 pb-1 \"\r\n >\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'pending'\">\r\n <i class=\"pi pi-clock pr-1\" style=\"font-size: 12px;\"></i>\r\n Pending\r\n </ng-container>\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'verified'\">\r\n <i class=\"pi pi-check-circle pr-1\" style=\"font-size: 12px;\"></i>\r\n Verified\r\n </ng-container>\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'sentreminder'\">\r\n <i class=\"pi pi-bell pr-1\" style=\"font-size: 12px;\"></i>\r\n Sent Reminder \r\n </ng-container>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n ", styles: [".product-badge.status-pending{background:#e9b127;color:#fff;border-radius:4px}.product-badge.status-verified{background:#4caf50;color:#fff;border-radius:4px}.product-badge.status-sentreminder{background:#f57c00;color:#fff;border-radius:4px}.product-badge{text-transform:none;font-weight:500;font-size:12px}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
579
956
|
}
|
|
580
957
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentListItemComponent, decorators: [{
|
|
581
958
|
type: Component,
|
|
@@ -634,21 +1011,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
634
1011
|
* @class DocumentUploadComponent
|
|
635
1012
|
*/
|
|
636
1013
|
class DocumentUploadComponent {
|
|
1014
|
+
documentUpload;
|
|
637
1015
|
uploadService;
|
|
638
1016
|
config;
|
|
639
1017
|
fileFormatService;
|
|
640
1018
|
messageService;
|
|
641
1019
|
cdr;
|
|
1020
|
+
/**
|
|
1021
|
+
* Represents the file size.
|
|
1022
|
+
* @type {number}
|
|
1023
|
+
*/
|
|
1024
|
+
fileSize = SHARED.EMPTY;
|
|
642
1025
|
/**
|
|
643
1026
|
* Represent contextId
|
|
644
1027
|
* @type {string}
|
|
645
1028
|
*/
|
|
646
1029
|
contextId = SHARED.EMPTY;
|
|
647
|
-
/**
|
|
648
|
-
* Provide id of file after upload.
|
|
649
|
-
* @type {*}
|
|
650
|
-
*/
|
|
651
|
-
onInput = new EventEmitter();
|
|
652
1030
|
/**
|
|
653
1031
|
* To make file explorer visible.
|
|
654
1032
|
* @type {!FileUpload}
|
|
@@ -673,13 +1051,15 @@ class DocumentUploadComponent {
|
|
|
673
1051
|
/**
|
|
674
1052
|
* Creates an instance of DocumentUploadComponent.
|
|
675
1053
|
* @class
|
|
1054
|
+
* @param {DocumentUploadService} documentUpload - Service for handling document upload.
|
|
676
1055
|
* @param {DocumentService} uploadService - Service for handling document upload.
|
|
677
1056
|
* @param {PrimeNGConfig} config - PrimeNG configuration.
|
|
678
1057
|
* @param {FileFormatService} fileFormatService - Service for formatting file sizes.
|
|
679
1058
|
* @param {MessageService} messageService - Service for displaying messages.
|
|
680
1059
|
* @param {ChangeDetectorRef} cdr - Service for detecting changes.
|
|
681
1060
|
*/
|
|
682
|
-
constructor(uploadService, config, fileFormatService, messageService, cdr) {
|
|
1061
|
+
constructor(documentUpload, uploadService, config, fileFormatService, messageService, cdr) {
|
|
1062
|
+
this.documentUpload = documentUpload;
|
|
683
1063
|
this.uploadService = uploadService;
|
|
684
1064
|
this.config = config;
|
|
685
1065
|
this.fileFormatService = fileFormatService;
|
|
@@ -702,39 +1082,17 @@ class DocumentUploadComponent {
|
|
|
702
1082
|
* @returns {void}
|
|
703
1083
|
*/
|
|
704
1084
|
handleTemplatedUpload(file) {
|
|
705
|
-
|
|
706
|
-
this.
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
* @param {any} event - The event emitted by the upload service on success.
|
|
712
|
-
*/
|
|
713
|
-
next: (event) => {
|
|
714
|
-
this.uploadedFiles.push(event);
|
|
715
|
-
this.fileProgress.set(event, 100);
|
|
716
|
-
this.onInput.emit(event._id);
|
|
717
|
-
this.totalSizePercent = 100;
|
|
718
|
-
},
|
|
719
|
-
/**
|
|
720
|
-
* Handles the error event during file upload.
|
|
721
|
-
* Updates the progress of the file to indicate failure.
|
|
722
|
-
* @param {any} error - The error object returned by the upload service.
|
|
723
|
-
*/
|
|
724
|
-
error: (error) => {
|
|
725
|
-
this.fileProgress.set(file, SHARED.INITIAL_COUNT);
|
|
726
|
-
this.messageService.add({
|
|
727
|
-
severity: SHARED.SEVERITY,
|
|
728
|
-
summary: SHARED.UPLOAD_SUMMERY,
|
|
729
|
-
detail: error?.message,
|
|
730
|
-
});
|
|
731
|
-
},
|
|
732
|
-
});
|
|
1085
|
+
this.documentUpload.getUploadFileData(file, this.contextId);
|
|
1086
|
+
const formattedSize = this.fileFormatService.formatFileSize(file.size, this.config);
|
|
1087
|
+
const progress = 100;
|
|
1088
|
+
this.uploadedFiles.push({ file, formattedSize, progress });
|
|
1089
|
+
this.fileProgress.set(file, progress);
|
|
1090
|
+
this.totalSizePercent = 100;
|
|
733
1091
|
}
|
|
734
1092
|
/**
|
|
735
1093
|
* Handle the creation of formdata.
|
|
736
1094
|
* @param {File} file - The file to append in formdata.
|
|
737
|
-
* @returns {*}
|
|
1095
|
+
* @returns {*} - The formdata object.
|
|
738
1096
|
*/
|
|
739
1097
|
handleCreateFormData(file) {
|
|
740
1098
|
const formData = new FormData();
|
|
@@ -743,10 +1101,10 @@ class DocumentUploadComponent {
|
|
|
743
1101
|
return formData;
|
|
744
1102
|
}
|
|
745
1103
|
/**
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
1104
|
+
* Handles the event when new files are selected.
|
|
1105
|
+
* @param { { currentFiles: File[] } } event - The event containing the newly selected files.
|
|
1106
|
+
* @returns {void} - No return value.
|
|
1107
|
+
*/
|
|
750
1108
|
onSelectedFiles(event) {
|
|
751
1109
|
event.currentFiles.forEach((file) => {
|
|
752
1110
|
this.handleTemplatedUpload(file);
|
|
@@ -759,7 +1117,7 @@ class DocumentUploadComponent {
|
|
|
759
1117
|
* @returns {string} The formatted file size (e.g., '1.2 KB', '2.3 MB').
|
|
760
1118
|
*/
|
|
761
1119
|
formatSize(bytes) {
|
|
762
|
-
|
|
1120
|
+
this.fileSize = this.fileFormatService.formatFileSize(bytes, this.config);
|
|
763
1121
|
}
|
|
764
1122
|
/**
|
|
765
1123
|
* Handles the removal of a file from the uploaded files list.
|
|
@@ -787,16 +1145,14 @@ class DocumentUploadComponent {
|
|
|
787
1145
|
triggerFileUpload() {
|
|
788
1146
|
this.fileUploader.choose();
|
|
789
1147
|
}
|
|
790
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentUploadComponent, deps: [{ token: DocumentService }, { token:
|
|
791
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: DocumentUploadComponent, isStandalone: false, selector: "lib-document-upload", inputs: { contextId: "contextId" },
|
|
1148
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentUploadComponent, deps: [{ token: DocumentUploadService }, { token: DocumentService }, { token: i3.PrimeNGConfig }, { token: FileFormatService }, { token: i3.MessageService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1149
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: DocumentUploadComponent, isStandalone: false, selector: "lib-document-upload", inputs: { contextId: "contextId" }, viewQueries: [{ propertyName: "fileUploader", first: true, predicate: ["fileUploader"], descendants: true }], ngImport: i0, template: "<div class=\"grid\">\r\n <div class=\"col-12 md:col-12\">\r\n <p-fileUpload #fileUploader [multiple]=\"true\" auto=\"true\" accept=\"image/png,application/pdf\" maxFileSize=\"1000000\"\r\n (onSelect)=\"onSelectedFiles($event)\">\r\n <ng-template pTemplate=\"header\" let-chooseCallback=\"chooseCallback\" let-clearCallback=\"clearCallback\">\r\n <div class=\"p-2 flex flex-wrap justify-content-between align-items-center flex-1 gap-2\">\r\n <div class=\"flex gap-2\">\r\n <p-button (onClick)=\"choose($event, chooseCallback)\" icon=\"pi pi-images\" [rounded]=\"true\"\r\n [outlined]=\"true\" />\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"content\" let-removeFileCallback=\"removeFileCallback\"\r\n let-removeUploadedFileCallback=\"removeUploadedFileCallback\">\r\n <div class=\"col-12 md:col-12 p-0\">\r\n <div class=\"col-12 md:col-12 p-0\" *ngIf=\"uploadedFiles.length > 0\">\r\n <div *ngFor=\"let uploadedFile of uploadedFiles; let i = index\"\r\n class=\"m-0 flex flex-column align-items-center gap-1 mt-3\">\r\n <div class=\"col-12 md:col-12 p-0 flex documentInfo\">\r\n <div class=\"documentImage\">\r\n <img src=\"../../../../assets/images/document.png\" [alt]=\"uploadedFile.file.name\" width=\"45\" height=\"50\"\r\n class=\"object-contain\" />\r\n </div>\r\n <div class=\"flex w-full flex-column mt-2 ml-2\">\r\n <div class=\"flex justify-content-between\">\r\n <div style=\" font-weight: bold;font-size: 14px\">\r\n {{ uploadedFile.file.name }}\r\n </div>\r\n <i class=\"pi pi-times cursor-pointer\" (click)=\"handleDocumentRemove(uploadedFile.file,i)\"></i>\r\n </div>\r\n <div class=\"flex justify-content-between mt-1\">\r\n <div style=\"color: #676B89; font-size: 12px; color: green;\" class=\"pi pi-verified \"> {{ uploadedFile.formattedSize }}</div>\r\n <div class=\"white-space-nowrap\" style=\"color: #0F8BFD; font-family: 14px;\"> {{ uploadedFile.progress }} %</div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 md:col-12 p-0\">\r\n <p-progressBar [value]=\"totalSizePercent\" [showValue]=\"false\" styleClass=\"h-1/2rem md:ml-auto relative\"\r\n [ngClass]=\"{ 'exceeded-progress-bar': totalSizePercent > 100 }\">\r\n </p-progressBar>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"empty\" let-chooseCallback=\"chooseCallback\">\r\n <div *ngIf=\"!uploadedFiles.length\" class=\"flex align-items-center justify-content-center flex-column\"\r\n (click)=\"triggerFileUpload()\">\r\n <i class=\"pi pi-cloud-upload border-2 border-circle p-5 text-8xl text-400 border-400\"></i>\r\n <p class=\"mt-4 mb-0\">Drag and drop files here to upload.</p>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"file\"> </ng-template>\r\n </p-fileUpload>\r\n </div>\r\n</div>", styles: [".flex{display:flex}.items-center{align-items:center}.justify-center{justify-content:center}.flex-col{flex-direction:column}.text-muted-color{color:#6c757d}.p-fileupload-buttonbar{padding:0}.p-fileupload-content{background-color:#0f8bfd1a}.p-fileupload .p-fileupload-content{padding:1rem}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "style", "styleClass", "badgeClass", "ariaLabel", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i7.FileUpload, selector: "p-fileUpload", inputs: ["name", "url", "method", "multiple", "accept", "disabled", "auto", "withCredentials", "maxFileSize", "invalidFileSizeMessageSummary", "invalidFileSizeMessageDetail", "invalidFileTypeMessageSummary", "invalidFileTypeMessageDetail", "invalidFileLimitMessageDetail", "invalidFileLimitMessageSummary", "style", "styleClass", "previewWidth", "chooseLabel", "uploadLabel", "cancelLabel", "chooseIcon", "uploadIcon", "cancelIcon", "showUploadButton", "showCancelButton", "mode", "headers", "customUpload", "fileLimit", "uploadStyleClass", "cancelStyleClass", "removeStyleClass", "chooseStyleClass", "files"], outputs: ["onBeforeUpload", "onSend", "onUpload", "onError", "onClear", "onRemove", "onSelect", "onProgress", "uploadHandler", "onImageError", "onRemoveUploadedFile"] }, { kind: "component", type: i8.ProgressBar, selector: "p-progressBar", inputs: ["value", "showValue", "styleClass", "style", "unit", "mode", "color"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
792
1150
|
}
|
|
793
1151
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentUploadComponent, decorators: [{
|
|
794
1152
|
type: Component,
|
|
795
|
-
args: [{ selector: 'lib-document-upload', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"grid\">\r\n <div class=\"col-12 md:col-12\">\r\n <p-fileUpload #fileUploader [multiple]=\"true\" auto=\"true\" accept=\"image/png,application/pdf\" maxFileSize=\"1000000\"\r\n (onSelect)=\"onSelectedFiles($event)\">\r\n <ng-template pTemplate=\"header\" let-chooseCallback=\"chooseCallback\" let-clearCallback=\"clearCallback\">\r\n <div class=\"p-2 flex flex-wrap justify-content-between align-items-center flex-1 gap-2\">\r\n <div class=\"flex gap-2\">\r\n <p-button (onClick)=\"choose($event, chooseCallback)\" icon=\"pi pi-images\" [rounded]=\"true\"\r\n [outlined]=\"true\" />\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"content\" let-removeFileCallback=\"removeFileCallback\"\r\n let-removeUploadedFileCallback=\"removeUploadedFileCallback\">\r\n <div class=\"col-12 md:col-12 p-0\">\r\n <div class=\"col-12 md:col-12 p-0\" *ngIf=\"uploadedFiles.length > 0\">\r\n <div *ngFor=\"let
|
|
796
|
-
}], ctorParameters: () => [{ type: DocumentService }, { type:
|
|
1153
|
+
args: [{ selector: 'lib-document-upload', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"grid\">\r\n <div class=\"col-12 md:col-12\">\r\n <p-fileUpload #fileUploader [multiple]=\"true\" auto=\"true\" accept=\"image/png,application/pdf\" maxFileSize=\"1000000\"\r\n (onSelect)=\"onSelectedFiles($event)\">\r\n <ng-template pTemplate=\"header\" let-chooseCallback=\"chooseCallback\" let-clearCallback=\"clearCallback\">\r\n <div class=\"p-2 flex flex-wrap justify-content-between align-items-center flex-1 gap-2\">\r\n <div class=\"flex gap-2\">\r\n <p-button (onClick)=\"choose($event, chooseCallback)\" icon=\"pi pi-images\" [rounded]=\"true\"\r\n [outlined]=\"true\" />\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"content\" let-removeFileCallback=\"removeFileCallback\"\r\n let-removeUploadedFileCallback=\"removeUploadedFileCallback\">\r\n <div class=\"col-12 md:col-12 p-0\">\r\n <div class=\"col-12 md:col-12 p-0\" *ngIf=\"uploadedFiles.length > 0\">\r\n <div *ngFor=\"let uploadedFile of uploadedFiles; let i = index\"\r\n class=\"m-0 flex flex-column align-items-center gap-1 mt-3\">\r\n <div class=\"col-12 md:col-12 p-0 flex documentInfo\">\r\n <div class=\"documentImage\">\r\n <img src=\"../../../../assets/images/document.png\" [alt]=\"uploadedFile.file.name\" width=\"45\" height=\"50\"\r\n class=\"object-contain\" />\r\n </div>\r\n <div class=\"flex w-full flex-column mt-2 ml-2\">\r\n <div class=\"flex justify-content-between\">\r\n <div style=\" font-weight: bold;font-size: 14px\">\r\n {{ uploadedFile.file.name }}\r\n </div>\r\n <i class=\"pi pi-times cursor-pointer\" (click)=\"handleDocumentRemove(uploadedFile.file,i)\"></i>\r\n </div>\r\n <div class=\"flex justify-content-between mt-1\">\r\n <div style=\"color: #676B89; font-size: 12px; color: green;\" class=\"pi pi-verified \"> {{ uploadedFile.formattedSize }}</div>\r\n <div class=\"white-space-nowrap\" style=\"color: #0F8BFD; font-family: 14px;\"> {{ uploadedFile.progress }} %</div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 md:col-12 p-0\">\r\n <p-progressBar [value]=\"totalSizePercent\" [showValue]=\"false\" styleClass=\"h-1/2rem md:ml-auto relative\"\r\n [ngClass]=\"{ 'exceeded-progress-bar': totalSizePercent > 100 }\">\r\n </p-progressBar>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"empty\" let-chooseCallback=\"chooseCallback\">\r\n <div *ngIf=\"!uploadedFiles.length\" class=\"flex align-items-center justify-content-center flex-column\"\r\n (click)=\"triggerFileUpload()\">\r\n <i class=\"pi pi-cloud-upload border-2 border-circle p-5 text-8xl text-400 border-400\"></i>\r\n <p class=\"mt-4 mb-0\">Drag and drop files here to upload.</p>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"file\"> </ng-template>\r\n </p-fileUpload>\r\n </div>\r\n</div>", styles: [".flex{display:flex}.items-center{align-items:center}.justify-center{justify-content:center}.flex-col{flex-direction:column}.text-muted-color{color:#6c757d}.p-fileupload-buttonbar{padding:0}.p-fileupload-content{background-color:#0f8bfd1a}.p-fileupload .p-fileupload-content{padding:1rem}\n"] }]
|
|
1154
|
+
}], ctorParameters: () => [{ type: DocumentUploadService }, { type: DocumentService }, { type: i3.PrimeNGConfig }, { type: FileFormatService }, { type: i3.MessageService }, { type: i0.ChangeDetectorRef }], propDecorators: { contextId: [{
|
|
797
1155
|
type: Input
|
|
798
|
-
}], onInput: [{
|
|
799
|
-
type: Output
|
|
800
1156
|
}], fileUploader: [{
|
|
801
1157
|
type: ViewChild,
|
|
802
1158
|
args: ['fileUploader']
|
|
@@ -809,6 +1165,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
809
1165
|
* @implements {OnInit}
|
|
810
1166
|
*/
|
|
811
1167
|
class DocumentViewerComponent {
|
|
1168
|
+
documentHttpService;
|
|
812
1169
|
/**
|
|
813
1170
|
* Get the selected document by user.
|
|
814
1171
|
* @type {*}
|
|
@@ -819,21 +1176,11 @@ class DocumentViewerComponent {
|
|
|
819
1176
|
* @type {!string}
|
|
820
1177
|
*/
|
|
821
1178
|
notes;
|
|
822
|
-
/**
|
|
823
|
-
* Country data according to Country model.
|
|
824
|
-
* @type {!Country[]}
|
|
825
|
-
*/
|
|
826
|
-
countries;
|
|
827
1179
|
/**
|
|
828
1180
|
* Indicates whether a checkbox is selected.
|
|
829
1181
|
* @type {boolean}
|
|
830
1182
|
*/
|
|
831
1183
|
checked = false;
|
|
832
|
-
/**
|
|
833
|
-
* The currently selected country.
|
|
834
|
-
* @type {Country}
|
|
835
|
-
*/
|
|
836
|
-
selectedCountry;
|
|
837
1184
|
/**
|
|
838
1185
|
* Reference to the dynamic dialog used for displaying additional details.
|
|
839
1186
|
* @type {(DynamicDialogRef | undefined)}
|
|
@@ -859,16 +1206,29 @@ class DocumentViewerComponent {
|
|
|
859
1206
|
* @type {any}
|
|
860
1207
|
*/
|
|
861
1208
|
alertData;
|
|
1209
|
+
/**
|
|
1210
|
+
* Holds the subscription to manage observable cleanup.
|
|
1211
|
+
* @private
|
|
1212
|
+
* @type {Subscription}
|
|
1213
|
+
*/
|
|
1214
|
+
subscription = new Subscription();
|
|
862
1215
|
/**
|
|
863
1216
|
* Initializes a new instance of the DocumentViewerComponent.
|
|
864
1217
|
*/
|
|
865
|
-
constructor() {
|
|
1218
|
+
constructor(documentHttpService) {
|
|
1219
|
+
this.documentHttpService = documentHttpService;
|
|
1220
|
+
}
|
|
866
1221
|
/**
|
|
867
|
-
*
|
|
868
|
-
*
|
|
1222
|
+
* Fetches the alerts for the selected document.
|
|
1223
|
+
* @returns {void}
|
|
869
1224
|
*/
|
|
870
|
-
|
|
871
|
-
this.
|
|
1225
|
+
ngOnChanges() {
|
|
1226
|
+
if (this.selectedDocument) {
|
|
1227
|
+
const documentSubscription = this.documentHttpService.getAlertsByDocumentID(this.selectedDocument._id).subscribe((data) => {
|
|
1228
|
+
this.alertData = data;
|
|
1229
|
+
});
|
|
1230
|
+
this.subscription.add(documentSubscription);
|
|
1231
|
+
}
|
|
872
1232
|
}
|
|
873
1233
|
/**
|
|
874
1234
|
* Determines if the given content type is an image.
|
|
@@ -878,74 +1238,174 @@ class DocumentViewerComponent {
|
|
|
878
1238
|
isImage(contentType) {
|
|
879
1239
|
return SUPPORTED_IMAGE_TYPES.includes(contentType);
|
|
880
1240
|
}
|
|
881
|
-
|
|
882
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DocumentViewerComponent, isStandalone: false, selector: "document-viewer", inputs: { selectedDocument: "selectedDocument" }, 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-between\">\r\n <div class=\"action col-12 p-0 md:col-2 no-grow-no-shrink\">\r\n <p-listbox\r\n [options]=\"countries\"\r\n [filter]=\"true\"\r\n [(ngModel)]=\"selectedCountry\"\r\n optionLabel=\"name\"\r\n [style]=\"{ width: '15rem' }\"\r\n [listStyle]=\"{ 'max-height': '250px' }\"\r\n >\r\n <ng-template let-country pTemplate=\"item\">\r\n <div class=\"flex align-items-center gap-2\">\r\n <p-checkbox\r\n [(ngModel)]=\"country.checked\"\r\n [binary]=\"true\"\r\n [inputId]=\"country.code\"\r\n ></p-checkbox>\r\n <div>{{ country.name }}</div>\r\n </div>\r\n </ng-template>\r\n </p-listbox>\r\n </div>\r\n @if(selectedDocument){\r\n\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 width=\"500\"\r\n height=\"500\"\r\n alt=\"Document Image\"\r\n />\r\n </div>\r\n @if(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: 55vw; height: 100vh\"\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\" >\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 <div class=\"summery mb-4 pb-1\">\r\n <div class=\"card p-0 mb-0\" style=\"border-bottom: 1px solid;border-color: rgba(68, 72, 109, 0.2); border-bottom-right-radius: 0px;border-bottom-left-radius: 0px;\">\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; \">Summary</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 <p-timeline [value]=\"events\">\r\n <ng-template pTemplate=\"content\" let-event>\r\n {{ event.status }}\r\n </ng-template>\r\n </p-timeline>\r\n </div>\r\n </div>\r\n <div *ngIf=\"propertyDetails\" class=\"property-details mb-4 pb-1\">\r\n <div class=\"card mb-0\">\r\n <h4 class=\"bold\" style=\"font-size: 21px; font-weight: bold;\">Property Details</h4>\r\n <hr />\r\n <div class=\"grid\">\r\n <div class=\"col-12 md:col-12\">\r\n <div class=\"feild flex\">\r\n <div class=\"col-12 flex md:col-7\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/building-icon.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\" style=\"font-size: 21px; font-weight: bold;\">Detached House</div>\r\n <div class=\"decription\">\r\n {{ propertyDetails?.PropertyType }}\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 flex md:col-5\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/building-icon.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Floors }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Floors</div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"feild flex\">\r\n <div class=\"col-12 flex md:col-7\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/badroom.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Bedrooms }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Bedrooms</div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 flex md:col-5\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/building-icon.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Kitchen }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Kitchen</div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 flex ml-2 md:col-12\">\r\n <div class=\"img mr-2\">\r\n <img src=\"../../../../assets/icons/location.png\" alt=\"\" />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Address }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Address</div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"notes card pl-0 pr-0 pt-0\">\r\n <div class=\"card p-0\" style=\"border-bottom: 1px solid;border-color: rgba(68, 72, 109, 0.2); border-bottom-right-radius: 0px;border-bottom-left-radius: 0px;\">\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; \">Notes</h4>\r\n </div>\r\n </div>\r\n <div class=\"card mb-0 pt-0\">\r\n <div class=\"textAreaControl mt-3\">\r\n <textarea\r\n rows=\"5\"\r\n cols=\"30\"\r\n pInputTextarea\r\n #textArea\r\n [(ngModel)]=\"notes\"\r\n >\r\n </textarea>\r\n </div>\r\n <div class=\"buttons document-btn-wrapper flex mt-2\">\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n label=\"Resubmission\"\r\n class=\"p-button-outlined mr-2\"\r\n ></button>\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n label=\"Accept\"\r\n ></button>\r\n </div>\r\n </div>\r\n </div>\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-header,.document-viewer .p-dialog-content{background-color:#ececf9}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i3.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: i4.Listbox, selector: "p-listbox", inputs: ["id", "searchMessage", "emptySelectionMessage", "selectionMessage", "autoOptionFocus", "ariaLabel", "selectOnFocus", "searchLocale", "focusOnHover", "filterMessage", "filterFields", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "scrollHeight", "tabindex", "multiple", "style", "styleClass", "listStyle", "listStyleClass", "readonly", "disabled", "checkbox", "filter", "filterBy", "filterMatchMode", "filterLocale", "metaKeySelection", "dataKey", "showToggleAll", "optionLabel", "optionValue", "optionGroupChildren", "optionGroupLabel", "optionDisabled", "ariaFilterLabel", "filterPlaceHolder", "emptyFilterMessage", "emptyMessage", "group", "options", "filterValue", "selectAll"], outputs: ["onChange", "onClick", "onDblClick", "onFilter", "onFocus", "onBlur", "onSelectAllChange"] }, { kind: "component", type: i5.Checkbox, selector: "p-checkbox", inputs: ["value", "name", "disabled", "binary", "label", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "styleClass", "labelStyleClass", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "component", type: i6$1.Timeline, selector: "p-timeline", inputs: ["value", "style", "styleClass", "align", "layout"] }, { kind: "directive", type: i7$1.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize", "variant"], outputs: ["onResize"] }, { kind: "directive", type: i8.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: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i9.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 });
|
|
1241
|
+
ngOnDestroy() {
|
|
1242
|
+
this.subscription.unsubscribe();
|
|
1243
|
+
}
|
|
1244
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentViewerComponent, deps: [{ token: DocumentHttpService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1245
|
+
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 width=\"500\"\r\n height=\"500\"\r\n alt=\"Document Image\"\r\n />\r\n </div>\r\n @if(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: 55vw; height: 100vh\"\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\" >\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 <div class=\"summery mb-4 pb-1\">\r\n <div class=\"card p-0 mb-0\" style=\"border-bottom: 1px solid;border-color: rgba(68, 72, 109, 0.2); border-bottom-right-radius: 0px;border-bottom-left-radius: 0px;\">\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; \">Summary</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 <p-timeline [value]=\"events\">\r\n <ng-template pTemplate=\"content\" let-event>\r\n {{ event.status }}\r\n </ng-template>\r\n </p-timeline>\r\n </div>\r\n </div>\r\n <div *ngIf=\"propertyDetails\" class=\"property-details mb-4 pb-1\">\r\n <div class=\"card mb-0\">\r\n <h4 class=\"bold\" style=\"font-size: 21px; font-weight: bold;\">Property Details</h4>\r\n <hr />\r\n <div class=\"grid\">\r\n <div class=\"col-12 md:col-12\">\r\n <div class=\"feild flex\">\r\n <div class=\"col-12 flex md:col-7\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/building-icon.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\" style=\"font-size: 21px; font-weight: bold;\">Detached House</div>\r\n <div class=\"decription\">\r\n {{ propertyDetails?.PropertyType }}\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 flex md:col-5\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/building-icon.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Floors }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Floors</div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"feild flex\">\r\n <div class=\"col-12 flex md:col-7\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/badroom.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Bedrooms }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Bedrooms</div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 flex md:col-5\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/building-icon.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Kitchen }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Kitchen</div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 flex ml-2 md:col-12\">\r\n <div class=\"img mr-2\">\r\n <img src=\"../../../../assets/icons/location.png\" alt=\"\" />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Address }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Address</div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"notes card pl-0 pr-0 pt-0\">\r\n <div class=\"card p-0\" style=\"border-bottom: 1px solid;border-color: rgba(68, 72, 109, 0.2); border-bottom-right-radius: 0px;border-bottom-left-radius: 0px;\">\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; \">Notes</h4>\r\n </div>\r\n </div>\r\n <div class=\"card mb-0 pt-0\">\r\n <div class=\"textAreaControl mt-3\">\r\n <textarea\r\n rows=\"5\"\r\n cols=\"30\"\r\n pInputTextarea\r\n #textArea\r\n [(ngModel)]=\"notes\"\r\n >\r\n </textarea>\r\n </div>\r\n <div class=\"buttons document-btn-wrapper flex mt-2\">\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n label=\"Resubmission\"\r\n class=\"p-button-outlined mr-2\"\r\n ></button>\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n label=\"Accept\"\r\n ></button>\r\n </div>\r\n </div>\r\n </div>\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-header,.document-viewer .p-dialog-content{background-color:#ececf9}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i5.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: i5$1.Timeline, selector: "p-timeline", inputs: ["value", "style", "styleClass", "align", "layout"] }, { kind: "directive", type: i6.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize", "variant"], outputs: ["onResize"] }, { kind: "directive", type: i7$1.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: i7$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i8$1.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 });
|
|
883
1246
|
}
|
|
884
1247
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentViewerComponent, decorators: [{
|
|
885
1248
|
type: Component,
|
|
886
|
-
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-between\">\r\n <div class=\"action col-12 p-0 md:col-2 no-grow-no-shrink\">\r\n <p-listbox\r\n [options]=\"countries\"\r\n [filter]=\"true\"\r\n [(ngModel)]=\"selectedCountry\"\r\n optionLabel=\"name\"\r\n [style]=\"{ width: '15rem' }\"\r\n [listStyle]=\"{ 'max-height': '250px' }\"\r\n >\r\n <ng-template let-country pTemplate=\"item\">\r\n <div class=\"flex align-items-center gap-2\">\r\n <p-checkbox\r\n [(ngModel)]=\"country.checked\"\r\n [binary]=\"true\"\r\n [inputId]=\"country.code\"\r\n ></p-checkbox>\r\n <div>{{ country.name }}</div>\r\n </div>\r\n </ng-template>\r\n </p-listbox>\r\n </div>\r\n @if(selectedDocument){\r\n\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 width=\"500\"\r\n height=\"500\"\r\n alt=\"Document Image\"\r\n />\r\n </div>\r\n @if(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: 55vw; height: 100vh\"\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\" >\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 <div class=\"summery mb-4 pb-1\">\r\n <div class=\"card p-0 mb-0\" style=\"border-bottom: 1px solid;border-color: rgba(68, 72, 109, 0.2); border-bottom-right-radius: 0px;border-bottom-left-radius: 0px;\">\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; \">Summary</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 <p-timeline [value]=\"events\">\r\n <ng-template pTemplate=\"content\" let-event>\r\n {{ event.status }}\r\n </ng-template>\r\n </p-timeline>\r\n </div>\r\n </div>\r\n <div *ngIf=\"propertyDetails\" class=\"property-details mb-4 pb-1\">\r\n <div class=\"card mb-0\">\r\n <h4 class=\"bold\" style=\"font-size: 21px; font-weight: bold;\">Property Details</h4>\r\n <hr />\r\n <div class=\"grid\">\r\n <div class=\"col-12 md:col-12\">\r\n <div class=\"feild flex\">\r\n <div class=\"col-12 flex md:col-7\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/building-icon.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\" style=\"font-size: 21px; font-weight: bold;\">Detached House</div>\r\n <div class=\"decription\">\r\n {{ propertyDetails?.PropertyType }}\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 flex md:col-5\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/building-icon.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Floors }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Floors</div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"feild flex\">\r\n <div class=\"col-12 flex md:col-7\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/badroom.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Bedrooms }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Bedrooms</div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 flex md:col-5\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/building-icon.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Kitchen }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Kitchen</div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 flex ml-2 md:col-12\">\r\n <div class=\"img mr-2\">\r\n <img src=\"../../../../assets/icons/location.png\" alt=\"\" />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Address }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Address</div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"notes card pl-0 pr-0 pt-0\">\r\n <div class=\"card p-0\" style=\"border-bottom: 1px solid;border-color: rgba(68, 72, 109, 0.2); border-bottom-right-radius: 0px;border-bottom-left-radius: 0px;\">\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; \">Notes</h4>\r\n </div>\r\n </div>\r\n <div class=\"card mb-0 pt-0\">\r\n <div class=\"textAreaControl mt-3\">\r\n <textarea\r\n rows=\"5\"\r\n cols=\"30\"\r\n pInputTextarea\r\n #textArea\r\n [(ngModel)]=\"notes\"\r\n >\r\n </textarea>\r\n </div>\r\n <div class=\"buttons document-btn-wrapper flex mt-2\">\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n label=\"Resubmission\"\r\n class=\"p-button-outlined mr-2\"\r\n ></button>\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n label=\"Accept\"\r\n ></button>\r\n </div>\r\n </div>\r\n </div>\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-header,.document-viewer .p-dialog-content{background-color:#ececf9}\n"] }]
|
|
887
|
-
}], ctorParameters: () => [], propDecorators: { selectedDocument: [{
|
|
1249
|
+
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 width=\"500\"\r\n height=\"500\"\r\n alt=\"Document Image\"\r\n />\r\n </div>\r\n @if(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: 55vw; height: 100vh\"\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\" >\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 <div class=\"summery mb-4 pb-1\">\r\n <div class=\"card p-0 mb-0\" style=\"border-bottom: 1px solid;border-color: rgba(68, 72, 109, 0.2); border-bottom-right-radius: 0px;border-bottom-left-radius: 0px;\">\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; \">Summary</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 <p-timeline [value]=\"events\">\r\n <ng-template pTemplate=\"content\" let-event>\r\n {{ event.status }}\r\n </ng-template>\r\n </p-timeline>\r\n </div>\r\n </div>\r\n <div *ngIf=\"propertyDetails\" class=\"property-details mb-4 pb-1\">\r\n <div class=\"card mb-0\">\r\n <h4 class=\"bold\" style=\"font-size: 21px; font-weight: bold;\">Property Details</h4>\r\n <hr />\r\n <div class=\"grid\">\r\n <div class=\"col-12 md:col-12\">\r\n <div class=\"feild flex\">\r\n <div class=\"col-12 flex md:col-7\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/building-icon.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\" style=\"font-size: 21px; font-weight: bold;\">Detached House</div>\r\n <div class=\"decription\">\r\n {{ propertyDetails?.PropertyType }}\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 flex md:col-5\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/building-icon.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Floors }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Floors</div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"feild flex\">\r\n <div class=\"col-12 flex md:col-7\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/badroom.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Bedrooms }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Bedrooms</div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 flex md:col-5\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/building-icon.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Kitchen }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Kitchen</div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 flex ml-2 md:col-12\">\r\n <div class=\"img mr-2\">\r\n <img src=\"../../../../assets/icons/location.png\" alt=\"\" />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Address }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Address</div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"notes card pl-0 pr-0 pt-0\">\r\n <div class=\"card p-0\" style=\"border-bottom: 1px solid;border-color: rgba(68, 72, 109, 0.2); border-bottom-right-radius: 0px;border-bottom-left-radius: 0px;\">\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; \">Notes</h4>\r\n </div>\r\n </div>\r\n <div class=\"card mb-0 pt-0\">\r\n <div class=\"textAreaControl mt-3\">\r\n <textarea\r\n rows=\"5\"\r\n cols=\"30\"\r\n pInputTextarea\r\n #textArea\r\n [(ngModel)]=\"notes\"\r\n >\r\n </textarea>\r\n </div>\r\n <div class=\"buttons document-btn-wrapper flex mt-2\">\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n label=\"Resubmission\"\r\n class=\"p-button-outlined mr-2\"\r\n ></button>\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n label=\"Accept\"\r\n ></button>\r\n </div>\r\n </div>\r\n </div>\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-header,.document-viewer .p-dialog-content{background-color:#ececf9}\n"] }]
|
|
1250
|
+
}], ctorParameters: () => [{ type: DocumentHttpService }], propDecorators: { selectedDocument: [{
|
|
888
1251
|
type: Input
|
|
889
1252
|
}] } });
|
|
890
1253
|
|
|
891
1254
|
/**
|
|
892
|
-
* This component is responsible for displaying a list of documents.
|
|
1255
|
+
* This component is responsible for displaying and managing a list of documents.
|
|
1256
|
+
* Provides functionality for file upload, document selection, and dialog management.
|
|
893
1257
|
* @class DocumentListComponent
|
|
894
|
-
* @typedef {DocumentListComponent}
|
|
895
1258
|
*/
|
|
896
1259
|
class DocumentListComponent {
|
|
1260
|
+
documentUploadService;
|
|
1261
|
+
documentHttpService;
|
|
897
1262
|
/**
|
|
898
|
-
*
|
|
1263
|
+
* Represents the context ID for the document list.
|
|
1264
|
+
* This value is passed from the parent component.
|
|
899
1265
|
* @type {string}
|
|
1266
|
+
* @memberof DocumentListComponent
|
|
900
1267
|
*/
|
|
901
1268
|
contextId = SHARED.EMPTY;
|
|
1269
|
+
/**
|
|
1270
|
+
* The currently selected document.
|
|
1271
|
+
* @type {DocumentModel}
|
|
1272
|
+
* @memberof DocumentListComponent
|
|
1273
|
+
*/
|
|
902
1274
|
selectedDocument;
|
|
903
1275
|
/**
|
|
904
|
-
* Default
|
|
1276
|
+
* Default visibility of the sidebar.
|
|
905
1277
|
* @type {boolean}
|
|
1278
|
+
* @memberof DocumentListComponent
|
|
906
1279
|
*/
|
|
907
1280
|
isSidebarVisible = SHARED.FALSE;
|
|
908
1281
|
/**
|
|
909
|
-
* Default
|
|
1282
|
+
* Default visibility of the dialog.
|
|
910
1283
|
* @type {boolean}
|
|
1284
|
+
* @memberof DocumentListComponent
|
|
911
1285
|
*/
|
|
912
1286
|
isdialogVisible = SHARED.FALSE;
|
|
913
1287
|
/**
|
|
914
1288
|
* The list of documents to display.
|
|
1289
|
+
* This value is passed from the parent component.
|
|
915
1290
|
* @type {DocumentModel[]}
|
|
1291
|
+
* @memberof DocumentListComponent
|
|
916
1292
|
*/
|
|
917
|
-
documentList =
|
|
1293
|
+
documentList = SHARED.EMPTY_ARRAY;
|
|
1294
|
+
/**
|
|
1295
|
+
* The name of the document being uploaded or managed.
|
|
1296
|
+
* @type {string}
|
|
1297
|
+
* @memberof DocumentListComponent
|
|
1298
|
+
*/
|
|
1299
|
+
documentName = SHARED.EMPTY;
|
|
1300
|
+
/**
|
|
1301
|
+
* Available document types for selection.
|
|
1302
|
+
* @type {string[]}
|
|
1303
|
+
* @memberof DocumentListComponent
|
|
1304
|
+
*/
|
|
1305
|
+
options = SHARED.EMPTY_ARRAY;
|
|
1306
|
+
/**
|
|
1307
|
+
* The selected option for the document type.
|
|
1308
|
+
* @type {(string | null)}
|
|
1309
|
+
* @memberof DocumentListComponent
|
|
1310
|
+
*/
|
|
1311
|
+
selectedOption = null;
|
|
1312
|
+
/**
|
|
1313
|
+
* Creates an instance of DocumentListComponent.
|
|
1314
|
+
* @class
|
|
1315
|
+
* @param {DocumentUploadService} documentUploadService - The service responsible for uploading documents.
|
|
1316
|
+
* @param {DocumentHttpService} documentHttpService - The service responsible for fetching documents from the server.
|
|
1317
|
+
*/
|
|
1318
|
+
constructor(documentUploadService, documentHttpService) {
|
|
1319
|
+
this.documentUploadService = documentUploadService;
|
|
1320
|
+
this.documentHttpService = documentHttpService;
|
|
1321
|
+
}
|
|
1322
|
+
/**
|
|
1323
|
+
* Initializes the component by fetching the document type list.
|
|
1324
|
+
*/
|
|
1325
|
+
ngOnInit() {
|
|
1326
|
+
this.getDocumentTypeList();
|
|
1327
|
+
}
|
|
918
1328
|
/**
|
|
919
1329
|
* Handles the click event for file upload.
|
|
920
1330
|
* Prevents event propagation and displays the sidebar.
|
|
921
1331
|
* @param {MouseEvent} event - The click event triggered by the user.
|
|
1332
|
+
* @memberof DocumentListComponent
|
|
922
1333
|
*/
|
|
923
1334
|
handleFileUploadClick(event) {
|
|
924
1335
|
event.stopPropagation();
|
|
925
1336
|
this.isSidebarVisible = SHARED.TRUE;
|
|
926
1337
|
}
|
|
927
1338
|
/**
|
|
928
|
-
*
|
|
929
|
-
*
|
|
1339
|
+
* Handles the selection of an individual document.
|
|
1340
|
+
* Opens a dialog to display or manage the selected document.
|
|
1341
|
+
* @param {DocumentModel} document - The document that was clicked by the user.
|
|
1342
|
+
* @memberof DocumentListComponent
|
|
930
1343
|
*/
|
|
931
|
-
handleClickForDocument(
|
|
1344
|
+
handleClickForDocument(document) {
|
|
932
1345
|
this.isdialogVisible = SHARED.TRUE;
|
|
933
|
-
this.selectedDocument =
|
|
1346
|
+
this.selectedDocument = document;
|
|
934
1347
|
}
|
|
935
1348
|
/**
|
|
936
|
-
*
|
|
1349
|
+
* Closes the dialog and resets the selected document.
|
|
1350
|
+
* @memberof DocumentListComponent
|
|
937
1351
|
*/
|
|
938
1352
|
handleCloseModel() {
|
|
939
1353
|
this.selectedDocument = { _id: SHARED.INITIAL_VALUE };
|
|
940
1354
|
this.isdialogVisible = SHARED.FALSE;
|
|
941
1355
|
}
|
|
942
|
-
|
|
943
|
-
|
|
1356
|
+
/**
|
|
1357
|
+
* Handles the upload action for a document.
|
|
1358
|
+
* Validates if a document type is selected and logs the result.
|
|
1359
|
+
* @memberof DocumentListComponent
|
|
1360
|
+
*/
|
|
1361
|
+
handleUploadDocument() {
|
|
1362
|
+
if (this.selectedOption) {
|
|
1363
|
+
this.documentUploadService.getDocumentNameAndType(this.documentName, this.selectedOption);
|
|
1364
|
+
this.documentUploadService.handleTemplatedUpload();
|
|
1365
|
+
}
|
|
1366
|
+
else {
|
|
1367
|
+
console.error(ERRORS.INVALID_RECIPIENT);
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
/**
|
|
1371
|
+
* Fetches the list of document types from the server.
|
|
1372
|
+
* Updates the options array with the available document types.
|
|
1373
|
+
* @memberof DocumentListComponent
|
|
1374
|
+
* @returns {void}
|
|
1375
|
+
*/
|
|
1376
|
+
getDocumentTypeList() {
|
|
1377
|
+
this.documentHttpService.getDocumentTypes().subscribe({
|
|
1378
|
+
/**
|
|
1379
|
+
* Updates the options array with the available document types.
|
|
1380
|
+
* @param documentTypes - The list of document types returned by the server.
|
|
1381
|
+
*/
|
|
1382
|
+
next: (documentTypes) => {
|
|
1383
|
+
if (documentTypes?.allDocumentTypes) {
|
|
1384
|
+
this.options = documentTypes.allDocumentTypes.map((doc) => ({
|
|
1385
|
+
label: doc.name,
|
|
1386
|
+
value: doc._id
|
|
1387
|
+
}));
|
|
1388
|
+
}
|
|
1389
|
+
else {
|
|
1390
|
+
console.error(ERRORS.ERROR_ALLDOCUMENT_MISSING, documentTypes);
|
|
1391
|
+
}
|
|
1392
|
+
},
|
|
1393
|
+
/**
|
|
1394
|
+
* Handles errors if the request fails.
|
|
1395
|
+
* @param err - The error object returned by the server.
|
|
1396
|
+
*/
|
|
1397
|
+
error: (err) => {
|
|
1398
|
+
console.error(ERRORS.ERROR_DOCUMENT_TYPES, err);
|
|
1399
|
+
}
|
|
1400
|
+
});
|
|
1401
|
+
}
|
|
1402
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentListComponent, deps: [{ token: DocumentUploadService }, { token: DocumentHttpService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1403
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DocumentListComponent, isStandalone: false, selector: "lib-document-list", inputs: { contextId: "contextId", documentList: "documentList" }, ngImport: i0, template: "<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" (onHide)=\"handleCloseModel()\" [style]=\"{ width: '100vw' }\"\r\n [draggable]=\"false\" [closable]=\"true\">\r\n <document-viewer [selectedDocument]=\"selectedDocument\"></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 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\">\r\n Documents\r\n </span>\r\n <button pButton pRipple class=\"p-button-raised\" type=\"button\" label=\"Upload File\"\r\n style=\"border-radius: 10px;\" (click)=\"handleFileUploadClick($event)\"></button>\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\">\r\n <div class=\"col-12\">\r\n <p-sidebar [(visible)]=\"isSidebarVisible\" position=\"right\" [styleClass]=\"'right-sidebar'\" class=\"relative\">\r\n <ng-template pTemplate=\"header\">\r\n <p-messages />\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=\"username\">Document Name</label>\r\n <input type=\"text\" pInputText [(ngModel)]=\"documentName\" placeholder=\"Proof of Identity\" />\r\n </div>\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-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}\n"], dependencies: [{ kind: "component", type: i3$1.Accordion, selector: "p-accordion", inputs: ["multiple", "style", "styleClass", "expandIcon", "collapseIcon", "activeIndex", "selectOnFocus", "headerAriaLevel"], outputs: ["onClose", "onOpen", "activeIndexChange"] }, { kind: "component", type: i3$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: i5.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: i5.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: i6$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: i7$2.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange", "onClose"] }, { kind: "directive", type: i7$1.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: i7$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i9.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: i10.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: i11.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"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
944
1404
|
}
|
|
945
1405
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentListComponent, decorators: [{
|
|
946
1406
|
type: Component,
|
|
947
|
-
args: [{ selector: 'lib-document-list', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" (onHide)=\"handleCloseModel()\" [style]=\"{ width: '100vw' }\"\r\n [draggable]=\"false\" [closable]=\"true\">\r\n <document-viewer [selectedDocument]=\"selectedDocument\"></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 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\">\r\n Documents\r\n </span>\r\n <button pButton pRipple class=\"p-button-raised\" type=\"button\" label=\"Upload File\"\r\n style=\"border-radius: 10px;\" (click)=\"handleFileUploadClick($event)\"></button>\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\">\r\n <div class=\"col-12\">\r\n <p-sidebar [(visible)]=\"isSidebarVisible\" position=\"right\" [styleClass]=\"'right-sidebar'\">\r\n <lib-document-upload [contextId]=\"contextId\"></lib-document-upload>\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%}\n"] }]
|
|
948
|
-
}], propDecorators: { contextId: [{
|
|
1407
|
+
args: [{ selector: 'lib-document-list', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" (onHide)=\"handleCloseModel()\" [style]=\"{ width: '100vw' }\"\r\n [draggable]=\"false\" [closable]=\"true\">\r\n <document-viewer [selectedDocument]=\"selectedDocument\"></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 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\">\r\n Documents\r\n </span>\r\n <button pButton pRipple class=\"p-button-raised\" type=\"button\" label=\"Upload File\"\r\n style=\"border-radius: 10px;\" (click)=\"handleFileUploadClick($event)\"></button>\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\">\r\n <div class=\"col-12\">\r\n <p-sidebar [(visible)]=\"isSidebarVisible\" position=\"right\" [styleClass]=\"'right-sidebar'\" class=\"relative\">\r\n <ng-template pTemplate=\"header\">\r\n <p-messages />\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=\"username\">Document Name</label>\r\n <input type=\"text\" pInputText [(ngModel)]=\"documentName\" placeholder=\"Proof of Identity\" />\r\n </div>\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-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}\n"] }]
|
|
1408
|
+
}], ctorParameters: () => [{ type: DocumentUploadService }, { type: DocumentHttpService }], propDecorators: { contextId: [{
|
|
949
1409
|
type: Input
|
|
950
1410
|
}], documentList: [{
|
|
951
1411
|
type: Input
|
|
@@ -958,13 +1418,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
958
1418
|
*/
|
|
959
1419
|
class DocumentContainerComponent {
|
|
960
1420
|
documentService;
|
|
1421
|
+
documentQuery;
|
|
1422
|
+
documentHttpService;
|
|
961
1423
|
/**
|
|
962
1424
|
* Creates an instance of DocumentContainerComponent.
|
|
963
1425
|
* @class
|
|
964
1426
|
* @param {DocumentService} documentService - Service to manage document-related operations.
|
|
965
1427
|
*/
|
|
966
|
-
constructor(documentService) {
|
|
1428
|
+
constructor(documentService, documentQuery, documentHttpService) {
|
|
967
1429
|
this.documentService = documentService;
|
|
1430
|
+
this.documentQuery = documentQuery;
|
|
1431
|
+
this.documentHttpService = documentHttpService;
|
|
968
1432
|
}
|
|
969
1433
|
/**
|
|
970
1434
|
* Get contextId in input.
|
|
@@ -972,10 +1436,15 @@ class DocumentContainerComponent {
|
|
|
972
1436
|
*/
|
|
973
1437
|
contextId = SHARED.EMPTY;
|
|
974
1438
|
/**
|
|
975
|
-
* The list of
|
|
1439
|
+
* The list of documents.
|
|
976
1440
|
* @type {Array}
|
|
977
1441
|
*/
|
|
978
1442
|
documentList = [];
|
|
1443
|
+
/**
|
|
1444
|
+
* The list of folders.
|
|
1445
|
+
* @type {Array}
|
|
1446
|
+
*/
|
|
1447
|
+
folderList = [];
|
|
979
1448
|
/**
|
|
980
1449
|
* Holds the subscription to manage observable cleanup.
|
|
981
1450
|
* @private
|
|
@@ -983,28 +1452,75 @@ class DocumentContainerComponent {
|
|
|
983
1452
|
*/
|
|
984
1453
|
subscription = new Subscription();
|
|
985
1454
|
/**
|
|
986
|
-
*
|
|
1455
|
+
* Fetches the folder and document data on initialization.
|
|
1456
|
+
* @returns {void}
|
|
987
1457
|
*/
|
|
988
1458
|
ngOnInit() {
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
.
|
|
1459
|
+
this.fetchFolder();
|
|
1460
|
+
const folderSubscription = this.documentQuery
|
|
1461
|
+
.selectParentDocumentTypeId()
|
|
1462
|
+
.subscribe((folderBlockId) => {
|
|
1463
|
+
const idToFetch = folderBlockId ?? this.folderList?.[0]?._id;
|
|
1464
|
+
if (idToFetch) {
|
|
1465
|
+
this.fetchDocuments(idToFetch);
|
|
1466
|
+
}
|
|
1467
|
+
});
|
|
1468
|
+
this.subscription.add(folderSubscription);
|
|
1469
|
+
}
|
|
1470
|
+
/**
|
|
1471
|
+
* Fetches the folder data from the API.
|
|
1472
|
+
* @returns {void}
|
|
1473
|
+
*/
|
|
1474
|
+
fetchFolder() {
|
|
1475
|
+
const folderSubscription = this.documentHttpService.getDocumentTypes().subscribe({
|
|
992
1476
|
/**
|
|
993
1477
|
* Handles the successful API response.
|
|
994
|
-
* @param
|
|
1478
|
+
* @param documentTypes - The list of document types returned by the API.
|
|
995
1479
|
*/
|
|
996
|
-
next: (
|
|
997
|
-
if (
|
|
998
|
-
this.
|
|
1480
|
+
next: (documentTypes) => {
|
|
1481
|
+
if (documentTypes?.allDocumentTypes) {
|
|
1482
|
+
this.folderList = documentTypes.parentFolderData;
|
|
1483
|
+
this.fetchDocuments(this.folderList[0]._id);
|
|
1484
|
+
}
|
|
1485
|
+
else {
|
|
1486
|
+
console.error(ERRORS.ERROR_ALLDOCUMENT_MISSING, documentTypes);
|
|
999
1487
|
}
|
|
1000
1488
|
},
|
|
1001
1489
|
/**
|
|
1002
|
-
* Handles errors
|
|
1003
|
-
*
|
|
1004
|
-
* @param {any} err - The error object returned from the API.
|
|
1490
|
+
* Handles errors if the request fails.
|
|
1491
|
+
* @param err - The error object returned by the server.
|
|
1005
1492
|
*/
|
|
1006
1493
|
error: (err) => {
|
|
1007
|
-
|
|
1494
|
+
console.error(ERRORS.ERROR_DOCUMENT_TYPES, err);
|
|
1495
|
+
}
|
|
1496
|
+
});
|
|
1497
|
+
this.subscription.add(folderSubscription);
|
|
1498
|
+
}
|
|
1499
|
+
/**
|
|
1500
|
+
* Fetches the document data from the API.
|
|
1501
|
+
* @param folderBlockId - The folder ID to fetch the document.
|
|
1502
|
+
* @returns {void}
|
|
1503
|
+
*/
|
|
1504
|
+
fetchDocuments(folderBlockId) {
|
|
1505
|
+
const documentSubscription = this.documentHttpService.getDocumentByFolderID(folderBlockId).subscribe({
|
|
1506
|
+
/**
|
|
1507
|
+
* Handles the successful API response.
|
|
1508
|
+
* @param documentList - The list of documents returned by the API.
|
|
1509
|
+
*/
|
|
1510
|
+
next: (documentList) => {
|
|
1511
|
+
if (documentList) {
|
|
1512
|
+
this.documentList = documentList;
|
|
1513
|
+
}
|
|
1514
|
+
else {
|
|
1515
|
+
console.error(ERRORS.ERROR_FETCHING_DOCUMENTS, documentList);
|
|
1516
|
+
}
|
|
1517
|
+
},
|
|
1518
|
+
/**
|
|
1519
|
+
* Handles errors if the request fails.
|
|
1520
|
+
* @param err - The error object returned by the server.
|
|
1521
|
+
*/
|
|
1522
|
+
error: (err) => {
|
|
1523
|
+
console.error(ERRORS.ERROR_FETCHING_DOCUMENTS, err);
|
|
1008
1524
|
}
|
|
1009
1525
|
});
|
|
1010
1526
|
this.subscription.add(documentSubscription);
|
|
@@ -1015,13 +1531,13 @@ class DocumentContainerComponent {
|
|
|
1015
1531
|
ngOnDestroy() {
|
|
1016
1532
|
this.subscription.unsubscribe();
|
|
1017
1533
|
}
|
|
1018
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentContainerComponent, deps: [{ token: DocumentService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1019
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: DocumentContainerComponent, isStandalone: false, selector: "lib-document-container", inputs: { contextId: "contextId" }, ngImport: i0, template: "<div class=\"grid m-0\">\r\n <div class=\"col-12 md:col-12 lg:col-12
|
|
1534
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentContainerComponent, deps: [{ token: DocumentService }, { token: DocumentQuery }, { token: DocumentHttpService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1535
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: DocumentContainerComponent, isStandalone: false, selector: "lib-document-container", inputs: { contextId: "contextId" }, ngImport: i0, template: "<div class=\"grid m-0\">\r\n <div class=\"col-12 md:col-12 lg:col-12 py-0 pl-0\" >\r\n <lib-folder-container [documentList]=\"documentList\" [folderList]=\"folderList\" [contextId]=\"contextId\"></lib-folder-container>\r\n <lib-document-list [documentList]=\"documentList\" [contextId]=\"contextId\"></lib-document-list>\r\n </div>\r\n</div>", styles: [""], dependencies: [{ kind: "component", type: FolderContainerComponent, selector: "lib-folder-container", inputs: ["documentList", "folderList", "contextId"] }, { kind: "component", type: DocumentListComponent, selector: "lib-document-list", inputs: ["contextId", "documentList"] }] });
|
|
1020
1536
|
}
|
|
1021
1537
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentContainerComponent, decorators: [{
|
|
1022
1538
|
type: Component,
|
|
1023
|
-
args: [{ selector: 'lib-document-container', standalone: false, template: "<div class=\"grid m-0\">\r\n <div class=\"col-12 md:col-12 lg:col-12
|
|
1024
|
-
}], ctorParameters: () => [{ type: DocumentService }], propDecorators: { contextId: [{
|
|
1539
|
+
args: [{ selector: 'lib-document-container', standalone: false, template: "<div class=\"grid m-0\">\r\n <div class=\"col-12 md:col-12 lg:col-12 py-0 pl-0\" >\r\n <lib-folder-container [documentList]=\"documentList\" [folderList]=\"folderList\" [contextId]=\"contextId\"></lib-folder-container>\r\n <lib-document-list [documentList]=\"documentList\" [contextId]=\"contextId\"></lib-document-list>\r\n </div>\r\n</div>" }]
|
|
1540
|
+
}], ctorParameters: () => [{ type: DocumentService }, { type: DocumentQuery }, { type: DocumentHttpService }], propDecorators: { contextId: [{
|
|
1025
1541
|
type: Input
|
|
1026
1542
|
}] } });
|
|
1027
1543
|
|
|
@@ -1160,7 +1676,15 @@ class DocumentModule {
|
|
|
1160
1676
|
/**
|
|
1161
1677
|
* PrimeNG DialogModule is used for showing dialog.
|
|
1162
1678
|
*/
|
|
1163
|
-
DialogModule
|
|
1679
|
+
DialogModule,
|
|
1680
|
+
/**
|
|
1681
|
+
* PrimeNG DropdownModule is used for creating dropdown menus, allowing users to select options from a list.
|
|
1682
|
+
*/
|
|
1683
|
+
DropdownModule,
|
|
1684
|
+
/**
|
|
1685
|
+
* PrimeNG InputTextModule is used for creating InputTextFeilds, allowing users to enter name for a document.
|
|
1686
|
+
*/
|
|
1687
|
+
InputTextModule], exports: [
|
|
1164
1688
|
/**
|
|
1165
1689
|
* Exports the `DocumentContainerComponent` to be used in other modules.
|
|
1166
1690
|
*/
|
|
@@ -1189,6 +1713,10 @@ class DocumentModule {
|
|
|
1189
1713
|
provide: APP_INITIALIZER,
|
|
1190
1714
|
/**
|
|
1191
1715
|
* This useFactory is executed when the app initializes.
|
|
1716
|
+
* It calls the AppConfigService to load the configuration.
|
|
1717
|
+
* If an error occurs, it throws an error.
|
|
1718
|
+
* @param {AppConfigService} configService - The service responsible for loading the application configuration.
|
|
1719
|
+
* @returns {Function} - A function that loads the configuration from the AppConfigService.
|
|
1192
1720
|
*/
|
|
1193
1721
|
useFactory: (configService) => () => configService.loadAppConfig().catch((error) => {
|
|
1194
1722
|
throw new Error(error);
|
|
@@ -1256,7 +1784,15 @@ class DocumentModule {
|
|
|
1256
1784
|
/**
|
|
1257
1785
|
* PrimeNG DialogModule is used for showing dialog.
|
|
1258
1786
|
*/
|
|
1259
|
-
DialogModule
|
|
1787
|
+
DialogModule,
|
|
1788
|
+
/**
|
|
1789
|
+
* PrimeNG DropdownModule is used for creating dropdown menus, allowing users to select options from a list.
|
|
1790
|
+
*/
|
|
1791
|
+
DropdownModule,
|
|
1792
|
+
/**
|
|
1793
|
+
* PrimeNG InputTextModule is used for creating InputTextFeilds, allowing users to enter name for a document.
|
|
1794
|
+
*/
|
|
1795
|
+
InputTextModule] });
|
|
1260
1796
|
}
|
|
1261
1797
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentModule, decorators: [{
|
|
1262
1798
|
type: NgModule,
|
|
@@ -1356,7 +1892,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
1356
1892
|
/**
|
|
1357
1893
|
* PrimeNG DialogModule is used for showing dialog.
|
|
1358
1894
|
*/
|
|
1359
|
-
DialogModule
|
|
1895
|
+
DialogModule,
|
|
1896
|
+
/**
|
|
1897
|
+
* PrimeNG DropdownModule is used for creating dropdown menus, allowing users to select options from a list.
|
|
1898
|
+
*/
|
|
1899
|
+
DropdownModule,
|
|
1900
|
+
/**
|
|
1901
|
+
* PrimeNG InputTextModule is used for creating InputTextFeilds, allowing users to enter name for a document.
|
|
1902
|
+
*/
|
|
1903
|
+
InputTextModule
|
|
1360
1904
|
],
|
|
1361
1905
|
exports: [
|
|
1362
1906
|
/**
|
|
@@ -1388,6 +1932,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
1388
1932
|
provide: APP_INITIALIZER,
|
|
1389
1933
|
/**
|
|
1390
1934
|
* This useFactory is executed when the app initializes.
|
|
1935
|
+
* It calls the AppConfigService to load the configuration.
|
|
1936
|
+
* If an error occurs, it throws an error.
|
|
1937
|
+
* @param {AppConfigService} configService - The service responsible for loading the application configuration.
|
|
1938
|
+
* @returns {Function} - A function that loads the configuration from the AppConfigService.
|
|
1391
1939
|
*/
|
|
1392
1940
|
useFactory: (configService) => () => configService.loadAppConfig().catch((error) => {
|
|
1393
1941
|
throw new Error(error);
|