Add body text

This commit is contained in:
Ramon Wenger 2023-05-02 15:32:27 +02:00
parent 17028b8905
commit ba2d4df639
2 changed files with 12 additions and 8 deletions

View File

@ -5,7 +5,7 @@
<DialogPanel class="w-full max-w-2xl bg-white pt-8">
<div class="px-8 pb-4">
<DialogTitle class="relative mb-8 flex flex-row">{{ title }}</DialogTitle>
Hallo Velo
<p v-html="content" />
</div>
<div class="flex flex-row-reverse gap-x-4 border-t border-t-gray-500 p-4">
<button class="btn-primary" @click="confirm">Löschen</button>
@ -22,6 +22,7 @@ import { Dialog, DialogPanel, DialogTitle } from "@headlessui/vue";
defineProps<{
isOpen: boolean;
title: string;
content: string;
}>();
const emit = defineEmits(["confirm", "close"]);

View File

@ -66,7 +66,8 @@
</ItModal>
<ConfirmDialog
:is-open="showConfirm"
title="Heyho"
:title="$t('circlePage.documents.deleteModalTitle')"
:content="$t('circlePage.documents.deleteModalWarning', { title: documentName })"
@close="close"
@confirm="confirm"
/>
@ -109,13 +110,16 @@ const dropdownLearningSequences = computed(() =>
name: sequence.title,
}))
);
type ResolveReject = (v: any) => void;
// confirm dialog
// todo: refactor to own service
type ResolveReject = (v: unknown) => void;
const showConfirm = ref(false);
const confirm = ref<ResolveReject | undefined>();
const close = ref<ResolveReject | undefined>();
const documentName = ref("");
const deleteDocument = (doc: CircleDocument) => {
// courseSessionsStore.removeDocument(doc.id);
showConfirm.value = true;
documentName.value = doc.name;
const modalDialog = new Promise((resolve, reject) => {
confirm.value = resolve;
close.value = reject;
@ -123,16 +127,15 @@ const deleteDocument = (doc: CircleDocument) => {
modalDialog
.then(
() => {
console.log("confirmed");
courseSessionsStore.removeDocument(doc.id);
showConfirm.value = false;
},
() => {
console.log("just closing");
showConfirm.value = false;
}
)
.finally(() => {
console.log("closing");
showConfirm.value = false;
documentName.value = "";
});
};
watch(showUploadModal, () => (showUploadErrorMessage.value = false));