cat-documents-ng 0.0.10 → 0.0.12

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.
Files changed (90) hide show
  1. package/README.md +19 -15
  2. package/Shared/constant/SHARED.d.ts +150 -0
  3. package/{projects/cat-document-lib/src/Shared/constant/URLS.ts → Shared/constant/URLS.d.ts} +29 -31
  4. package/Shared/services/app-config.service.d.ts +51 -0
  5. package/{projects/cat-document-lib/src/Shared/services/global-error.handler.ts → Shared/services/global-error.handler.d.ts} +27 -29
  6. package/fesm2022/cat-documents-ng.mjs +1411 -0
  7. package/fesm2022/cat-documents-ng.mjs.map +1 -0
  8. package/index.d.ts +5 -0
  9. package/lib/document/components/document-container/document-container.component.d.ts +44 -0
  10. package/lib/document/components/document-list/document-list.component.d.ts +47 -0
  11. package/lib/document/components/document-list-item/document-list-item.component.d.ts +28 -0
  12. package/lib/document/components/document-upload/document-upload.component.d.ts +113 -0
  13. package/lib/document/components/document-viewer/document-viewer.component.d.ts +113 -0
  14. 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
  15. package/lib/document/components/folder-container/folder-container.component.d.ts +28 -0
  16. package/lib/document/document.module.d.ts +35 -0
  17. package/lib/document/models/document.model.d.ts +33 -0
  18. package/{projects/cat-document-lib/src/lib/document/models/folder.model.ts → lib/document/models/folder.model.d.ts} +29 -35
  19. package/lib/document/services/file-format.service.d.ts +23 -0
  20. package/{projects/cat-document-lib/src/lib/document/state/document.service.ts → lib/document/state/document.service.d.ts} +64 -95
  21. package/{projects/cat-document-lib/src/lib/document/state/document.state.ts → lib/document/state/document.state.d.ts} +30 -39
  22. package/lib/document/state/document.store.d.ts +20 -0
  23. package/package.json +25 -66
  24. package/{projects/cat-document-lib/src/public-api.ts → public-api.d.ts} +3 -8
  25. package/src/assets/config/app.config.json +4 -0
  26. package/.github/PULL_REQUEST_TEMPLATE.md +0 -32
  27. package/.github/workflows/pr-validation.yml +0 -87
  28. package/.husky/pre-commit +0 -4
  29. package/angular.json +0 -119
  30. package/eslint.config.cjs +0 -148
  31. package/projects/cat-document-lib/README.md +0 -63
  32. package/projects/cat-document-lib/jest.config.mjs +0 -18
  33. package/projects/cat-document-lib/ng-package.json +0 -11
  34. package/projects/cat-document-lib/package-lock.json +0 -599
  35. package/projects/cat-document-lib/package.json +0 -19
  36. package/projects/cat-document-lib/setup-jest.ts +0 -10
  37. package/projects/cat-document-lib/src/Shared/constant/SHARED.ts +0 -232
  38. package/projects/cat-document-lib/src/Shared/services/app-config.service.spec.ts +0 -16
  39. package/projects/cat-document-lib/src/Shared/services/app-config.service.ts +0 -73
  40. package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.html +0 -6
  41. package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.scss +0 -0
  42. package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.spec.ts +0 -0
  43. package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.ts +0 -82
  44. package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.html +0 -35
  45. package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.scss +0 -12
  46. package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.spec.ts +0 -0
  47. package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.ts +0 -73
  48. package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.html +0 -33
  49. package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.scss +0 -22
  50. package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.spec.ts +0 -23
  51. package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.ts +0 -40
  52. package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.html +0 -56
  53. package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.scss +0 -26
  54. package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.spec.ts +0 -24
  55. package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.ts +0 -184
  56. package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.html +0 -244
  57. package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.scss +0 -36
  58. package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.spec.ts +0 -21
  59. package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.ts +0 -125
  60. package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.html +0 -46
  61. package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.scss +0 -0
  62. package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.spec.ts +0 -0
  63. package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.html +0 -2
  64. package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.scss +0 -0
  65. package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.spec.ts +0 -0
  66. package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.ts +0 -29
  67. package/projects/cat-document-lib/src/lib/document/document.module.ts +0 -191
  68. package/projects/cat-document-lib/src/lib/document/models/document.model.ts +0 -39
  69. package/projects/cat-document-lib/src/lib/document/services/file-format.service.spec.ts +0 -16
  70. package/projects/cat-document-lib/src/lib/document/services/file-format.service.ts +0 -41
  71. package/projects/cat-document-lib/src/lib/document/state/document.query.ts +0 -23
  72. package/projects/cat-document-lib/src/lib/document/state/document.store.ts +0 -23
  73. package/projects/cat-document-lib/tsconfig.lib.json +0 -15
  74. package/projects/cat-document-lib/tsconfig.lib.prod.json +0 -11
  75. package/projects/cat-document-lib/tsconfig.spec.json +0 -15
  76. package/public/favicon.ico +0 -0
  77. package/src/app/app.component.html +0 -1
  78. package/src/app/app.component.scss +0 -0
  79. package/src/app/app.component.spec.ts +0 -29
  80. package/src/app/app.component.ts +0 -15
  81. package/src/app/app.module.ts +0 -60
  82. package/src/app/app.routing.module.ts +0 -19
  83. package/src/index.html +0 -13
  84. package/src/main.ts +0 -5
  85. package/src/styles.scss +0 -39
  86. package/tsconfig.app.json +0 -15
  87. package/tsconfig.json +0 -32
  88. /package/{projects/cat-document-lib/src → src}/assets/images/FolderImg.png +0 -0
  89. /package/{projects/cat-document-lib/src → src}/assets/images/Frame.png +0 -0
  90. /package/{projects/cat-document-lib/src → src}/assets/images/document.png +0 -0
@@ -1,232 +0,0 @@
1
- /**
2
- * The `SHARED` class contains shared constants used across the application.
3
- * These constants are related to document statuses and other shared data.
4
- */
5
- export class SHARED {
6
- /**
7
- * Represents the count of missing files.
8
- */
9
- static MISSINGCOUNT = 2;
10
-
11
- /**
12
- * Represents the count of pending files.
13
- */
14
- static PENDINGCOUNT = 3;
15
-
16
- /**
17
- * Represents an empty string.
18
- */
19
- static EMPTY = "";
20
-
21
- /**
22
- * Represents an true.
23
- * @static
24
- * @type {boolean}
25
- */
26
- static TRUE: boolean = true;
27
-
28
-
29
- /**
30
- * Represents an false.
31
- * @static
32
- * @type {boolean}
33
- */
34
- static FALSE: boolean = false;
35
-
36
- /**
37
- * Represents an INITIAL_COUNT.
38
- */
39
- static INITIAL_COUNT = 0
40
- /**
41
- * Represents an INITIAL_VALUE.
42
- */
43
- static INITIAL_VALUE = 0
44
-
45
- /**
46
- * Represents the constant value for one (1).
47
- * @static
48
- * @type {number}
49
- */
50
- static ONE: number = 1
51
-
52
- /**
53
- * Represents the constant value for two (2).
54
- * @static
55
- * @type {number}
56
- */
57
- static TWO: number = 2
58
-
59
- /**
60
- * Represents the constant value for ten (10).
61
- * @static
62
- * @type {number}
63
- */
64
- static TEN: number = 10
65
-
66
- /**
67
- * Represents the constant string value 'files' used for file-related operations.
68
- * @static
69
- * @type {string}
70
- */
71
- static FILE: string = 'file';
72
-
73
- /**
74
- * Represents the array of file size units ('B', 'KB', 'MB') used for file size formatting.
75
- * @static
76
- * @type {string[]}
77
- */
78
- static FILE_SIZE_UNITS: string[] = ['B', 'KB', 'MB'];
79
-
80
- /**
81
- * Show SEVERITY value.
82
- * @static
83
- * @type {'error'}
84
- */
85
- static SEVERITY:string = 'error'
86
-
87
- /**
88
- * Show upload summery if it's failed.
89
- * @static
90
- * @type {'Upload Failed'}
91
- */
92
- static UPLOAD_SUMMERY:string = 'Upload Failed'
93
-
94
- /**
95
- * Represent empty array.
96
- * @static
97
- * @type {{}}
98
- */
99
- static EMPTY_ARRAY = []
100
-
101
- /**
102
- * Represent contextId.
103
- * @static
104
- * @type {string}
105
- */
106
- static CONTEXT_ID : string = 'contextId'
107
-
108
- /**
109
- * Represent fileSize.
110
- * @static
111
- * @type {string}
112
- */
113
- static FILE_SIZE : string = 'fileSize'
114
- }
115
-
116
- /**
117
- * `DUMMYDOCUMENTLIST` is a mock list of document objects used for testing and development purposes.
118
- * Each document includes an ID, file name, status, and document URL.
119
- */
120
- export const DUMMYDOCUMENTLIST = [
121
- {
122
- _id: 1,
123
- fileName: 'Document 1',
124
- status: 'pending',
125
- documentUrl: 'https://vadimdez.github.io/ng2-pdf-viewer/assets/pdf-test.pdf',
126
- },
127
- {
128
- _id: 2,
129
- fileName: 'Document 2',
130
- status: 'verified',
131
- documentUrl: 'https://vadimdez.github.io/ng2-pdf-viewer/assets/pdf-test.pdf',
132
- },
133
- {
134
- _id: 3,
135
- fileName: 'Document 3',
136
- status: 'sentReminder',
137
- documentUrl: 'https://vadimdez.github.io/ng2-pdf-viewer/assets/pdf-test.pdf',
138
- },
139
- {
140
- _id: 4,
141
- fileName: 'Document 4',
142
- status: 'pending',
143
- documentUrl: 'https://vadimdez.github.io/ng2-pdf-viewer/assets/pdf-test.pdf',
144
- },
145
- ];
146
-
147
- /**
148
- * `FOLDERPANEL` is a mock list of folder data representing various folders in the application.
149
- * Each folder contains an ID, file count, text description, missing files count, and pending files count.
150
- */
151
- export const FOLDERPANEL = [
152
- {
153
- _id: 'folder1',
154
- fileCount: 10,
155
- text: 'Documents',
156
- missingFiles: 3,
157
- pendingFiles: 2,
158
- },
159
- {
160
- _id: 'folder2',
161
- fileCount: 5,
162
- text: 'Images',
163
- missingFiles: 0,
164
- pendingFiles: 1,
165
- },
166
- {
167
- _id: 'folder3',
168
- fileCount: 20,
169
- text: 'Reports',
170
- missingFiles: 5,
171
- pendingFiles: 0,
172
- },
173
- {
174
- _id: 'folder4',
175
- fileCount: 8,
176
- text: 'Videos',
177
- missingFiles: 0,
178
- pendingFiles: 0,
179
- },
180
- {
181
- _id: 'folder5',
182
- fileCount: 15,
183
- text: 'Archives',
184
- missingFiles: 1,
185
- pendingFiles: 3,
186
- }
187
- ];
188
-
189
- /**
190
- * Dummy data for sumaery.
191
- * @type {{}}
192
- */
193
- export const DUMMYSUMMARY = [
194
- {
195
- status: 'Valuation report requested on 10th Oct 2024',
196
- date: '15/10/2020 10:30',
197
- icon: 'pi pi-shopping-cart',
198
- color: '#9C27B0',
199
- image: 'game-controller.jpg',
200
- },
201
- {
202
- status: 'Valuation report received on 13th Oct 2024',
203
- date: '15/10/2020 14:00',
204
- icon: 'pi pi-cog',
205
- color: '#673AB7',
206
- },
207
- {
208
- status: 'Waiting for Valuation Report to be accepted',
209
- date: '15/10/2020 16:15',
210
- icon: 'pi pi-shopping-cart',
211
- color: '#FF9800',
212
- },
213
- ];
214
-
215
- /**
216
- * Dummy data for list box.
217
- * @type {{}}
218
- */
219
- export const COUNTRIES = [
220
- { name: 'Any Word', code: 'NY', checked: false },
221
- { name: 'Case Sensitive', code: 'RM', checked: false },
222
- { name: 'Wildcard Search', code: 'LDN', checked: false },
223
- { name: 'Whole Word Only', code: 'IST', checked: false },
224
- ];
225
-
226
- /**
227
- * Default supported image types.
228
- * @type {{}}
229
- */
230
- export const SUPPORTED_IMAGE_TYPES = [
231
- 'image/png'
232
- ];
@@ -1,16 +0,0 @@
1
- import { TestBed } from '@angular/core/testing';
2
-
3
- import { AppConfigService } from './app-config.service';
4
-
5
- describe('AppConfigService', () => {
6
- let service: AppConfigService;
7
-
8
- beforeEach(() => {
9
- TestBed.configureTestingModule({});
10
- service = TestBed.inject(AppConfigService);
11
- });
12
-
13
- it('should be created', () => {
14
- expect(service).toBeTruthy();
15
- });
16
- });
@@ -1,73 +0,0 @@
1
- import { HttpClient } from '@angular/common/http';
2
- import { Injectable } from '@angular/core';
3
- import { firstValueFrom } from 'rxjs';
4
- import { URLS } from '../constant/URLS';
5
-
6
- /**
7
- * Service that handles loading and providing configuration settings for the application.
8
- * It fetches configuration data from a remote server and exposes various configuration options.
9
- * @class AppConfigService
10
- * @typedef {AppConfigService}
11
- */
12
- @Injectable({
13
- providedIn: 'root'
14
- })
15
- export class AppConfigService {
16
-
17
- /**
18
- * Holds the configuration data loaded from the server.
19
- * @private
20
- * @type {*}
21
- */
22
- private appConfig: any;
23
-
24
- /**
25
- * Creates an instance of AppConfigService.
26
- * Initializes the HttpClient for making HTTP requests.
27
- * @class
28
- * @param {HttpClient} http - The HttpClient service used for making HTTP requests.
29
- */
30
- constructor(private http: HttpClient) {}
31
-
32
- /**
33
- * Loads the application configuration from the server by making an HTTP request to the configuration URL.
34
- * This method retrieves the configuration data and assigns it to the appConfig property.
35
- * @async
36
- * @returns {*}
37
- */
38
- async loadAppConfig() {
39
- try {
40
- this.appConfig = await firstValueFrom(this.http.get(URLS.CONFIGFILEURL));
41
- } catch (error) {
42
- throw new Error("Api url is missing.")
43
- }
44
- }
45
-
46
-
47
- /**
48
- * Returns the base URL for the API from the loaded configuration.
49
- * @readonly
50
- * @type {*}
51
- */
52
- get apiBaseUrl() {
53
- return this.appConfig?.apiUrl;
54
- }
55
-
56
- /**
57
- * Returns the local server API URL from the loaded configuration.
58
- * @readonly
59
- * @type {*}
60
- */
61
- get localServerApi() {
62
- return this.appConfig?.localServerApi;
63
- }
64
-
65
- /**
66
- * Returns the visibility options from the loaded configuration.
67
- * @readonly
68
- * @type {*}
69
- */
70
- get visibilityOptions() {
71
- return this.appConfig?.visibilityOption;
72
- }
73
- }
@@ -1,6 +0,0 @@
1
- <div class="grid m-0">
2
- <div class="col-12 md:col-12 lg:col-12 overflow-y-scroll py-0 pl-0" >
3
- <lib-folder-container [documentList]="documentList"></lib-folder-container>
4
- <lib-document-list [documentList]="documentList"></lib-document-list>
5
- </div>
6
- </div>
@@ -1,82 +0,0 @@
1
- import { Component, Input, OnInit } from '@angular/core';
2
- import { SHARED } from '../../../../Shared/constant/SHARED';
3
- import { DocumentService } from '../../state/document.service';
4
- import { DocumentModel } from '../../models/document.model';
5
- import { URLS } from '../../../../Shared/constant/URLS';
6
- import { Subscription } from 'rxjs';
7
-
8
-
9
- /**
10
- *This component is responsible for managing and displaying a list of documents.
11
- * @class DocumentContainerComponent
12
- * @typedef {DocumentContainerComponent}
13
- */
14
- @Component({
15
- selector: 'lib-document-container',
16
- standalone: false,
17
- templateUrl: './document-container.component.html',
18
- styleUrl: './document-container.component.scss'
19
- })
20
- export class DocumentContainerComponent implements OnInit{
21
-
22
- /**
23
- * Creates an instance of DocumentContainerComponent.
24
- * @class
25
- * @param {DocumentService} documentService - Service to manage document-related operations.
26
- */
27
- constructor(public documentService : DocumentService){
28
-
29
- }
30
- /**
31
- * Get contextId in input.
32
- * @type {string}
33
- */
34
- @Input() contextId : string = "786755";
35
- /**
36
- * The list of dummy documents.
37
- * @type {Array}
38
- */
39
- documentList : DocumentModel[] = []
40
-
41
- /**
42
- * Holds the subscription to manage observable cleanup.
43
- * @private
44
- * @type {Subscription}
45
- */
46
- private subscription: Subscription = new Subscription();
47
-
48
- /**
49
- * Call document service method to get the document by contextId.
50
- */
51
- ngOnInit(): void {
52
- const documentSubscription = this.documentService
53
- .getById(`${URLS.CONTEXT}${this.contextId}`)
54
- .subscribe({
55
- /**
56
- * Handles the successful API response.
57
- * @param {DocumentModel[]} res - The list of documents returned by the API.
58
- */
59
- next: (res: DocumentModel[]) => {
60
- if (res) {
61
- this.documentList = res;
62
- }
63
- },
64
- /**
65
- * Handles errors that occur during the API call.
66
- * Logs the error to the console.
67
- * @param {any} err - The error object returned from the API.
68
- */
69
- error: (err) => {
70
- throw new Error(err)
71
- }
72
- });
73
- this.subscription.add(documentSubscription);
74
- }
75
-
76
- /**
77
- * Unsubscribe subscription on destroy of component .
78
- */
79
- ngOnDestroy(): void {
80
- this.subscription.unsubscribe();
81
- }
82
- }
@@ -1,35 +0,0 @@
1
- <div class="document-viewer">
2
- <p-dialog [(visible)]="isdialogVisible" [modal]="true" (onHide)="handleCloseModel()" [style]="{ width: '100vw' }"
3
- [draggable]="false" [closable]="true">
4
- <document-viewer [selectedDocument]="selectedDocument"></document-viewer>
5
- </p-dialog>
6
- </div>
7
-
8
- <div class="col-12 p-0">
9
- <div class="card p-0 document-list-wrapper">
10
- <p-accordion>
11
- <p-accordionTab [selected]="true" class="line-height-2 m-0">
12
- <ng-template pTemplate="header" let-active="active">
13
- <div class="flex align-items-center justify-content-between w-full">
14
- <span class="flex align-items-center gap-2">
15
- Documents
16
- </span>
17
- <button pButton pRipple class="p-button-raised" type="button" label="Upload File"
18
- style="border-radius: 10px;" (click)="handleFileUploadClick($event)"></button>
19
- </div>
20
- </ng-template>
21
- @for(document of documentList; track document){
22
- <lib-document-list-item [document]="document"
23
- (documentClick)="handleClickForDocument($event)"></lib-document-list-item>
24
- }
25
- </p-accordionTab>
26
- </p-accordion>
27
- </div>
28
- </div>
29
- <div class="grid">
30
- <div class="col-12">
31
- <p-sidebar [(visible)]="isSidebarVisible" position="right" [styleClass]="'right-sidebar'">
32
- <lib-document-upload [contextId]="contextId"></lib-document-upload>
33
- </p-sidebar>
34
- </div>
35
- </div>
@@ -1,12 +0,0 @@
1
- .document-list-wrapper{
2
- .p-accordion-header-link {
3
- padding: 0.5rem;
4
- }
5
- .p-sidebar-right{
6
- width: 35%;
7
- }
8
- }
9
-
10
- .right-sidebar{
11
- width: 35%;
12
- }
@@ -1,73 +0,0 @@
1
- import { Component, Input, ViewEncapsulation } from '@angular/core';
2
- import { DocumentModel } from '../../models/document.model';
3
- import { SHARED } from '../../../../Shared/constant/SHARED';
4
-
5
-
6
- /**
7
- * This component is responsible for displaying a list of documents.
8
- * @class DocumentListComponent
9
- * @typedef {DocumentListComponent}
10
- */
11
- @Component({
12
- selector: 'lib-document-list',
13
- standalone: false,
14
- templateUrl: './document-list.component.html',
15
- styleUrls: ['./document-list.component.scss'],
16
- encapsulation: ViewEncapsulation.None
17
- })
18
- export class DocumentListComponent {
19
-
20
- /**
21
- * Represent contextId
22
- * @type {string}
23
- */
24
- @Input() contextId : string = SHARED.EMPTY
25
-
26
- selectedDocument !: DocumentModel
27
- /**
28
- * Default visbility of sidebar
29
- * @type {boolean}
30
- */
31
- isSidebarVisible: boolean = SHARED.FALSE
32
-
33
- /**
34
- * Default visbility of dialog
35
- * @type {boolean}
36
- */
37
- isdialogVisible: boolean = SHARED.FALSE
38
-
39
- /**
40
- * The list of documents to display.
41
- * @type {DocumentModel[]}
42
- */
43
- @Input() documentList: DocumentModel[] = [];
44
-
45
-
46
- /**
47
- * Handles the click event for file upload.
48
- * Prevents event propagation and displays the sidebar.
49
- * @param {MouseEvent} event - The click event triggered by the user.
50
- */
51
- handleFileUploadClick(event: MouseEvent): void {
52
- event.stopPropagation();
53
- this.isSidebarVisible = SHARED.TRUE;
54
- }
55
-
56
-
57
- /**
58
- * Select a individual document.
59
- * @param {*} docuemnt - The document that was clicked by the user.
60
- */
61
- handleClickForDocument(docuemnt: DocumentModel) {
62
- this.isdialogVisible = SHARED.TRUE
63
- this.selectedDocument = docuemnt
64
- }
65
-
66
- /**
67
- * Close dialog.
68
- */
69
- handleCloseModel(){
70
- this.selectedDocument = {_id : SHARED.INITIAL_VALUE};
71
- this.isdialogVisible = SHARED.FALSE
72
- }
73
- }
@@ -1,33 +0,0 @@
1
- <div class="grid">
2
- <div
3
- class="col-12 flex align-items-center justify-content-between md:col-6 xl:col-12"
4
- >
5
- <div
6
- class="col-5 flex cursor-pointer align-items-center pl-0"
7
- (click)="handleOpenDocument(document)"
8
- >
9
- <img src="../../../../assets/images/Frame.png" alt="" />
10
- <span class="ml-4">{{ document.fileName }}</span>
11
- </div>
12
- <div class="col-4 flex align-items-center justify-content-center">
13
- <span
14
- [class]="'product-badge status-' + document.status?.toLowerCase()"
15
- class="flex align-items-center justify-content-center pl-2 pr-2 pt-1 pb-1 "
16
- >
17
- <ng-container *ngIf="document.status?.toLowerCase() === 'pending'">
18
- <i class="pi pi-clock pr-1" style="font-size: 12px;"></i>
19
- Pending
20
- </ng-container>
21
- <ng-container *ngIf="document.status?.toLowerCase() === 'verified'">
22
- <i class="pi pi-check-circle pr-1" style="font-size: 12px;"></i>
23
- Verified
24
- </ng-container>
25
- <ng-container *ngIf="document.status?.toLowerCase() === 'sentreminder'">
26
- <i class="pi pi-bell pr-1" style="font-size: 12px;"></i>
27
- Sent Reminder
28
- </ng-container>
29
- </span>
30
- </div>
31
- </div>
32
- </div>
33
-
@@ -1,22 +0,0 @@
1
- .product-badge.status-pending {
2
- background: #e9b127;
3
- color: #ffffff;
4
- border-radius: 4px;
5
- }
6
- .product-badge.status-verified {
7
- background: #4caf50;
8
- color: #ffffff;
9
- border-radius: 4px;
10
- }
11
- .product-badge.status-sentreminder {
12
- background: #f57c00;
13
- color: #ffffff;
14
- border-radius: 4px;
15
- }
16
- .product-badge {
17
- text-transform: none;
18
- font-weight: 500;
19
- font-size: 12px;
20
-
21
- }
22
-
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
- import { DocumentListItemComponent } from './document-list-item.component';
3
- import { CommonModule } from '@angular/common';
4
-
5
- describe('DocumentListItemComponent', () => {
6
- let component: DocumentListItemComponent;
7
- let fixture: ComponentFixture<DocumentListItemComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- declarations: [DocumentListItemComponent],
12
- imports: [CommonModule], // Use CommonModule instead of BrowserModule
13
- }).compileComponents();
14
-
15
- fixture = TestBed.createComponent(DocumentListItemComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,40 +0,0 @@
1
- import { Component, EventEmitter, Input, Output } from '@angular/core';
2
- import { DocumentModel } from '../../models/document.model';
3
-
4
- /**
5
- * DocumentListItemComponent
6
- *
7
- * This component displays individual document items within a list.
8
- * It accepts a list of documents as input and handles interactions with documents.
9
- */
10
- @Component({
11
- selector: 'lib-document-list-item',
12
- standalone: false,
13
- templateUrl: './document-list-item.component.html',
14
- styleUrls: ['./document-list-item.component.scss']
15
- })
16
- export class DocumentListItemComponent {
17
- /**
18
- * Emit the selected document.
19
- * @type {EventEmitter<DocumentModel>}
20
- */
21
- @Output() documentClick = new EventEmitter<DocumentModel>();
22
-
23
- /**
24
- * The document to display.
25
- * @type {DocumentModel[]}
26
- */
27
- @Input() document!: DocumentModel;
28
-
29
- /**
30
- * Handles interactions with a document.
31
- * @param {DocumentModel} document - The document to be opened or interacted with.
32
- */
33
- handleOpenDocument(document: DocumentModel): void {
34
- if (!document) {
35
- console.error('Error: Document is null or undefined:', document);
36
- return;
37
- }
38
- this.documentClick.emit(document);
39
- }
40
- }