fix: Remove savePath rule when creating category (#970)

This commit is contained in:
Rémi Marseault 2023-07-17 10:13:13 +02:00 committed by GitHub
parent 10ada6ed23
commit 9f59632d91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 19 additions and 31 deletions

View file

@ -16,15 +16,15 @@
:autofocus="!hasInitialCategory"
:disabled="hasInitialCategory"
/>
<v-text-field v-model="category.savePath" :rules="pathRules" :label="$t('path')" required :autofocus="hasInitialCategory" />
<v-text-field v-model="category.savePath" :label="$t('path')" :autofocus="hasInitialCategory" />
</v-container>
</v-card-text>
<v-divider />
<v-card-actions class="justify-end">
<v-btn v-if="!hasInitialCategory" class="accent white--text elevation-0 px-4" @click="create" :disabled="!isValid">
<v-btn v-if="!hasInitialCategory" class="accent white--text elevation-0 px-4" :disabled="!isValid" @click="create">
{{ $t('create') }}
</v-btn>
<v-btn v-else class="accent white--text elevation-0 px-4" @click="edit" :disabled="!isValid">
<v-btn v-else class="accent white--text elevation-0 px-4" :disabled="!isValid" @click="edit">
{{ $t('edit') }}
</v-btn>
<v-btn class="error white--text elevation-0 px-4" @click="cancel">
@ -62,11 +62,8 @@ export default {
nameRules() {
return [v => !!v || this.$t('modals.newCategory.tipOnNoName')]
},
pathRules() {
return [v => !!v || this.$t('modals.newCategory.tipOnNoPath')]
},
isValid() {
return !!this.category.name && !!this.category.savePath
return !!this.category.name
}
},
created() {

View file

@ -31,7 +31,7 @@ import qbit from '@/services/qbit'
import { Modal } from '@/mixins'
export default defineComponent({
name: 'CreateTagDialog',
name: 'CreateNewTagDialog',
mixins: [Modal],
data() {
return {

View file

@ -1,4 +1,4 @@
import CreateNewTagDialog from './CreateTagDialog.vue'
import CreateNewCategoryDialog from './CreateCategoryDialog.vue'
import CreateNewTagDialog from './CreateNewTagDialog.vue'
import CreateNewCategoryDialog from './CreateNewCategoryDialog.vue'
export { CreateNewTagDialog, CreateNewCategoryDialog }

View file

@ -90,10 +90,10 @@ export default {
this.$store.commit('FETCH_TAGS')
},
createTag() {
this.createModal('CreateTagDialog')
this.createModal('CreateNewTagDialog')
},
createCategory() {
this.createModal('CreateCategoryDialog')
this.createModal('CreateNewCategoryDialog')
},
async deleteCategory(category) {
await qbit.deleteCategory([category.name])
@ -104,7 +104,7 @@ export default {
this.$store.commit('FETCH_TAGS')
},
editCategory(cat) {
this.createModal('CreateCategoryDialog', { initialCategory: cat })
this.createModal('CreateNewCategoryDialog', { initialCategory: cat })
}
}
}

View file

@ -643,8 +643,7 @@
"newCategory": {
"categoryName": "Category name",
"Path": "Path",
"tipOnNoName": "Category name is required",
"tipOnNoPath": "Path is required"
"tipOnNoName": "Category name is required"
},
"newTag": {
"createNewTag": "Create New Tag",

View file

@ -351,8 +351,7 @@
"newCategory": {
"categoryName": "Nom de la catégorie",
"Path": "Chemin d'accès",
"tipOnNoName": "Le nom de la catégorie est obligatoire",
"tipOnNoPath": "Le chemin d'accès est obligatoire"
"tipOnNoName": "Le nom de la catégorie est obligatoire"
},
"newTag": {
"createNewTag": "Créer un nouveau tag",

View file

@ -271,8 +271,7 @@
"newCategory": {
"categoryName": "Nama kategori",
"Path": "Path",
"tipOnNoName": "Nama kategori diperlukan",
"tipOnNoPath": "Path is required"
"tipOnNoName": "Nama kategori diperlukan"
},
"newTag": {
"createNewTag": "Buat Tag Baru",

View file

@ -266,8 +266,7 @@
"newCategory": {
"categoryName": "カテゴリ名",
"Path": "パス",
"tipOnNoName": "カテゴリ名が必要です",
"tipOnNoPath": "パスが必要です"
"tipOnNoName": "カテゴリ名が必要です"
},
"newTag": {
"createNewTag": "タグを作成",

View file

@ -608,8 +608,7 @@
"newCategory": {
"categoryName": "Название категории",
"Path": "Путь",
"tipOnNoName": "Требуется название категории",
"tipOnNoPath": "Нужный путь"
"tipOnNoName": "Требуется название категории"
},
"newTag": {
"createNewTag": "Создать новый тэг",

View file

@ -608,8 +608,7 @@
"newCategory": {
"categoryName": "Назва категорії",
"Path": "Шлях",
"tipOnNoName": "Вкажіть назву категорії",
"tipOnNoPath": "Вкажіть шлях до теки"
"tipOnNoName": "Вкажіть назву категорії"
},
"newTag": {
"createNewTag": "Створити нову мітку",

View file

@ -334,8 +334,7 @@
"newCategory": {
"categoryName": "Tên danh mục",
"Path": "Nơi lưu",
"tipOnNoName": "Tên danh mục là bắt buộc",
"tipOnNoPath": "Nơi lưu là bắt buộc"
"tipOnNoName": "Tên danh mục là bắt buộc"
},
"newTag": {
"createNewTag": "Tạo thẻ mới",

View file

@ -637,8 +637,7 @@
"newCategory": {
"categoryName": "分类名称",
"Path": "路径",
"tipOnNoName": "分类名称是必须的",
"tipOnNoPath": "路径是必须的"
"tipOnNoName": "分类名称是必须的"
},
"newTag": {
"createNewTag": "新建标签",

View file

@ -643,8 +643,7 @@
"newCategory": {
"categoryName": "分類名稱",
"Path": "路徑",
"tipOnNoName": "必須填寫分類名稱",
"tipOnNoPath": "必須填寫路徑"
"tipOnNoName": "必須填寫分類名稱"
},
"newTag": {
"createNewTag": "新增標籤",