diff --git a/src/components/Autocomplete.vue b/src/components/Autocomplete.vue new file mode 100644 index 000000000..6c6df1af7 --- /dev/null +++ b/src/components/Autocomplete.vue @@ -0,0 +1,80 @@ + + + diff --git a/src/components/SelectLanguage.vue b/src/components/SelectLanguage.vue new file mode 100644 index 000000000..44d50fd2d --- /dev/null +++ b/src/components/SelectLanguage.vue @@ -0,0 +1,44 @@ + + + diff --git a/src/components/example/NewExampleForm.vue b/src/components/example/NewExampleForm.vue index f0ccc38ab..2eb581979 100644 --- a/src/components/example/NewExampleForm.vue +++ b/src/components/example/NewExampleForm.vue @@ -38,18 +38,11 @@ - @@ -58,19 +51,10 @@ :label="$t('webapp.create_repository.language_placeholder')" :message="errors.intent" > - - - + :placeholder="$t('webapp.translate.languages_select')" + /> @@ -125,6 +109,8 @@ import NewEntitiesInput from '@/components/inputs/EntitiesInput/NewEntitiesInput import { mapActions, mapGetters } from 'vuex'; import { formatters, LANGUAGES } from '@/utils'; import InputWithHightlights from '../InputWithHightlights'; +import SelectLanguage from '../SelectLanguage.vue'; +import Autocomplete from '../Autocomplete.vue'; export default { name: 'NewExampleForm', @@ -132,6 +118,8 @@ export default { ExampleTextWithHighlightedEntitiesInput, NewEntitiesInput, InputWithHightlights, + SelectLanguage, + Autocomplete, }, props: { repository: { @@ -151,7 +139,6 @@ export default { entitiesList: [], blockedNextStepTutorial: false, hideDropdown: true, - isIntentInputActive: false, isLanguageInputActive: false, alertSuccess: false, addEntity: false, @@ -165,9 +152,7 @@ export default { return this.isValid && !this.submitting; }, filteredData() { - return (this.repository.intents_list || []).filter((intent) => - intent.startsWith(this.intent.toLowerCase()), - ); + return this.repository.intents_list || []; }, validationErrors() { const errors = []; @@ -209,9 +194,6 @@ export default { entities, }; }, - languageList() { - return Object.keys(LANGUAGES).map((lang) => [lang, LANGUAGES[lang]]); - }, }, watch: { async intent() { @@ -294,9 +276,6 @@ export default { } return false; }, - onIntentInputClick() { - this.isIntentInputActive = !this.isIntentInputActive; - }, }, }; diff --git a/src/components/form-generator/inputs/ChoiceInput.vue b/src/components/form-generator/inputs/ChoiceInput.vue index 82a33f615..9259a59d4 100644 --- a/src/components/form-generator/inputs/ChoiceInput.vue +++ b/src/components/form-generator/inputs/ChoiceInput.vue @@ -1,103 +1,111 @@ - - - + + + diff --git a/src/components/inputs/EntitiesInput/NewEntitiesInput.vue b/src/components/inputs/EntitiesInput/NewEntitiesInput.vue index fee810256..ee0679cc0 100644 --- a/src/components/inputs/EntitiesInput/NewEntitiesInput.vue +++ b/src/components/inputs/EntitiesInput/NewEntitiesInput.vue @@ -73,16 +73,16 @@ :closeIcon="false" >