feat(ccli): add bookmarklet redirect import page
This commit is contained in:
parent
d77eb6ad1e
commit
3ec25bf70b
56
resources/js/Pages/Songs/ImportFromCcliPaste.vue
Normal file
56
resources/js/Pages/Songs/ImportFromCcliPaste.vue
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<script setup>
|
||||
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout.vue'
|
||||
import CcliPasteDialog from '@/Components/CcliPasteDialog.vue'
|
||||
import { Head, router } from '@inertiajs/vue3'
|
||||
|
||||
const props = defineProps({
|
||||
prefilledText: { type: String, default: null },
|
||||
prefilledMetadata: { type: Object, default: null },
|
||||
prefillError: { type: String, default: null },
|
||||
})
|
||||
|
||||
function handleClose() {
|
||||
router.visit(route('songs.index'))
|
||||
}
|
||||
|
||||
function handleImported(songId, mode) {
|
||||
if (mode === 'stay') {
|
||||
router.visit(route('songs.index'))
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Head title="Song aus SongSelect importieren" />
|
||||
|
||||
<AuthenticatedLayout>
|
||||
<template #header>
|
||||
<h2 class="text-xl font-semibold leading-tight text-gray-900">
|
||||
Song aus SongSelect importieren
|
||||
</h2>
|
||||
</template>
|
||||
|
||||
<div class="py-8">
|
||||
<div class="mx-auto max-w-2xl px-4 sm:px-6 lg:px-8">
|
||||
|
||||
<!-- Prefill error -->
|
||||
<div
|
||||
v-if="prefillError"
|
||||
data-testid="ccli-prefill-error-message"
|
||||
class="mb-4 rounded-lg border border-yellow-200 bg-yellow-50 p-4 text-sm text-yellow-800"
|
||||
>
|
||||
{{ prefillError }}
|
||||
</div>
|
||||
|
||||
<!-- Always-open paste dialog on this page -->
|
||||
<CcliPasteDialog
|
||||
:open="true"
|
||||
mode="songdb"
|
||||
:prefilled-text="prefilledText"
|
||||
@close="handleClose"
|
||||
@imported="handleImported"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</AuthenticatedLayout>
|
||||
</template>
|
||||
Loading…
Reference in a new issue