cat-documents-ng 0.3.68 → 0.3.71

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.
@@ -261,6 +261,7 @@ export declare class SHARED {
261
261
  static PDF_TYPE: string;
262
262
  static EXCEL_XLSX_MIME_TYPE: string;
263
263
  static EXCEL_XLS_MIME_TYPE: string;
264
+ static OCTET_STREAM: string;
264
265
  static WORD_DOCX_MIME_TYPE: string;
265
266
  static WORD_DOC_MIME_TYPE: string;
266
267
  static CSV_MIME_TYPE: string;
@@ -326,6 +326,7 @@ class SHARED {
326
326
  // MIME Type Constants
327
327
  static EXCEL_XLSX_MIME_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
328
328
  static EXCEL_XLS_MIME_TYPE = 'application/vnd.ms-excel';
329
+ static OCTET_STREAM = 'application/octet-stream';
329
330
  static WORD_DOCX_MIME_TYPE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
330
331
  static WORD_DOC_MIME_TYPE = 'application/msword';
331
332
  static CSV_MIME_TYPE = 'text/csv';
@@ -1413,7 +1414,7 @@ class DocumentHttpService {
1413
1414
  * @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
1414
1415
  */
1415
1416
  getDocumentCatagories(contextId) {
1416
- let headers = new HttpHeaders({ Authorization: 'Bearer 567c2b7f-bb41-4d93-8974-e57853acab12' });
1417
+ let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
1417
1418
  return this.http.get(`${this.apiUrl}${URLS.DOCUMENTS_CATAGORIES}/${contextId}`, { headers })
1418
1419
  .pipe(tap((response) => {
1419
1420
  if (response && response.categories) {
@@ -1472,7 +1473,7 @@ class DocumentHttpService {
1472
1473
  * @returns {Observable<DocumentModel>} An observable that emits the updated DocumentModel.
1473
1474
  */
1474
1475
  updateDocumentName(documentId, payload) {
1475
- let headers = new HttpHeaders({ Authorization: 'Bearer 567c2b7f-bb41-4d93-8974-e57853acab12' });
1476
+ let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
1476
1477
  return this.http.put(`${this.apiUrl}${URLS.ALIAS_NAME}${documentId}`, payload, { headers: headers }).pipe(catchError((error) => {
1477
1478
  return throwError(() => new Error(error));
1478
1479
  }));
@@ -1485,7 +1486,7 @@ class DocumentHttpService {
1485
1486
  getUserListByContextId(contextId) {
1486
1487
  if (!contextId)
1487
1488
  return EMPTY;
1488
- let headers = new HttpHeaders({ Authorization: 'Bearer 567c2b7f-bb41-4d93-8974-e57853acab12' });
1489
+ let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
1489
1490
  return this.http.get(`${this.apiUrl}${URLS.USERLIST}${contextId}`, { headers: headers }).pipe(tap((userList) => {
1490
1491
  this.documentStore.setUserList(userList);
1491
1492
  }), catchError((error) => {
@@ -1511,7 +1512,7 @@ class DocumentHttpService {
1511
1512
  if (categoryId) {
1512
1513
  params = params.set(SHARED.CATEGORY, categoryId);
1513
1514
  }
1514
- let headers = new HttpHeaders({ Authorization: 'Bearer 567c2b7f-bb41-4d93-8974-e57853acab12' });
1515
+ let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
1515
1516
  return this.http.get(url, { params, headers }).pipe(tap((statusData) => {
1516
1517
  this.documentStore.setStatusData(statusData);
1517
1518
  }), catchError((error) => {
@@ -1540,7 +1541,7 @@ class DocumentHttpService {
1540
1541
  if (searchKey) {
1541
1542
  params = params.set(SHARED.SEARCH_KEY, searchKey);
1542
1543
  }
1543
- let headers = new HttpHeaders({ Authorization: 'Bearer 567c2b7f-bb41-4d93-8974-e57853acab12' });
1544
+ let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
1544
1545
  return this.http.get(`${this.apiUrl}${URLS.GETALL}/${contextId}`, { params, headers }).pipe(tap((response) => {
1545
1546
  if (response.documents) {
1546
1547
  this.documentStore.setDocumentList(response.documents);
@@ -1553,7 +1554,7 @@ class DocumentHttpService {
1553
1554
  if (!documentId) {
1554
1555
  return of([]);
1555
1556
  }
1556
- let headers = new HttpHeaders({ Authorization: 'Bearer 567c2b7f-bb41-4d93-8974-e57853acab12' });
1557
+ let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
1557
1558
  return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_HISTORY}${documentId}`, { headers }).pipe(catchError((error) => {
1558
1559
  return throwError(() => new Error(error));
1559
1560
  }));
@@ -1566,7 +1567,7 @@ class DocumentHttpService {
1566
1567
  getCategoriesBySource(source) {
1567
1568
  if (!source)
1568
1569
  return EMPTY;
1569
- let headers = new HttpHeaders({ Authorization: 'Bearer 567c2b7f-bb41-4d93-8974-e57853acab12' });
1570
+ let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
1570
1571
  return this.http.get(`${this.apiUrl}${URLS.GET_CATEGORIES_BY_SOURCE}${source}`, { headers }).pipe(catchError((error) => {
1571
1572
  return throwError(() => new Error(error));
1572
1573
  }));
@@ -1579,7 +1580,7 @@ class DocumentHttpService {
1579
1580
  getDocumentTypesByCategory(categoryId) {
1580
1581
  if (!categoryId)
1581
1582
  return EMPTY;
1582
- let headers = new HttpHeaders({ Authorization: 'Bearer 567c2b7f-bb41-4d93-8974-e57853acab12' });
1583
+ let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
1583
1584
  return this.http.get(`${this.apiUrl}${URLS.GET_DOCUMENT_TYPES_BY_CATEGORY}${categoryId}`, { headers }).pipe(catchError((error) => {
1584
1585
  return throwError(() => new Error(error));
1585
1586
  }));
@@ -1590,7 +1591,7 @@ class DocumentHttpService {
1590
1591
  * @returns {Observable<any>} Observable that emits the upload response.
1591
1592
  */
1592
1593
  uploadFile(formData) {
1593
- let headers = new HttpHeaders({ Authorization: 'Bearer 567c2b7f-bb41-4d93-8974-e57853acab12' });
1594
+ let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
1594
1595
  return this.http.post(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD_FILE}`, formData, { headers }).pipe(catchError((error) => {
1595
1596
  return throwError(() => new Error(error));
1596
1597
  }));
@@ -1601,7 +1602,7 @@ class DocumentHttpService {
1601
1602
  * @returns {Observable<any>} Observable that emits the save response.
1602
1603
  */
1603
1604
  saveDocumentUpload(payload) {
1604
- let headers = new HttpHeaders({ Authorization: 'Bearer 567c2b7f-bb41-4d93-8974-e57853acab12' });
1605
+ let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
1605
1606
  return this.http.post(`${this.apiUrl}${URLS.SAVE_DOCUMENT_UPLOAD}`, payload, { headers }).pipe(catchError((error) => {
1606
1607
  return throwError(() => new Error(error));
1607
1608
  }));
@@ -1617,7 +1618,7 @@ class DocumentHttpService {
1617
1618
  const payload = {
1618
1619
  statusUpdateDescription: statusUpdateDescription
1619
1620
  };
1620
- let headers = new HttpHeaders({ Authorization: 'Bearer 567c2b7f-bb41-4d93-8974-e57853acab12' });
1621
+ let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
1621
1622
  return this.http.put(`${this.apiUrl}${URLS.UPDATE_DOCUMENT_STATUS}${documentId}/${status}`, payload, { headers }).pipe(tap((response) => {
1622
1623
  if (response && response.status) {
1623
1624
  const normalizedStatus = this.normalizeStatus(response.status);
@@ -1651,7 +1652,7 @@ class DocumentHttpService {
1651
1652
  * @returns {Observable<any>} Observable that emits the delete response
1652
1653
  */
1653
1654
  deleteDocument(documentId, contextId) {
1654
- let headers = new HttpHeaders({ Authorization: 'Bearer 567c2b7f-bb41-4d93-8974-e57853acab12' });
1655
+ let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
1655
1656
  return this.http.delete(`${this.apiUrl}${URLS.DELETE_DOCUMENT}${documentId}`, { headers }).pipe(tap(() => {
1656
1657
  this.getDocumentCatagories(contextId).subscribe();
1657
1658
  this.getUserListByContextId(contextId).subscribe();
@@ -2607,7 +2608,7 @@ class DocumentService {
2607
2608
  * @returns {Observable<any>} Observable that emits the newly created document.
2608
2609
  */
2609
2610
  create(entity) {
2610
- let headers = new HttpHeaders({ Authorization: 'Bearer 525d292d-42c9-4280-be65-caac72727902' });
2611
+ let headers = new HttpHeaders({ Authorization: 'Bearer 0fa14ac8-ea78-4666-b099-eb691653b229' });
2611
2612
  return this.http.post(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD_FILE}`, entity, { headers }).pipe(tap((newEntity) => this.documentStore.add(newEntity)));
2612
2613
  }
2613
2614
  /**
@@ -5288,7 +5289,6 @@ class TablePrimaryComponent {
5288
5289
  formatDocumentDisplayName(rowData) {
5289
5290
  let displayName = '';
5290
5291
  if (rowData.aliasName && rowData.aliasName.trim() !== '') {
5291
- // With aliasName: aliasName on top, docName - fileName below
5292
5292
  displayName += `<span class="alias-name">${rowData.aliasName}</span><br>`;
5293
5293
  if (rowData.docName && rowData.fileName) {
5294
5294
  displayName += `<span class="document-info">${rowData.docName} - ${rowData.fileName}</span>`;
@@ -5298,7 +5298,6 @@ class TablePrimaryComponent {
5298
5298
  }
5299
5299
  }
5300
5300
  else {
5301
- // Without aliasName: docName on top, fileName below
5302
5301
  if (rowData.docName) {
5303
5302
  displayName += `<span class="document-info">${rowData.docName}</span>`;
5304
5303
  }
@@ -7435,7 +7434,8 @@ class DocumentContentViewerComponent {
7435
7434
  */
7436
7435
  get isExcel() {
7437
7436
  return this.contentType === SHARED.EXCEL_XLSX_MIME_TYPE ||
7438
- this.contentType === SHARED.EXCEL_XLS_MIME_TYPE;
7437
+ this.contentType === SHARED.EXCEL_XLS_MIME_TYPE ||
7438
+ this.contentType === SHARED.OCTET_STREAM;
7439
7439
  }
7440
7440
  /**
7441
7441
  * Computed property to determine if the document is a Word file
@@ -7443,7 +7443,7 @@ class DocumentContentViewerComponent {
7443
7443
  */
7444
7444
  get isWord() {
7445
7445
  return this.contentType === SHARED.WORD_DOCX_MIME_TYPE ||
7446
- this.contentType === SHARED.WORD_DOC_MIME_TYPE;
7446
+ this.contentType === SHARED.WORD_DOC_MIME_TYPE || this.contentType === SHARED.OCTET_STREAM;
7447
7447
  }
7448
7448
  /**
7449
7449
  * Computed property to determine if the document is a CSV file
@@ -8862,7 +8862,26 @@ class DocumentsMenuComponent {
8862
8862
  * Maintains the original order as provided by the API
8863
8863
  */
8864
8864
  updateCachedCategories() {
8865
- this._cachedCategories = this.storeCategories.length > 0 ? this.storeCategories : this.catagories;
8865
+ const nextCategories = this.storeCategories.length > 0 ? this.storeCategories : this.catagories;
8866
+ if (!this._cachedCategories || this._cachedCategories.length === 0) {
8867
+ this._cachedCategories = nextCategories;
8868
+ return;
8869
+ }
8870
+ const previousById = new Map();
8871
+ this._cachedCategories.forEach(category => {
8872
+ category.items?.forEach(item => {
8873
+ if (item.isSelectable !== undefined) {
8874
+ previousById.set(item._id, item.isSelectable);
8875
+ }
8876
+ });
8877
+ });
8878
+ this._cachedCategories = nextCategories.map(category => ({
8879
+ ...category,
8880
+ items: category.items?.map(item => ({
8881
+ ...item,
8882
+ isSelectable: previousById.has(item._id) ? previousById.get(item._id) : item.isSelectable
8883
+ }))
8884
+ }));
8866
8885
  }
8867
8886
  /**
8868
8887
  * Finds the label of a menu item by its _id
@@ -8939,19 +8958,12 @@ class DocumentsMenuComponent {
8939
8958
  updateMenuItemsSelectability(documentListResponse) {
8940
8959
  if (this._cachedCategories && this._cachedCategories.length > 0) {
8941
8960
  // Only update if we have a valid response (not null/undefined)
8942
- // If response is null, it means no filters are applied, so all items should be selectable
8961
+ // If response is null, keep previous selectability to avoid flicker/reset during refresh
8943
8962
  if (documentListResponse !== null && documentListResponse !== undefined) {
8944
8963
  this._cachedCategories = this.documentMenuService.updateMenuItemsWithSelectabilityStatus(this._cachedCategories, documentListResponse);
8945
8964
  }
8946
8965
  else {
8947
- // If no response, make all items selectable (default state)
8948
- this._cachedCategories = this._cachedCategories.map(category => ({
8949
- ...category,
8950
- items: category.items?.map(item => ({
8951
- ...item,
8952
- isSelectable: true
8953
- }))
8954
- }));
8966
+ // Do nothing; preserve existing isSelectable values
8955
8967
  }
8956
8968
  }
8957
8969
  }