From 76fd4250275887e9378dc7cd952721a654d209d1 Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Tue, 16 May 2023 14:12:46 +0200 Subject: [PATCH] assert valid nw-new-entry listener if side-menu is enabled --- public/js/components/filter/Filter.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/js/components/filter/Filter.js b/public/js/components/filter/Filter.js index dbf15a315..eb5f1a005 100644 --- a/public/js/components/filter/Filter.js +++ b/public/js/components/filter/Filter.js @@ -40,6 +40,7 @@ export const CoreFilterCmpt = { 'nwNewEntry' ], props: { + onNwNewEntry: Function, // NOTE(chris): Hack to get the nwNewEntry listener into $props title: String, sideMenu: { type: Boolean, @@ -444,6 +445,8 @@ export const CoreFilterCmpt = { alert('You can not have a filter-type in table-only mode!'); }, created() { + if (this.sideMenu && (!this.$props.onNwNewEntry || !(this.$props.onNwNewEntry instanceof Function))) + alert('"nwNewEntry" listener is mandatory when sideMenu is true'); this.uuid = _uuid++; if (!this.tableOnly) this.getFilter(); // get the filter data @@ -451,7 +454,7 @@ export const CoreFilterCmpt = { mounted() { this.initTabulator(); }, - template: ` + template: `{{$attrs}}