Skip to content

feat: add feedback link to footer #2447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jun 17, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fixing type for ParameterSchema
resolves #2161
  • Loading branch information
Kira-Pilot committed Jun 15, 2022
commit f8dcb1b2ec3c8ba0e186b226e350b9fdca6cccd6
2 changes: 1 addition & 1 deletion codersdk/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ type ParameterSchema struct {

// This is a special array of items provided if the validation condition
// explicitly states the value must be one of a set.
ValidationContains []string `json:"validation_contains"`
ValidationContains []string `json:"validation_contains,omitempty"`
}

// CreateParameterRequest is used to create a new parameter value for a scope.
Expand Down
2 changes: 1 addition & 1 deletion site/src/api/typesGenerated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 9 additions & 11 deletions site/src/components/ParameterInput/ParameterInput.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
import FormControlLabel from "@material-ui/core/FormControlLabel"
import Radio from "@material-ui/core/Radio"
import RadioGroup from "@material-ui/core/RadioGroup"
Expand Down Expand Up @@ -38,16 +37,15 @@ const ParameterField: React.FC<ParameterInputProps> = ({ disabled, onChange, sch
onChange(event.target.value)
}}
>
{schema.validation_contains &&
schema.validation_contains.map((item) => (
<FormControlLabel
disabled={disabled}
key={item}
value={item}
control={<Radio color="primary" size="small" disableRipple />}
label={item}
/>
))}
{schema.validation_contains.map((item) => (
<FormControlLabel
disabled={disabled}
key={item}
value={item}
control={<Radio color="primary" size="small" disableRipple />}
label={item}
/>
))}
</RadioGroup>
)
}
Expand Down