discourse-data-explorer/assets/javascripts/discourse/components/param-input.hbs

65 lines
1.7 KiB
Handlebars
Raw Normal View History

<div class="param {{if this.valid 'valid' 'invalid'}}">
{{#if (eq this.type "boolean")}}
{{#if @info.nullable}}
<ComboBox
@valueAttribute="id"
@value={{this.nullableBoolValue}}
@nameProperty="name"
@content={{this.boolTypes}}
@onChange={{this.updateNullableBoolValue}}
name={{@info.identifier}}
/>
{{else}}
<Input
@type="checkbox"
@checked={{this.boolvalue}}
{{on "change" this.updateBoolValue}}
name={{@info.identifier}}
/>
{{/if}}
<span class="param-name">{{@info.identifier}}</span>
{{else if (eq this.type "int")}}
<Input
@type="number"
@value={{this.value}}
{{on "change" this.updateValue}}
name={{@info.identifier}}
/>
<span class="param-name">{{@info.identifier}}</span>
{{else if (eq this.type "string")}}
<TextField
@value={{this.value}}
@type="text"
@onChange={{this.updateValue}}
name={{@info.identifier}}
/>
<span class="param-name">{{@info.identifier}}</span>
{{else if (eq this.type "user_id")}}
<EmailGroupUserChooser
@value={{this.value}}
@options={{(hash maximum=1)}}
@onChange={{this.updateValue}}
name={{@info.identifier}}
/>
<span class="param-name">{{@info.identifier}}</span>
{{else if (eq this.type "user_list")}}
<EmailGroupUserChooser
@value={{this.value}}
@onChange={{this.updateValue}}
name={{@info.identifier}}
/>
<span class="param-name">{{@info.identifier}}</span>
{{else}}
<TextField
@value={{this.value}}
@onChange={{this.updateValue}}
name={{@info.identifier}}
/>
<span class="param-name">{{@info.identifier}}</span>
{{/if}}
</div>