refac: duplicates, crap, dry etc. on last features commits

This commit is contained in:
Florian Sylvain committed 2026-10-21 00:52:14 +02:00
1 parent fba20f83c5
commit 89051b3f1f
12 files changed
+260 -153

No files matched your search

+15 -6
View File
@@ -3,15 +3,24 @@ import { t } from '@/i18n'
import { computed } from 'vue'
import RetryAlert from '@/components/RetryAlert.vue'
import type { EntryEditorPage } from '@/composables/useEntryEditorPage'
import type { SaveFailure } from '@/composables/useEntryDraft'
import type { BuiltinField } from '@/lib/contentTypes'
import type { EntryIssues } from '@/lib/entryForm'
import { schemaChangedLine, uniqueAlert } from '@/lib/entryMessages'
const props = defineProps<{ page: EntryEditorPage }>()
const props = defineProps<{
failure: SaveFailure
schemaChanged: boolean
schemaField: string
issues: EntryIssues
fields: BuiltinField[]
typeName: string
}>()
const { failure, schemaChanged, schemaField, form, fields, typeName } = props.page
defineEmits<{ retry: []; reload: [] }>()
const uniqueField = computed(() =>
fields.value.find((field) => form.issues.value[field.key]?.rule === 'unique'),
props.fields.find((field) => props.issues[field.key]?.rule === 'unique'),
)
const alertUi = {
root: 'items-start gap-2.5 px-3.5 py-3',
@@ -29,7 +38,7 @@ const alertUi = {
'Something went wrong on our side. Your changes are still here. Try again in a moment.',
)
"
@retry="page.submit"
@retry="$emit('retry')"
/>
<UAlert
@@ -61,7 +70,7 @@ const alertUi = {
icon="i-lucide-rotate-cw"
class="h-11 gap-1.5 border border-accented bg-default px-2.5 text-xs text-highlighted ring-0 md:h-8"
:ui="{ leadingIcon: 'size-3.5' }"
@click="page.reload"
@click="$emit('reload')"
>
{{ t('Reload form') }}
</UButton>