meilisearch-admin/app/components/index-setting.hbs
Stanislav Romanov cc252f0ebc Add validation
2022-10-15 15:13:34 +03:00

28 lines
762 B
Handlebars

<div
class='mb-4'
{{did-insert this.setValue}}
{{did-update this.setValue @setting}}
>
{{! TODO: add link to meilisearch's documentation }}
<Form::Element @label={{@label}} @errors={{this.errors}}>
<MonacoEditor
@value={{json-stringify this.value}}
@uri={{@setting.uri}}
@language='json'
@schema={{@setting}}
@sendValue={{this.save}}
@invoker={{this.invoker}}
@onDidValidation={{set this 'errors'}}
class='h-40'
/>
</Form::Element>
<Button
@text='Save'
@style='primary'
@size='sm'
@onClick={{fn this.invoker.invoke 'invokeSendValue'}}
/>
<Button @text='Cancel' @size='sm' @onClick={{this.setValue}} />
<Button @text='Reset' @size='sm' @onClick={{this.reset}} />
</div>