diff --git a/client/src/pages/platform/workflow-editor/components/Properties/Properties.tsx b/client/src/pages/platform/workflow-editor/components/Properties/Properties.tsx index 584469e8adc..9c8d230e898 100644 --- a/client/src/pages/platform/workflow-editor/components/Properties/Properties.tsx +++ b/client/src/pages/platform/workflow-editor/components/Properties/Properties.tsx @@ -32,9 +32,9 @@ const Properties = ({ const {currentComponent} = useWorkflowNodeDetailsPanelStore(); const advancedProperties = properties.filter((property) => { - const {advancedOption, displayCondition, name} = property; + const {advancedOption, displayCondition, hidden, name} = property; - if (!name || !advancedOption) { + if (!name || !advancedOption || hidden) { return false; } @@ -45,7 +45,9 @@ const Properties = ({ return true; }); - const simpleProperties = properties.filter((property) => property.name && !property.advancedOption); + const simpleProperties = properties.filter( + (property) => property.name && !property.advancedOption && !property.hidden + ); return ( <> diff --git a/client/src/pages/platform/workflow-editor/components/Properties/Property.tsx b/client/src/pages/platform/workflow-editor/components/Properties/Property.tsx index 92964862667..2ef500a33a8 100644 --- a/client/src/pages/platform/workflow-editor/components/Properties/Property.tsx +++ b/client/src/pages/platform/workflow-editor/components/Properties/Property.tsx @@ -34,6 +34,7 @@ import {twMerge} from 'tailwind-merge'; import {useDebouncedCallback} from 'use-debounce'; import useWorkflowEditorStore from '../../stores/useWorkflowEditorStore'; +import formatKeysWithDigits from '../../utils/formatKeysWithDigits'; import replaceSpacesInKeys from '../../utils/replaceSpacesInObjectKeys'; import ArrayProperty from './ArrayProperty'; import ObjectProperty from './ObjectProperty'; @@ -199,24 +200,6 @@ const Property = ({ return componentDefinitions.find((component) => component.name === componentName)?.icon || '📄'; }; - const formatKeysWithDigits = (obj: any) => { - const formattedObj = {...obj}; - - Object.keys(formattedObj).forEach((key) => { - if (key.match(/^\d/)) { - formattedObj[`${PATH_DIGIT_PREFIX}${key}`] = formattedObj[key]; - - delete formattedObj[key]; - } - - if (typeof formattedObj[key] === 'object' && formattedObj[key] !== null) { - formattedObj[key] = formatKeysWithDigits(formattedObj[key]); - } - }); - - return formattedObj; - }; - const saveInputValue = useDebouncedCallback(() => { if (!currentComponent || !workflow || !name || !path || !updateWorkflowNodeParameterMutation) { return; @@ -833,6 +816,10 @@ const Property = ({ // eslint-disable-next-line react-hooks/exhaustive-deps }, [propertyParameterValue]); + if (hidden) { + return <>; + } + return (
  • { + if (key.match(/^\d/)) { + formattedObj[`${PATH_DIGIT_PREFIX}${key}`] = formattedObj[key]; + + delete formattedObj[key]; + } + + if (isObject(formattedObj[key]) && formattedObj[key] !== null) { + formattedObj[key] = formatKeysWithDigits(formattedObj[key]); + } + }); + + return formattedObj; +}