cat-documents-ng 0.2.34 → 0.2.36

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 (31) hide show
  1. package/Shared/components/table-primary/table-primary.component.d.ts +11 -13
  2. package/Shared/components/table-primary/table-primary.model.d.ts +19 -0
  3. package/Shared/constant/ERROR.d.ts +1 -0
  4. package/Shared/constant/SHARED.d.ts +113 -0
  5. package/Shared/constant/URLS.d.ts +22 -0
  6. package/fesm2022/cat-documents-ng.mjs +1333 -678
  7. package/fesm2022/cat-documents-ng.mjs.map +1 -1
  8. package/lib/document/components/document-container/document-container.component.d.ts +36 -35
  9. package/lib/document/components/document-list/document-list.component.d.ts +53 -35
  10. package/lib/document/components/document-status/document-status.component.d.ts +9 -12
  11. package/lib/document/components/document-viewer/document-viewer.component.d.ts +6 -6
  12. package/lib/document/components/documents-menu/documents-menu.component.d.ts +33 -11
  13. package/lib/document/components/folder-container/folder-container.component.d.ts +23 -6
  14. package/lib/document/components/linked-document/linked-document.component.d.ts +5 -4
  15. package/lib/document/components/user-list/user-list.component.d.ts +19 -22
  16. package/lib/document/directives/document.directive.d.ts +2 -2
  17. package/lib/document/models/document-category.model.d.ts +19 -0
  18. package/lib/document/models/document-list-response.model.d.ts +25 -0
  19. package/lib/document/models/status-data.model.d.ts +27 -0
  20. package/lib/document/models/user-list.model.d.ts +8 -0
  21. package/lib/document/services/document-http.service.d.ts +28 -2
  22. package/lib/document/services/document-menu.service.d.ts +65 -0
  23. package/lib/document/services/document-table-builder.service.d.ts +21 -35
  24. package/lib/document/services/document.service.d.ts +29 -8
  25. package/lib/document/services/status-calculator.service.d.ts +20 -0
  26. package/lib/document/services/user-list.service.d.ts +36 -0
  27. package/lib/document/state/document.query.d.ts +52 -1
  28. package/lib/document/state/document.state.d.ts +9 -0
  29. package/lib/document/state/document.store.d.ts +9 -0
  30. package/package.json +1 -1
  31. package/lib/document/models/document-status.model.d.ts +0 -6
@@ -1,21 +1,25 @@
1
- import { OnInit } from '@angular/core';
1
+ import { OnInit, OnDestroy } from '@angular/core';
2
2
  import { DocumentService } from '../../state/document.service';
3
- import { DocumentModel } from '../../models/document.model';
4
- import { FolderBlockModel } from '../../models/folder.model';
5
3
  import { DocumentHttpService } from '../../services/document-http.service';
6
4
  import { DocumentQuery } from '../../state/document.query';
7
5
  import { DocumentStore } from '../../state/document.store';
6
+ import { DocumentCategory } from '../../models/document-category.model';
7
+ import { UserListModel } from '../../models/user-list.model';
8
+ import { StatusDataModel } from '../../models/status-data.model';
9
+ import { DocumentListResponse } from '../../models/document-list-response.model';
10
+ import { DocumentHelperService } from '../../services/document.service';
8
11
  import * as i0 from "@angular/core";
9
12
  /**
10
13
  *This component is responsible for managing and displaying a list of documents.
11
14
  * @class DocumentContainerComponent
12
15
  * @typedef {DocumentContainerComponent}
13
16
  */
14
- export declare class DocumentContainerComponent implements OnInit {
17
+ export declare class DocumentContainerComponent implements OnInit, OnDestroy {
15
18
  documentStore: DocumentStore;
16
19
  documentService: DocumentService;
17
20
  documentQuery: DocumentQuery;
18
21
  documentHttpService: DocumentHttpService;
22
+ documentHelperService: DocumentHelperService;
19
23
  /**
20
24
  * Creates an instance of DocumentContainerComponent.
21
25
  * @param {DocumentStore} documentStore - Query Store service to manage store document-related state.
@@ -23,38 +27,29 @@ export declare class DocumentContainerComponent implements OnInit {
23
27
  * @param {DocumentQuery} documentQuery - Query service to manage document-related state.
24
28
  * @param {DocumentHttpService} documentHttpService - Service to make HTTP requests related to documents.
25
29
  */
26
- constructor(documentStore: DocumentStore, documentService: DocumentService, documentQuery: DocumentQuery, documentHttpService: DocumentHttpService);
30
+ constructor(documentStore: DocumentStore, documentService: DocumentService, documentQuery: DocumentQuery, documentHttpService: DocumentHttpService, documentHelperService: DocumentHelperService);
27
31
  /**
28
32
  * Get contextId in input.
29
33
  * @type {string}
30
34
  */
31
35
  contextId: string;
32
36
  /**
33
- * Get isCollapsed in input.
34
- * @type {string}
37
+ * The list of folders.
38
+ * @type {Array}
35
39
  */
36
- isCollapsed: boolean;
40
+ applicationNumber: string;
41
+ catagories: DocumentCategory[];
42
+ userList: UserListModel[];
37
43
  /**
38
- * Get showFolderList in input.
39
- * @type {boolean}
44
+ * Status data for the current selection
45
+ * @type {StatusDataModel[]}
40
46
  */
41
- showFolderList: boolean;
47
+ statusData: StatusDataModel[];
42
48
  /**
43
- * Get isUploadButtonVisible in input.
44
- * @type {boolean}
49
+ * Document list response from API
50
+ * @type {DocumentListResponse | null}
45
51
  */
46
- isUploadButtonVisible: boolean;
47
- /**
48
- * The list of documents.
49
- * @type {Array}
50
- */
51
- documentList: DocumentModel[];
52
- /**
53
- * The list of folders.
54
- * @type {Array}
55
- */
56
- folderList: FolderBlockModel[];
57
- items: any;
52
+ documentListResponse: DocumentListResponse[] | null;
58
53
  /**
59
54
  * Holds the subscription to manage observable cleanup.
60
55
  * @private
@@ -67,24 +62,30 @@ export declare class DocumentContainerComponent implements OnInit {
67
62
  */
68
63
  ngOnInit(): void;
69
64
  /**
70
- * Fetches the folder data from the API.
71
- * @returns {void}
65
+ * Sets up subscriptions to monitor menu item and user selection changes
66
+ * to trigger status data fetching
72
67
  */
68
+ private setupStatusDataSubscriptions;
73
69
  /**
74
- * Fetches the folder data from the API.
75
- * @returns {void}
70
+ * Fetches status data based on current selections
76
71
  */
77
- fetchFolder(): void;
72
+ private fetchStatusData;
78
73
  /**
79
- * Fetches the document data from the API.
80
- * @param {string} folderBlockId - The folder ID to fetch the document.
81
- * @returns {void}
74
+ * Fetches document catagory data.
75
+ */
76
+ fetchDocumentCatagories(): void;
77
+ /**
78
+ * Fetches userlist data
79
+ */
80
+ fetchUserList(): void;
81
+ /**
82
+ * Sets up subscription to listen for filtered document responses
82
83
  */
83
- private fetchDocuments;
84
+ private setupFilteredDocumentSubscription;
84
85
  /**
85
86
  * Unsubscribe subscription on destroy of component .
86
87
  */
87
88
  ngOnDestroy(): void;
88
89
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentContainerComponent, never>;
89
- static ɵcmp: i0.ɵɵComponentDeclaration<DocumentContainerComponent, "lib-document-container", never, { "contextId": { "alias": "contextId"; "required": false; }; "isCollapsed": { "alias": "isCollapsed"; "required": false; }; "showFolderList": { "alias": "showFolderList"; "required": false; }; "isUploadButtonVisible": { "alias": "isUploadButtonVisible"; "required": false; }; }, {}, never, ["*"], false, never>;
90
+ static ɵcmp: i0.ɵɵComponentDeclaration<DocumentContainerComponent, "lib-document-container", never, { "contextId": { "alias": "contextId"; "required": false; }; }, {}, never, ["*"], false, never>;
90
91
  }
@@ -1,26 +1,25 @@
1
- import { EventEmitter, OnInit } from '@angular/core';
2
- import { DocumentModel } from '../../models/document.model';
1
+ import { OnInit, OnDestroy } from '@angular/core';
3
2
  import { DocumentHttpService } from '../../services/document-http.service';
4
3
  import { DocumentUploadService } from '../../services/document-upload.service';
5
4
  import { Message } from 'primeng/api';
6
5
  import { DocumentQuery } from '../../state/document.query';
7
6
  import { DocumentStore } from '../../state/document.store';
8
7
  import { PERMISSIONS } from '../../../../Shared/constant/PERMISSIONS';
9
- import { DocumentTableBuilderService, DocumentSection } from '../../services/document-table-builder.service';
10
- import { TableData } from '../../../../Shared/components/table-primary/table-primary.component';
8
+ import { DocumentTableBuilderService } from '../../services/document-table-builder.service';
9
+ import { DocumentListItem, DocumentListResponse } from '../../models/document-list-response.model';
10
+ import { TableData } from '../../../../Shared/components/table-primary/table-primary.model';
11
11
  import * as i0 from "@angular/core";
12
12
  /**
13
13
  * This component is responsible for displaying and managing a list of documents.
14
14
  * Provides functionality for file upload, document selection, and dialog management.
15
15
  * @class DocumentListComponent
16
16
  */
17
- export declare class DocumentListComponent implements OnInit {
17
+ export declare class DocumentListComponent implements OnInit, OnDestroy {
18
18
  documentUploadService: DocumentUploadService;
19
19
  documentHttpService: DocumentHttpService;
20
20
  documentQuery: DocumentQuery;
21
21
  documentStore: DocumentStore;
22
22
  private documentTableBuilder;
23
- onRefresh: EventEmitter<any>;
24
23
  /**
25
24
  * Represents the context ID for the document list.
26
25
  * This value is passed from the parent component.
@@ -28,6 +27,16 @@ export declare class DocumentListComponent implements OnInit {
28
27
  * @memberof DocumentListComponent
29
28
  */
30
29
  contextId: string;
30
+ /**
31
+ * The document list response data passed from the parent component.
32
+ * @type {DocumentListResponse[] | null}
33
+ * @memberof DocumentListComponent
34
+ */
35
+ documentListResponse: DocumentListResponse[] | null;
36
+ /**
37
+ * Subscription to document list response from store
38
+ */
39
+ private documentListSubscription;
31
40
  /**
32
41
  * Default visibility of the upload button.
33
42
  * @type {boolean}
@@ -39,19 +48,13 @@ export declare class DocumentListComponent implements OnInit {
39
48
  * @type {DocumentModel}
40
49
  * @memberof DocumentListComponent
41
50
  */
42
- selectedDocument: DocumentModel;
51
+ selectedDocument: DocumentListItem;
43
52
  /**
44
53
  * Default visibility of the sidebar.
45
54
  * @type {boolean}
46
55
  * @memberof DocumentListComponent
47
56
  */
48
57
  isSidebarVisible: boolean;
49
- /**
50
- * Default visibility of the Accordion.
51
- * @type {boolean}
52
- * @memberof DocumentListComponent
53
- */
54
- isCollapsed: boolean;
55
58
  /**
56
59
  * Default visibility of the messages.
57
60
  * @type {Message[]}
@@ -70,7 +73,7 @@ export declare class DocumentListComponent implements OnInit {
70
73
  * @type {DocumentModel[]}
71
74
  * @memberof DocumentListComponent
72
75
  */
73
- documentList: DocumentModel[];
76
+ documentList: DocumentListItem[];
74
77
  /**
75
78
  * The name of the document being uploaded or managed.
76
79
  * @type {string}
@@ -100,13 +103,23 @@ export declare class DocumentListComponent implements OnInit {
100
103
  */
101
104
  fileName: string | undefined;
102
105
  /**
103
- * Document sections data for rendering tables
106
+ * Table data for each category
107
+ */
108
+ categoryTables: TableData[];
109
+ /**
110
+ * Document categories from the response
104
111
  */
105
- documentSections: DocumentSection[];
112
+ documentCategories: DocumentListResponse[];
106
113
  /**
107
- * Table data for each section
114
+ * Completion counts for each category
108
115
  */
109
- sectionTables: TableData[];
116
+ categoryCompletionCounts: string[];
117
+ /**
118
+ * Filter properties
119
+ */
120
+ status: string | null;
121
+ category: string | null;
122
+ searchKey: string | null;
110
123
  /**
111
124
  * Creates an instance of DocumentListComponent.
112
125
  * @class
@@ -127,13 +140,6 @@ export declare class DocumentListComponent implements OnInit {
127
140
  * @memberof DocumentListComponent
128
141
  */
129
142
  handleFileUploadClick(event: MouseEvent): void;
130
- /**
131
- * Handles the selection of an individual document.
132
- * Opens a dialog to display or manage the selected document.
133
- * @param {DocumentModel} document - The document that was clicked by the user.
134
- * @memberof DocumentListComponent
135
- */
136
- handleClickForDocument(document: DocumentModel): void;
137
143
  /**
138
144
  * Handles the save click event to update the document's file name.
139
145
  * This method creates a payload with the updated file name and calls the
@@ -142,11 +148,6 @@ export declare class DocumentListComponent implements OnInit {
142
148
  * @returns {void}
143
149
  */
144
150
  handleSaveClick(): void;
145
- /**
146
- * Closes the dialog and resets the selected document.
147
- * @memberof DocumentListComponent
148
- */
149
- handleCloseModal(): void;
150
151
  /**
151
152
  * Handles the upload action for a document.
152
153
  * Validates if a document type is selected and logs the result.
@@ -162,13 +163,30 @@ export declare class DocumentListComponent implements OnInit {
162
163
  getDocumentTypeList(): void;
163
164
  handleOpenSideBar(isVisible: boolean): void;
164
165
  /**
165
- * Builds table data for all document sections
166
+ * Gets completion count for a category
167
+ */
168
+ getCompletionCount(category: DocumentListResponse): string;
169
+ /**
170
+ * Gets pending document count for a category
171
+ */
172
+ getPendingDocumentCount(category: DocumentListResponse): number;
173
+ /**
174
+ * Gets approved document count for a category
175
+ */
176
+ getApprovedDocumentCount(category: DocumentListResponse): number;
177
+ /**
178
+ * Builds document categories from the API response
179
+ */
180
+ buildDocumentCategories(): void;
181
+ /**
182
+ * Sets up subscription to document list response from store
166
183
  */
167
- private buildSectionTables;
184
+ private setupDocumentListSubscription;
185
+ handleTableRowClick(rowData: any): void;
168
186
  /**
169
- * Gets completion count for a section
187
+ * Cleanup subscriptions on component destroy
170
188
  */
171
- getCompletionCount(section: DocumentSection): string;
189
+ ngOnDestroy(): void;
172
190
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentListComponent, never>;
173
- static ɵcmp: i0.ɵɵComponentDeclaration<DocumentListComponent, "lib-document-list", never, { "contextId": { "alias": "contextId"; "required": false; }; "isUploadButtonVisible": { "alias": "isUploadButtonVisible"; "required": false; }; "isCollapsed": { "alias": "isCollapsed"; "required": false; }; "documentList": { "alias": "documentList"; "required": false; }; }, { "onRefresh": "onRefresh"; }, never, ["*"], false, never>;
191
+ static ɵcmp: i0.ɵɵComponentDeclaration<DocumentListComponent, "lib-document-list", never, { "contextId": { "alias": "contextId"; "required": false; }; "documentListResponse": { "alias": "documentListResponse"; "required": false; }; "isUploadButtonVisible": { "alias": "isUploadButtonVisible"; "required": false; }; "documentList": { "alias": "documentList"; "required": false; }; "status": { "alias": "status"; "required": false; }; "category": { "alias": "category"; "required": false; }; "searchKey": { "alias": "searchKey"; "required": false; }; }, {}, never, ["*"], false, never>;
174
192
  }
@@ -1,25 +1,22 @@
1
1
  import { OnInit, OnDestroy } from '@angular/core';
2
- import { StatusDataModel } from '../../models/document-status.model';
3
- import { DocumentStore } from '../../state/document.store';
4
2
  import { DocumentQuery } from '../../state/document.query';
5
- import { DocumentService } from '../../services/document.service';
3
+ import { StatusCalculatorService, CalculatedStatusData } from '../../services/status-calculator.service';
4
+ import { DocumentHelperService } from '../../services/document.service';
6
5
  import * as i0 from "@angular/core";
7
6
  export declare class DocumentStatusComponent implements OnInit, OnDestroy {
8
- private documentStore;
9
7
  private documentQuery;
10
8
  private documentService;
11
- statusData: StatusDataModel[];
9
+ private statusCalculatorService;
10
+ contextId: string;
11
+ statusData: any;
12
12
  selectedStatus: string | null;
13
+ statusDataWithPercentages: CalculatedStatusData[];
13
14
  private subscription;
14
- constructor(documentStore: DocumentStore, documentQuery: DocumentQuery, documentService: DocumentService);
15
+ constructor(documentQuery: DocumentQuery, documentService: DocumentHelperService, statusCalculatorService: StatusCalculatorService);
15
16
  ngOnInit(): void;
16
17
  ngOnDestroy(): void;
17
- getTotalCount(): number;
18
- getPercentage(count: number): number;
19
18
  selectStatus(status: string): void;
20
- isSelected(status: string): boolean;
21
- setExampleSelections(): void;
22
- clearAllSelections(): void;
19
+ private updateCalculatedStatusData;
23
20
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentStatusComponent, never>;
24
- static ɵcmp: i0.ɵɵComponentDeclaration<DocumentStatusComponent, "lib-document-status", never, {}, {}, never, never, false, never>;
21
+ static ɵcmp: i0.ɵɵComponentDeclaration<DocumentStatusComponent, "lib-document-status", never, { "contextId": { "alias": "contextId"; "required": false; }; "statusData": { "alias": "statusData"; "required": false; }; }, {}, never, never, false, never>;
25
22
  }
@@ -1,8 +1,8 @@
1
1
  import { OnChanges, OnDestroy } from '@angular/core';
2
2
  import { DynamicDialogRef } from 'primeng/dynamicdialog';
3
3
  import { DocumentHttpService } from '../../services/document-http.service';
4
- import { DocumentModel } from '../../models/document.model';
5
- import { DocumentService } from '../../services/document.service';
4
+ import { DocumentHelperService } from '../../services/document.service';
5
+ import { DocumentListItem } from '../../models/document-list-response.model';
6
6
  import * as i0 from "@angular/core";
7
7
  /**
8
8
  * Component for viewing and managing document details.
@@ -16,12 +16,12 @@ export declare class DocumentViewerComponent implements OnChanges, OnDestroy {
16
16
  * Get the selected document by user.
17
17
  * @type {*}
18
18
  */
19
- selectedDocument?: DocumentModel;
19
+ selectedDocument?: DocumentListItem;
20
20
  /**
21
21
  * Get the selected document by user.
22
22
  * @type {*}
23
23
  */
24
- documentList?: DocumentModel[];
24
+ documentList?: DocumentListItem[];
25
25
  /**
26
26
  * Indicates whether a checkbox is selected.
27
27
  * @type {boolean}
@@ -53,13 +53,13 @@ export declare class DocumentViewerComponent implements OnChanges, OnDestroy {
53
53
  * @param {DocumentHttpService} documentHttpService - Handle the http service.
54
54
  * @param {DocumentService} documentService - Handle the states.
55
55
  */
56
- constructor(documentHttpService: DocumentHttpService, documentService: DocumentService);
56
+ constructor(documentHttpService: DocumentHttpService, documentService: DocumentHelperService);
57
57
  /**
58
58
  * Fetches the alerts for the selected document.
59
59
  * @returns {void}
60
60
  */
61
61
  ngOnChanges(): void;
62
- handleSelectedDocument(document: DocumentModel): void;
62
+ handleSelectedDocument(document: DocumentListItem): void;
63
63
  /**
64
64
  * Determines if the given content type is an image.
65
65
  * @param {string | undefined} contentType - The MIME type of the content.
@@ -1,21 +1,43 @@
1
- import { OnInit } from '@angular/core';
1
+ import { OnInit, OnChanges, SimpleChanges } from '@angular/core';
2
2
  import { DocumentStore } from '../../state/document.store';
3
3
  import { DocumentQuery } from '../../state/document.query';
4
+ import { DocumentCategory, DocumentCategoryItem } from '../../models/document-category.model';
5
+ import { DocumentMenuService } from '../../services/document-menu.service';
6
+ import { DocumentHelperService } from '../../services/document.service';
4
7
  import * as i0 from "@angular/core";
5
- export declare class DocumentsMenuComponent implements OnInit {
8
+ export declare class DocumentsMenuComponent implements OnInit, OnChanges {
6
9
  private documentStore;
7
10
  private documentQuery;
8
- items: any;
11
+ private documentMenuService;
12
+ private documentHelperService;
13
+ catagories: DocumentCategory[];
14
+ applicationNumber: string;
15
+ contextId: string;
9
16
  selectedMenuItem: string | null;
10
- constructor(documentStore: DocumentStore, documentQuery: DocumentQuery);
17
+ selectedMenuItemId: string | null;
18
+ constructor(documentStore: DocumentStore, documentQuery: DocumentQuery, documentMenuService: DocumentMenuService, documentHelperService: DocumentHelperService);
11
19
  ngOnInit(): void;
12
- onMenuItemClick(event: any, item: any): void;
13
- selectMenuItem(menuItemLabel: string): void;
14
- unselectMenuItem(): void;
15
- isMenuItemSelected(menuItemLabel: string): boolean;
20
+ ngOnChanges(changes: SimpleChanges): void;
21
+ /**
22
+ * Finds the label of a menu item by its _id
23
+ * @param id The _id to search for
24
+ * @returns The label of the menu item or null if not found
25
+ */
26
+ private findMenuItemLabelById;
27
+ /**
28
+ * Update menu use catagories
29
+ */
30
+ private updateMenuItemsData;
31
+ /**
32
+ * Handle the menu item click
33
+ * @param {*} event - Event
34
+ * @param {DocumentCategoryItem} item - catagory item
35
+ */
36
+ onMenuItemClick(event: any, item: DocumentCategoryItem): void;
37
+ onSelectMenuItem(menuItemId: string): void;
38
+ onUnselectMenuItem(): void;
16
39
  getSelectedMenuItem(): string | null;
17
- private getMenuItemCategory;
18
- private handleUserListVisibility;
40
+ getSelectedMenuItemId(): string | null;
19
41
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentsMenuComponent, never>;
20
- static ɵcmp: i0.ɵɵComponentDeclaration<DocumentsMenuComponent, "lib-documents-menu", never, { "items": { "alias": "items"; "required": false; }; }, {}, never, never, false, never>;
42
+ static ɵcmp: i0.ɵɵComponentDeclaration<DocumentsMenuComponent, "lib-documents-menu", never, { "catagories": { "alias": "catagories"; "required": false; }; "applicationNumber": { "alias": "applicationNumber"; "required": false; }; "contextId": { "alias": "contextId"; "required": false; }; }, {}, never, never, false, never>;
21
43
  }
@@ -2,11 +2,13 @@ import { OnInit } from '@angular/core';
2
2
  import { DocumentModel } from '../../models/document.model';
3
3
  import { FolderBlockModel } from '../../models/folder.model';
4
4
  import { DocumentQuery } from '../../state/document.query';
5
+ import { UserListModel } from '../../models/user-list.model';
6
+ import { StatusDataModel } from '../../models/status-data.model';
7
+ import { DocumentCategory } from '../../models/document-category.model';
5
8
  import * as i0 from "@angular/core";
6
9
  /**
7
10
  * The `FolderContainerComponent` is responsible for rendering a container
8
11
  * that displays a list of documents and associated folder panel data.
9
- *
10
12
  * This component utilizes the `FOLDERPANEL` constant for folder panel data
11
13
  * and accepts a document list input of type `DocumentModel`.
12
14
  */
@@ -27,16 +29,31 @@ export declare class FolderContainerComponent implements OnInit {
27
29
  * @type {string}
28
30
  */
29
31
  contextId: string;
32
+ /**
33
+ * The list of users passed as input to the component.
34
+ * @type {UserListModel[]}
35
+ */
36
+ userList: UserListModel[];
37
+ /**
38
+ * The status data passed as input to the component.
39
+ * @type {StatusDataModel[]}
40
+ */
41
+ statusData: StatusDataModel[];
42
+ /**
43
+ * The document categories passed as input to the component.
44
+ * @type {DocumentCategory[]}
45
+ */
46
+ categories: DocumentCategory[];
30
47
  /**
31
48
  * Flag to control user list visibility
32
49
  */
33
50
  showUserList: boolean;
34
- constructor(documentQuery: DocumentQuery);
35
- ngOnInit(): void;
36
51
  /**
37
- * Get the animation state for the user list
52
+ * Animation state for user list visibility
38
53
  */
39
- getUserListAnimationState(): string;
54
+ userListAnimationState: string;
55
+ constructor(documentQuery: DocumentQuery);
56
+ ngOnInit(): void;
40
57
  static ɵfac: i0.ɵɵFactoryDeclaration<FolderContainerComponent, never>;
41
- static ɵcmp: i0.ɵɵComponentDeclaration<FolderContainerComponent, "lib-folder-container", never, { "documentList": { "alias": "documentList"; "required": false; }; "folderList": { "alias": "folderList"; "required": false; }; "contextId": { "alias": "contextId"; "required": false; }; }, {}, never, never, false, never>;
58
+ static ɵcmp: i0.ɵɵComponentDeclaration<FolderContainerComponent, "lib-folder-container", never, { "documentList": { "alias": "documentList"; "required": false; }; "folderList": { "alias": "folderList"; "required": false; }; "contextId": { "alias": "contextId"; "required": false; }; "userList": { "alias": "userList"; "required": false; }; "statusData": { "alias": "statusData"; "required": false; }; "categories": { "alias": "categories"; "required": false; }; }, {}, never, never, false, never>;
42
59
  }
@@ -1,5 +1,6 @@
1
1
  import { EventEmitter } from '@angular/core';
2
2
  import { DocumentModel } from '../../models/document.model';
3
+ import { DocumentListItem } from '../../models/document-list-response.model';
3
4
  import * as i0 from "@angular/core";
4
5
  /**
5
6
  * Description placeholder
@@ -12,17 +13,17 @@ export declare class LinkedDocumentComponent {
12
13
  * Selected document for view.
13
14
  * @type {?DocumentModel}
14
15
  */
15
- selectedDocument?: DocumentModel;
16
+ selectedDocument?: DocumentListItem;
16
17
  /**
17
18
  * Whole document list.
18
19
  * @type {?DocumentModel[]}
19
20
  */
20
- documentList?: DocumentModel[];
21
+ documentList?: DocumentListItem[];
21
22
  /**
22
23
  * Changed selected document.
23
24
  * @type {*}
24
25
  */
25
- selectedDocumentChange: EventEmitter<DocumentModel>;
26
+ selectedDocumentChange: EventEmitter<DocumentListItem>;
26
27
  /**
27
28
  * Filtered documents.
28
29
  * @type {DocumentModel[]}
@@ -32,7 +33,7 @@ export declare class LinkedDocumentComponent {
32
33
  * Handle the click on the document.
33
34
  * @param {DocumentModel} document - Clicked document.
34
35
  */
35
- handleDocumentClick(document: DocumentModel): void;
36
+ handleDocumentClick(document: DocumentListItem): void;
36
37
  static ɵfac: i0.ɵɵFactoryDeclaration<LinkedDocumentComponent, never>;
37
38
  static ɵcmp: i0.ɵɵComponentDeclaration<LinkedDocumentComponent, "app-linked-document", never, { "selectedDocument": { "alias": "selectedDocument"; "required": false; }; "documentList": { "alias": "documentList"; "required": false; }; }, { "selectedDocumentChange": "selectedDocumentChange"; }, never, never, false, never>;
38
39
  }
@@ -1,32 +1,29 @@
1
- import { EventEmitter, OnInit } from '@angular/core';
2
- import { DocumentService } from '../../services/document.service';
1
+ import { EventEmitter, OnInit, OnChanges, SimpleChanges } from '@angular/core';
3
2
  import { DocumentStore } from '../../state/document.store';
4
3
  import { DocumentQuery } from '../../state/document.query';
4
+ import { UserListModel } from '../../models/user-list.model';
5
+ import { UserListService } from '../../services/user-list.service';
6
+ import { DocumentCategory } from '../../models/document-category.model';
7
+ import { DocumentHelperService } from '../../services/document.service';
5
8
  import * as i0 from "@angular/core";
6
- export interface UserData {
7
- _id: string;
8
- username: string;
9
- approveDocumentCount: number;
10
- pendingDocumentCount: number;
11
- initials?: string;
12
- color: string;
13
- }
14
- export declare class UserListComponent implements OnInit {
15
- documentService: DocumentService;
9
+ export declare class UserListComponent implements OnInit, OnChanges {
10
+ documentService: DocumentHelperService;
16
11
  private documentStore;
17
12
  private documentQuery;
18
- userData: UserData[];
19
- selectedUser?: string;
13
+ private userListService;
14
+ userList: UserListModel[];
15
+ categories: DocumentCategory[];
20
16
  userSelected: EventEmitter<string>;
21
- constructor(documentService: DocumentService, documentStore: DocumentStore, documentQuery: DocumentQuery);
17
+ userData: UserListModel[];
18
+ filteredUserData: UserListModel[];
19
+ selectedUser: string | undefined;
20
+ shouldShowContainer: boolean;
21
+ constructor(documentService: DocumentHelperService, documentStore: DocumentStore, documentQuery: DocumentQuery, userListService: UserListService);
22
+ ngOnChanges(changes: SimpleChanges): void;
23
+ private initializeUserData;
24
+ private updateFilteredUserData;
22
25
  ngOnInit(): void;
23
- getInitials(username: string): string;
24
- getColorByIndex(index: number): string;
25
- getColorValue(colorName: string): string;
26
26
  onUserSelect(username: string, id: string): void;
27
- selectUser(userId: string): void;
28
- unselectUser(): void;
29
- isUserSelected(userId: string): boolean;
30
27
  static ɵfac: i0.ɵɵFactoryDeclaration<UserListComponent, never>;
31
- static ɵcmp: i0.ɵɵComponentDeclaration<UserListComponent, "lib-user-list", never, {}, { "userSelected": "userSelected"; }, never, never, false, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<UserListComponent, "lib-user-list", never, { "userList": { "alias": "userList"; "required": false; }; "categories": { "alias": "categories"; "required": false; }; }, { "userSelected": "userSelected"; }, never, never, false, never>;
32
29
  }
@@ -1,5 +1,5 @@
1
1
  import { TemplateRef, ViewContainerRef } from "@angular/core";
2
- import { DocumentService } from "../services/document.service";
2
+ import { DocumentHelperService } from "../services/document.service";
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
5
  * Directive to display the document data
@@ -14,7 +14,7 @@ export declare class DocumentDirective {
14
14
  * @param templateRef Reference to the template.
15
15
  * @param vcr View container reference to manage the view.
16
16
  */
17
- constructor(documentService: DocumentService, templateRef: TemplateRef<any>, vcr: ViewContainerRef);
17
+ constructor(documentService: DocumentHelperService, templateRef: TemplateRef<any>, vcr: ViewContainerRef);
18
18
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentDirective, never>;
19
19
  static ɵdir: i0.ɵɵDirectiveDeclaration<DocumentDirective, "[doc]", never, {}, {}, never, never, false, never>;
20
20
  }
@@ -0,0 +1,19 @@
1
+ export interface DocumentCategoryStatus {
2
+ Pending: number;
3
+ Reviewing: number;
4
+ Accepted: number;
5
+ Rejected: number;
6
+ }
7
+ export interface DocumentCategoryItem {
8
+ _id: string;
9
+ label: string;
10
+ icon: string;
11
+ status: DocumentCategoryStatus;
12
+ }
13
+ export interface DocumentCategory {
14
+ label: string;
15
+ items: DocumentCategoryItem[];
16
+ }
17
+ export interface DocumentCategoriesResponse {
18
+ categories: DocumentCategory[];
19
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Represents a document list item within a category
3
+ */
4
+ export interface DocumentListItem {
5
+ _id: string;
6
+ fileName: string;
7
+ docName: string;
8
+ fileSize: string;
9
+ documentUrl: string;
10
+ status: string;
11
+ uploadedOn: string;
12
+ ownerName: string;
13
+ contentType: string;
14
+ }
15
+ /**
16
+ * Represents the complete document list response
17
+ */
18
+ export interface DocumentListResponse {
19
+ label: string;
20
+ categoryDescription: string;
21
+ totalDocs: number;
22
+ acceptedDocs: number;
23
+ list: DocumentListItem[];
24
+ completed: string;
25
+ }