fix(task): show related tasks form with shortcut even when there are already other related tasks
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
Resolves https://github.com/go-vikunja/frontend/issues/122
This commit is contained in:
parent
47d589002c
commit
5630c90dee
|
@ -9,6 +9,7 @@
|
|||
variant="secondary"
|
||||
icon="plus"
|
||||
:shadow="false"
|
||||
id="showRelatedTasksFormButton"
|
||||
/>
|
||||
<transition-group name="fade">
|
||||
<template v-if="editEnabled && showCreate">
|
||||
|
|
|
@ -378,7 +378,7 @@
|
|||
{{ $t('task.detail.actions.attachments') }}
|
||||
</x-button>
|
||||
<x-button
|
||||
@click="setFieldActive('relatedTasks')"
|
||||
@click="setRelatedTasksActive()"
|
||||
variant="secondary"
|
||||
icon="sitemap"
|
||||
v-shortcut="'r'"
|
||||
|
@ -777,6 +777,19 @@ async function removeRepeatAfter() {
|
|||
task.value.repeatMode = TASK_REPEAT_MODES.REPEAT_MODE_DEFAULT
|
||||
await saveTask()
|
||||
}
|
||||
|
||||
function setRelatedTasksActive() {
|
||||
setFieldActive('relatedTasks')
|
||||
|
||||
// If the related tasks are already available, show the form again
|
||||
const el = activeFieldElements['relatedTasks']
|
||||
for (const child in el?.children) {
|
||||
if (el?.children[child]?.id === 'showRelatedTasksFormButton') {
|
||||
el?.children[child]?.click()
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
Reference in New Issue