mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-02 18:47:10 -05:00 
			
		
		
		
	more fixes regarding empty titles
This commit is contained in:
		
							parent
							
								
									dec17a3b9b
								
							
						
					
					
						commit
						8e339789fa
					
				@ -119,7 +119,8 @@ import { MetadataCollapseComponent } from './components/document-detail/metadata
 | 
				
			|||||||
      useClass: CsrfInterceptor,
 | 
					      useClass: CsrfInterceptor,
 | 
				
			||||||
      multi: true
 | 
					      multi: true
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    FilterPipe
 | 
					    FilterPipe,
 | 
				
			||||||
 | 
					    DocumentTitlePipe
 | 
				
			||||||
  ],
 | 
					  ],
 | 
				
			||||||
  bootstrap: [AppComponent]
 | 
					  bootstrap: [AppComponent]
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
				
			|||||||
@ -65,7 +65,7 @@
 | 
				
			|||||||
              <svg class="sidebaricon" fill="currentColor">
 | 
					              <svg class="sidebaricon" fill="currentColor">
 | 
				
			||||||
                <use xlink:href="assets/bootstrap-icons.svg#file-text"/>
 | 
					                <use xlink:href="assets/bootstrap-icons.svg#file-text"/>
 | 
				
			||||||
              </svg>
 | 
					              </svg>
 | 
				
			||||||
              {{d.title}}
 | 
					              {{d.title | documentTitle}}
 | 
				
			||||||
            </a>
 | 
					            </a>
 | 
				
			||||||
          </li>
 | 
					          </li>
 | 
				
			||||||
          <li class="nav-item w-100" *ngIf="openDocuments.length > 1">
 | 
					          <li class="nav-item w-100" *ngIf="openDocuments.length > 1">
 | 
				
			||||||
 | 
				
			|||||||
@ -13,7 +13,7 @@
 | 
				
			|||||||
    <tbody>
 | 
					    <tbody>
 | 
				
			||||||
      <tr *ngFor="let doc of documents" routerLink="/documents/{{doc.id}}">
 | 
					      <tr *ngFor="let doc of documents" routerLink="/documents/{{doc.id}}">
 | 
				
			||||||
        <td>{{doc.created | date}}</td>
 | 
					        <td>{{doc.created | date}}</td>
 | 
				
			||||||
        <td>{{doc.title}}<app-tag [tag]="t" *ngFor="let t of doc.tags$ | async" class="ml-1"></app-tag>
 | 
					        <td>{{doc.title | documentTitle}}<app-tag [tag]="t" *ngFor="let t of doc.tags$ | async" class="ml-1"></app-tag>
 | 
				
			||||||
      </tr>
 | 
					      </tr>
 | 
				
			||||||
    </tbody>
 | 
					    </tbody>
 | 
				
			||||||
  </table>
 | 
					  </table>
 | 
				
			||||||
 | 
				
			|||||||
@ -6,6 +6,7 @@ import { PaperlessCorrespondent } from 'src/app/data/paperless-correspondent';
 | 
				
			|||||||
import { PaperlessDocument } from 'src/app/data/paperless-document';
 | 
					import { PaperlessDocument } from 'src/app/data/paperless-document';
 | 
				
			||||||
import { PaperlessDocumentMetadata } from 'src/app/data/paperless-document-metadata';
 | 
					import { PaperlessDocumentMetadata } from 'src/app/data/paperless-document-metadata';
 | 
				
			||||||
import { PaperlessDocumentType } from 'src/app/data/paperless-document-type';
 | 
					import { PaperlessDocumentType } from 'src/app/data/paperless-document-type';
 | 
				
			||||||
 | 
					import { DocumentTitlePipe } from 'src/app/pipes/document-title.pipe';
 | 
				
			||||||
import { DocumentListViewService } from 'src/app/services/document-list-view.service';
 | 
					import { DocumentListViewService } from 'src/app/services/document-list-view.service';
 | 
				
			||||||
import { OpenDocumentsService } from 'src/app/services/open-documents.service';
 | 
					import { OpenDocumentsService } from 'src/app/services/open-documents.service';
 | 
				
			||||||
import { CorrespondentService } from 'src/app/services/rest/correspondent.service';
 | 
					import { CorrespondentService } from 'src/app/services/rest/correspondent.service';
 | 
				
			||||||
@ -54,7 +55,8 @@ export class DocumentDetailComponent implements OnInit {
 | 
				
			|||||||
    private router: Router,
 | 
					    private router: Router,
 | 
				
			||||||
    private modalService: NgbModal,
 | 
					    private modalService: NgbModal,
 | 
				
			||||||
    private openDocumentService: OpenDocumentsService,
 | 
					    private openDocumentService: OpenDocumentsService,
 | 
				
			||||||
    private documentListViewService: DocumentListViewService) { }
 | 
					    private documentListViewService: DocumentListViewService,
 | 
				
			||||||
 | 
					    private documentTitlePipe: DocumentTitlePipe) { }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  getContentType() {
 | 
					  getContentType() {
 | 
				
			||||||
    return this.metadata?.has_archive_version ? 'application/pdf' : this.metadata?.original_mime_type
 | 
					    return this.metadata?.has_archive_version ? 'application/pdf' : this.metadata?.original_mime_type
 | 
				
			||||||
@ -90,7 +92,7 @@ export class DocumentDetailComponent implements OnInit {
 | 
				
			|||||||
    this.documentsService.getMetadata(doc.id).subscribe(result => {
 | 
					    this.documentsService.getMetadata(doc.id).subscribe(result => {
 | 
				
			||||||
      this.metadata = result
 | 
					      this.metadata = result
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
    this.title = doc.title
 | 
					    this.title = this.documentTitlePipe.transform(doc.title)
 | 
				
			||||||
    this.documentForm.patchValue(doc)
 | 
					    this.documentForm.patchValue(doc)
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -5,7 +5,7 @@ import { Pipe, PipeTransform } from '@angular/core';
 | 
				
			|||||||
})
 | 
					})
 | 
				
			||||||
export class DocumentTitlePipe implements PipeTransform {
 | 
					export class DocumentTitlePipe implements PipeTransform {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  transform(value: string): unknown {
 | 
					  transform(value: string): string {
 | 
				
			||||||
    if (value) {
 | 
					    if (value) {
 | 
				
			||||||
      return value
 | 
					      return value
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user