Add support for hidden command arguments (#5534)
* Add configuration/type support for `hidden` * Add UI support for `hidden` configuration * Make `nodeToEdit` args hidden * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Fix cmdBarFixture to actually serialize to "pickCommand" case * Add test step to ensure hidden commands can't be backed into * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
@ -43,9 +43,10 @@ export const CommandBar = () => {
|
||||
if (commandBarState.matches('Review')) {
|
||||
const entries = Object.entries(selectedCommand?.args || {}).filter(
|
||||
([_, argConfig]) =>
|
||||
typeof argConfig.required === 'function'
|
||||
!argConfig.hidden &&
|
||||
(typeof argConfig.required === 'function'
|
||||
? argConfig.required(commandBarState.context)
|
||||
: argConfig.required
|
||||
: argConfig.required)
|
||||
)
|
||||
|
||||
const currentArgName = entries[entries.length - 1][0]
|
||||
@ -64,7 +65,9 @@ export const CommandBar = () => {
|
||||
commandBarActor.send({ type: 'Deselect command' })
|
||||
}
|
||||
} else {
|
||||
const entries = Object.entries(selectedCommand?.args || {})
|
||||
const entries = Object.entries(selectedCommand?.args || {}).filter(
|
||||
(a) => !a[1].hidden
|
||||
)
|
||||
const index = entries.findIndex(
|
||||
([key, _]) => key === currentArgument.name
|
||||
)
|
||||
|
Reference in New Issue
Block a user