minor imps

This commit is contained in:
2025-06-19 17:54:13 +02:00
parent e6c66ab232
commit 8b7a51c5bd
7 changed files with 38 additions and 25 deletions

View File

@ -23,23 +23,39 @@
</li> </li>
</template> </template>
<li class="ml-2"> <li class="ml-2">
<NuxtLinkLocale <UiTooltip
:to="{ :tooltip="t('edit')"
name: 'passwordGroupEdit', class="[--placement:bottom]"
params: { groupId: lastGroup?.id },
}"
> >
<Icon name="mdi:pencil" /> <NuxtLinkLocale
</NuxtLinkLocale> :to="{
name: 'passwordGroupEdit',
params: { groupId: lastGroup?.id },
}"
>
<Icon name="mdi:pencil" />
</NuxtLinkLocale>
</UiTooltip>
</li> </li>
</ul> </ul>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { UiTooltip } from '#components'
import type { SelectHaexPasswordsGroups } from '~~/src-tauri/database/schemas/vault' import type { SelectHaexPasswordsGroups } from '~~/src-tauri/database/schemas/vault'
const groups = defineProps<{ items: SelectHaexPasswordsGroups[] }>() const groups = defineProps<{ items: SelectHaexPasswordsGroups[] }>()
const lastGroup = computed(() => groups.items.at(-1)) const lastGroup = computed(() => groups.items.at(-1))
const { t } = useI18n()
</script> </script>
<i18n lang="yaml">
de:
edit: Bearbeiten
en:
edit: Edit
</i18n>

View File

@ -95,7 +95,6 @@ const onClickItemAsync = async (item: IPasswordMenuItem) => {
if (!selectedItems.value.size) longPressedHook.value = false if (!selectedItems.value.size) longPressedHook.value = false
} else { } else {
search.value = ''
if (item.type === 'group') if (item.type === 'group')
await navigateTo( await navigateTo(
localePath({ localePath({
@ -114,6 +113,7 @@ const onClickItemAsync = async (item: IPasswordMenuItem) => {
}), }),
) )
} }
search.value = ''
} }
} }

View File

@ -11,13 +11,10 @@
</slot> </slot>
<span <span
class="tooltip-content tooltip-shown:opacity-100 tooltip-shown:visible z-40 pointer-events-none" class="tooltip-content tooltip-shown:opacity-100 tooltip-shown:visible pointer-events-none z-50"
role="tooltip" role="tooltip"
> >
<span <span class="tooltip-body">
class="tooltip-body"
v-bind="$attrs"
>
{{ tooltip }} {{ tooltip }}
</span> </span>
</span> </span>
@ -57,8 +54,4 @@ const props = defineProps({
default: 'hover', default: 'hover',
}, },
}) })
defineOptions({
inheritAttrs: false,
})
</script> </script>

View File

@ -7,7 +7,7 @@
<button <button
ref="sidebarToogleRef" ref="sidebarToogleRef"
type="button" type="button"
class="btn btn-text btn-square me-2 z-50" class="btn btn-text btn-square me-2 z-30"
aria-haspopup="dialog" aria-haspopup="dialog"
aria-expanded="false" aria-expanded="false"
aria-controls="sidebar" aria-controls="sidebar"

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="h-full overflow-auto px-2 relative"> <div class="h-full overflow-auto p-2 relative">
<NuxtPage /> <NuxtPage />
</div> </div>
</template> </template>

View File

@ -3,7 +3,7 @@
<div class="min-h-full flex flex-col"> <div class="min-h-full flex flex-col">
<HaexPassGroupBreadcrumbs <HaexPassGroupBreadcrumbs
:items="breadCrumbs" :items="breadCrumbs"
class="px-2 sticky top-0 z-10 bg-base-200" class="px-2 sticky -top-2 z-10 bg-base-200"
v-show="breadCrumbs.length" v-show="breadCrumbs.length"
/> />
<div class="flex-1 overflow-auto py-1"> <div class="flex-1 overflow-auto py-1">

View File

@ -110,6 +110,7 @@
<HaexPassDialogUnsavedChanges <HaexPassDialogUnsavedChanges
:has-changes="hasChanges" :has-changes="hasChanges"
v-model:ignore-changes="ignoreChanges"
@abort="showUnsavedChangesDialog = false" @abort="showUnsavedChangesDialog = false"
@confirm="onConfirmIgnoreChanges" @confirm="onConfirmIgnoreChanges"
v-model:open="showUnsavedChangesDialog" v-model:open="showUnsavedChangesDialog"
@ -189,6 +190,7 @@ const { deleteAsync, updateAsync } = usePasswordItemStore()
const { syncGroupItemsAsync } = usePasswordGroupStore() const { syncGroupItemsAsync } = usePasswordGroupStore()
const { currentGroupId, inTrashGroup } = storeToRefs(usePasswordGroupStore()) const { currentGroupId, inTrashGroup } = storeToRefs(usePasswordGroupStore())
const ignoreChanges = ref(false)
const onUpdateAsync = async () => { const onUpdateAsync = async () => {
try { try {
const newId = await updateAsync({ const newId = await updateAsync({
@ -200,16 +202,17 @@ const onUpdateAsync = async () => {
}) })
if (newId) add({ type: 'success', text: t('success.update') }) if (newId) add({ type: 'success', text: t('success.update') })
syncGroupItemsAsync(currentGroupId.value) syncGroupItemsAsync(currentGroupId.value)
onClose(true) ignoreChanges.value = true
onClose()
} catch (error) { } catch (error) {
add({ type: 'error', text: t('error.update') }) add({ type: 'error', text: t('error.update') })
} }
} }
const onClose = (ignoreChanges?: boolean) => { const onClose = () => {
if (showConfirmDeleteDialog.value || showUnsavedChangesDialog.value) return if (showConfirmDeleteDialog.value || showUnsavedChangesDialog.value) return
if (hasChanges.value && !ignoreChanges) if (hasChanges.value && !ignoreChanges.value)
return (showUnsavedChangesDialog.value = true) return (showUnsavedChangesDialog.value = true)
read_only.value = true read_only.value = true
@ -222,7 +225,7 @@ const deleteItemAsync = async () => {
showConfirmDeleteDialog.value = false showConfirmDeleteDialog.value = false
add({ type: 'success', text: t('success.delete') }) add({ type: 'success', text: t('success.delete') })
await syncGroupItemsAsync(currentGroupId.value) await syncGroupItemsAsync(currentGroupId.value)
onClose(true) onClose()
} catch (errro) { } catch (errro) {
add({ add({
type: 'error', type: 'error',
@ -244,7 +247,8 @@ const hasChanges = computed(
const showUnsavedChangesDialog = ref(false) const showUnsavedChangesDialog = ref(false)
const onConfirmIgnoreChanges = () => { const onConfirmIgnoreChanges = () => {
showUnsavedChangesDialog.value = false showUnsavedChangesDialog.value = false
onClose(true) ignoreChanges.value = true
onClose()
} }
</script> </script>