diff --git a/assets/javascripts/discourse/components/param-input-form.gjs b/assets/javascripts/discourse/components/param-input-form.gjs index 4b28313d..fa09833d 100644 --- a/assets/javascripts/discourse/components/param-input-form.gjs +++ b/assets/javascripts/discourse/components/param-input-form.gjs @@ -100,46 +100,34 @@ function validationOf(info) { } } +const components = { + int: , + boolean: , + boolean_three: BooleanThree, + category_id: CategoryIdInput, // TODO + user_id: UserIdInput, + user_list: UserListInput, + group_list: GroupInput, + date: , + time: , + datetime: , + default: , +}; + function componentOf(info) { let type = layoutMap[info.type] || "generic"; if (info.nullable && type === "boolean") { type = "boolean_three"; } - switch (type) { - case "int": - return ; - case "boolean": - return ; - case "boolean_three": - return BooleanThree; - case "category_id": - // TODO - return CategoryIdInput; - case "user_id": - return UserIdInput; - case "user_list": - return UserListInput; - case "group_list": - return GroupInput; - case "date": - return ; - case "time": - return ; - case "datetime": - return ; - case "bigint": - case "string": - default: - return ; - } + return components[type] || components.default; } export default class ParamInputForm extends Component {