cat-documents-ng 0.3.9 → 0.3.10

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.
@@ -4544,23 +4544,12 @@ class DocumentTableBuilderService {
4544
4544
  * @returns TableData object
4545
4545
  */
4546
4546
  buildDocumentTable(documents) {
4547
- console.log('Building document table with documents:', documents);
4548
4547
  const columns = SHARED.DOCUMENT_TABLE_COLUMNS.filter(col => col.type !== SHARED.ACTIONS);
4549
4548
  // Format document names to include aliasName if available
4550
- const formattedDocuments = documents.map(doc => {
4551
- console.log('Processing document:', {
4552
- docName: doc.docName,
4553
- aliasName: doc.aliasName,
4554
- hasAliasName: !!doc.aliasName,
4555
- aliasNameTrimmed: doc.aliasName?.trim(),
4556
- aliasNameEmpty: doc.aliasName === SHARED.EMPTY
4557
- });
4558
- return {
4559
- ...doc,
4560
- docName: this.formatDocumentDisplayName(doc.docName, doc.aliasName)
4561
- };
4562
- });
4563
- console.log('Formatted documents:', formattedDocuments);
4549
+ const formattedDocuments = documents.map(doc => ({
4550
+ ...doc,
4551
+ docName: this.formatDocumentDisplayName(doc.docName, doc.aliasName)
4552
+ }));
4564
4553
  return {
4565
4554
  columns: columns,
4566
4555
  data: formattedDocuments
@@ -4573,17 +4562,10 @@ class DocumentTableBuilderService {
4573
4562
  * @returns Formatted display name
4574
4563
  */
4575
4564
  formatDocumentDisplayName(docName, aliasName) {
4576
- console.log('Formatting document name:', { docName, aliasName });
4577
- // Only show aliasName if it exists, is not empty, and is different from docName
4578
- if (aliasName &&
4579
- aliasName.trim() !== '' &&
4580
- aliasName !== SHARED.EMPTY &&
4581
- aliasName.trim() !== docName.replace(/\.[^/.]+$/, '')) { // Remove file extension for comparison
4582
- const formattedName = `${docName} - ${aliasName}`;
4583
- console.log('Formatted name:', formattedName);
4584
- return formattedName;
4585
- }
4586
- console.log('Using original name:', docName);
4565
+ // Show aliasName if it exists and is not empty
4566
+ if (aliasName && aliasName.trim() !== SHARED.EMPTY) {
4567
+ return `${docName} - ${aliasName}`;
4568
+ }
4587
4569
  return docName;
4588
4570
  }
4589
4571
  /**
@@ -4815,7 +4797,7 @@ class TablePrimaryComponent {
4815
4797
  }
4816
4798
  }
4817
4799
  processTableData() {
4818
- this.processedData = this.tableData.data.map(rowData => {
4800
+ this.processedData = this.tableData.data.map((rowData, index) => {
4819
4801
  const processedRow = { ...rowData };
4820
4802
  if (rowData.fileName) {
4821
4803
  processedRow._fileExtension = this.getFileExtension(rowData.fileName);