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.
- package/fesm2022/cat-documents-ng.mjs +416 -205
- package/fesm2022/cat-documents-ng.mjs.map +1 -1
- package/lib/document/components/document-list/document-list.component.d.ts +27 -3
- package/lib/document/components/documents-menu/documents-menu.component.d.ts +10 -0
- package/lib/document/models/document-category.model.d.ts +1 -0
- package/lib/document/services/document-menu.service.d.ts +45 -0
- package/lib/document/services/document.service.d.ts +9 -1
- package/package.json +1 -1
- package/src/assets/config/api.config.json +20 -0
|
@@ -1413,7 +1413,7 @@ class DocumentHttpService {
|
|
|
1413
1413
|
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
1414
1414
|
*/
|
|
1415
1415
|
getDocumentCatagories(contextId) {
|
|
1416
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1416
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1417
1417
|
return this.http.get(`${this.apiUrl}${URLS.DOCUMENTS_CATAGORIES}/${contextId}`, { headers })
|
|
1418
1418
|
.pipe(tap((response) => {
|
|
1419
1419
|
if (response && response.categories) {
|
|
@@ -1457,7 +1457,7 @@ class DocumentHttpService {
|
|
|
1457
1457
|
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
1458
1458
|
*/
|
|
1459
1459
|
getDocumentByFolderID(folderId, contextId) {
|
|
1460
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1460
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1461
1461
|
return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${URLS.PARENT_DOCUMENT_TYPE_ID}${folderId}${URLS.CONTEXT_ID}${contextId}`, { headers }).pipe(tap((records) => {
|
|
1462
1462
|
this.documentStore.set(records);
|
|
1463
1463
|
}), catchError((error) => {
|
|
@@ -1473,7 +1473,7 @@ class DocumentHttpService {
|
|
|
1473
1473
|
* @returns {Observable<DocumentModel>} An observable that emits the updated DocumentModel.
|
|
1474
1474
|
*/
|
|
1475
1475
|
updateDocumentName(documentId, payload) {
|
|
1476
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1476
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1477
1477
|
return this.http.put(`${this.apiUrl}${URLS.ALIAS_NAME}${documentId}`, payload, { headers }).pipe(catchError((error) => {
|
|
1478
1478
|
return throwError(() => new Error(error));
|
|
1479
1479
|
}));
|
|
@@ -1486,7 +1486,7 @@ class DocumentHttpService {
|
|
|
1486
1486
|
getUserListByContextId(contextId) {
|
|
1487
1487
|
if (!contextId)
|
|
1488
1488
|
return EMPTY;
|
|
1489
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1489
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1490
1490
|
return this.http.get(`${this.apiUrl}${URLS.USERLIST}${contextId}`, { headers }).pipe(tap((userList) => {
|
|
1491
1491
|
this.documentStore.setUserList(userList);
|
|
1492
1492
|
}), catchError((error) => {
|
|
@@ -1512,7 +1512,7 @@ class DocumentHttpService {
|
|
|
1512
1512
|
if (categoryId) {
|
|
1513
1513
|
params = params.set(SHARED.CATEGORY, categoryId);
|
|
1514
1514
|
}
|
|
1515
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1515
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1516
1516
|
return this.http.get(url, { params, headers }).pipe(tap((statusData) => {
|
|
1517
1517
|
this.documentStore.setStatusData(statusData);
|
|
1518
1518
|
}), catchError((error) => {
|
|
@@ -1541,7 +1541,7 @@ class DocumentHttpService {
|
|
|
1541
1541
|
if (searchKey) {
|
|
1542
1542
|
params = params.set(SHARED.SEARCH_KEY, searchKey);
|
|
1543
1543
|
}
|
|
1544
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1544
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1545
1545
|
return this.http.get(`${this.apiUrl}${URLS.GETALL}/${contextId}`, { params, headers }).pipe(tap((response) => {
|
|
1546
1546
|
if (response.documents) {
|
|
1547
1547
|
this.documentStore.setDocumentList(response.documents);
|
|
@@ -1554,7 +1554,7 @@ class DocumentHttpService {
|
|
|
1554
1554
|
if (!documentId) {
|
|
1555
1555
|
return of([]);
|
|
1556
1556
|
}
|
|
1557
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1557
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1558
1558
|
return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_HISTORY}${documentId}`, { headers }).pipe(catchError((error) => {
|
|
1559
1559
|
return throwError(() => new Error(error));
|
|
1560
1560
|
}));
|
|
@@ -1567,7 +1567,7 @@ class DocumentHttpService {
|
|
|
1567
1567
|
getCategoriesBySource(source) {
|
|
1568
1568
|
if (!source)
|
|
1569
1569
|
return EMPTY;
|
|
1570
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1570
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1571
1571
|
return this.http.get(`${this.apiUrl}${URLS.GET_CATEGORIES_BY_SOURCE}${source}`, { headers }).pipe(catchError((error) => {
|
|
1572
1572
|
return throwError(() => new Error(error));
|
|
1573
1573
|
}));
|
|
@@ -1580,7 +1580,7 @@ class DocumentHttpService {
|
|
|
1580
1580
|
getDocumentTypesByCategory(categoryId) {
|
|
1581
1581
|
if (!categoryId)
|
|
1582
1582
|
return EMPTY;
|
|
1583
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1583
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1584
1584
|
return this.http.get(`${this.apiUrl}${URLS.GET_DOCUMENT_TYPES_BY_CATEGORY}${categoryId}`, { headers }).pipe(catchError((error) => {
|
|
1585
1585
|
return throwError(() => new Error(error));
|
|
1586
1586
|
}));
|
|
@@ -1591,7 +1591,7 @@ class DocumentHttpService {
|
|
|
1591
1591
|
* @returns {Observable<any>} Observable that emits the upload response.
|
|
1592
1592
|
*/
|
|
1593
1593
|
uploadFile(formData) {
|
|
1594
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1594
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1595
1595
|
return this.http.post(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD_FILE}`, formData, { headers }).pipe(catchError((error) => {
|
|
1596
1596
|
return throwError(() => new Error(error));
|
|
1597
1597
|
}));
|
|
@@ -1602,7 +1602,7 @@ class DocumentHttpService {
|
|
|
1602
1602
|
* @returns {Observable<any>} Observable that emits the save response.
|
|
1603
1603
|
*/
|
|
1604
1604
|
saveDocumentUpload(payload) {
|
|
1605
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1605
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1606
1606
|
return this.http.post(`${this.apiUrl}${URLS.SAVE_DOCUMENT_UPLOAD}`, payload, { headers }).pipe(catchError((error) => {
|
|
1607
1607
|
return throwError(() => new Error(error));
|
|
1608
1608
|
}));
|
|
@@ -1618,7 +1618,7 @@ class DocumentHttpService {
|
|
|
1618
1618
|
const payload = {
|
|
1619
1619
|
statusUpdateDescription: statusUpdateDescription
|
|
1620
1620
|
};
|
|
1621
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1621
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1622
1622
|
return this.http.put(`${this.apiUrl}${URLS.UPDATE_DOCUMENT_STATUS}${documentId}/${status}`, payload, { headers }).pipe(tap((response) => {
|
|
1623
1623
|
if (response && response.status) {
|
|
1624
1624
|
const normalizedStatus = this.normalizeStatus(response.status);
|
|
@@ -1652,7 +1652,7 @@ class DocumentHttpService {
|
|
|
1652
1652
|
* @returns {Observable<any>} Observable that emits the delete response
|
|
1653
1653
|
*/
|
|
1654
1654
|
deleteDocument(documentId, contextId) {
|
|
1655
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1655
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1656
1656
|
return this.http.delete(`${this.apiUrl}${URLS.DELETE_DOCUMENT}${documentId}`, { headers }).pipe(tap(() => {
|
|
1657
1657
|
this.getDocumentCatagories(contextId).subscribe();
|
|
1658
1658
|
this.getUserListByContextId(contextId).subscribe();
|
|
@@ -2014,6 +2014,255 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2014
2014
|
args: [{ providedIn: 'root' }]
|
|
2015
2015
|
}], ctorParameters: () => [{ type: DocumentStore }] });
|
|
2016
2016
|
|
|
2017
|
+
class DocumentMenuService {
|
|
2018
|
+
documentStore;
|
|
2019
|
+
constructor(documentStore) {
|
|
2020
|
+
this.documentStore = documentStore;
|
|
2021
|
+
}
|
|
2022
|
+
/**
|
|
2023
|
+
* Sorts categories alphabetically by label
|
|
2024
|
+
* @param categories - The list of document categories to sort
|
|
2025
|
+
* @returns Sorted categories array
|
|
2026
|
+
*/
|
|
2027
|
+
sortCategoriesAlphabetically(categories) {
|
|
2028
|
+
return [...categories].sort((a, b) => a.label.localeCompare(b.label));
|
|
2029
|
+
}
|
|
2030
|
+
/**
|
|
2031
|
+
* Sorts menu items within each category alphabetically by label
|
|
2032
|
+
* @param categories - The list of document categories to sort
|
|
2033
|
+
* @returns Categories with sorted menu items
|
|
2034
|
+
*/
|
|
2035
|
+
sortMenuItemsAlphabetically(categories) {
|
|
2036
|
+
return categories.map(category => ({
|
|
2037
|
+
...category,
|
|
2038
|
+
items: category.items ? [...category.items].sort((a, b) => a.label.localeCompare(b.label)) : category.items
|
|
2039
|
+
}));
|
|
2040
|
+
}
|
|
2041
|
+
/**
|
|
2042
|
+
* Sorts both categories and their menu items alphabetically
|
|
2043
|
+
* @param categories - The list of document categories to sort
|
|
2044
|
+
* @returns Fully sorted categories array
|
|
2045
|
+
*/
|
|
2046
|
+
sortCategoriesAndMenuItems(categories) {
|
|
2047
|
+
const sortedCategories = this.sortCategoriesAlphabetically(categories);
|
|
2048
|
+
return this.sortMenuItemsAlphabetically(sortedCategories);
|
|
2049
|
+
}
|
|
2050
|
+
/**
|
|
2051
|
+
* Gets the category name for a given menu item _id
|
|
2052
|
+
* @param menuItemId - The _id of the menu item
|
|
2053
|
+
* @param categories - The list of document categories
|
|
2054
|
+
* @returns The category name or null if not found
|
|
2055
|
+
*/
|
|
2056
|
+
getMenuItemCategory(menuItemId, categories) {
|
|
2057
|
+
for (const category of categories) {
|
|
2058
|
+
if (category.items?.some((menuItem) => menuItem._id === menuItemId)) {
|
|
2059
|
+
return category.label;
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
return null;
|
|
2063
|
+
}
|
|
2064
|
+
/**
|
|
2065
|
+
* Gets the menu item by its _id
|
|
2066
|
+
* @param menuItemId - The _id of the menu item
|
|
2067
|
+
* @param categories - The list of document categories
|
|
2068
|
+
* @returns The menu item or null if not found
|
|
2069
|
+
*/
|
|
2070
|
+
getMenuItemById(menuItemId, categories) {
|
|
2071
|
+
for (const category of categories) {
|
|
2072
|
+
if (category.items) {
|
|
2073
|
+
const item = category.items.find((menuItem) => menuItem._id === menuItemId);
|
|
2074
|
+
if (item) {
|
|
2075
|
+
return item;
|
|
2076
|
+
}
|
|
2077
|
+
}
|
|
2078
|
+
}
|
|
2079
|
+
return null;
|
|
2080
|
+
}
|
|
2081
|
+
/**
|
|
2082
|
+
* Handles user list visibility based on menu item category
|
|
2083
|
+
* @param menuItemId - The _id of the menu item
|
|
2084
|
+
* @param categories - The list of document categories
|
|
2085
|
+
*/
|
|
2086
|
+
handleUserListVisibility(menuItemId, categories) {
|
|
2087
|
+
const category = this.getMenuItemCategory(menuItemId, categories);
|
|
2088
|
+
this.documentStore.setShowUserList(true);
|
|
2089
|
+
}
|
|
2090
|
+
/**
|
|
2091
|
+
* Calculates total documents for a menu item
|
|
2092
|
+
* @param item - The menu item
|
|
2093
|
+
* @returns Total number of documents
|
|
2094
|
+
*/
|
|
2095
|
+
getTotalDocuments(item) {
|
|
2096
|
+
const status = item.status;
|
|
2097
|
+
// Handle both uppercase and lowercase keys
|
|
2098
|
+
const pending = status.Pending || status.pending || 0;
|
|
2099
|
+
const reviewing = status.Reviewing || status.reviewing || 0;
|
|
2100
|
+
const accepted = status.Accepted || status.approved || 0; // Note: approved maps to Accepted
|
|
2101
|
+
const rejected = status.Rejected || status.rejected || 0;
|
|
2102
|
+
return pending + reviewing + accepted + rejected;
|
|
2103
|
+
}
|
|
2104
|
+
/**
|
|
2105
|
+
* Gets badge value for a menu item
|
|
2106
|
+
* @param item - The menu item
|
|
2107
|
+
* @returns Badge value string (e.g., "2/3")
|
|
2108
|
+
*/
|
|
2109
|
+
getBadgeValue(item) {
|
|
2110
|
+
const approved = this.getApprovedDocuments(item);
|
|
2111
|
+
const total = this.getTotalDocuments(item);
|
|
2112
|
+
return `${approved}/${total}`;
|
|
2113
|
+
}
|
|
2114
|
+
/**
|
|
2115
|
+
* Gets badge severity based on status
|
|
2116
|
+
* @param item - The menu item
|
|
2117
|
+
* @returns Badge severity for PrimeNG
|
|
2118
|
+
*/
|
|
2119
|
+
getBadgeSeverity(item) {
|
|
2120
|
+
const status = item.status;
|
|
2121
|
+
const total = this.getTotalDocuments(item);
|
|
2122
|
+
const pending = status.Pending || status.pending || 0;
|
|
2123
|
+
const rejected = status.Rejected || status.rejected || 0;
|
|
2124
|
+
const reviewing = status.Reviewing || status.reviewing || 0;
|
|
2125
|
+
const approved = this.getApprovedDocuments(item);
|
|
2126
|
+
if (total === 0)
|
|
2127
|
+
return 'info';
|
|
2128
|
+
if (pending > 0)
|
|
2129
|
+
return 'info';
|
|
2130
|
+
if (rejected > 0)
|
|
2131
|
+
return 'danger';
|
|
2132
|
+
if (reviewing > 0)
|
|
2133
|
+
return 'warning';
|
|
2134
|
+
if (approved === total && total > 0)
|
|
2135
|
+
return 'success';
|
|
2136
|
+
return 'warning';
|
|
2137
|
+
}
|
|
2138
|
+
/**
|
|
2139
|
+
* Checks if badge should be shown for a menu item
|
|
2140
|
+
* @param item - The menu item
|
|
2141
|
+
* @returns True if badge should be shown
|
|
2142
|
+
*/
|
|
2143
|
+
shouldShowBadge(item) {
|
|
2144
|
+
return this.getTotalDocuments(item) > 0;
|
|
2145
|
+
}
|
|
2146
|
+
/**
|
|
2147
|
+
* Calculates approved documents for a menu item
|
|
2148
|
+
* @param item - The menu item
|
|
2149
|
+
* @returns Number of approved documents
|
|
2150
|
+
*/
|
|
2151
|
+
getApprovedDocuments(item) {
|
|
2152
|
+
const status = item.status;
|
|
2153
|
+
// Handle both uppercase and lowercase keys, with approved mapping to Accepted
|
|
2154
|
+
return status.Accepted || status.approved || 0;
|
|
2155
|
+
}
|
|
2156
|
+
/**
|
|
2157
|
+
* Checks if a menu item's section is visible in the filtered document list
|
|
2158
|
+
* @param menuItemId - The ID of the menu item to check
|
|
2159
|
+
* @param documentListResponse - The filtered document list response
|
|
2160
|
+
* @returns True if the section is visible, false otherwise
|
|
2161
|
+
*/
|
|
2162
|
+
isMenuItemSectionVisible(menuItemId, documentListResponse, menuItemLabel) {
|
|
2163
|
+
if (!menuItemId || !documentListResponse || documentListResponse.length === 0) {
|
|
2164
|
+
return false;
|
|
2165
|
+
}
|
|
2166
|
+
return documentListResponse.some(category => {
|
|
2167
|
+
if (!category.label || !category.list || category.list.length === 0) {
|
|
2168
|
+
return false;
|
|
2169
|
+
}
|
|
2170
|
+
const categoryLabelLower = category.label.toLowerCase();
|
|
2171
|
+
if (menuItemLabel) {
|
|
2172
|
+
const menuItemLabelLower = menuItemLabel.toLowerCase();
|
|
2173
|
+
if (categoryLabelLower === menuItemLabelLower) {
|
|
2174
|
+
return true;
|
|
2175
|
+
}
|
|
2176
|
+
if (this.isSmartPartialMatch(menuItemLabelLower, categoryLabelLower)) {
|
|
2177
|
+
return true;
|
|
2178
|
+
}
|
|
2179
|
+
}
|
|
2180
|
+
const menuItemIdLower = menuItemId.toLowerCase();
|
|
2181
|
+
if (this.isSmartPartialMatch(menuItemIdLower, categoryLabelLower)) {
|
|
2182
|
+
return true;
|
|
2183
|
+
}
|
|
2184
|
+
return false;
|
|
2185
|
+
});
|
|
2186
|
+
}
|
|
2187
|
+
/**
|
|
2188
|
+
* Performs smart partial matching to prevent substring conflicts
|
|
2189
|
+
* @param menuLabel - The menu item label to match
|
|
2190
|
+
* @param categoryLabel - The category label to match against
|
|
2191
|
+
* @returns True if it's a valid partial match, false otherwise
|
|
2192
|
+
*/
|
|
2193
|
+
isSmartPartialMatch(menuLabel, categoryLabel) {
|
|
2194
|
+
if (categoryLabel.length > menuLabel.length + 3) {
|
|
2195
|
+
return false;
|
|
2196
|
+
}
|
|
2197
|
+
return categoryLabel.includes(menuLabel) || menuLabel.includes(categoryLabel);
|
|
2198
|
+
}
|
|
2199
|
+
/**
|
|
2200
|
+
* Deselects a menu item if its section is not visible in the filtered document list
|
|
2201
|
+
* @param menuItemId - The ID of the menu item to check
|
|
2202
|
+
* @param documentListResponse - The filtered document list response
|
|
2203
|
+
* @param menuItemLabel - The label of the menu item (optional)
|
|
2204
|
+
* @returns True if the menu item was deselected, false otherwise
|
|
2205
|
+
*/
|
|
2206
|
+
deselectMenuItemIfSectionNotVisible(menuItemId, documentListResponse, menuItemLabel) {
|
|
2207
|
+
if (!this.isMenuItemSectionVisible(menuItemId, documentListResponse, menuItemLabel)) {
|
|
2208
|
+
this.documentStore.setSelectedMenuItem(null);
|
|
2209
|
+
return true;
|
|
2210
|
+
}
|
|
2211
|
+
return false;
|
|
2212
|
+
}
|
|
2213
|
+
/**
|
|
2214
|
+
* Checks if a menu item should be selectable based on the filtered document list
|
|
2215
|
+
* @param menuItemId - The ID of the menu item to check
|
|
2216
|
+
* @param documentListResponse - The filtered document list response
|
|
2217
|
+
* @param menuItemLabel - The label of the menu item (optional)
|
|
2218
|
+
* @returns True if the menu item should be selectable, false otherwise
|
|
2219
|
+
*/
|
|
2220
|
+
isMenuItemSelectable(menuItemId, documentListResponse, menuItemLabel) {
|
|
2221
|
+
return this.isMenuItemSectionVisible(menuItemId, documentListResponse, menuItemLabel);
|
|
2222
|
+
}
|
|
2223
|
+
/**
|
|
2224
|
+
* Gets the selectability status for all menu items in categories
|
|
2225
|
+
* @param categories - The document categories containing menu items
|
|
2226
|
+
* @param documentListResponse - The filtered document list response
|
|
2227
|
+
* @returns Map of menu item IDs to their selectability status
|
|
2228
|
+
*/
|
|
2229
|
+
getMenuItemsSelectabilityStatus(categories, documentListResponse) {
|
|
2230
|
+
const selectabilityMap = new Map();
|
|
2231
|
+
categories.forEach(category => {
|
|
2232
|
+
if (category.items) {
|
|
2233
|
+
category.items.forEach(item => {
|
|
2234
|
+
const isSelectable = this.isMenuItemSelectable(item._id, documentListResponse);
|
|
2235
|
+
selectabilityMap.set(item._id, isSelectable);
|
|
2236
|
+
});
|
|
2237
|
+
}
|
|
2238
|
+
});
|
|
2239
|
+
return selectabilityMap;
|
|
2240
|
+
}
|
|
2241
|
+
/**
|
|
2242
|
+
* Updates menu items with selectability status
|
|
2243
|
+
* @param categories - The document categories containing menu items
|
|
2244
|
+
* @param documentListResponse - The filtered document list response
|
|
2245
|
+
* @returns Updated categories with selectability information
|
|
2246
|
+
*/
|
|
2247
|
+
updateMenuItemsWithSelectabilityStatus(categories, documentListResponse) {
|
|
2248
|
+
return categories.map(category => ({
|
|
2249
|
+
...category,
|
|
2250
|
+
items: category.items?.map(item => ({
|
|
2251
|
+
...item,
|
|
2252
|
+
isSelectable: this.isMenuItemSelectable(item._id, documentListResponse, item.label)
|
|
2253
|
+
}))
|
|
2254
|
+
}));
|
|
2255
|
+
}
|
|
2256
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentMenuService, deps: [{ token: DocumentStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2257
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentMenuService, providedIn: 'root' });
|
|
2258
|
+
}
|
|
2259
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentMenuService, decorators: [{
|
|
2260
|
+
type: Injectable,
|
|
2261
|
+
args: [{
|
|
2262
|
+
providedIn: 'root'
|
|
2263
|
+
}]
|
|
2264
|
+
}], ctorParameters: () => [{ type: DocumentStore }] });
|
|
2265
|
+
|
|
2017
2266
|
/**
|
|
2018
2267
|
* Service to manage the document data and selection state
|
|
2019
2268
|
*/
|
|
@@ -2021,11 +2270,13 @@ class DocumentHelperService {
|
|
|
2021
2270
|
documentStore;
|
|
2022
2271
|
documentQuery;
|
|
2023
2272
|
documentHttpService;
|
|
2273
|
+
documentMenuService;
|
|
2024
2274
|
selectionWatcherSubscription = null;
|
|
2025
|
-
constructor(documentStore, documentQuery, documentHttpService) {
|
|
2275
|
+
constructor(documentStore, documentQuery, documentHttpService, documentMenuService) {
|
|
2026
2276
|
this.documentStore = documentStore;
|
|
2027
2277
|
this.documentQuery = documentQuery;
|
|
2028
2278
|
this.documentHttpService = documentHttpService;
|
|
2279
|
+
this.documentMenuService = documentMenuService;
|
|
2029
2280
|
// Note: initializeSelectionWatcher now requires contextId
|
|
2030
2281
|
// This should be called from the component that has access to contextId
|
|
2031
2282
|
}
|
|
@@ -2197,9 +2448,13 @@ class DocumentHelperService {
|
|
|
2197
2448
|
refreshDocumentsWithCurrentSelection(contextId) {
|
|
2198
2449
|
const currentState = this.documentQuery.getSelectionState();
|
|
2199
2450
|
this.documentHttpService.getDocumentsBySelection(contextId, null, // No menu item filtering
|
|
2200
|
-
currentState.userId, currentState.status).subscribe({
|
|
2451
|
+
currentState.userId, currentState.status, currentState.searchKey).subscribe({
|
|
2201
2452
|
next: (response) => {
|
|
2202
|
-
|
|
2453
|
+
// Set the correct response structure - check if response has documents property
|
|
2454
|
+
const documentListResponse = response.documents || response;
|
|
2455
|
+
this.documentStore.setDocumentListResponse(documentListResponse);
|
|
2456
|
+
// Check if the selected menu item's section is still visible after filtering
|
|
2457
|
+
this.checkAndDeselectMenuItemIfSectionNotVisible(contextId);
|
|
2203
2458
|
},
|
|
2204
2459
|
error: (error) => {
|
|
2205
2460
|
throw new Error(error);
|
|
@@ -2286,164 +2541,31 @@ class DocumentHelperService {
|
|
|
2286
2541
|
});
|
|
2287
2542
|
this.refreshDocumentsWithCurrentSelection(contextId);
|
|
2288
2543
|
}
|
|
2289
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHelperService, deps: [{ token: DocumentStore }, { token: DocumentQuery }, { token: DocumentHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2290
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHelperService, providedIn: 'root' });
|
|
2291
|
-
}
|
|
2292
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHelperService, decorators: [{
|
|
2293
|
-
type: Injectable,
|
|
2294
|
-
args: [{
|
|
2295
|
-
providedIn: 'root',
|
|
2296
|
-
}]
|
|
2297
|
-
}], ctorParameters: () => [{ type: DocumentStore }, { type: DocumentQuery }, { type: DocumentHttpService }] });
|
|
2298
|
-
|
|
2299
|
-
class DocumentMenuService {
|
|
2300
|
-
documentStore;
|
|
2301
|
-
constructor(documentStore) {
|
|
2302
|
-
this.documentStore = documentStore;
|
|
2303
|
-
}
|
|
2304
|
-
/**
|
|
2305
|
-
* Sorts categories alphabetically by label
|
|
2306
|
-
* @param categories - The list of document categories to sort
|
|
2307
|
-
* @returns Sorted categories array
|
|
2308
|
-
*/
|
|
2309
|
-
sortCategoriesAlphabetically(categories) {
|
|
2310
|
-
return [...categories].sort((a, b) => a.label.localeCompare(b.label));
|
|
2311
|
-
}
|
|
2312
|
-
/**
|
|
2313
|
-
* Sorts menu items within each category alphabetically by label
|
|
2314
|
-
* @param categories - The list of document categories to sort
|
|
2315
|
-
* @returns Categories with sorted menu items
|
|
2316
|
-
*/
|
|
2317
|
-
sortMenuItemsAlphabetically(categories) {
|
|
2318
|
-
return categories.map(category => ({
|
|
2319
|
-
...category,
|
|
2320
|
-
items: category.items ? [...category.items].sort((a, b) => a.label.localeCompare(b.label)) : category.items
|
|
2321
|
-
}));
|
|
2322
|
-
}
|
|
2323
|
-
/**
|
|
2324
|
-
* Sorts both categories and their menu items alphabetically
|
|
2325
|
-
* @param categories - The list of document categories to sort
|
|
2326
|
-
* @returns Fully sorted categories array
|
|
2327
|
-
*/
|
|
2328
|
-
sortCategoriesAndMenuItems(categories) {
|
|
2329
|
-
const sortedCategories = this.sortCategoriesAlphabetically(categories);
|
|
2330
|
-
return this.sortMenuItemsAlphabetically(sortedCategories);
|
|
2331
|
-
}
|
|
2332
|
-
/**
|
|
2333
|
-
* Gets the category name for a given menu item _id
|
|
2334
|
-
* @param menuItemId - The _id of the menu item
|
|
2335
|
-
* @param categories - The list of document categories
|
|
2336
|
-
* @returns The category name or null if not found
|
|
2337
|
-
*/
|
|
2338
|
-
getMenuItemCategory(menuItemId, categories) {
|
|
2339
|
-
for (const category of categories) {
|
|
2340
|
-
if (category.items?.some((menuItem) => menuItem._id === menuItemId)) {
|
|
2341
|
-
return category.label;
|
|
2342
|
-
}
|
|
2343
|
-
}
|
|
2344
|
-
return null;
|
|
2345
|
-
}
|
|
2346
2544
|
/**
|
|
2347
|
-
*
|
|
2348
|
-
*
|
|
2349
|
-
* @param
|
|
2350
|
-
* @returns The menu item or null if not found
|
|
2545
|
+
* Checks if the currently selected menu item's section is visible in the filtered document list
|
|
2546
|
+
* and deselects it if not visible
|
|
2547
|
+
* @param contextId - The context ID to use for API calls
|
|
2351
2548
|
*/
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2549
|
+
checkAndDeselectMenuItemIfSectionNotVisible(contextId) {
|
|
2550
|
+
const currentState = this.documentQuery.getSelectionState();
|
|
2551
|
+
const selectedMenuItem = currentState.menuItem;
|
|
2552
|
+
if (selectedMenuItem) {
|
|
2553
|
+
// Get the current document list response
|
|
2554
|
+
const documentListResponse = this.documentQuery.getDocumentListResponse();
|
|
2555
|
+
// Check if the menu item's section is visible and deselect if not
|
|
2556
|
+
const wasDeselected = this.documentMenuService.deselectMenuItemIfSectionNotVisible(selectedMenuItem, documentListResponse);
|
|
2557
|
+
// Menu item was deselected if its section is not visible
|
|
2360
2558
|
}
|
|
2361
|
-
return null;
|
|
2362
|
-
}
|
|
2363
|
-
/**
|
|
2364
|
-
* Handles user list visibility based on menu item category
|
|
2365
|
-
* @param menuItemId - The _id of the menu item
|
|
2366
|
-
* @param categories - The list of document categories
|
|
2367
|
-
*/
|
|
2368
|
-
handleUserListVisibility(menuItemId, categories) {
|
|
2369
|
-
const category = this.getMenuItemCategory(menuItemId, categories);
|
|
2370
|
-
this.documentStore.setShowUserList(true);
|
|
2371
|
-
}
|
|
2372
|
-
/**
|
|
2373
|
-
* Calculates total documents for a menu item
|
|
2374
|
-
* @param item - The menu item
|
|
2375
|
-
* @returns Total number of documents
|
|
2376
|
-
*/
|
|
2377
|
-
getTotalDocuments(item) {
|
|
2378
|
-
const status = item.status;
|
|
2379
|
-
// Handle both uppercase and lowercase keys
|
|
2380
|
-
const pending = status.Pending || status.pending || 0;
|
|
2381
|
-
const reviewing = status.Reviewing || status.reviewing || 0;
|
|
2382
|
-
const accepted = status.Accepted || status.approved || 0; // Note: approved maps to Accepted
|
|
2383
|
-
const rejected = status.Rejected || status.rejected || 0;
|
|
2384
|
-
return pending + reviewing + accepted + rejected;
|
|
2385
|
-
}
|
|
2386
|
-
/**
|
|
2387
|
-
* Gets badge value for a menu item
|
|
2388
|
-
* @param item - The menu item
|
|
2389
|
-
* @returns Badge value string (e.g., "2/3")
|
|
2390
|
-
*/
|
|
2391
|
-
getBadgeValue(item) {
|
|
2392
|
-
const approved = this.getApprovedDocuments(item);
|
|
2393
|
-
const total = this.getTotalDocuments(item);
|
|
2394
|
-
return `${approved}/${total}`;
|
|
2395
|
-
}
|
|
2396
|
-
/**
|
|
2397
|
-
* Gets badge severity based on status
|
|
2398
|
-
* @param item - The menu item
|
|
2399
|
-
* @returns Badge severity for PrimeNG
|
|
2400
|
-
*/
|
|
2401
|
-
getBadgeSeverity(item) {
|
|
2402
|
-
const status = item.status;
|
|
2403
|
-
const total = this.getTotalDocuments(item);
|
|
2404
|
-
const pending = status.Pending || status.pending || 0;
|
|
2405
|
-
const rejected = status.Rejected || status.rejected || 0;
|
|
2406
|
-
const reviewing = status.Reviewing || status.reviewing || 0;
|
|
2407
|
-
const approved = this.getApprovedDocuments(item);
|
|
2408
|
-
if (total === 0)
|
|
2409
|
-
return 'info';
|
|
2410
|
-
if (pending > 0)
|
|
2411
|
-
return 'info';
|
|
2412
|
-
if (rejected > 0)
|
|
2413
|
-
return 'danger';
|
|
2414
|
-
if (reviewing > 0)
|
|
2415
|
-
return 'warning';
|
|
2416
|
-
if (approved === total && total > 0)
|
|
2417
|
-
return 'success';
|
|
2418
|
-
return 'warning';
|
|
2419
2559
|
}
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
* @param item - The menu item
|
|
2423
|
-
* @returns True if badge should be shown
|
|
2424
|
-
*/
|
|
2425
|
-
shouldShowBadge(item) {
|
|
2426
|
-
return this.getTotalDocuments(item) > 0;
|
|
2427
|
-
}
|
|
2428
|
-
/**
|
|
2429
|
-
* Calculates approved documents for a menu item
|
|
2430
|
-
* @param item - The menu item
|
|
2431
|
-
* @returns Number of approved documents
|
|
2432
|
-
*/
|
|
2433
|
-
getApprovedDocuments(item) {
|
|
2434
|
-
const status = item.status;
|
|
2435
|
-
// Handle both uppercase and lowercase keys, with approved mapping to Accepted
|
|
2436
|
-
return status.Accepted || status.approved || 0;
|
|
2437
|
-
}
|
|
2438
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentMenuService, deps: [{ token: DocumentStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2439
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentMenuService, providedIn: 'root' });
|
|
2560
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHelperService, deps: [{ token: DocumentStore }, { token: DocumentQuery }, { token: DocumentHttpService }, { token: DocumentMenuService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2561
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHelperService, providedIn: 'root' });
|
|
2440
2562
|
}
|
|
2441
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type:
|
|
2563
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHelperService, decorators: [{
|
|
2442
2564
|
type: Injectable,
|
|
2443
2565
|
args: [{
|
|
2444
|
-
providedIn: 'root'
|
|
2566
|
+
providedIn: 'root',
|
|
2445
2567
|
}]
|
|
2446
|
-
}], ctorParameters: () => [{ type: DocumentStore }] });
|
|
2568
|
+
}], ctorParameters: () => [{ type: DocumentStore }, { type: DocumentQuery }, { type: DocumentHttpService }, { type: DocumentMenuService }] });
|
|
2447
2569
|
|
|
2448
2570
|
/**
|
|
2449
2571
|
* Service for managing document-related operations.
|
|
@@ -7970,7 +8092,6 @@ class DocumentViewerComponent {
|
|
|
7970
8092
|
*/
|
|
7971
8093
|
onDocumentSelected(document) {
|
|
7972
8094
|
if (document && document.documentUrl && document.docName) {
|
|
7973
|
-
// Create a temporary document object for the viewer
|
|
7974
8095
|
const tempDocument = {
|
|
7975
8096
|
_id: document._id,
|
|
7976
8097
|
docName: document.docName,
|
|
@@ -7979,11 +8100,13 @@ class DocumentViewerComponent {
|
|
|
7979
8100
|
contentType: document.contentType,
|
|
7980
8101
|
status: document.status,
|
|
7981
8102
|
isUploaded: true,
|
|
8103
|
+
isAliasEditable: document.isAliasEditable,
|
|
8104
|
+
parentDocumentId: document.parentDocumentId,
|
|
8105
|
+
aliasName: document.aliasName,
|
|
7982
8106
|
fileSize: '0',
|
|
7983
|
-
uploadedOn: new Date().toISOString(),
|
|
7984
|
-
ownerName: 'History Document'
|
|
8107
|
+
uploadedOn: new Date().toISOString(),
|
|
8108
|
+
ownerName: 'History Document'
|
|
7985
8109
|
};
|
|
7986
|
-
// Update the selected document to show in the viewer
|
|
7987
8110
|
this.selectedDocument = tempDocument;
|
|
7988
8111
|
}
|
|
7989
8112
|
}
|
|
@@ -8260,15 +8383,12 @@ class DocumentListComponent {
|
|
|
8260
8383
|
this.documentListService.handleDeleteAction(rowData, this.contextId)
|
|
8261
8384
|
.subscribe({
|
|
8262
8385
|
next: (response) => {
|
|
8263
|
-
console.log('response', response);
|
|
8264
8386
|
if (this.selectedDocument && this.selectedDocument._id === rowData._id) {
|
|
8265
8387
|
this.handleCloseModal();
|
|
8266
8388
|
}
|
|
8267
8389
|
this.documentListService.refreshAllDataWithCurrentFilters(this.contextId);
|
|
8268
8390
|
},
|
|
8269
8391
|
error: (error) => {
|
|
8270
|
-
console.error(ERRORS.ERROR_FETCHING_DOCUMENTS, error);
|
|
8271
|
-
// Show error message without closing dialog
|
|
8272
8392
|
this.showDeleteErrorMessage(error);
|
|
8273
8393
|
}
|
|
8274
8394
|
});
|
|
@@ -8349,7 +8469,6 @@ class DocumentListComponent {
|
|
|
8349
8469
|
* Triggers a refresh of the document data
|
|
8350
8470
|
*/
|
|
8351
8471
|
handleViewerDestroyed() {
|
|
8352
|
-
// Refresh document data when viewer is closed
|
|
8353
8472
|
this.documentListService.refreshDocumentList(this.contextId);
|
|
8354
8473
|
}
|
|
8355
8474
|
/**
|
|
@@ -8361,20 +8480,12 @@ class DocumentListComponent {
|
|
|
8361
8480
|
return;
|
|
8362
8481
|
}
|
|
8363
8482
|
this.documentScrollService.setScrolling();
|
|
8364
|
-
let targetCategory = this.
|
|
8365
|
-
category.label.toLowerCase().includes(SHARED.APPLICANT_LOWERCASE) ||
|
|
8366
|
-
category.label.toLowerCase().includes(SHARED.DOCUMENT_LOWERCASE));
|
|
8483
|
+
let targetCategory = this.findCategoryByMenuItemId(menuItemId);
|
|
8367
8484
|
if (!targetCategory) {
|
|
8368
|
-
|
|
8369
|
-
|
|
8370
|
-
|
|
8371
|
-
|
|
8372
|
-
targetCategory = this.documentCategories.find(cat => cat.label.toLowerCase().includes(SHARED.APPLICANT_LOWERCASE) ||
|
|
8373
|
-
cat.label.toLowerCase().includes(SHARED.USER_LOWERCASE));
|
|
8374
|
-
}
|
|
8375
|
-
else {
|
|
8376
|
-
targetCategory = this.documentCategories[0];
|
|
8377
|
-
}
|
|
8485
|
+
targetCategory = this.findCategoryByLegacyMatching(menuItemId);
|
|
8486
|
+
}
|
|
8487
|
+
if (!targetCategory) {
|
|
8488
|
+
targetCategory = this.documentCategories[0];
|
|
8378
8489
|
}
|
|
8379
8490
|
if (targetCategory) {
|
|
8380
8491
|
const categoryIndex = this.documentCategories.findIndex(cat => cat === targetCategory);
|
|
@@ -8391,6 +8502,61 @@ class DocumentListComponent {
|
|
|
8391
8502
|
}
|
|
8392
8503
|
}
|
|
8393
8504
|
}
|
|
8505
|
+
/**
|
|
8506
|
+
* Finds category by converting menuItemId to readable format and matching exactly
|
|
8507
|
+
* @param menuItemId - The menu item ID to match
|
|
8508
|
+
* @returns The matching category or null
|
|
8509
|
+
*/
|
|
8510
|
+
findCategoryByMenuItemId(menuItemId) {
|
|
8511
|
+
const readableLabel = this.convertMenuItemIdToReadableLabel(menuItemId);
|
|
8512
|
+
let targetCategory = this.documentCategories.find(category => category.label.toLowerCase() === readableLabel.toLowerCase());
|
|
8513
|
+
if (!targetCategory) {
|
|
8514
|
+
targetCategory = this.documentCategories.find(category => {
|
|
8515
|
+
const categoryLabel = category.label.toLowerCase();
|
|
8516
|
+
const menuLabel = readableLabel.toLowerCase();
|
|
8517
|
+
return categoryLabel.includes(menuLabel) &&
|
|
8518
|
+
!this.isSubstringOfLongerCategory(menuLabel, categoryLabel);
|
|
8519
|
+
});
|
|
8520
|
+
}
|
|
8521
|
+
return targetCategory || null;
|
|
8522
|
+
}
|
|
8523
|
+
/**
|
|
8524
|
+
* Converts menuItemId to readable label format
|
|
8525
|
+
* @param menuItemId - The menu item ID
|
|
8526
|
+
* @returns Readable label
|
|
8527
|
+
*/
|
|
8528
|
+
convertMenuItemIdToReadableLabel(menuItemId) {
|
|
8529
|
+
// Convert kebab-case or snake_case to Title Case
|
|
8530
|
+
return menuItemId
|
|
8531
|
+
.replace(/[-_]/g, ' ')
|
|
8532
|
+
.replace(/\b\w/g, l => l.toUpperCase());
|
|
8533
|
+
}
|
|
8534
|
+
/**
|
|
8535
|
+
* Checks if a menu label is a substring of a longer category name
|
|
8536
|
+
* @param menuLabel - The menu label to check
|
|
8537
|
+
* @param categoryLabel - The category label to check against
|
|
8538
|
+
* @returns True if menuLabel is a substring of a longer category
|
|
8539
|
+
*/
|
|
8540
|
+
isSubstringOfLongerCategory(menuLabel, categoryLabel) {
|
|
8541
|
+
// If the category is significantly longer than the menu item, it's likely a substring
|
|
8542
|
+
return categoryLabel.length > menuLabel.length + 3; // Allow some tolerance
|
|
8543
|
+
}
|
|
8544
|
+
/**
|
|
8545
|
+
* Legacy matching for backward compatibility with existing hardcoded keywords
|
|
8546
|
+
* @param menuItemId - The menu item ID
|
|
8547
|
+
* @returns The matching category or null
|
|
8548
|
+
*/
|
|
8549
|
+
findCategoryByLegacyMatching(menuItemId) {
|
|
8550
|
+
// Legacy matching for specific hardcoded keywords
|
|
8551
|
+
if (menuItemId.includes(SHARED.APPLICATION_LOWERCASE)) {
|
|
8552
|
+
return this.documentCategories.find(cat => cat.label.toLowerCase().includes(SHARED.APPLICATION_LOWERCASE)) || null;
|
|
8553
|
+
}
|
|
8554
|
+
else if (menuItemId.includes(SHARED.APPLICANT_LOWERCASE) || menuItemId.includes(SHARED.USER_LOWERCASE)) {
|
|
8555
|
+
return this.documentCategories.find(cat => cat.label.toLowerCase().includes(SHARED.APPLICANT_LOWERCASE) ||
|
|
8556
|
+
cat.label.toLowerCase().includes(SHARED.USER_LOWERCASE)) || null;
|
|
8557
|
+
}
|
|
8558
|
+
return null;
|
|
8559
|
+
}
|
|
8394
8560
|
/**
|
|
8395
8561
|
* Scrolls to the category section using navigationInfo
|
|
8396
8562
|
* @param navigationInfo - The navigation info object containing menuItemId
|
|
@@ -8412,9 +8578,7 @@ class DocumentListComponent {
|
|
|
8412
8578
|
inline: 'nearest'
|
|
8413
8579
|
});
|
|
8414
8580
|
this.highlightCategory(targetElement);
|
|
8415
|
-
// Setup observer to deselect menu item when section scrolls out of view
|
|
8416
8581
|
this.documentScrollService.setupSectionObserver(targetElement, this.selectedMenuItemId);
|
|
8417
|
-
// Reset scrolling flag after smooth scroll completes
|
|
8418
8582
|
this.documentScrollService.resetScrollingAfterDelay(1200);
|
|
8419
8583
|
}
|
|
8420
8584
|
else {
|
|
@@ -8494,26 +8658,26 @@ class DocumentListComponent {
|
|
|
8494
8658
|
* Checks if the selected menu item's section is still visible and deselects if not
|
|
8495
8659
|
*/
|
|
8496
8660
|
handleDocumentListFilteringChange() {
|
|
8497
|
-
if (this.selectedMenuItemId && this.documentCategories
|
|
8498
|
-
|
|
8661
|
+
if (this.selectedMenuItemId && this.documentCategories) {
|
|
8662
|
+
// If no categories are available (all filtered out), deselect the menu item
|
|
8663
|
+
if (this.documentCategories.length === 0) {
|
|
8664
|
+
this.deselectMenuItemAndReset();
|
|
8665
|
+
return;
|
|
8666
|
+
}
|
|
8667
|
+
// Use the document menu service to check visibility
|
|
8668
|
+
const isSectionVisible = this.documentMenuService.isMenuItemSectionVisible(this.selectedMenuItemId, this.documentListResponse);
|
|
8499
8669
|
if (!isSectionVisible) {
|
|
8500
|
-
this.
|
|
8501
|
-
this.documentStore.setSelectedMenuItem(null);
|
|
8502
|
-
this.resetToTop();
|
|
8670
|
+
this.deselectMenuItemAndReset();
|
|
8503
8671
|
}
|
|
8504
8672
|
}
|
|
8505
8673
|
}
|
|
8506
8674
|
/**
|
|
8507
|
-
*
|
|
8508
|
-
* @returns True if the section is visible, false otherwise
|
|
8675
|
+
* Deselects the current menu item and resets the view
|
|
8509
8676
|
*/
|
|
8510
|
-
|
|
8511
|
-
|
|
8512
|
-
|
|
8513
|
-
|
|
8514
|
-
return this.documentCategories.some(category => category.label && this.selectedMenuItemId &&
|
|
8515
|
-
(category.label.toLowerCase().includes(this.selectedMenuItemId.toLowerCase()) ||
|
|
8516
|
-
this.selectedMenuItemId.toLowerCase().includes(category.label.toLowerCase())));
|
|
8677
|
+
deselectMenuItemAndReset() {
|
|
8678
|
+
this.selectedMenuItemId = null;
|
|
8679
|
+
this.documentStore.setSelectedMenuItem(null);
|
|
8680
|
+
this.resetToTop();
|
|
8517
8681
|
}
|
|
8518
8682
|
/**
|
|
8519
8683
|
* Cleanup subscriptions on component destroy
|
|
@@ -8566,6 +8730,7 @@ class DocumentsMenuComponent {
|
|
|
8566
8730
|
// Subscriptions to track for cleanup
|
|
8567
8731
|
selectedMenuItemSubscription;
|
|
8568
8732
|
documentCategoriesSubscription;
|
|
8733
|
+
documentListResponseSubscription;
|
|
8569
8734
|
constructor(documentStore, documentQuery, documentMenuService, documentHelperService) {
|
|
8570
8735
|
this.documentStore = documentStore;
|
|
8571
8736
|
this.documentQuery = documentQuery;
|
|
@@ -8590,6 +8755,8 @@ class DocumentsMenuComponent {
|
|
|
8590
8755
|
this.updateMenuItemsData();
|
|
8591
8756
|
}
|
|
8592
8757
|
});
|
|
8758
|
+
// Subscribe to document list response to update menu item selectability
|
|
8759
|
+
this.setupDocumentListResponseSubscription();
|
|
8593
8760
|
}
|
|
8594
8761
|
/**
|
|
8595
8762
|
* Handle changes to input properties
|
|
@@ -8673,16 +8840,57 @@ class DocumentsMenuComponent {
|
|
|
8673
8840
|
shouldShowBadge: this.documentMenuService.shouldShowBadge(item)
|
|
8674
8841
|
};
|
|
8675
8842
|
item.menuData = menuData;
|
|
8843
|
+
// Initialize isSelectable as true (default state)
|
|
8844
|
+
if (item.isSelectable === undefined) {
|
|
8845
|
+
item.isSelectable = true;
|
|
8846
|
+
}
|
|
8676
8847
|
});
|
|
8677
8848
|
}
|
|
8678
8849
|
});
|
|
8679
8850
|
}
|
|
8851
|
+
/**
|
|
8852
|
+
* Sets up subscription to document list response to update menu item selectability
|
|
8853
|
+
*/
|
|
8854
|
+
setupDocumentListResponseSubscription() {
|
|
8855
|
+
this.documentListResponseSubscription = this.documentQuery.selectDocumentListResponse().subscribe(documentListResponse => {
|
|
8856
|
+
this.updateMenuItemsSelectability(documentListResponse);
|
|
8857
|
+
});
|
|
8858
|
+
}
|
|
8859
|
+
/**
|
|
8860
|
+
* Updates menu items with selectability status based on filtered document list
|
|
8861
|
+
* @param documentListResponse - The filtered document list response
|
|
8862
|
+
*/
|
|
8863
|
+
updateMenuItemsSelectability(documentListResponse) {
|
|
8864
|
+
if (this._cachedCategories && this._cachedCategories.length > 0) {
|
|
8865
|
+
// Only update if we have a valid response (not null/undefined)
|
|
8866
|
+
// If response is null, it means no filters are applied, so all items should be selectable
|
|
8867
|
+
if (documentListResponse !== null && documentListResponse !== undefined) {
|
|
8868
|
+
this._cachedCategories = this.documentMenuService.updateMenuItemsWithSelectabilityStatus(this._cachedCategories, documentListResponse);
|
|
8869
|
+
}
|
|
8870
|
+
else {
|
|
8871
|
+
// If no response, make all items selectable (default state)
|
|
8872
|
+
this._cachedCategories = this._cachedCategories.map(category => ({
|
|
8873
|
+
...category,
|
|
8874
|
+
items: category.items?.map(item => ({
|
|
8875
|
+
...item,
|
|
8876
|
+
isSelectable: true
|
|
8877
|
+
}))
|
|
8878
|
+
}));
|
|
8879
|
+
}
|
|
8880
|
+
}
|
|
8881
|
+
}
|
|
8680
8882
|
/**
|
|
8681
8883
|
* Handle the menu item click for navigation
|
|
8682
8884
|
* @param {*} event - Event
|
|
8683
8885
|
* @param {DocumentCategoryItem} item - catagory item
|
|
8684
8886
|
*/
|
|
8685
8887
|
onMenuItemClick(event, item) {
|
|
8888
|
+
// Prevent selection if the menu item is not selectable
|
|
8889
|
+
if (item.isSelectable === false) {
|
|
8890
|
+
event.preventDefault();
|
|
8891
|
+
event.stopPropagation();
|
|
8892
|
+
return;
|
|
8893
|
+
}
|
|
8686
8894
|
if (this.selectedMenuItemId === item._id) {
|
|
8687
8895
|
this.selectedMenuItem = null;
|
|
8688
8896
|
this.selectedMenuItemId = null;
|
|
@@ -8747,13 +8955,16 @@ class DocumentsMenuComponent {
|
|
|
8747
8955
|
if (this.documentCategoriesSubscription) {
|
|
8748
8956
|
this.documentCategoriesSubscription.unsubscribe();
|
|
8749
8957
|
}
|
|
8958
|
+
if (this.documentListResponseSubscription) {
|
|
8959
|
+
this.documentListResponseSubscription.unsubscribe();
|
|
8960
|
+
}
|
|
8750
8961
|
}
|
|
8751
8962
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentsMenuComponent, deps: [{ token: DocumentStore }, { token: DocumentQuery }, { token: DocumentMenuService }, { token: DocumentHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
8752
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: DocumentsMenuComponent, isStandalone: false, selector: "lib-documents-menu", inputs: { catagories: "catagories", applicationNumber: "applicationNumber", contextId: "contextId" }, outputs: { menuItemSelected: "menuItemSelected" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"document-sidebar-container h-full\">\r\n <!-- Menu items are now used for navigation to specific sections, not for filtering documents -->\r\n <p-card class=\"widget-menu-wrapper h-full\">\r\n @if(applicationNumber){\r\n <div class=\"flex align-items-center justify-content-between widget-menu-header-wrapper\">\r\n <p class=\"mb-0 application-title-wrapper\">ID - {{applicationNumber}}</p>\r\n <div class=\"expand-icon-wrapper\">\r\n <i class=\"ri-arrow-left-s-line text-primary flex align-items-center justify-content-center w-full h-full\"></i>\r\n </div>\r\n </div>\r\n }\r\n\r\n <div class=\"widget-menu-container\" >\r\n <div class=\"widget-menu-wrapper h-ful l custom-scroll\">\r\n <p-menu [model]=\"categories\" styleClass=\"w-full md:w-15rem\">\r\n <ng-template pTemplate=\"submenuheader\" let-item>\r\n <span [style]=\"{\r\n color : '#9EA0B3'\r\n }\">{{ item.label }} Documents</span>\r\n </ng-template>\r\n <ng-template pTemplate=\"item\" let-item>\r\n <a pRipple \r\n class=\"flex align-items-center p-menuitem-link\"\r\n [class.selected-menu-item]=\"selectedMenuItemId === item._id\"\r\n (click)=\"onMenuItemClick($event, item)\">\r\n <span [class]=\"item.icon\" class=\"text-xl\"></span>\r\n <span class=\"ml-2\">{{ item.label }}</span>\r\n <p-badge *ngIf=\"item.menuData?.shouldShowBadge\" \r\n class=\"ml-auto\" \r\n [severity]=\"item.menuData?.badgeSeverity\" \r\n [value]=\"item.menuData?.badgeValue\" />\r\n </a>\r\n </ng-template>\r\n </p-menu>\r\n </div>\r\n </div>\r\n </p-card>\r\n</div>\r\n\r\n ", styles: [".expand-icon-wrapper{border:1px solid var(--primary-color);height:24px;width:24px;border-radius:50%;background:var(--blue-bg-light)}::ng-deep .p-badge.p-badge-success{background-color:#dcfce7;color:#16a34a;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-badge.p-badge-danger{background-color:#fee2e2;color:#dc2626;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-badge.p-badge-warning{background-color:#fef3c7;color:#d97706;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-badge.p-badge-info{background-color:#e5e7eb;color:#000;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-menu .p-menuitem>.p-menuitem-content .p-menuitem-link{color:#1f2937}@media screen and (min-width: 768px){::ng-deep .md\\:w-15rem{width:100%!important}}::ng-deep .p-menu{border:none}::ng-deep .custom-scroll{scrollbar-gutter:inherit}::ng-deep .selected-menu-item{background-color:#0066ff1a!important;color:var(--primary-color)!important;border:1px solid rgba(68,72,109,.1)!important;border-radius:10px!important}::ng-deep .selected-menu-item .text-xl{color:var(--primary-color)!important}::ng-deep .p-menuitem-link:not(.selected-menu-item){background-color:#fff!important;border:none!important;border-radius:0!important}::ng-deep .p-menuitem-link:not(.selected-menu-item) .text-xl{color:var(--text-color)!important}::ng-deep .p-panelmenu .p-panelmenu-content{border:none!important}.application-title-wrapper{color:#9ea0b3;font-weight:500}.widget-menu-wrapper{margin-top:8px}.widget-menu-header-wrapper{padding:4px 4px 4px 16px}.widget-menu-container{overflow-y:auto;overflow-x:hidden}.custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}::ng-deep .document-sidebar-container .p-card{height:100%;box-shadow:none}::ng-deep .document-sidebar-container .p-card .p-card-content{height:100%;padding:0!important}::ng-deep .document-sidebar-container .p-card .p-card-body{height:100%;width:100%;padding:12px 8px;border-radius:10px;border:1px solid #e5e7eb}::ng-deep .document-sidebar-container .widget-menu-wrapper .p-panelmenu-panel .p-panelmenu-expanded .p-panelmenu-content{border:none!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content{border:none;color:var(--text-color);font-weight:400!important;background-color:var(--surface-0)!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-panelmenu-header-action{color:var(--text-color);font-weight:400!important;position:relative;padding:12px}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-panelmenu-header-action .p-icon-wrapper{position:absolute;right:0;top:16px;margin-right:7px;transform:rotate(90deg)!important;transition:none!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-panelmenu-header-action .p-menuitem-text{max-width:75%;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-menuitem-link-active{border:1px solid rgba(68,72,109,.1);border-radius:10px;padding:12px;color:var(--primary-color);background-color:#0066ff1a!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-menuitem-link-active .p-menuitem-icon{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-menuitem-link-active .p-menuitem-text{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .company-action-wrapper:not(.p-disabled).p-highlight .p-panelmenu-header-content{margin:12px 0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .no-highlight.p-panelmenu-header:not(.p-disabled).p-highlight .p-panelmenu-header-content{background-color:transparent!important;border-radius:10px;padding:12px;border-bottom:0!important;border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .no-highlight.p-panelmenu-header:not(.p-disabled).p-highlight .p-panelmenu-header-content .p-panelmenu-header-action{padding:0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .no-highlight.p-panelmenu-header:not(.p-disabled).p-highlight .p-panelmenu-header-content .p-panelmenu-header-action .p-icon-wrapper{transform:rotate(180deg)!important;transition:none!important;top:0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link{background-color:#fff!important;color:var(--text-color);padding:12px 6px!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link .p-menuitem-text{max-width:75%;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link-active{border:1px solid rgba(68,72,109,.1);border-radius:10px;padding:12px;color:var(--primary-color);box-shadow:none!important;background-color:#0066ff1a!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link-active .p-menuitem-icon{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link-active .p-menuitem-text{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem.p-focus>.p-menuitem-content{background-color:#fff!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem:not(.p-focus)>.p-menuitem-content .p-menuitem-link{background-color:#fff!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link:not(.selected-menu-item){background-color:#fff!important;border:none!important;border-radius:0!important;color:var(--text-color)!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link:not(.selected-menu-item) .p-menuitem-icon{color:var(--text-color)!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link:not(.selected-menu-item) .p-menuitem-text{color:var(--text-color)!important}::ng-deep .widget-menu-wrapper .p-panelmenu-panel .p-panelmenu-expanded .p-panelmenu-content{border:1px solid rgba(68,72,109,.1)!important;border-top:0!important;border-bottom-left-radius:10px;border-bottom-right-radius:10px}::ng-deep .widget-menu-wrapper .p-panelmenu-panel .widget-separator{border-top:1px solid rgba(68,72,109,.1)!important}::ng-deep .widget-menu-wrapper .p-panelmenu-panel .widget-separator .p-panelmenu-header-content .p-panelmenu-header-action{padding:0!important}.no-documents-message{padding:12px 16px;text-align:center}.no-documents-message .text-muted{color:#9ea0b3;font-size:14px;font-style:italic}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i9$1.Badge, selector: "p-badge", inputs: ["styleClass", "style", "badgeSize", "severity", "value", "badgeDisabled", "size"] }, { kind: "component", type: i8$2.Menu, selector: "p-menu", inputs: ["model", "popup", "style", "styleClass", "appendTo", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaLabel", "ariaLabelledBy", "id", "tabindex"], outputs: ["onShow", "onHide", "onBlur", "onFocus"] }, { kind: "component", type: i9$2.Card, selector: "p-card", inputs: ["header", "subheader", "style", "styleClass"] }] });
|
|
8963
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: DocumentsMenuComponent, isStandalone: false, selector: "lib-documents-menu", inputs: { catagories: "catagories", applicationNumber: "applicationNumber", contextId: "contextId" }, outputs: { menuItemSelected: "menuItemSelected" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"document-sidebar-container h-full\">\n <!-- Menu items are now used for navigation to specific sections, not for filtering documents -->\n <p-card class=\"widget-menu-wrapper h-full\">\n @if(applicationNumber){\n <div class=\"flex align-items-center justify-content-between widget-menu-header-wrapper\">\n <p class=\"mb-0 application-title-wrapper\">ID - {{applicationNumber}}</p>\n <div class=\"expand-icon-wrapper\">\n <i class=\"ri-arrow-left-s-line text-primary flex align-items-center justify-content-center w-full h-full\"></i>\n </div>\n </div>\n }\n\n <div class=\"widget-menu-container\" >\n <div class=\"widget-menu-wrapper h-ful l custom-scroll\">\n <p-menu [model]=\"categories\" styleClass=\"w-full md:w-15rem\">\n <ng-template pTemplate=\"submenuheader\" let-item>\n <span [style]=\"{\n color : '#9EA0B3'\n }\">{{ item.label }} Documents</span>\n </ng-template>\n <ng-template pTemplate=\"item\" let-item>\n <a pRipple \n class=\"flex align-items-center p-menuitem-link\"\n [class.selected-menu-item]=\"selectedMenuItemId === item._id\"\n [class.disabled-menu-item]=\"item.isSelectable === false\"\n [class.pointer-events-none]=\"item.isSelectable === false\"\n [style.opacity]=\"item.isSelectable === false ? '0.5' : '1'\"\n [style.cursor]=\"item.isSelectable === false ? 'not-allowed' : 'pointer'\"\n (click)=\"onMenuItemClick($event, item)\">\n <span [class]=\"item.icon\" class=\"text-xl\"></span>\n <span class=\"ml-2\">{{ item.label }}</span>\n <p-badge *ngIf=\"item.menuData?.shouldShowBadge\" \n class=\"ml-auto\" \n [severity]=\"item.menuData?.badgeSeverity\" \n [value]=\"item.menuData?.badgeValue\" />\n </a>\n </ng-template>\n </p-menu>\n </div>\n </div>\n </p-card>\n</div>\n\n ", styles: [".expand-icon-wrapper{border:1px solid var(--primary-color);height:24px;width:24px;border-radius:50%;background:var(--blue-bg-light)}::ng-deep .p-badge.p-badge-success{background-color:#dcfce7;color:#16a34a;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-badge.p-badge-danger{background-color:#fee2e2;color:#dc2626;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-badge.p-badge-warning{background-color:#fef3c7;color:#d97706;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-badge.p-badge-info{background-color:#e5e7eb;color:#000;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-menu .p-menuitem>.p-menuitem-content .p-menuitem-link{color:#1f2937}@media screen and (min-width: 768px){::ng-deep .md\\:w-15rem{width:100%!important}}::ng-deep .p-menu{border:none}::ng-deep .custom-scroll{scrollbar-gutter:inherit}::ng-deep .selected-menu-item{background-color:#0066ff1a!important;color:var(--primary-color)!important;border:1px solid rgba(68,72,109,.1)!important;border-radius:10px!important}::ng-deep .selected-menu-item .text-xl{color:var(--primary-color)!important}::ng-deep .disabled-menu-item{opacity:.5!important;cursor:not-allowed!important;pointer-events:none!important}::ng-deep .disabled-menu-item .text-xl{color:#9ea0b3!important}::ng-deep .disabled-menu-item .ml-2{color:#9ea0b3!important}::ng-deep .disabled-menu-item .p-badge{opacity:.5!important}::ng-deep .p-menuitem-link:not(.selected-menu-item){background-color:#fff!important;border:none!important;border-radius:0!important}::ng-deep .p-menuitem-link:not(.selected-menu-item) .text-xl{color:var(--text-color)!important}::ng-deep .p-panelmenu .p-panelmenu-content{border:none!important}.application-title-wrapper{color:#9ea0b3;font-weight:500}.widget-menu-wrapper{margin-top:8px}.widget-menu-header-wrapper{padding:4px 4px 4px 16px}.widget-menu-container{overflow-y:auto;overflow-x:hidden}.custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}::ng-deep .document-sidebar-container .p-card{height:100%;box-shadow:none}::ng-deep .document-sidebar-container .p-card .p-card-content{height:100%;padding:0!important}::ng-deep .document-sidebar-container .p-card .p-card-body{height:100%;width:100%;padding:12px 8px;border-radius:10px;border:1px solid #e5e7eb}::ng-deep .document-sidebar-container .widget-menu-wrapper .p-panelmenu-panel .p-panelmenu-expanded .p-panelmenu-content{border:none!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content{border:none;color:var(--text-color);font-weight:400!important;background-color:var(--surface-0)!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-panelmenu-header-action{color:var(--text-color);font-weight:400!important;position:relative;padding:12px}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-panelmenu-header-action .p-icon-wrapper{position:absolute;right:0;top:16px;margin-right:7px;transform:rotate(90deg)!important;transition:none!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-panelmenu-header-action .p-menuitem-text{max-width:75%;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-menuitem-link-active{border:1px solid rgba(68,72,109,.1);border-radius:10px;padding:12px;color:var(--primary-color);background-color:#0066ff1a!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-menuitem-link-active .p-menuitem-icon{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-menuitem-link-active .p-menuitem-text{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .company-action-wrapper:not(.p-disabled).p-highlight .p-panelmenu-header-content{margin:12px 0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .no-highlight.p-panelmenu-header:not(.p-disabled).p-highlight .p-panelmenu-header-content{background-color:transparent!important;border-radius:10px;padding:12px;border-bottom:0!important;border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .no-highlight.p-panelmenu-header:not(.p-disabled).p-highlight .p-panelmenu-header-content .p-panelmenu-header-action{padding:0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .no-highlight.p-panelmenu-header:not(.p-disabled).p-highlight .p-panelmenu-header-content .p-panelmenu-header-action .p-icon-wrapper{transform:rotate(180deg)!important;transition:none!important;top:0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link{background-color:#fff!important;color:var(--text-color);padding:12px 6px!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link .p-menuitem-text{max-width:75%;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link-active{border:1px solid rgba(68,72,109,.1);border-radius:10px;padding:12px;color:var(--primary-color);box-shadow:none!important;background-color:#0066ff1a!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link-active .p-menuitem-icon{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link-active .p-menuitem-text{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem.p-focus>.p-menuitem-content{background-color:#fff!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem:not(.p-focus)>.p-menuitem-content .p-menuitem-link{background-color:#fff!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link:not(.selected-menu-item){background-color:#fff!important;border:none!important;border-radius:0!important;color:var(--text-color)!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link:not(.selected-menu-item) .p-menuitem-icon{color:var(--text-color)!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link:not(.selected-menu-item) .p-menuitem-text{color:var(--text-color)!important}::ng-deep .widget-menu-wrapper .p-panelmenu-panel .p-panelmenu-expanded .p-panelmenu-content{border:1px solid rgba(68,72,109,.1)!important;border-top:0!important;border-bottom-left-radius:10px;border-bottom-right-radius:10px}::ng-deep .widget-menu-wrapper .p-panelmenu-panel .widget-separator{border-top:1px solid rgba(68,72,109,.1)!important}::ng-deep .widget-menu-wrapper .p-panelmenu-panel .widget-separator .p-panelmenu-header-content .p-panelmenu-header-action{padding:0!important}.no-documents-message{padding:12px 16px;text-align:center}.no-documents-message .text-muted{color:#9ea0b3;font-size:14px;font-style:italic}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i9$1.Badge, selector: "p-badge", inputs: ["styleClass", "style", "badgeSize", "severity", "value", "badgeDisabled", "size"] }, { kind: "component", type: i8$2.Menu, selector: "p-menu", inputs: ["model", "popup", "style", "styleClass", "appendTo", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaLabel", "ariaLabelledBy", "id", "tabindex"], outputs: ["onShow", "onHide", "onBlur", "onFocus"] }, { kind: "component", type: i9$2.Card, selector: "p-card", inputs: ["header", "subheader", "style", "styleClass"] }] });
|
|
8753
8964
|
}
|
|
8754
8965
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentsMenuComponent, decorators: [{
|
|
8755
8966
|
type: Component,
|
|
8756
|
-
args: [{ selector: 'lib-documents-menu', standalone: false, template: "<div class=\"document-sidebar-container h-full\">\
|
|
8967
|
+
args: [{ selector: 'lib-documents-menu', standalone: false, template: "<div class=\"document-sidebar-container h-full\">\n <!-- Menu items are now used for navigation to specific sections, not for filtering documents -->\n <p-card class=\"widget-menu-wrapper h-full\">\n @if(applicationNumber){\n <div class=\"flex align-items-center justify-content-between widget-menu-header-wrapper\">\n <p class=\"mb-0 application-title-wrapper\">ID - {{applicationNumber}}</p>\n <div class=\"expand-icon-wrapper\">\n <i class=\"ri-arrow-left-s-line text-primary flex align-items-center justify-content-center w-full h-full\"></i>\n </div>\n </div>\n }\n\n <div class=\"widget-menu-container\" >\n <div class=\"widget-menu-wrapper h-ful l custom-scroll\">\n <p-menu [model]=\"categories\" styleClass=\"w-full md:w-15rem\">\n <ng-template pTemplate=\"submenuheader\" let-item>\n <span [style]=\"{\n color : '#9EA0B3'\n }\">{{ item.label }} Documents</span>\n </ng-template>\n <ng-template pTemplate=\"item\" let-item>\n <a pRipple \n class=\"flex align-items-center p-menuitem-link\"\n [class.selected-menu-item]=\"selectedMenuItemId === item._id\"\n [class.disabled-menu-item]=\"item.isSelectable === false\"\n [class.pointer-events-none]=\"item.isSelectable === false\"\n [style.opacity]=\"item.isSelectable === false ? '0.5' : '1'\"\n [style.cursor]=\"item.isSelectable === false ? 'not-allowed' : 'pointer'\"\n (click)=\"onMenuItemClick($event, item)\">\n <span [class]=\"item.icon\" class=\"text-xl\"></span>\n <span class=\"ml-2\">{{ item.label }}</span>\n <p-badge *ngIf=\"item.menuData?.shouldShowBadge\" \n class=\"ml-auto\" \n [severity]=\"item.menuData?.badgeSeverity\" \n [value]=\"item.menuData?.badgeValue\" />\n </a>\n </ng-template>\n </p-menu>\n </div>\n </div>\n </p-card>\n</div>\n\n ", styles: [".expand-icon-wrapper{border:1px solid var(--primary-color);height:24px;width:24px;border-radius:50%;background:var(--blue-bg-light)}::ng-deep .p-badge.p-badge-success{background-color:#dcfce7;color:#16a34a;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-badge.p-badge-danger{background-color:#fee2e2;color:#dc2626;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-badge.p-badge-warning{background-color:#fef3c7;color:#d97706;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-badge.p-badge-info{background-color:#e5e7eb;color:#000;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-menu .p-menuitem>.p-menuitem-content .p-menuitem-link{color:#1f2937}@media screen and (min-width: 768px){::ng-deep .md\\:w-15rem{width:100%!important}}::ng-deep .p-menu{border:none}::ng-deep .custom-scroll{scrollbar-gutter:inherit}::ng-deep .selected-menu-item{background-color:#0066ff1a!important;color:var(--primary-color)!important;border:1px solid rgba(68,72,109,.1)!important;border-radius:10px!important}::ng-deep .selected-menu-item .text-xl{color:var(--primary-color)!important}::ng-deep .disabled-menu-item{opacity:.5!important;cursor:not-allowed!important;pointer-events:none!important}::ng-deep .disabled-menu-item .text-xl{color:#9ea0b3!important}::ng-deep .disabled-menu-item .ml-2{color:#9ea0b3!important}::ng-deep .disabled-menu-item .p-badge{opacity:.5!important}::ng-deep .p-menuitem-link:not(.selected-menu-item){background-color:#fff!important;border:none!important;border-radius:0!important}::ng-deep .p-menuitem-link:not(.selected-menu-item) .text-xl{color:var(--text-color)!important}::ng-deep .p-panelmenu .p-panelmenu-content{border:none!important}.application-title-wrapper{color:#9ea0b3;font-weight:500}.widget-menu-wrapper{margin-top:8px}.widget-menu-header-wrapper{padding:4px 4px 4px 16px}.widget-menu-container{overflow-y:auto;overflow-x:hidden}.custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}::ng-deep .document-sidebar-container .p-card{height:100%;box-shadow:none}::ng-deep .document-sidebar-container .p-card .p-card-content{height:100%;padding:0!important}::ng-deep .document-sidebar-container .p-card .p-card-body{height:100%;width:100%;padding:12px 8px;border-radius:10px;border:1px solid #e5e7eb}::ng-deep .document-sidebar-container .widget-menu-wrapper .p-panelmenu-panel .p-panelmenu-expanded .p-panelmenu-content{border:none!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content{border:none;color:var(--text-color);font-weight:400!important;background-color:var(--surface-0)!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-panelmenu-header-action{color:var(--text-color);font-weight:400!important;position:relative;padding:12px}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-panelmenu-header-action .p-icon-wrapper{position:absolute;right:0;top:16px;margin-right:7px;transform:rotate(90deg)!important;transition:none!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-panelmenu-header-action .p-menuitem-text{max-width:75%;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-menuitem-link-active{border:1px solid rgba(68,72,109,.1);border-radius:10px;padding:12px;color:var(--primary-color);background-color:#0066ff1a!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-menuitem-link-active .p-menuitem-icon{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-menuitem-link-active .p-menuitem-text{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .company-action-wrapper:not(.p-disabled).p-highlight .p-panelmenu-header-content{margin:12px 0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .no-highlight.p-panelmenu-header:not(.p-disabled).p-highlight .p-panelmenu-header-content{background-color:transparent!important;border-radius:10px;padding:12px;border-bottom:0!important;border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .no-highlight.p-panelmenu-header:not(.p-disabled).p-highlight .p-panelmenu-header-content .p-panelmenu-header-action{padding:0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .no-highlight.p-panelmenu-header:not(.p-disabled).p-highlight .p-panelmenu-header-content .p-panelmenu-header-action .p-icon-wrapper{transform:rotate(180deg)!important;transition:none!important;top:0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link{background-color:#fff!important;color:var(--text-color);padding:12px 6px!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link .p-menuitem-text{max-width:75%;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link-active{border:1px solid rgba(68,72,109,.1);border-radius:10px;padding:12px;color:var(--primary-color);box-shadow:none!important;background-color:#0066ff1a!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link-active .p-menuitem-icon{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link-active .p-menuitem-text{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem.p-focus>.p-menuitem-content{background-color:#fff!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem:not(.p-focus)>.p-menuitem-content .p-menuitem-link{background-color:#fff!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link:not(.selected-menu-item){background-color:#fff!important;border:none!important;border-radius:0!important;color:var(--text-color)!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link:not(.selected-menu-item) .p-menuitem-icon{color:var(--text-color)!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link:not(.selected-menu-item) .p-menuitem-text{color:var(--text-color)!important}::ng-deep .widget-menu-wrapper .p-panelmenu-panel .p-panelmenu-expanded .p-panelmenu-content{border:1px solid rgba(68,72,109,.1)!important;border-top:0!important;border-bottom-left-radius:10px;border-bottom-right-radius:10px}::ng-deep .widget-menu-wrapper .p-panelmenu-panel .widget-separator{border-top:1px solid rgba(68,72,109,.1)!important}::ng-deep .widget-menu-wrapper .p-panelmenu-panel .widget-separator .p-panelmenu-header-content .p-panelmenu-header-action{padding:0!important}.no-documents-message{padding:12px 16px;text-align:center}.no-documents-message .text-muted{color:#9ea0b3;font-size:14px;font-style:italic}\n"] }]
|
|
8757
8968
|
}], ctorParameters: () => [{ type: DocumentStore }, { type: DocumentQuery }, { type: DocumentMenuService }, { type: DocumentHelperService }], propDecorators: { catagories: [{
|
|
8758
8969
|
type: Input
|
|
8759
8970
|
}], applicationNumber: [{
|