Hide selection-type args from command palette while in an edit flow (#5763)
* Allow `hidden` config to be a callback * Hide selection type args if `nodeToEdit` is present in workflows that have an edit flow set up * Remove Selection from headerArguments in edit flow tests
This commit is contained in:
@ -17,7 +17,12 @@ function CommandBarHeader({ children }: React.PropsWithChildren<{}>) {
|
||||
if (!selectedCommand?.args) return undefined
|
||||
const s = { ...selectedCommand.args }
|
||||
for (const [name, arg] of Object.entries(s)) {
|
||||
if (arg.hidden) delete s[name]
|
||||
if (
|
||||
typeof arg.hidden === 'function'
|
||||
? arg.hidden(commandBarState.context)
|
||||
: arg.hidden
|
||||
)
|
||||
delete s[name]
|
||||
}
|
||||
return s
|
||||
}, [selectedCommand])
|
||||
|
Reference in New Issue
Block a user