MCPcopy Index your code
hub / github.com/FlowiseAI/Flowise / showHideInputs

Function showHideInputs

packages/ui/src/utils/genericHelper.js:1304–1334  ·  view source on GitHub ↗
(nodeData, inputType, overrideParams, arrayIndex)

Source from the content-addressed store, hash-verified

1302}
1303
1304export const showHideInputs = (nodeData, inputType, overrideParams, arrayIndex) => {
1305 const params = overrideParams ?? nodeData[inputType] ?? []
1306 const effectiveNodeData = { ...nodeData, inputs: _inputsWithDeclaredDefaults(params, nodeData.inputs) }
1307
1308 for (let i = 0; i < params.length; i += 1) {
1309 const inputParam = params[i]
1310
1311 // Reset display flag to false for each inputParam
1312 inputParam.display = true
1313
1314 if (inputParam.show) {
1315 _showHideOperation(effectiveNodeData, inputParam, 'show', arrayIndex)
1316 }
1317 if (inputParam.hide) {
1318 _showHideOperation(effectiveNodeData, inputParam, 'hide', arrayIndex)
1319 }
1320
1321 // Filter individual options within dropdowns based on their own show/hide conditions
1322 if (inputParam.type === 'options' && inputParam.options) {
1323 inputParam.options = inputParam.options.filter((opt) => {
1324 if (typeof opt === 'string' || (!opt.show && !opt.hide)) return true
1325 const synthetic = { show: opt.show, hide: opt.hide, display: true }
1326 if (opt.show) _showHideOperation(nodeData, synthetic, 'show', arrayIndex)
1327 if (opt.hide) _showHideOperation(nodeData, synthetic, 'hide', arrayIndex)
1328 return synthetic.display !== false
1329 })
1330 }
1331 }
1332
1333 return params
1334}
1335
1336export const showHideInputParams = (nodeData) => {
1337 return showHideInputs(nodeData, 'inputParams')

Callers 7

handleItemInputChangeFunction · 0.90
ArrayRendererFunction · 0.90
handleAddItemFunction · 0.90
showHideInputParamsFunction · 0.70
showHideInputAnchorsFunction · 0.70

Calls 2

_showHideOperationFunction · 0.70

Tested by

no test coverage detected