From cda4c1a2680cdccbb6d9022e339c32435d8c9ba1 Mon Sep 17 00:00:00 2001 From: David Straub Date: Mon, 21 Aug 2023 20:16:00 +0200 Subject: [PATCH] Add label filter to tasks --- src/components/GrampsjsTasks.js | 12 ++++++++++++ src/views/GrampsjsViewTasks.js | 11 +++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/components/GrampsjsTasks.js b/src/components/GrampsjsTasks.js index f5d1868c..71322175 100644 --- a/src/components/GrampsjsTasks.js +++ b/src/components/GrampsjsTasks.js @@ -58,6 +58,10 @@ class GrampsjsTasks extends GrampsjsTranslateMixin(LitElement) { margin-right: 8px; } + .filters { + margin-bottom: 32px; + } + .taskbar { padding-left: 10px; display: flex; @@ -135,6 +139,14 @@ class GrampsjsTasks extends GrampsjsTranslateMixin(LitElement) { _renderTaskBar() { return html` +
+ + + +
+
@@ -72,6 +75,7 @@ export class GrampsjsViewTasks extends GrampsjsView { name: 'HasTag', values: ['ToDo'], }, + ...this._filters, ], } const uri = `/api/sources/?rules=${encodeURIComponent( @@ -111,6 +115,13 @@ export class GrampsjsViewTasks extends GrampsjsView { fireEvent(this, 'db:changed') } + _handleFiltersChanged(e) { + this._filters = e.detail.filters + e.preventDefault() + e.stopPropagation() + this._fetchData() + } + firstUpdated() { if ('__lang__' in this.strings) { // don't load before we have strings