Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/forms/KeyValue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ interface KeyValueProps {
// render the value field as a textarea when true
isTextArea?: boolean
isEncrypted?: boolean
isValueOptional?: boolean
}

// This local subcomponent watches the key field (using its path) and checks the provided
Expand Down Expand Up @@ -182,6 +183,7 @@ export default function KeyValue(props: KeyValueProps) {
decoratorMapping,
isTextArea = false,
isEncrypted,
isValueOptional = false,
} = props

const { fields, append, remove } = useFieldArray({ control, name })
Expand Down Expand Up @@ -220,7 +222,7 @@ export default function KeyValue(props: KeyValueProps) {
const commonProps = {
...register(valuePath),
width: valueSize,
label: showLabel && localIndex === 0 ? valueLabel : '',
label: showLabel && localIndex === 0 ? `${valueLabel}${isValueOptional ? ' (optional)' : ''}` : '',
noMarginTop: compressed,
disabled: isFieldDisabled,
type: valueIsNumber ? 'number' : undefined,
Expand Down
3 changes: 2 additions & 1 deletion src/pages/builds/create-edit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,13 @@ export default function CreateEditBuilds({
title='Extra arguments'
subTitle='Additional arguments to pass on to the build executor'
keyLabel='Name'
valueLabel='Value (optional)'
valueLabel='Value'
addLabel='Add argument'
compressed
name={`mode.${watch('mode.type')}.envVars`}
{...register(`mode.${watch('mode.type')}.envVars`)}
errorText={extraArgumentsError()}
isValueOptional
/>

<Divider sx={{ mt: 2, mb: 2 }} />
Expand Down