Skip to content

feat: setup connection to dynamic parameters websocket #17393

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 20 commits into from
Apr 16, 2025
Merged
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
fix: remove filters
  • Loading branch information
jaaydenh committed Apr 16, 2025
commit 7c13eb7079affb51d6bbed95269feb14082d035f
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,6 @@ const ParameterField: FC<ParameterFieldProps> = ({
</SelectTrigger>
<SelectContent>
{parameter.options
.filter(
(option): option is NonNullable<typeof option> =>
option !== null,
)
.map((option) => (
<SelectItem key={option.value.value} value={option.value.value}>
<OptionDisplay option={option} />
Expand All @@ -190,7 +186,6 @@ const ParameterField: FC<ParameterFieldProps> = ({
case "multi-select": {
// Map parameter options to MultiSelectCombobox options format
const comboboxOptions: Option[] = parameter.options
.filter((opt): opt is NonNullable<typeof opt> => opt !== null)
.map((opt) => ({
value: opt.value.value,
label: opt.name,
Expand All @@ -200,7 +195,6 @@ const ParameterField: FC<ParameterFieldProps> = ({
const defaultOptions: Option[] = JSON.parse(defaultValue).map(
(val: string) => {
const option = parameter.options
.filter((o): o is NonNullable<typeof o> => o !== null)
.find((o) => o.value.value === val);
return {
value: val,
Expand Down Expand Up @@ -252,9 +246,6 @@ const ParameterField: FC<ParameterFieldProps> = ({
defaultValue={defaultValue}
>
{parameter.options
.filter(
(option): option is NonNullable<typeof option> => option !== null,
)
.map((option) => (
<div
key={option.value.value}
Expand Down Expand Up @@ -294,10 +285,7 @@ const ParameterField: FC<ParameterFieldProps> = ({
const inputProps: Record<string, unknown> = {};

if (parameter.type === "number") {
const validations =
parameter.validations.filter(
(v): v is NonNullable<typeof v> => v !== null,
)[0] || {};
const validations = parameter.validations[0] || {};
const { validation_min, validation_max } = validations;

if (validation_min !== null) {
Expand Down Expand Up @@ -366,10 +354,6 @@ const ParameterDiagnostics: FC<ParameterDiagnosticsProps> = ({
return (
<div className="flex flex-col gap-2">
{diagnostics
.filter(
(diagnostic): diagnostic is NonNullable<typeof diagnostic> =>
diagnostic !== null,
)
.map((diagnostic, index) => (
<div
key={`diagnostic-${diagnostic.summary}-${index}`}
Expand Down Expand Up @@ -455,10 +439,8 @@ export const useValidationSchemaForDynamicParameters = (
switch (parameter.type) {
case "number": {
const minValidation = parameter.validations
.filter((v): v is NonNullable<typeof v> => v !== null)
.find((v) => v.validation_min !== null);
const maxValidation = parameter.validations
.filter((v): v is NonNullable<typeof v> => v !== null)
.find((v) => v.validation_max !== null);

if (
Expand Down Expand Up @@ -569,13 +551,10 @@ const parameterError = (
value?: string,
): string | undefined => {
const validation_error = parameter.validations
.filter((v): v is NonNullable<typeof v> => v !== null)
.find((v) => v.validation_error !== null);
const minValidation = parameter.validations
.filter((v): v is NonNullable<typeof v> => v !== null)
.find((v) => v.validation_min !== null);
const maxValidation = parameter.validations
.filter((v): v is NonNullable<typeof v> => v !== null)
.find((v) => v.validation_max !== null);

if (!validation_error || !value) {
Expand Down