fix(quick actions): do not allow creating a task when the current project is a saved filter
Resolves https://community.vikunja.io/t/creating-task-on-saved-filter-page-doesnt-save/2127
This commit is contained in:
parent
b3caece256
commit
1de39b1cd1
@ -85,7 +85,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {ref, computed, watchEffect, shallowReactive, type ComponentPublicInstance} from 'vue'
|
import {type ComponentPublicInstance, computed, ref, shallowReactive, watchEffect} from 'vue'
|
||||||
import {useI18n} from 'vue-i18n'
|
import {useI18n} from 'vue-i18n'
|
||||||
import {useRouter} from 'vue-router'
|
import {useRouter} from 'vue-router'
|
||||||
|
|
||||||
@ -107,13 +107,14 @@ import {useTaskStore} from '@/stores/tasks'
|
|||||||
import {useAuthStore} from '@/stores/auth'
|
import {useAuthStore} from '@/stores/auth'
|
||||||
|
|
||||||
import {getHistory} from '@/modules/projectHistory'
|
import {getHistory} from '@/modules/projectHistory'
|
||||||
import {parseTaskText, PrefixMode, PREFIXES} from '@/modules/parseTaskText'
|
import {parseTaskText, PREFIXES, PrefixMode} from '@/modules/parseTaskText'
|
||||||
import {success} from '@/message'
|
import {success} from '@/message'
|
||||||
|
|
||||||
import type {ITeam} from '@/modelTypes/ITeam'
|
import type {ITeam} from '@/modelTypes/ITeam'
|
||||||
import type {ITask} from '@/modelTypes/ITask'
|
import type {ITask} from '@/modelTypes/ITask'
|
||||||
import type {IProject} from '@/modelTypes/IProject'
|
import type {IProject} from '@/modelTypes/IProject'
|
||||||
import type {IAbstract} from '@/modelTypes/IAbstract'
|
import type {IAbstract} from '@/modelTypes/IAbstract'
|
||||||
|
import {isSavedFilter} from '@/services/savedFilter'
|
||||||
|
|
||||||
const {t} = useI18n({useScope: 'global'})
|
const {t} = useI18n({useScope: 'global'})
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@ -280,10 +281,13 @@ const commands = computed<{ [key in COMMAND_TYPE]: Command }>(() => ({
|
|||||||
|
|
||||||
const placeholder = computed(() => selectedCmd.value?.placeholder || t('quickActions.placeholder'))
|
const placeholder = computed(() => selectedCmd.value?.placeholder || t('quickActions.placeholder'))
|
||||||
|
|
||||||
const currentProject = computed(() => Object.keys(baseStore.currentProject).length === 0
|
const currentProject = computed(() => {
|
||||||
? null
|
if (Object.keys(baseStore.currentProject).length === 0 || isSavedFilter(baseStore.currentProject)) {
|
||||||
: baseStore.currentProject,
|
return null
|
||||||
)
|
}
|
||||||
|
|
||||||
|
return baseStore.currentProject
|
||||||
|
})
|
||||||
|
|
||||||
const hintText = computed(() => {
|
const hintText = computed(() => {
|
||||||
if (selectedCmd.value !== null && currentProject.value !== null) {
|
if (selectedCmd.value !== null && currentProject.value !== null) {
|
||||||
@ -372,7 +376,7 @@ function searchTasks() {
|
|||||||
const {text, project: projectName, labels} = parsedQuery.value
|
const {text, project: projectName, labels} = parsedQuery.value
|
||||||
|
|
||||||
let filter = ''
|
let filter = ''
|
||||||
|
|
||||||
if (projectName !== null) {
|
if (projectName !== null) {
|
||||||
const project = projectStore.findProjectByExactname(projectName)
|
const project = projectStore.findProjectByExactname(projectName)
|
||||||
console.log({project})
|
console.log({project})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user