cat-documents-ng 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -15
- package/Shared/constant/SHARED.d.ts +150 -0
- package/{projects/cat-document-lib/src/Shared/constant/URLS.ts → Shared/constant/URLS.d.ts} +29 -31
- package/Shared/services/app-config.service.d.ts +51 -0
- package/{projects/cat-document-lib/src/Shared/services/global-error.handler.ts → Shared/services/global-error.handler.d.ts} +27 -29
- package/fesm2022/cat-documents-ng.mjs +1411 -0
- package/fesm2022/cat-documents-ng.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/document/components/document-container/document-container.component.d.ts +44 -0
- package/lib/document/components/document-list/document-list.component.d.ts +47 -0
- package/lib/document/components/document-list-item/document-list-item.component.d.ts +28 -0
- package/lib/document/components/document-upload/document-upload.component.d.ts +113 -0
- package/lib/document/components/document-viewer/document-viewer.component.d.ts +113 -0
- package/{projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.ts → lib/document/components/folder-block/folder-block.component.d.ts} +37 -51
- package/lib/document/components/folder-container/folder-container.component.d.ts +28 -0
- package/lib/document/document.module.d.ts +35 -0
- package/lib/document/models/document.model.d.ts +33 -0
- package/{projects/cat-document-lib/src/lib/document/models/folder.model.ts → lib/document/models/folder.model.d.ts} +29 -35
- package/lib/document/services/file-format.service.d.ts +23 -0
- package/{projects/cat-document-lib/src/lib/document/state/document.service.ts → lib/document/state/document.service.d.ts} +64 -95
- package/{projects/cat-document-lib/src/lib/document/state/document.state.ts → lib/document/state/document.state.d.ts} +30 -39
- package/lib/document/state/document.store.d.ts +20 -0
- package/package.json +25 -66
- package/{projects/cat-document-lib/src/public-api.ts → public-api.d.ts} +3 -8
- package/src/assets/config/api.config.json +4 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -32
- package/.github/workflows/pr-validation.yml +0 -87
- package/.husky/pre-commit +0 -4
- package/angular.json +0 -119
- package/eslint.config.cjs +0 -148
- package/projects/cat-document-lib/README.md +0 -63
- package/projects/cat-document-lib/jest.config.mjs +0 -18
- package/projects/cat-document-lib/ng-package.json +0 -11
- package/projects/cat-document-lib/package-lock.json +0 -599
- package/projects/cat-document-lib/package.json +0 -19
- package/projects/cat-document-lib/setup-jest.ts +0 -10
- package/projects/cat-document-lib/src/Shared/constant/SHARED.ts +0 -232
- package/projects/cat-document-lib/src/Shared/services/app-config.service.spec.ts +0 -16
- package/projects/cat-document-lib/src/Shared/services/app-config.service.ts +0 -73
- package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.html +0 -6
- package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.scss +0 -0
- package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.spec.ts +0 -0
- package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.ts +0 -82
- package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.html +0 -35
- package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.scss +0 -12
- package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.spec.ts +0 -0
- package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.ts +0 -73
- package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.html +0 -33
- package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.scss +0 -22
- package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.spec.ts +0 -23
- package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.ts +0 -40
- package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.html +0 -56
- package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.scss +0 -26
- package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.spec.ts +0 -24
- package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.ts +0 -184
- package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.html +0 -244
- package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.scss +0 -36
- package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.spec.ts +0 -21
- package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.ts +0 -125
- package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.html +0 -46
- package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.scss +0 -0
- package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.spec.ts +0 -0
- package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.html +0 -2
- package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.scss +0 -0
- package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.spec.ts +0 -0
- package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.ts +0 -29
- package/projects/cat-document-lib/src/lib/document/document.module.ts +0 -191
- package/projects/cat-document-lib/src/lib/document/models/document.model.ts +0 -39
- package/projects/cat-document-lib/src/lib/document/services/file-format.service.spec.ts +0 -16
- package/projects/cat-document-lib/src/lib/document/services/file-format.service.ts +0 -41
- package/projects/cat-document-lib/src/lib/document/state/document.query.ts +0 -23
- package/projects/cat-document-lib/src/lib/document/state/document.store.ts +0 -23
- package/projects/cat-document-lib/tsconfig.lib.json +0 -15
- package/projects/cat-document-lib/tsconfig.lib.prod.json +0 -11
- package/projects/cat-document-lib/tsconfig.spec.json +0 -15
- package/public/favicon.ico +0 -0
- package/src/app/app.component.html +0 -1
- package/src/app/app.component.scss +0 -0
- package/src/app/app.component.spec.ts +0 -29
- package/src/app/app.component.ts +0 -15
- package/src/app/app.module.ts +0 -60
- package/src/app/app.routing.module.ts +0 -19
- package/src/index.html +0 -13
- package/src/main.ts +0 -5
- package/src/styles.scss +0 -39
- package/tsconfig.app.json +0 -15
- package/tsconfig.json +0 -32
- /package/{projects/cat-document-lib/src → src}/assets/images/FolderImg.png +0 -0
- /package/{projects/cat-document-lib/src → src}/assets/images/Frame.png +0 -0
- /package/{projects/cat-document-lib/src → src}/assets/images/document.png +0 -0
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
<div class="grid">
|
|
2
|
-
<div class="col-12 md:col-12">
|
|
3
|
-
<p-fileUpload #fileUploader [multiple]="true" auto="true" accept="image/png,application/pdf" maxFileSize="1000000"
|
|
4
|
-
(onSelect)="onSelectedFiles($event)">
|
|
5
|
-
<ng-template pTemplate="header" let-chooseCallback="chooseCallback" let-clearCallback="clearCallback">
|
|
6
|
-
<div class="p-2 flex flex-wrap justify-content-between align-items-center flex-1 gap-2">
|
|
7
|
-
<div class="flex gap-2">
|
|
8
|
-
<p-button (onClick)="choose($event, chooseCallback)" icon="pi pi-images" [rounded]="true"
|
|
9
|
-
[outlined]="true" />
|
|
10
|
-
</div>
|
|
11
|
-
</div>
|
|
12
|
-
</ng-template>
|
|
13
|
-
<ng-template pTemplate="content" let-removeFileCallback="removeFileCallback"
|
|
14
|
-
let-removeUploadedFileCallback="removeUploadedFileCallback">
|
|
15
|
-
<div class="col-12 md:col-12 p-0">
|
|
16
|
-
<div class="col-12 md:col-12 p-0" *ngIf="uploadedFiles.length > 0">
|
|
17
|
-
<div *ngFor="let file of uploadedFiles; let i = index"
|
|
18
|
-
class="m-0 flex flex-column align-items-center gap-1 mt-3">
|
|
19
|
-
<div class="col-12 md:col-12 p-0 flex documentInfo">
|
|
20
|
-
<div class="documentImage">
|
|
21
|
-
<img src="../../../../assets/images/document.png" [alt]="file.name" width="45"
|
|
22
|
-
height="50" class="object-contain" />
|
|
23
|
-
</div>
|
|
24
|
-
<div class="flex w-full flex-column mt-2 ml-2">
|
|
25
|
-
<div class="flex justify-content-between">
|
|
26
|
-
<div style=" font-weight: bold;font-size: 14px">
|
|
27
|
-
{{ file.fileName }}
|
|
28
|
-
</div>
|
|
29
|
-
<i class="pi pi-times cursor-pointer" (click)="handleDocumentRemove(file,i)"></i>
|
|
30
|
-
</div>
|
|
31
|
-
<div class="flex justify-content-between mt-1">
|
|
32
|
-
<div style="color: #676B89; font-size: 12px;"></div>
|
|
33
|
-
<div class="white-space-nowrap" style="color: #0F8BFD; font-family: 14px;">{{ getProgress(file) }} %
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
<div class="col-12 md:col-12 p-0">
|
|
39
|
-
<p-progressBar [value]="totalSizePercent" [showValue]="false" styleClass="h-1/2rem md:ml-auto relative"
|
|
40
|
-
[ngClass]="{ 'exceeded-progress-bar': totalSizePercent > 100 }">
|
|
41
|
-
</p-progressBar>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
</ng-template>
|
|
47
|
-
<ng-template pTemplate="empty" let-chooseCallback="chooseCallback" >
|
|
48
|
-
<div *ngIf="!uploadedFiles.length" class="flex align-items-center justify-content-center flex-column" (click)="triggerFileUpload()">
|
|
49
|
-
<i class="pi pi-cloud-upload border-2 border-circle p-5 text-8xl text-400 border-400"></i>
|
|
50
|
-
<p class="mt-4 mb-0">Drag and drop files here to upload.</p>
|
|
51
|
-
</div>
|
|
52
|
-
</ng-template>
|
|
53
|
-
<ng-template pTemplate="file"> </ng-template>
|
|
54
|
-
</p-fileUpload>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
.flex {
|
|
2
|
-
display: flex;
|
|
3
|
-
}
|
|
4
|
-
.items-center {
|
|
5
|
-
align-items: center;
|
|
6
|
-
}
|
|
7
|
-
.justify-center {
|
|
8
|
-
justify-content: center;
|
|
9
|
-
}
|
|
10
|
-
.flex-col {
|
|
11
|
-
flex-direction: column;
|
|
12
|
-
}
|
|
13
|
-
.text-muted-color {
|
|
14
|
-
color: #6c757d; // Adjust to match your theme
|
|
15
|
-
}
|
|
16
|
-
.p-fileupload-buttonbar {
|
|
17
|
-
padding: 0px;
|
|
18
|
-
}
|
|
19
|
-
.p-fileupload-content {
|
|
20
|
-
background-color: #0f8bfd1a;
|
|
21
|
-
}
|
|
22
|
-
.p-fileupload {
|
|
23
|
-
.p-fileupload-content {
|
|
24
|
-
padding: 1rem 1rem;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { DocumentUploadComponent } from './document-upload.component';
|
|
4
|
-
|
|
5
|
-
describe('DocumentUploadComponent', () => {
|
|
6
|
-
let component: DocumentUploadComponent;
|
|
7
|
-
let fixture: ComponentFixture<DocumentUploadComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
imports: [DocumentUploadComponent]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
|
|
15
|
-
fixture = TestBed.createComponent(DocumentUploadComponent);
|
|
16
|
-
component = fixture.componentInstance;
|
|
17
|
-
fixture.detectChanges();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('should create', () => {
|
|
21
|
-
expect(component).toBeTruthy();
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
});
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectorRef, Component, EventEmitter, Input, input, Output, ViewChild, ViewEncapsulation } from '@angular/core';
|
|
2
|
-
import { FileUpload } from 'primeng/fileupload';
|
|
3
|
-
import { MessageService } from 'primeng/api';
|
|
4
|
-
import { PrimeNGConfig } from 'primeng/api';
|
|
5
|
-
import { SHARED } from '../../../../Shared/constant/SHARED';
|
|
6
|
-
import { FileFormatService } from '../../services/file-format.service';
|
|
7
|
-
import { DocumentService } from '../../state/document.service';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* A component for handling document uploads, including file selection, removal, and progress tracking.
|
|
11
|
-
* @class DocumentUploadComponent
|
|
12
|
-
*/
|
|
13
|
-
@Component({
|
|
14
|
-
selector: 'lib-document-upload',
|
|
15
|
-
templateUrl: './document-upload.component.html',
|
|
16
|
-
styleUrls: ['./document-upload.component.scss'],
|
|
17
|
-
standalone: false,
|
|
18
|
-
encapsulation: ViewEncapsulation.None
|
|
19
|
-
})
|
|
20
|
-
export class DocumentUploadComponent {
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Represent contextId
|
|
24
|
-
* @type {string}
|
|
25
|
-
*/
|
|
26
|
-
@Input() contextId: string = SHARED.EMPTY
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Provide id of file after upload.
|
|
30
|
-
* @type {*}
|
|
31
|
-
*/
|
|
32
|
-
@Output() onInput = new EventEmitter();
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* To make file explorer visible.
|
|
36
|
-
* @type {!FileUpload}
|
|
37
|
-
*/
|
|
38
|
-
@ViewChild('fileUploader') fileUploader!: FileUpload;
|
|
39
|
-
|
|
40
|
-
fileProgress: Map<File, number> = new Map();
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* List of files selected for upload.
|
|
44
|
-
* @type {File[]}
|
|
45
|
-
*/
|
|
46
|
-
uploadedFiles: any[] = [];
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Percentage of the total size calculated for displaying upload progress.
|
|
50
|
-
* @type {number}
|
|
51
|
-
*/
|
|
52
|
-
totalSizePercent: number = SHARED.INITIAL_COUNT;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* The current upload progress percentage (SHARED.INITIAL_VALUE-100).
|
|
56
|
-
* @type {number}
|
|
57
|
-
*/
|
|
58
|
-
uploadProgress: number = SHARED.INITIAL_COUNT;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Creates an instance of DocumentUploadComponent.
|
|
63
|
-
* @class
|
|
64
|
-
* @param {DocumentService} uploadService - Service for handling document upload.
|
|
65
|
-
* @param {PrimeNGConfig} config - PrimeNG configuration.
|
|
66
|
-
* @param {FileFormatService} fileFormatService - Service for formatting file sizes.
|
|
67
|
-
* @param {MessageService} messageService - Service for displaying messages.
|
|
68
|
-
* @param {ChangeDetectorRef} cdr - Service for detecting changes.
|
|
69
|
-
*/
|
|
70
|
-
constructor(public uploadService: DocumentService, private config: PrimeNGConfig, public fileFormatService: FileFormatService, public messageService: MessageService, public cdr: ChangeDetectorRef) { }
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Open the file explorer.
|
|
74
|
-
* @param {*} event - The triggering event.
|
|
75
|
-
* @param {() => void} callback - A callback function to execute.
|
|
76
|
-
* @returns {void} - No return value.
|
|
77
|
-
*/
|
|
78
|
-
choose(event: any, callback: () => void) {
|
|
79
|
-
callback();
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Prepares the files for upload by creating a FormData object.
|
|
86
|
-
* This method appends each file to the FormData for submission.
|
|
87
|
-
* @param {File} file - The file to upload.
|
|
88
|
-
* @returns {void}
|
|
89
|
-
*/
|
|
90
|
-
handleTemplatedUpload(file: File) {
|
|
91
|
-
let formData = this.handleCreateFormData(file)
|
|
92
|
-
this.uploadService.create(formData)
|
|
93
|
-
.subscribe({
|
|
94
|
-
/**
|
|
95
|
-
* Handles the successful upload event.
|
|
96
|
-
* Updates the list of uploaded files and emits the file ID.
|
|
97
|
-
* @param {any} event - The event emitted by the upload service on success.
|
|
98
|
-
*/
|
|
99
|
-
next: (event) => {
|
|
100
|
-
this.uploadedFiles.push(event);
|
|
101
|
-
this.fileProgress.set(event, 100);
|
|
102
|
-
this.onInput.emit(event._id)
|
|
103
|
-
this.totalSizePercent = 100;
|
|
104
|
-
},
|
|
105
|
-
/**
|
|
106
|
-
* Handles the error event during file upload.
|
|
107
|
-
* Updates the progress of the file to indicate failure.
|
|
108
|
-
* @param {any} error - The error object returned by the upload service.
|
|
109
|
-
*/
|
|
110
|
-
error: (error) => {
|
|
111
|
-
this.fileProgress.set(file, SHARED.INITIAL_COUNT);
|
|
112
|
-
this.messageService.add({
|
|
113
|
-
severity: SHARED.SEVERITY,
|
|
114
|
-
summary: SHARED.UPLOAD_SUMMERY,
|
|
115
|
-
detail: error?.message,
|
|
116
|
-
});
|
|
117
|
-
},
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Handle the creation of formdata.
|
|
124
|
-
* @param {File} file - The file to append in formdata.
|
|
125
|
-
* @returns {*}
|
|
126
|
-
*/
|
|
127
|
-
handleCreateFormData(file: File) {
|
|
128
|
-
const formData = new FormData();
|
|
129
|
-
formData.append(SHARED.FILE, file, file.name);
|
|
130
|
-
formData.append(SHARED.CONTEXT_ID, this.contextId)
|
|
131
|
-
return formData;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Handles the event when new files are selected.
|
|
135
|
-
* @param { { currentFiles: File[] } } event - The event containing the newly selected files.
|
|
136
|
-
* @returns {void}
|
|
137
|
-
*/
|
|
138
|
-
onSelectedFiles(event: { currentFiles: File[] }): void {
|
|
139
|
-
event.currentFiles.forEach((file: File) => {
|
|
140
|
-
this.handleTemplatedUpload(file);
|
|
141
|
-
});
|
|
142
|
-
this.fileUploader.clear();
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Formats the given file size in bytes into a readable format (e.g., KB, MB).
|
|
147
|
-
* @param {number} bytes - The size of the file in bytes.
|
|
148
|
-
* @returns {string} The formatted file size (e.g., '1.2 KB', '2.3 MB').
|
|
149
|
-
*/
|
|
150
|
-
formatSize(bytes: number): string {
|
|
151
|
-
return this.fileFormatService.formatFileSize(bytes, this.config)
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Handles the removal of a file from the uploaded files list.
|
|
156
|
-
* @param {File} file - The file to be removed.
|
|
157
|
-
* @param {number} index - The index of the file in the uploaded files list.
|
|
158
|
-
*/
|
|
159
|
-
handleDocumentRemove(file: File, index: number): void {
|
|
160
|
-
this.uploadedFiles.splice(index, 1);
|
|
161
|
-
this.fileProgress.delete(file);
|
|
162
|
-
this.cdr.detectChanges();
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Major progress for the progress bar.
|
|
167
|
-
* @param {File} file - File to check progress for.
|
|
168
|
-
* @returns {number} - The progress percentage for the file.
|
|
169
|
-
*/
|
|
170
|
-
getProgress(file: File): number {
|
|
171
|
-
return this.fileProgress.get(file) || SHARED.INITIAL_COUNT;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Triggers the file upload dialog.
|
|
176
|
-
* Opens the file explorer for selecting files.
|
|
177
|
-
* @returns {void}
|
|
178
|
-
*/
|
|
179
|
-
triggerFileUpload() {
|
|
180
|
-
this.fileUploader.choose();
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
<div class="grid">
|
|
2
|
-
<div class="col-12">
|
|
3
|
-
<div class="p-fluid p-formgrid grid m-0">
|
|
4
|
-
<div class="col-12 md:col-12 md:flex justify-content-between">
|
|
5
|
-
<div class="action col-12 p-0 md:col-2 no-grow-no-shrink">
|
|
6
|
-
<p-listbox
|
|
7
|
-
[options]="countries"
|
|
8
|
-
[filter]="true"
|
|
9
|
-
[(ngModel)]="selectedCountry"
|
|
10
|
-
optionLabel="name"
|
|
11
|
-
[style]="{ width: '15rem' }"
|
|
12
|
-
[listStyle]="{ 'max-height': '250px' }"
|
|
13
|
-
>
|
|
14
|
-
<ng-template let-country pTemplate="item">
|
|
15
|
-
<div class="flex align-items-center gap-2">
|
|
16
|
-
<p-checkbox
|
|
17
|
-
[(ngModel)]="country.checked"
|
|
18
|
-
[binary]="true"
|
|
19
|
-
[inputId]="country.code"
|
|
20
|
-
></p-checkbox>
|
|
21
|
-
<div>{{ country.name }}</div>
|
|
22
|
-
</div>
|
|
23
|
-
</ng-template>
|
|
24
|
-
</p-listbox>
|
|
25
|
-
</div>
|
|
26
|
-
@if(selectedDocument){
|
|
27
|
-
|
|
28
|
-
<div id="outerContainer col-12 md:col-7">
|
|
29
|
-
<div
|
|
30
|
-
*ngIf="isImage(selectedDocument.contentType)"
|
|
31
|
-
class="img-container"
|
|
32
|
-
>
|
|
33
|
-
<img
|
|
34
|
-
[src]="selectedDocument.documentUrl"
|
|
35
|
-
width="500"
|
|
36
|
-
height="500"
|
|
37
|
-
alt="Document Image"
|
|
38
|
-
/>
|
|
39
|
-
</div>
|
|
40
|
-
@if(selectedDocument.contentType == "application/pdf"){
|
|
41
|
-
<div class="pdf-container">
|
|
42
|
-
<pdf-viewer
|
|
43
|
-
[src]="selectedDocument.documentUrl"
|
|
44
|
-
[rotation]="0"
|
|
45
|
-
[original-size]="false"
|
|
46
|
-
[show-all]="true"
|
|
47
|
-
[fit-to-page]="false"
|
|
48
|
-
[zoom]="1"
|
|
49
|
-
[zoom-scale]="'page-width'"
|
|
50
|
-
[stick-to-page]="false"
|
|
51
|
-
[render-text]="true"
|
|
52
|
-
[external-link-target]="'blank'"
|
|
53
|
-
[autoresize]="true"
|
|
54
|
-
[show-borders]="false"
|
|
55
|
-
style="width: 55vw; height: 100vh"
|
|
56
|
-
></pdf-viewer>
|
|
57
|
-
</div>
|
|
58
|
-
}
|
|
59
|
-
</div>
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
<div class="left-part col-12 md:col-3 pt-0">
|
|
63
|
-
<div class="alerts mb-4 pb-1">
|
|
64
|
-
<button
|
|
65
|
-
type="button"
|
|
66
|
-
*ngIf="
|
|
67
|
-
(alertData?.status !== 'Pending' && !!alertData?.status) ||
|
|
68
|
-
alertData?.isAlert === false
|
|
69
|
-
"
|
|
70
|
-
class="bg-green-500 border-none border-round-md flex align-items-center mb-3 p-2 px-3"
|
|
71
|
-
>
|
|
72
|
-
<i
|
|
73
|
-
class="pi pi-verified mr-2 cursor-pointer"
|
|
74
|
-
[ngStyle]="{
|
|
75
|
-
color:
|
|
76
|
-
alertData?.status === 'Pending' &&
|
|
77
|
-
alertData?.isAlert !== false
|
|
78
|
-
? '#FFFFFF'
|
|
79
|
-
: '#8A8EA6'
|
|
80
|
-
}"
|
|
81
|
-
style="font-size: 20px"
|
|
82
|
-
></i>
|
|
83
|
-
<span class="font-semibold text-white">Verified</span>
|
|
84
|
-
</button>
|
|
85
|
-
<div
|
|
86
|
-
class="card mb-0"
|
|
87
|
-
[ngClass]="
|
|
88
|
-
(alertData?.status === 'Pending' || !alertData?.status) &&
|
|
89
|
-
alertData?.isAlert !== false
|
|
90
|
-
? 'alert-card'
|
|
91
|
-
: 'success-alert'
|
|
92
|
-
"
|
|
93
|
-
>
|
|
94
|
-
<div class="flex align-items-center mb-2 pb-1" >
|
|
95
|
-
<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>
|
|
96
|
-
<i
|
|
97
|
-
class="pi pi-exclamation-triangle"
|
|
98
|
-
style="font-size: 20px"
|
|
99
|
-
[ngStyle]="{
|
|
100
|
-
color:
|
|
101
|
-
(alertData?.status === 'Pending' || !alertData?.status) &&
|
|
102
|
-
alertData?.isAlert !== false
|
|
103
|
-
? '#FB392D'
|
|
104
|
-
: '#8A8EA6'
|
|
105
|
-
}"
|
|
106
|
-
></i>
|
|
107
|
-
</div>
|
|
108
|
-
<p class="text-color mb-0">{{ alertData?.alertMessage }}</p>
|
|
109
|
-
</div>
|
|
110
|
-
</div>
|
|
111
|
-
<div class="summery mb-4 pb-1">
|
|
112
|
-
<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;">
|
|
113
|
-
<div class="p-0" >
|
|
114
|
-
<h4 class="m-0 pt-3 pl-3 mb-3" style="font-size: 21px; font-weight: bold; ">Summary</h4>
|
|
115
|
-
</div>
|
|
116
|
-
</div>
|
|
117
|
-
<div class="card mb-0" style="border-top-right-radius: 0px;border-top-left-radius: 0px;" >
|
|
118
|
-
<p-timeline [value]="events">
|
|
119
|
-
<ng-template pTemplate="content" let-event>
|
|
120
|
-
{{ event.status }}
|
|
121
|
-
</ng-template>
|
|
122
|
-
</p-timeline>
|
|
123
|
-
</div>
|
|
124
|
-
</div>
|
|
125
|
-
<div *ngIf="propertyDetails" class="property-details mb-4 pb-1">
|
|
126
|
-
<div class="card mb-0">
|
|
127
|
-
<h4 class="bold" style="font-size: 21px; font-weight: bold;">Property Details</h4>
|
|
128
|
-
<hr />
|
|
129
|
-
<div class="grid">
|
|
130
|
-
<div class="col-12 md:col-12">
|
|
131
|
-
<div class="feild flex">
|
|
132
|
-
<div class="col-12 flex md:col-7">
|
|
133
|
-
<div class="img mr-2">
|
|
134
|
-
<img
|
|
135
|
-
src="../../../../assets/icons/building-icon.png"
|
|
136
|
-
alt=""
|
|
137
|
-
/>
|
|
138
|
-
</div>
|
|
139
|
-
<div class="title">
|
|
140
|
-
<div class="title font-bold" style="font-size: 21px; font-weight: bold;">Detached House</div>
|
|
141
|
-
<div class="decription">
|
|
142
|
-
{{ propertyDetails?.PropertyType }}
|
|
143
|
-
</div>
|
|
144
|
-
</div>
|
|
145
|
-
</div>
|
|
146
|
-
<div class="col-12 flex md:col-5">
|
|
147
|
-
<div class="img mr-2">
|
|
148
|
-
<img
|
|
149
|
-
src="../../../../assets/icons/building-icon.png"
|
|
150
|
-
alt=""
|
|
151
|
-
/>
|
|
152
|
-
</div>
|
|
153
|
-
<div class="title">
|
|
154
|
-
<div class="title font-bold">
|
|
155
|
-
{{ propertyDetails?.Floors }}
|
|
156
|
-
</div>
|
|
157
|
-
<div class="decription" style="font-size: 21px; font-weight: bold;">Floors</div>
|
|
158
|
-
</div>
|
|
159
|
-
</div>
|
|
160
|
-
</div>
|
|
161
|
-
<div class="feild flex">
|
|
162
|
-
<div class="col-12 flex md:col-7">
|
|
163
|
-
<div class="img mr-2">
|
|
164
|
-
<img
|
|
165
|
-
src="../../../../assets/icons/badroom.png"
|
|
166
|
-
alt=""
|
|
167
|
-
/>
|
|
168
|
-
</div>
|
|
169
|
-
<div class="title">
|
|
170
|
-
<div class="title font-bold">
|
|
171
|
-
{{ propertyDetails?.Bedrooms }}
|
|
172
|
-
</div>
|
|
173
|
-
<div class="decription" style="font-size: 21px; font-weight: bold;">Bedrooms</div>
|
|
174
|
-
</div>
|
|
175
|
-
</div>
|
|
176
|
-
<div class="col-12 flex md:col-5">
|
|
177
|
-
<div class="img mr-2">
|
|
178
|
-
<img
|
|
179
|
-
src="../../../../assets/icons/building-icon.png"
|
|
180
|
-
alt=""
|
|
181
|
-
/>
|
|
182
|
-
</div>
|
|
183
|
-
<div class="title">
|
|
184
|
-
<div class="title font-bold">
|
|
185
|
-
{{ propertyDetails?.Kitchen }}
|
|
186
|
-
</div>
|
|
187
|
-
<div class="decription" style="font-size: 21px; font-weight: bold;">Kitchen</div>
|
|
188
|
-
</div>
|
|
189
|
-
</div>
|
|
190
|
-
</div>
|
|
191
|
-
</div>
|
|
192
|
-
<div class="col-12 flex ml-2 md:col-12">
|
|
193
|
-
<div class="img mr-2">
|
|
194
|
-
<img src="../../../../assets/icons/location.png" alt="" />
|
|
195
|
-
</div>
|
|
196
|
-
<div class="title">
|
|
197
|
-
<div class="title font-bold">
|
|
198
|
-
{{ propertyDetails?.Address }}
|
|
199
|
-
</div>
|
|
200
|
-
<div class="decription" style="font-size: 21px; font-weight: bold;">Address</div>
|
|
201
|
-
</div>
|
|
202
|
-
</div>
|
|
203
|
-
</div>
|
|
204
|
-
</div>
|
|
205
|
-
</div>
|
|
206
|
-
<div class="notes card pl-0 pr-0 pt-0">
|
|
207
|
-
<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;">
|
|
208
|
-
<div class="p-0" >
|
|
209
|
-
<h4 class="m-0 pt-3 pl-3 mb-3" style="font-size: 21px; font-weight: bold; ">Notes</h4>
|
|
210
|
-
</div>
|
|
211
|
-
</div>
|
|
212
|
-
<div class="card mb-0 pt-0">
|
|
213
|
-
<div class="textAreaControl mt-3">
|
|
214
|
-
<textarea
|
|
215
|
-
rows="5"
|
|
216
|
-
cols="30"
|
|
217
|
-
pInputTextarea
|
|
218
|
-
#textArea
|
|
219
|
-
[(ngModel)]="notes"
|
|
220
|
-
>
|
|
221
|
-
</textarea>
|
|
222
|
-
</div>
|
|
223
|
-
<div class="buttons document-btn-wrapper flex mt-2">
|
|
224
|
-
<button
|
|
225
|
-
pButton
|
|
226
|
-
pRipple
|
|
227
|
-
type="button"
|
|
228
|
-
label="Resubmission"
|
|
229
|
-
class="p-button-outlined mr-2"
|
|
230
|
-
></button>
|
|
231
|
-
<button
|
|
232
|
-
pButton
|
|
233
|
-
pRipple
|
|
234
|
-
type="button"
|
|
235
|
-
label="Accept"
|
|
236
|
-
></button>
|
|
237
|
-
</div>
|
|
238
|
-
</div>
|
|
239
|
-
</div>
|
|
240
|
-
</div>
|
|
241
|
-
</div>
|
|
242
|
-
</div>
|
|
243
|
-
</div>
|
|
244
|
-
</div>
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
.alert-card {
|
|
2
|
-
background-color: #fb392d1a;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.success-alert {
|
|
6
|
-
border-radius: 10px;
|
|
7
|
-
border: 1px solid rgba(251, 57, 45, 0.1);
|
|
8
|
-
background: linear-gradient(0deg, #dedede 0%, #dedede 100%), #fff;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.p-timeline-event-opposite {
|
|
12
|
-
display: none;
|
|
13
|
-
}
|
|
14
|
-
.decription {
|
|
15
|
-
color: #676b89;
|
|
16
|
-
}
|
|
17
|
-
.textAreaControl textarea {
|
|
18
|
-
width: 100%;
|
|
19
|
-
resize: vertical;
|
|
20
|
-
max-width: 100%;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.document-btn-wrapper {
|
|
24
|
-
.p-button-outlined {
|
|
25
|
-
color: #f57c00;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.document-viewer{
|
|
30
|
-
.p-dialog-header{
|
|
31
|
-
background-color:#ececf9;
|
|
32
|
-
}
|
|
33
|
-
.p-dialog-content{
|
|
34
|
-
background-color:#ececf9;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
import { DocumentViewerComponent } from './document-viewer.component';
|
|
3
|
-
|
|
4
|
-
describe('DocumentViewerComponent', () => {
|
|
5
|
-
let component: DocumentViewerComponent;
|
|
6
|
-
let fixture: ComponentFixture<DocumentViewerComponent>;
|
|
7
|
-
|
|
8
|
-
beforeEach(async () => {
|
|
9
|
-
await TestBed.configureTestingModule({
|
|
10
|
-
imports: [DocumentViewerComponent],
|
|
11
|
-
}).compileComponents();
|
|
12
|
-
|
|
13
|
-
fixture = TestBed.createComponent(DocumentViewerComponent);
|
|
14
|
-
component = fixture.componentInstance;
|
|
15
|
-
fixture.detectChanges();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should create', () => {
|
|
19
|
-
expect(component).toBeTruthy();
|
|
20
|
-
});
|
|
21
|
-
});
|