From 5d70198f77d50323d3078bd03c245f7e97321e08 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Fri, 4 Nov 2022 15:48:18 -0700 Subject: [PATCH] Adding a settings filter for project settings (#2659) --- .../dispatch/src/components/AppDrawer.vue | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/dispatch/static/dispatch/src/components/AppDrawer.vue b/src/dispatch/static/dispatch/src/components/AppDrawer.vue index 791e26bd366d..e3fd01b191c8 100644 --- a/src/dispatch/static/dispatch/src/components/AppDrawer.vue +++ b/src/dispatch/static/dispatch/src/components/AppDrawer.vue @@ -65,6 +65,8 @@ + + {{ group | capitalize }} @@ -144,6 +146,7 @@ export default { maxScrollbarLength: 160, }, mini: false, + q: "", }), created() { @@ -176,7 +179,10 @@ export default { }, showChildPane() { if (Object.keys(this.children).length) { - return Object.values(this.children)[0].length > 1 + return Object.values(this.children)[0].length || this.q.length + } + if (this.q.length) { + return true } return false }, @@ -198,9 +204,22 @@ export default { return child.meta.group }) - return groupBy(children, function (child) { + // Filter children if we have a filter string + let q = this.q + if (q.length) { + children = children.filter(function (item) { + let metadata = + item.meta.group.toLowerCase() + + item.meta.subMenu.toLowerCase() + + item.meta.title.toLowerCase() + return metadata.includes(q.toLowerCase()) + }) + } + + children = groupBy(children, function (child) { return child.meta.group }) + return children }, ...mapState("app", ["toggleDrawer"]), },