mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-02-01 22:47:40 +00:00
refactor(frontend): use FormField disabled prop instead of class
Simplify FormField usages by using the new disabled prop instead of
manually setting both :class="{ disabled: ... }" and :disabled="...".
This commit is contained in:
@@ -14,8 +14,8 @@
|
||||
v-model="filter.title"
|
||||
v-focus
|
||||
:label="$t('filters.attributes.title')"
|
||||
:class="{ 'disabled': filterService.loading, 'is-danger': !titleValid }"
|
||||
:disabled="filterService.loading || undefined"
|
||||
:class="{ 'is-danger': !titleValid }"
|
||||
:disabled="filterService.loading"
|
||||
:placeholder="$t('filters.attributes.titlePlaceholder')"
|
||||
type="text"
|
||||
:error="titleValid ? null : $t('filters.create.titleRequired')"
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
v-model="filter.title"
|
||||
v-focus
|
||||
:label="$t('filters.attributes.title')"
|
||||
:class="{ 'disabled': filterService.loading, 'is-danger': !titleValid }"
|
||||
:disabled="filterService.loading || undefined"
|
||||
:class="{ 'is-danger': !titleValid }"
|
||||
:disabled="filterService.loading"
|
||||
:placeholder="$t('filters.attributes.titlePlaceholder')"
|
||||
type="text"
|
||||
:error="titleValid ? null : $t('filters.create.titleRequired')"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
v-model="label.title"
|
||||
v-focus
|
||||
:label="$t('label.attributes.title')"
|
||||
:class="{ disabled: loading }"
|
||||
:disabled="loading"
|
||||
:placeholder="$t('label.attributes.titlePlaceholder')"
|
||||
type="text"
|
||||
:error="showError && label.title === '' ? $t('label.create.titleRequired') : null"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
v-model="project.title"
|
||||
v-focus
|
||||
:label="$t('project.title')"
|
||||
:class="{ disabled: projectService.loading }"
|
||||
:disabled="projectService.loading"
|
||||
:placeholder="$t('project.create.titlePlaceholder')"
|
||||
type="text"
|
||||
name="projectTitle"
|
||||
|
||||
@@ -13,8 +13,7 @@
|
||||
v-model="project.title"
|
||||
v-focus
|
||||
:label="$t('project.title')"
|
||||
:class="{ 'disabled': isLoading}"
|
||||
:disabled="isLoading || undefined"
|
||||
:disabled="isLoading"
|
||||
:placeholder="$t('project.edit.titlePlaceholder')"
|
||||
type="text"
|
||||
@keyup.enter="save"
|
||||
@@ -39,8 +38,7 @@
|
||||
v-model="project.identifier"
|
||||
v-tooltip="$t('project.edit.identifierTooltip')"
|
||||
:label="$t('project.edit.identifier')"
|
||||
:class="{ 'disabled': isLoading}"
|
||||
:disabled="isLoading || undefined"
|
||||
:disabled="isLoading"
|
||||
:placeholder="$t('project.edit.identifierPlaceholder')"
|
||||
type="text"
|
||||
maxlength="10"
|
||||
|
||||
@@ -14,8 +14,7 @@
|
||||
v-model="team.name"
|
||||
v-focus
|
||||
:label="$t('team.attributes.name')"
|
||||
:class="{ disabled: teamMemberService.loading }"
|
||||
:disabled="teamMemberService.loading || undefined"
|
||||
:disabled="teamMemberService.loading"
|
||||
:placeholder="$t('team.attributes.namePlaceholder')"
|
||||
type="text"
|
||||
:error="showErrorTeamnameRequired && team.name === '' ? $t('team.attributes.nameRequired') : null"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
v-model="team.name"
|
||||
v-focus
|
||||
:label="$t('team.attributes.name')"
|
||||
:class="{ 'disabled': teamService.loading }"
|
||||
:disabled="teamService.loading"
|
||||
:placeholder="$t('team.attributes.namePlaceholder')"
|
||||
type="text"
|
||||
:error="showError && team.name === '' ? $t('team.attributes.nameRequired') : null"
|
||||
|
||||
Reference in New Issue
Block a user