mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 03:16:10 -06:00 
			
		
		
		
	Merge pull request #515 from paperless-ngx/clickable-dashboard-widget-tags
Clickable tags in dashboard widgets
This commit is contained in:
		@@ -11,9 +11,9 @@
 | 
			
		||||
      </tr>
 | 
			
		||||
    </thead>
 | 
			
		||||
    <tbody>
 | 
			
		||||
      <tr *ngFor="let doc of documents" routerLink="/documents/{{doc.id}}">
 | 
			
		||||
      <tr *ngFor="let doc of documents" [routerLink]="['/', 'documents', doc.id]">
 | 
			
		||||
        <td>{{doc.created | customDate}}</td>
 | 
			
		||||
        <td>{{doc.title | documentTitle}}<app-tag [tag]="t" *ngFor="let t of doc.tags$ | async" class="ms-1"></app-tag></td>
 | 
			
		||||
        <td>{{doc.title | documentTitle}}<app-tag [tag]="t" *ngFor="let t of doc.tags$ | async" class="ms-1" (click)="clickTag(t); $event.stopPropagation();"></app-tag></td>
 | 
			
		||||
      </tr>
 | 
			
		||||
    </tbody>
 | 
			
		||||
  </table>
 | 
			
		||||
 
 | 
			
		||||
@@ -6,6 +6,8 @@ import { PaperlessSavedView } from 'src/app/data/paperless-saved-view'
 | 
			
		||||
import { DocumentListViewService } from 'src/app/services/document-list-view.service'
 | 
			
		||||
import { ConsumerStatusService } from 'src/app/services/consumer-status.service'
 | 
			
		||||
import { DocumentService } from 'src/app/services/rest/document.service'
 | 
			
		||||
import { PaperlessTag } from 'src/app/data/paperless-tag'
 | 
			
		||||
import { FILTER_HAS_TAGS_ALL } from 'src/app/data/filter-rule-type'
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-saved-view-widget',
 | 
			
		||||
@@ -62,4 +64,10 @@ export class SavedViewWidgetComponent implements OnInit, OnDestroy {
 | 
			
		||||
      this.router.navigate(['documents'])
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  clickTag(tag: PaperlessTag) {
 | 
			
		||||
    this.list.quickFilter([
 | 
			
		||||
      { rule_type: FILTER_HAS_TAGS_ALL, value: tag.id.toString() },
 | 
			
		||||
    ])
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user