Skip to content

Commit

Permalink
Add mising validations to admin definition UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Jun 26, 2022
1 parent 76cfdd8 commit c873773
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions admin/definition.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h3>Add definition</h3>
<div>&darr;</div>
<div>
<label>Definition</label>
<textarea autofocus name="content" x-model="def.content"></textarea>
<textarea required autofocus name="content" x-ref="content" x-model="def.content"></textarea>
</div>
<br />
<template x-if="Object.keys(config.languages[parent.lang].types).length > 0">
Expand All @@ -27,7 +27,7 @@ <h3>Add definition</h3>

<div class="column four">
<label>Relation types</label>
<select name="lang" x-model="def.types" multiple>
<select name="lang" x-model="def.types" multiple required>
<template x-for="[id, typ] in Object.entries(config.languages[def.lang].types)" :key="id">
<option :value="id" x-text="typ"></option>
</template>
Expand Down
3 changes: 3 additions & 0 deletions admin/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,9 @@ function definitionComponent() {

this.def = { ...e.detail, tags: e.detail.tags.join('\n') };
this.isVisible = true;
this.$nextTick(() => {
this.$refs.content.focus();
});
},

onSave() {
Expand Down

0 comments on commit c873773

Please sign in to comment.