Refactor lyric storage so each song owns its sections instead of sharing global labels. Adds song_sections (per song+label) owning song_slides; labels stay global ProPresenter group tags (name/color/macro). Arrangements now reference sections, so editing/importing one song no longer corrupts others that share a label name. - New: song_sections table + migration with safe backfill; SongSection, SongArrangementSection models; SongSectionController (edit/add/delete sections, immediate persistence) wired into SongEditModal. - Refactor writers/readers: CcliImport, ProImport, SongService, ArrangementController, SongController, ProExport, PDF, Translation (translation reset now section-scoped), CCLI pairing. - CCLI import fixes: parse SongSelect copy-icon format (German "Vers" abbrev + trailing author), fill empty CTS-synced songs instead of blocking as duplicate, distinct label colors per section kind, import&edit/existing-song open the edit modal (no 404/405), teleport paste dialog above assign dialog, preview shows section content, correct SongSelect search URL, copy-icon instructions. - Bookmarklet clicks #generalCopyLyricsButton and captures clipboard; serves correct host from request. - Export: embed key-visual/background under fixed bundle-relative names. - Tests updated for the section model; new section + isolation coverage.
68 lines
2 KiB
Vue
68 lines
2 KiB
Vue
<script setup>
|
|
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout.vue'
|
|
import CcliPasteDialog from '@/Components/CcliPasteDialog.vue'
|
|
import SongEditModal from '@/Components/SongEditModal.vue'
|
|
import { Head, router } from '@inertiajs/vue3'
|
|
import { ref } from 'vue'
|
|
|
|
const props = defineProps({
|
|
prefilledText: { type: String, default: null },
|
|
prefilledMetadata: { type: Object, default: null },
|
|
prefillError: { type: String, default: null },
|
|
})
|
|
|
|
const editSongId = ref(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"
|
|
@edit-song="(id) => { editSongId = id }"
|
|
/>
|
|
|
|
<SongEditModal
|
|
:show="editSongId !== null"
|
|
:song-id="editSongId"
|
|
@close="() => router.visit(route('songs.index'))"
|
|
/>
|
|
</div>
|
|
</div>
|
|
</AuthenticatedLayout>
|
|
</template>
|