feat: move quick add magic to a popup behind an icon
This commit is contained in:
parent
7fb85dacec
commit
6989558963
@ -67,6 +67,7 @@ import {
|
|||||||
faStar,
|
faStar,
|
||||||
faSun,
|
faSun,
|
||||||
faTimesCircle,
|
faTimesCircle,
|
||||||
|
faCircleQuestion,
|
||||||
} from '@fortawesome/free-regular-svg-icons'
|
} from '@fortawesome/free-regular-svg-icons'
|
||||||
import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome'
|
import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome'
|
||||||
|
|
||||||
@ -86,6 +87,7 @@ library.add(faCheckDouble)
|
|||||||
library.add(faChessKnight)
|
library.add(faChessKnight)
|
||||||
library.add(faChevronDown)
|
library.add(faChevronDown)
|
||||||
library.add(faCircleInfo)
|
library.add(faCircleInfo)
|
||||||
|
library.add(faCircleQuestion)
|
||||||
library.add(faClock)
|
library.add(faClock)
|
||||||
library.add(faCloudDownloadAlt)
|
library.add(faCloudDownloadAlt)
|
||||||
library.add(faCloudUploadAlt)
|
library.add(faCloudUploadAlt)
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
<span class="icon is-small is-left">
|
<span class="icon is-small is-left">
|
||||||
<icon icon="tasks"/>
|
<icon icon="tasks"/>
|
||||||
</span>
|
</span>
|
||||||
|
<quick-add-magic/>
|
||||||
</p>
|
</p>
|
||||||
<p class="control">
|
<p class="control">
|
||||||
<x-button
|
<x-button
|
||||||
@ -32,11 +33,10 @@
|
|||||||
</x-button>
|
</x-button>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<Expandable :open="errorMessage !== '' || showQuickAddMagicHelp">
|
<Expandable :open="errorMessage !== ''">
|
||||||
<p class="pt-3 mt-0 help is-danger" v-if="errorMessage !== ''">
|
<p class="pt-3 mt-0 help is-danger" v-if="errorMessage !== ''">
|
||||||
{{ errorMessage }}
|
{{ errorMessage }}
|
||||||
</p>
|
</p>
|
||||||
<quick-add-magic v-else class="quick-add-magic" @hide="() => showQuickAddMagicHelp = false"/>
|
|
||||||
</Expandable>
|
</Expandable>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -44,7 +44,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {computed, ref} from 'vue'
|
import {computed, ref} from 'vue'
|
||||||
import {useI18n} from 'vue-i18n'
|
import {useI18n} from 'vue-i18n'
|
||||||
import {useLocalStorage} from '@vueuse/core'
|
|
||||||
|
|
||||||
import {RELATION_KIND} from '@/types/IRelationKind'
|
import {RELATION_KIND} from '@/types/IRelationKind'
|
||||||
import type {ITask} from '@/modelTypes/ITask'
|
import type {ITask} from '@/modelTypes/ITask'
|
||||||
@ -85,8 +84,6 @@ const taskStore = useTaskStore()
|
|||||||
// newTaskInput.value.focus()
|
// newTaskInput.value.focus()
|
||||||
// })
|
// })
|
||||||
|
|
||||||
const showQuickAddMagicHelp = useLocalStorage('show-quick-add-magic', true)
|
|
||||||
|
|
||||||
const errorMessage = ref('')
|
const errorMessage = ref('')
|
||||||
|
|
||||||
function resetEmptyTitleError(e: KeyboardEvent) {
|
function resetEmptyTitleError(e: KeyboardEvent) {
|
||||||
@ -238,8 +235,4 @@ defineExpose({
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
.quick-add-magic {
|
|
||||||
padding-top: 0.75rem;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,10 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-if="mode !== 'disabled' && prefixes !== undefined">
|
<div v-if="mode !== 'disabled' && prefixes !== undefined">
|
||||||
<p class="help has-text-grey">
|
<BaseButton
|
||||||
{{ $t('task.quickAddMagic.hint') }}.
|
@click="() => visible = true"
|
||||||
<ButtonLink @click="() => visible = true">{{ $t('task.quickAddMagic.what') }}</ButtonLink>
|
class="icon is-small show-helper-text"
|
||||||
<ButtonLink @click="() => emit('hide')" class="ml-1">{{ $t('task.quickAddMagic.hide') }}</ButtonLink>
|
v-tooltip="$t('task.quickAddMagic.hint')"
|
||||||
</p>
|
:aria-label="$t('task.quickAddMagic.hint')"
|
||||||
|
>
|
||||||
|
<icon :icon="['far', 'circle-question']"/>
|
||||||
|
</BaseButton>
|
||||||
<modal
|
<modal
|
||||||
:enabled="visible"
|
:enabled="visible"
|
||||||
@close="() => visible = false"
|
@close="() => visible = false"
|
||||||
@ -70,7 +73,7 @@
|
|||||||
<li>17th ({{ $t('task.quickAddMagic.dateNth', {day: '17'}) }})</li>
|
<li>17th ({{ $t('task.quickAddMagic.dateNth', {day: '17'}) }})</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>{{ $t('task.quickAddMagic.dateTime', {time: 'at 17:00', timePM: '5pm'}) }}</p>
|
<p>{{ $t('task.quickAddMagic.dateTime', {time: 'at 17:00', timePM: '5pm'}) }}</p>
|
||||||
|
|
||||||
<h3>{{ $t('task.quickAddMagic.repeats') }}</h3>
|
<h3>{{ $t('task.quickAddMagic.repeats') }}</h3>
|
||||||
<p>{{ $t('task.quickAddMagic.repeatsDescription', {suffix: 'every {amount} {type}'}) }}</p>
|
<p>{{ $t('task.quickAddMagic.repeatsDescription', {suffix: 'every {amount} {type}'}) }}</p>
|
||||||
<p>{{ $t('misc.forExample') }}</p>
|
<p>{{ $t('misc.forExample') }}</p>
|
||||||
@ -93,15 +96,20 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {ref, computed} from 'vue'
|
import {ref, computed} from 'vue'
|
||||||
|
|
||||||
import ButtonLink from '@/components/misc/ButtonLink.vue'
|
import BaseButton from '@/components/base/BaseButton.vue'
|
||||||
|
|
||||||
import {getQuickAddMagicMode} from '@/helpers/quickAddMagicMode'
|
import {getQuickAddMagicMode} from '@/helpers/quickAddMagicMode'
|
||||||
import {PREFIXES} from '@/modules/parseTaskText'
|
import {PREFIXES} from '@/modules/parseTaskText'
|
||||||
|
|
||||||
const emit = defineEmits(['hide'])
|
|
||||||
|
|
||||||
const visible = ref(false)
|
const visible = ref(false)
|
||||||
const mode = ref(getQuickAddMagicMode())
|
const mode = ref(getQuickAddMagicMode())
|
||||||
|
|
||||||
const prefixes = computed(() => PREFIXES[mode.value])
|
const prefixes = computed(() => PREFIXES[mode.value])
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.show-helper-text {
|
||||||
|
right: 0;
|
||||||
|
pointer-events: auto !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -737,9 +737,7 @@
|
|||||||
"invalidAmount": "Please enter more than 0."
|
"invalidAmount": "Please enter more than 0."
|
||||||
},
|
},
|
||||||
"quickAddMagic": {
|
"quickAddMagic": {
|
||||||
"hint": "You can use Quick Add Magic",
|
"hint": "You can use Quick Add Magic. Click to learn more.",
|
||||||
"hide": "Hide",
|
|
||||||
"what": "What?",
|
|
||||||
"title": "Quick Add Magic",
|
"title": "Quick Add Magic",
|
||||||
"intro": "When creating a task, you can use special keywords to directly add attributes to the newly created task. This allows to add commonly used attributes to tasks much faster.",
|
"intro": "When creating a task, you can use special keywords to directly add attributes to the newly created task. This allows to add commonly used attributes to tasks much faster.",
|
||||||
"multiple": "You can use this multiple times.",
|
"multiple": "You can use this multiple times.",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user