mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: adjust ParameterSchema type for workspace creation (#2384)
* add ability to activate users resolves #2254 * added test * PR feedback * guarding against null validation_contains field * fixing type for ParameterSchema resolves #2161
This commit is contained in:
@@ -190,7 +190,7 @@ export interface ParameterSchema {
|
||||
readonly validation_condition: string
|
||||
readonly validation_type_system: string
|
||||
readonly validation_value_type: string
|
||||
readonly validation_contains: string[]
|
||||
readonly validation_contains?: string[]
|
||||
}
|
||||
|
||||
// From codersdk/provisionerdaemons.go:33:6
|
||||
|
||||
@@ -29,7 +29,7 @@ export const ParameterInput: FC<ParameterInputProps> = ({ disabled, onChange, sc
|
||||
}
|
||||
|
||||
const ParameterField: React.FC<ParameterInputProps> = ({ disabled, onChange, schema }) => {
|
||||
if (schema.validation_contains.length > 0) {
|
||||
if (schema.validation_contains && schema.validation_contains.length > 0) {
|
||||
return (
|
||||
<RadioGroup
|
||||
defaultValue={schema.default_source_value}
|
||||
|
||||
Reference in New Issue
Block a user