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>
</template>
<li class="ml-2">
<NuxtLinkLocale
:to="{
name: 'passwordGroupEdit',
params: { groupId: lastGroup?.id },
}"
<UiTooltip
:tooltip="t('edit')"
class="[--placement:bottom]"
>
<Icon name="mdi:pencil" />
</NuxtLinkLocale>
<NuxtLinkLocale
:to="{
name: 'passwordGroupEdit',
params: { groupId: lastGroup?.id },
}"
>
<Icon name="mdi:pencil" />
</NuxtLinkLocale>
</UiTooltip>
</li>
</ul>
</div>
</template>
<script setup lang="ts">
import { UiTooltip } from '#components'
import type { SelectHaexPasswordsGroups } from '~~/src-tauri/database/schemas/vault'
const groups = defineProps<{ items: SelectHaexPasswordsGroups[] }>()
const lastGroup = computed(() => groups.items.at(-1))
const { t } = useI18n()
</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
} else {
search.value = ''
if (item.type === 'group')
await navigateTo(
localePath({
@ -114,6 +113,7 @@ const onClickItemAsync = async (item: IPasswordMenuItem) => {
}),
)
}
search.value = ''
}
}

View File

@ -11,13 +11,10 @@
</slot>
<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"
>
<span
class="tooltip-body"
v-bind="$attrs"
>
<span class="tooltip-body">
{{ tooltip }}
</span>
</span>
@ -57,8 +54,4 @@ const props = defineProps({
default: 'hover',
},
})
defineOptions({
inheritAttrs: false,
})
</script>

View File

@ -7,7 +7,7 @@
<button
ref="sidebarToogleRef"
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-expanded="false"
aria-controls="sidebar"

View File

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

View File

@ -3,7 +3,7 @@
<div class="min-h-full flex flex-col">
<HaexPassGroupBreadcrumbs
: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"
/>
<div class="flex-1 overflow-auto py-1">

View File

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