mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-09 09:58:20 -05:00
Merge pull request #515 from paperless-ngx/clickable-dashboard-widget-tags
Clickable tags in dashboard widgets
This commit is contained in:
commit
a4b36b041a
@ -11,9 +11,9 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<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 | customDate}}</td>
|
<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>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</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 { DocumentListViewService } from 'src/app/services/document-list-view.service'
|
||||||
import { ConsumerStatusService } from 'src/app/services/consumer-status.service'
|
import { ConsumerStatusService } from 'src/app/services/consumer-status.service'
|
||||||
import { DocumentService } from 'src/app/services/rest/document.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({
|
@Component({
|
||||||
selector: 'app-saved-view-widget',
|
selector: 'app-saved-view-widget',
|
||||||
@ -62,4 +64,10 @@ export class SavedViewWidgetComponent implements OnInit, OnDestroy {
|
|||||||
this.router.navigate(['documents'])
|
this.router.navigate(['documents'])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clickTag(tag: PaperlessTag) {
|
||||||
|
this.list.quickFilter([
|
||||||
|
{ rule_type: FILTER_HAS_TAGS_ALL, value: tag.id.toString() },
|
||||||
|
])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user