cat-documents-ng 0.3.51 → 0.3.53

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.
@@ -220,6 +220,31 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
220
220
  * @param menuItemId - The ID of the selected menu item
221
221
  */
222
222
  scrollToCategorySection(menuItemId: string): void;
223
+ /**
224
+ * Finds category by converting menuItemId to readable format and matching exactly
225
+ * @param menuItemId - The menu item ID to match
226
+ * @returns The matching category or null
227
+ */
228
+ private findCategoryByMenuItemId;
229
+ /**
230
+ * Converts menuItemId to readable label format
231
+ * @param menuItemId - The menu item ID
232
+ * @returns Readable label
233
+ */
234
+ private convertMenuItemIdToReadableLabel;
235
+ /**
236
+ * Checks if a menu label is a substring of a longer category name
237
+ * @param menuLabel - The menu label to check
238
+ * @param categoryLabel - The category label to check against
239
+ * @returns True if menuLabel is a substring of a longer category
240
+ */
241
+ private isSubstringOfLongerCategory;
242
+ /**
243
+ * Legacy matching for backward compatibility with existing hardcoded keywords
244
+ * @param menuItemId - The menu item ID
245
+ * @returns The matching category or null
246
+ */
247
+ private findCategoryByLegacyMatching;
223
248
  /**
224
249
  * Scrolls to the category section using navigationInfo
225
250
  * @param navigationInfo - The navigation info object containing menuItemId
@@ -256,10 +281,9 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
256
281
  */
257
282
  private handleDocumentListFilteringChange;
258
283
  /**
259
- * Checks if the currently selected menu item's section is visible in the filtered document list
260
- * @returns True if the section is visible, false otherwise
284
+ * Deselects the current menu item and resets the view
261
285
  */
262
- private isSelectedMenuItemSectionVisible;
286
+ private deselectMenuItemAndReset;
263
287
  /**
264
288
  * Cleanup subscriptions on component destroy
265
289
  */
@@ -29,6 +29,7 @@ export declare class DocumentsMenuComponent implements OnInit, OnChanges, OnDest
29
29
  private _cachedCategories;
30
30
  private selectedMenuItemSubscription;
31
31
  private documentCategoriesSubscription;
32
+ private documentListResponseSubscription;
32
33
  constructor(documentStore: DocumentStore, documentQuery: DocumentQuery, documentMenuService: DocumentMenuService, documentHelperService: DocumentHelperService);
33
34
  /**
34
35
  * Initialize the component
@@ -70,6 +71,15 @@ export declare class DocumentsMenuComponent implements OnInit, OnChanges, OnDest
70
71
  * Update menu use catagories
71
72
  */
72
73
  private updateMenuItemsData;
74
+ /**
75
+ * Sets up subscription to document list response to update menu item selectability
76
+ */
77
+ private setupDocumentListResponseSubscription;
78
+ /**
79
+ * Updates menu items with selectability status based on filtered document list
80
+ * @param documentListResponse - The filtered document list response
81
+ */
82
+ private updateMenuItemsSelectability;
73
83
  /**
74
84
  * Handle the menu item click for navigation
75
85
  * @param {*} event - Event
@@ -13,6 +13,7 @@ export interface DocumentCategoryItem {
13
13
  label: string;
14
14
  icon: string;
15
15
  status: DocumentCategoryStatus;
16
+ isSelectable?: boolean;
16
17
  }
17
18
  export interface DocumentCategory {
18
19
  label: string;
@@ -1,5 +1,6 @@
1
1
  import { DocumentCategory, DocumentCategoryItem } from '../models/document-category.model';
2
2
  import { DocumentStore } from '../state/document.store';
3
+ import { DocumentListResponse } from '../models/document-list-response.model';
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class DocumentMenuService {
5
6
  private documentStore;
@@ -72,6 +73,50 @@ export declare class DocumentMenuService {
72
73
  * @returns Number of approved documents
73
74
  */
74
75
  getApprovedDocuments(item: DocumentCategoryItem): number;
76
+ /**
77
+ * Checks if a menu item's section is visible in the filtered document list
78
+ * @param menuItemId - The ID of the menu item to check
79
+ * @param documentListResponse - The filtered document list response
80
+ * @returns True if the section is visible, false otherwise
81
+ */
82
+ isMenuItemSectionVisible(menuItemId: string, documentListResponse: DocumentListResponse[] | null, menuItemLabel?: string): boolean;
83
+ /**
84
+ * Performs smart partial matching to prevent substring conflicts
85
+ * @param menuLabel - The menu item label to match
86
+ * @param categoryLabel - The category label to match against
87
+ * @returns True if it's a valid partial match, false otherwise
88
+ */
89
+ private isSmartPartialMatch;
90
+ /**
91
+ * Deselects a menu item if its section is not visible in the filtered document list
92
+ * @param menuItemId - The ID of the menu item to check
93
+ * @param documentListResponse - The filtered document list response
94
+ * @param menuItemLabel - The label of the menu item (optional)
95
+ * @returns True if the menu item was deselected, false otherwise
96
+ */
97
+ deselectMenuItemIfSectionNotVisible(menuItemId: string, documentListResponse: DocumentListResponse[] | null, menuItemLabel?: string): boolean;
98
+ /**
99
+ * Checks if a menu item should be selectable based on the filtered document list
100
+ * @param menuItemId - The ID of the menu item to check
101
+ * @param documentListResponse - The filtered document list response
102
+ * @param menuItemLabel - The label of the menu item (optional)
103
+ * @returns True if the menu item should be selectable, false otherwise
104
+ */
105
+ isMenuItemSelectable(menuItemId: string, documentListResponse: DocumentListResponse[] | null, menuItemLabel?: string): boolean;
106
+ /**
107
+ * Gets the selectability status for all menu items in categories
108
+ * @param categories - The document categories containing menu items
109
+ * @param documentListResponse - The filtered document list response
110
+ * @returns Map of menu item IDs to their selectability status
111
+ */
112
+ getMenuItemsSelectabilityStatus(categories: DocumentCategory[], documentListResponse: DocumentListResponse[] | null): Map<string, boolean>;
113
+ /**
114
+ * Updates menu items with selectability status
115
+ * @param categories - The document categories containing menu items
116
+ * @param documentListResponse - The filtered document list response
117
+ * @returns Updated categories with selectability information
118
+ */
119
+ updateMenuItemsWithSelectabilityStatus(categories: DocumentCategory[], documentListResponse: DocumentListResponse[] | null): DocumentCategory[];
75
120
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentMenuService, never>;
76
121
  static ɵprov: i0.ɵɵInjectableDeclaration<DocumentMenuService>;
77
122
  }
@@ -3,6 +3,7 @@ import { DocumentModel } from "../models/document.model";
3
3
  import { DocumentStore } from "../state/document.store";
4
4
  import { DocumentQuery } from "../state/document.query";
5
5
  import { DocumentHttpService } from "./document-http.service";
6
+ import { DocumentMenuService } from "./document-menu.service";
6
7
  import * as i0 from "@angular/core";
7
8
  /**
8
9
  * Service to manage the document data and selection state
@@ -11,8 +12,9 @@ export declare class DocumentHelperService {
11
12
  private documentStore;
12
13
  private documentQuery;
13
14
  private documentHttpService;
15
+ private documentMenuService;
14
16
  private selectionWatcherSubscription;
15
- constructor(documentStore: DocumentStore, documentQuery: DocumentQuery, documentHttpService: DocumentHttpService);
17
+ constructor(documentStore: DocumentStore, documentQuery: DocumentQuery, documentHttpService: DocumentHttpService, documentMenuService: DocumentMenuService);
16
18
  /**
17
19
  * Initialize watcher for selection state changes
18
20
  * @param contextId - The context ID to use for API calls
@@ -148,6 +150,12 @@ export declare class DocumentHelperService {
148
150
  * @param contextId - The context ID to use for the API calls
149
151
  */
150
152
  refreshAllDataWithCurrentFilters(contextId: string): void;
153
+ /**
154
+ * Checks if the currently selected menu item's section is visible in the filtered document list
155
+ * and deselects it if not visible
156
+ * @param contextId - The context ID to use for API calls
157
+ */
158
+ checkAndDeselectMenuItemIfSectionNotVisible(contextId: string): void;
151
159
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentHelperService, never>;
152
160
  static ɵprov: i0.ɵɵInjectableDeclaration<DocumentHelperService>;
153
161
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cat-documents-ng",
3
- "version": "0.3.51",
3
+ "version": "0.3.53",
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
+ }