From ea05fe9dfaf508d56d7fac812ce70f6ad3109ebe Mon Sep 17 00:00:00 2001 From: sjoerdbeentjes <11621275+sjoerdbeentjes@users.noreply.github.com> Date: Tue, 10 Dec 2024 11:10:33 +0100 Subject: [PATCH 1/2] Add migration to update "Acknowledgments" field in "Menu" model to use markdown editor --- migrations/1733825239_colophonPresentation.ts | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 migrations/1733825239_colophonPresentation.ts diff --git a/migrations/1733825239_colophonPresentation.ts b/migrations/1733825239_colophonPresentation.ts new file mode 100644 index 0000000..89b2d1a --- /dev/null +++ b/migrations/1733825239_colophonPresentation.ts @@ -0,0 +1,33 @@ +import { Client } from "@datocms/cli/lib/cma-client-node"; + +export default async function (client: Client) { + console.log("Update existing fields/fieldsets"); + + const currentField = await client.fields.find("H7cTIWERTG-z24IE8ILCUw"); + + console.log( + 'Update Multiple-paragraph text field "Acknowledgments" (`acknowledgments`) in model "Menu" (`menu`)' + ); + await client.fields.update("H7cTIWERTG-z24IE8ILCUw", { + appearance: { + addons: currentField.appearance.addons, + editor: "markdown", + parameters: { + toolbar: [ + "heading", + "bold", + "italic", + "strikethrough", + "code", + "unordered_list", + "ordered_list", + "quote", + "link", + "image", + "fullscreen", + ], + }, + type: "markdown", + }, + }); +} From fa979d24a838159822dea354956757530fab2f08 Mon Sep 17 00:00:00 2001 From: sjoerdbeentjes <11621275+sjoerdbeentjes@users.noreply.github.com> Date: Tue, 10 Dec 2024 11:29:18 +0100 Subject: [PATCH 2/2] Enhance AcknowledgmentsDialog styling and image handling - Added 'markdown-body' class to the vue-markdown component for improved styling. - Introduced CSS rules to ensure images within the markdown are responsive, with a maximum width of 500px. --- .../AcknowledgmentsDialog/AcknowledgmentsDialog.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/AcknowledgmentsDialog/AcknowledgmentsDialog.vue b/src/components/AcknowledgmentsDialog/AcknowledgmentsDialog.vue index 2d0e3e0..88f1c30 100644 --- a/src/components/AcknowledgmentsDialog/AcknowledgmentsDialog.vue +++ b/src/components/AcknowledgmentsDialog/AcknowledgmentsDialog.vue @@ -17,7 +17,7 @@ - + @@ -57,4 +57,10 @@ +