diff --git a/app/client/src/components/formControls/BaseControl.tsx b/app/client/src/components/formControls/BaseControl.tsx index 61afa2872e..6b5dfc1120 100644 --- a/app/client/src/components/formControls/BaseControl.tsx +++ b/app/client/src/components/formControls/BaseControl.tsx @@ -13,7 +13,9 @@ export type ComparisonOperations = | "EQUALS" | "NOT_EQUALS" | "LESSER" - | "GREATER"; + | "GREATER" + | "IN" + | "NOT_IN"; export type HiddenType = | boolean diff --git a/app/client/src/components/formControls/utils.test.ts b/app/client/src/components/formControls/utils.test.ts index 0aabdc5685..8eb25215da 100644 --- a/app/client/src/components/formControls/utils.test.ts +++ b/app/client/src/components/formControls/utils.test.ts @@ -54,6 +54,22 @@ describe("isHidden test", () => { comparison: "NOT_EQUALS", }, }, + { + values: { name: "Name", config: { type: "Different BODY" } }, + hidden: { + path: "config.type", + value: ["EMAIL", "BODY"], + comparison: "IN", + }, + }, + { + values: { name: "Name", config: { type: "BODY" } }, + hidden: { + path: "config.type", + value: ["EMAIL", "BODY"], + comparison: "NOT_IN", + }, + }, { values: undefined, hidden: false, diff --git a/app/client/src/components/formControls/utils.ts b/app/client/src/components/formControls/utils.ts index 2e2616d803..0afa6604b0 100644 --- a/app/client/src/components/formControls/utils.ts +++ b/app/client/src/components/formControls/utils.ts @@ -15,6 +15,10 @@ export const isHidden = (values: any, hiddenConfig?: HiddenType) => { return valueAtPath > value; case "LESSER": return valueAtPath < value; + case "IN": + return Array.isArray(value) && value.includes(valueAtPath); + case "NOT_IN": + return Array.isArray(value) && !value.includes(valueAtPath); default: return true; } diff --git a/app/server/appsmith-plugins/firestorePlugin/src/main/resources/editor.json b/app/server/appsmith-plugins/firestorePlugin/src/main/resources/editor.json index 97f2e828ee..e592ec6a3a 100644 --- a/app/server/appsmith-plugins/firestorePlugin/src/main/resources/editor.json +++ b/app/server/appsmith-plugins/firestorePlugin/src/main/resources/editor.json @@ -188,7 +188,12 @@ { "label": "Body", "configProperty": "actionConfiguration.body", - "controlType": "QUERY_DYNAMIC_TEXT" + "controlType": "QUERY_DYNAMIC_TEXT", + "hidden": { + "path": "actionConfiguration.pluginSpecifiedTemplates[0].value", + "comparison": "IN", + "value": ["GET_DOCUMENT", "GET_COLLECTION", "DELETE_DOCUMENT"] + } } ] }