cat-documents-ng 0.3.11 → 0.3.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.
@@ -5,6 +5,7 @@ import { DocumentListService } from '../../services/document-list.service';
5
5
  import { Message } from 'primeng/api';
6
6
  import { DocumentHttpService } from '../../services/document-http.service';
7
7
  import { DocumentMenuService } from '../../services/document-menu.service';
8
+ import { DocumentCategoryReorderService } from '../../services/document-category-reorder.service';
8
9
  import * as i0 from "@angular/core";
9
10
  /**
10
11
  * This component is responsible for displaying and managing a list of documents.
@@ -15,6 +16,7 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
15
16
  private documentListService;
16
17
  private documentHttpService;
17
18
  private documentMenuService;
19
+ private documentCategoryReorderService;
18
20
  /**
19
21
  * Represents the context ID for the document list.
20
22
  * This value is passed from the parent component.
@@ -161,7 +163,7 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
161
163
  * @class
162
164
  * @param {DocumentListService} documentListService - The service responsible for document list operations.
163
165
  */
164
- constructor(documentListService: DocumentListService, documentHttpService: DocumentHttpService, documentMenuService: DocumentMenuService);
166
+ constructor(documentListService: DocumentListService, documentHttpService: DocumentHttpService, documentMenuService: DocumentMenuService, documentCategoryReorderService: DocumentCategoryReorderService);
165
167
  /**
166
168
  * Handles changes to input properties
167
169
  */
@@ -184,16 +186,6 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
184
186
  * Builds document categories from the API response
185
187
  */
186
188
  buildDocumentCategories(): void;
187
- /**
188
- * Reorders document categories to match the menu item order
189
- * This ensures sections are displayed in the same order as menu items
190
- */
191
- private reorderCategoriesByMenuItemOrder;
192
- /**
193
- * Gets the menu item order from the sorted menu items input
194
- * This ensures sections are displayed in the same order as the sorted menu items
195
- */
196
- private getMenuItemOrder;
197
189
  /**
198
190
  * Sets up subscription to document list response from store
199
191
  */
@@ -0,0 +1,53 @@
1
+ import { DocumentListResponse } from '../models/document-list-response.model';
2
+ import { TableData } from '../../../Shared/components/table-primary/table-primary.model';
3
+ import * as i0 from "@angular/core";
4
+ export interface CategoryData {
5
+ category: DocumentListResponse;
6
+ table: TableData;
7
+ count: string;
8
+ }
9
+ /**
10
+ * Service responsible for reordering document categories to match menu item order
11
+ * This ensures sections are displayed in the same order as menu items
12
+ */
13
+ export declare class DocumentCategoryReorderService {
14
+ constructor();
15
+ /**
16
+ * Reorders document categories to match the menu item order
17
+ * This ensures sections are displayed in the same order as menu items
18
+ * @param documentCategories - The document categories to reorder
19
+ * @param categoryTables - The table data for each category
20
+ * @param categoryCompletionCounts - The completion counts for each category
21
+ * @param sortedMenuItems - The sorted menu items to determine order
22
+ * @returns Object containing reordered categories, tables, and completion counts
23
+ */
24
+ reorderCategoriesByMenuItemOrder(documentCategories: DocumentListResponse[], categoryTables: TableData[], categoryCompletionCounts: string[], sortedMenuItems: any[]): {
25
+ reorderedCategories: DocumentListResponse[];
26
+ reorderedTables: TableData[];
27
+ reorderedCompletionCounts: string[];
28
+ };
29
+ /**
30
+ * Gets the menu item order from the sorted menu items input
31
+ * This ensures sections are displayed in the same order as the sorted menu items
32
+ * @param sortedMenuItems - The sorted menu items array
33
+ * @returns Array of menu item labels in order
34
+ */
35
+ private getMenuItemOrder;
36
+ /**
37
+ * Builds a map of category labels to their order based on menu items
38
+ * @param documentCategories - The document categories
39
+ * @param menuItemOrder - The ordered menu item labels
40
+ * @returns Map of category label to order index
41
+ */
42
+ private buildCategoryOrderMap;
43
+ /**
44
+ * Builds a map of original category data for reordering
45
+ * @param documentCategories - The document categories
46
+ * @param categoryTables - The table data for each category
47
+ * @param categoryCompletionCounts - The completion counts for each category
48
+ * @returns Map of category label to category data
49
+ */
50
+ private buildOriginalCategoryData;
51
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocumentCategoryReorderService, never>;
52
+ static ɵprov: i0.ɵɵInjectableDeclaration<DocumentCategoryReorderService>;
53
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cat-documents-ng",
3
- "version": "0.3.11",
3
+ "version": "0.3.13",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0"
@@ -0,0 +1,20 @@
1
+ {
2
+ "catQwUrl": "https://qa-qw-api.dynamatix.com/api/",
3
+ "apiUrl": "https://gatehouse-qa.dynamatix.com/api/",
4
+ "swaggerUrl": "https://qa-qw-api.dynamatix.com/api-docs/",
5
+ "adminEmail": "neeraj.kumar@catura.co.uk",
6
+ "interactBaseApi": "https://qa-interact-api.dynamatix.com/api/",
7
+ "actionBaseApi": "https://qa-qw-api.dynamatix.com/api/",
8
+ "documentApiUrl": "https://gatehouse-documents-qa-bgavezbwe9b6e9h6.uksouth-01.azurewebsites.net/api/",
9
+ "adminPhoneNumber": "+447380300545",
10
+ "visibilityOption": {
11
+ "isRationalVisible": false,
12
+ "isChecklistVisible": false,
13
+ "isAudit": false,
14
+ "isConversation": true,
15
+ "isOverview": true,
16
+ "isDocuments": true
17
+ },
18
+ "env": "qa"
19
+
20
+ }