From c8685e92fc3a5c11b087adca0635bbfa4d3b533c Mon Sep 17 00:00:00 2001 From: Nathan Bisson Date: Mon, 25 Jul 2022 06:34:44 -0400 Subject: [PATCH] Added widget property filters, and filtered general from modal widget (#3596) --- .../Editor/Inspector/Components/DefaultComponent.jsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/src/Editor/Inspector/Components/DefaultComponent.jsx b/frontend/src/Editor/Inspector/Components/DefaultComponent.jsx index bbaa8e408d..a79a392631 100644 --- a/frontend/src/Editor/Inspector/Components/DefaultComponent.jsx +++ b/frontend/src/Editor/Inspector/Components/DefaultComponent.jsx @@ -53,6 +53,14 @@ export const baseComponentProperties = ( validations, darkMode ) => { + // Add widget title to section key to filter that property section from specified widgets' settings + const accordionFilters = { + Properties: [], + Events: [], + Validation: [], + General: ['Modal'], + Layout: [], + }; let items = []; if (properties.length > 0) { items.push({ @@ -159,5 +167,7 @@ export const baseComponentProperties = ( ), }); - return items; + return items.filter( + (item) => !(item.title in accordionFilters && accordionFilters[item.title].includes(componentMeta.component)) + ); };