Trim important fields in repository and inventory forms

This will prevent whitespaces at the start or the end of the strings
to be saved as part of the inventory path or the repository url/path
This commit is contained in:
Arnaud V 2024-07-02 17:59:05 +02:00
parent 2dc2e3e191
commit c60e952ec5
2 changed files with 4 additions and 4 deletions

View File

@ -52,7 +52,7 @@
></v-select>
<v-text-field
v-model="item.inventory"
v-model.trim="item.inventory"
:label="$t('pathToInventoryFile')"
:rules="[v => !!v || $t('path_required')]"
required
@ -73,7 +73,7 @@
<codemirror
:style="{ border: '1px solid lightgray' }"
v-model="item.inventory"
v-model.trim="item.inventory"
:options="cmOptions"
v-if="item.type === 'static' || item.type === 'static-yaml'"
:placeholder="$t('enterInventory')"

View File

@ -21,7 +21,7 @@
></v-text-field>
<v-text-field
v-model="item.git_url"
v-model.trim="item.git_url"
:label="$t('urlOrPath')"
:rules="[
v => !!v || $t('repository_required'),
@ -56,7 +56,7 @@
</div>
<v-text-field
v-model="item.git_branch"
v-model.trim="item.git_branch"
:label="$t('branch')"
:rules="[v => (!!v || type === 'local') || $t('branch_required')]"
required