From 7c96a29982afdcf11984f4ecc30824e8ab8c7243 Mon Sep 17 00:00:00 2001 From: Manuel Meister Date: Sat, 17 Aug 2024 21:13:41 +0200 Subject: [PATCH] Refactor story page to summary page --- common/locales/de.json | 10 +- common/locales/en.json | 6 +- common/locales/fr.json | 6 +- common/locales/it.json | 6 +- .../components/print/PrintConfigurator.vue | 9 +- .../print/__tests__/repairPrintConfig.spec.js | 67 +- .../components/print/config/StoryConfig.vue | 58 - .../components/print/config/SummaryConfig.vue | 95 ++ frontend/src/locales/de.json | 8 +- frontend/src/locales/en.json | 6 +- frontend/src/locales/fr.json | 4 +- frontend/src/locales/it.json | 4 +- frontend/src/locales/rm.json | 2 +- pdf/src/CampPrint.vue | 4 +- pdf/src/campPrint/story/StoryPeriod.vue | 35 - .../{story/Story.vue => summary/Summary.vue} | 14 +- .../StoryDay.vue => summary/SummaryDay.vue} | 43 +- pdf/src/campPrint/summary/SummaryPeriod.vue | 59 + .../tableOfContents/TableOfContents.vue | 4 +- .../entry/{Story.vue => Summary.vue} | 11 +- .../story_overview.spec.json.snap | 1187 +---------------- .../Toc/{TocStory.vue => TocSummary.vue} | 8 +- .../config/{Story.vue => Summary.vue} | 6 +- print/components/config/Toc.vue | 19 +- .../StoryDay.vue => summary/SummaryDay.vue} | 43 +- .../SummaryPeriod.vue} | 28 +- 26 files changed, 359 insertions(+), 1383 deletions(-) delete mode 100644 frontend/src/components/print/config/StoryConfig.vue create mode 100644 frontend/src/components/print/config/SummaryConfig.vue delete mode 100644 pdf/src/campPrint/story/StoryPeriod.vue rename pdf/src/campPrint/{story/Story.vue => summary/Summary.vue} (59%) rename pdf/src/campPrint/{story/StoryDay.vue => summary/SummaryDay.vue} (62%) create mode 100644 pdf/src/campPrint/summary/SummaryPeriod.vue rename pdf/src/campPrint/tableOfContents/entry/{Story.vue => Summary.vue} (56%) rename print/components/Toc/{TocStory.vue => TocSummary.vue} (78%) rename print/components/config/{Story.vue => Summary.vue} (87%) rename print/components/{story/StoryDay.vue => summary/SummaryDay.vue} (62%) rename print/components/{story/StoryPeriod.vue => summary/SummaryPeriod.vue} (56%) diff --git a/common/locales/de.json b/common/locales/de.json index c8f3f1d83fc..43b551bf2f3 100644 --- a/common/locales/de.json +++ b/common/locales/de.json @@ -1,8 +1,8 @@ { "components": { - "story": { - "storyDay": { - "noStory": "Die Blöcke an diesem Tag enthalten keinen roten Faden." + "summary": { + "summaryDay": { + "noContent": "Die Blöcke an diesem Tag enthalten keine '{contentType}' Inhalte." } } }, @@ -259,8 +259,8 @@ "program": { "title": "Detailprogramm" }, - "story": { - "title": "Roter Faden" + "summary": { + "title": "Zusammenfassung" }, "toc": { "title": "Inhaltsverzeichnis" diff --git a/common/locales/en.json b/common/locales/en.json index 1093dd758cc..a8d75e79583 100644 --- a/common/locales/en.json +++ b/common/locales/en.json @@ -2,7 +2,7 @@ "components": { "story": { "storyDay": { - "noStory": "The activities on this day do not contain any story content." + "noStory": "The activities on this day do not contain any {contentType} content." } } }, @@ -266,8 +266,8 @@ "program": { "title": "Program" }, - "story": { - "title": "Storyline" + "summary": { + "title": "Summary" }, "toc": { "title": "Table of contents" diff --git a/common/locales/fr.json b/common/locales/fr.json index db1a1a74a49..eed6db55e30 100644 --- a/common/locales/fr.json +++ b/common/locales/fr.json @@ -2,7 +2,7 @@ "components": { "story": { "storyDay": { - "noStory": "Aucun file rouge trouvé ce jour-là..." + "noStory": "Aucun {contentType} trouvé ce jour-là..." } } }, @@ -246,8 +246,8 @@ "program": { "title": "Programme" }, - "story": { - "title": "Histoire" + "summary": { + "title": "Résumé" }, "toc": { "title": "Table des matières" diff --git a/common/locales/it.json b/common/locales/it.json index f7ea5a40545..3fa0b5a1bcd 100644 --- a/common/locales/it.json +++ b/common/locales/it.json @@ -2,7 +2,7 @@ "components": { "story": { "storyDay": { - "noStory": "Nessun contenuto di storia trovato in questo giorno..." + "noStory": "Nessun contenuto '{contentType}' trovato in questo giorno..." } } }, @@ -230,8 +230,8 @@ "program": { "title": "Programma" }, - "story": { - "title": "Trama" + "summary": { + "title": "Sommario" }, "toc": { "title": "Indice dei contenuti" diff --git a/frontend/src/components/print/PrintConfigurator.vue b/frontend/src/components/print/PrintConfigurator.vue index 60863f5764a..8fe30f790b7 100644 --- a/frontend/src/components/print/PrintConfigurator.vue +++ b/frontend/src/components/print/PrintConfigurator.vue @@ -100,7 +100,7 @@ import PrintPreviewNuxt from './print-nuxt/PrintPreviewNuxt.vue' import Draggable from 'vuedraggable' import CoverConfig from './config/CoverConfig.vue' import PicassoConfig from './config/PicassoConfig.vue' -import StoryConfig from './config/StoryConfig.vue' +import SummaryConfig from './config/SummaryConfig.vue' import ProgramConfig from './config/ProgramConfig.vue' import ActivityConfig from './config/ActivityConfig.vue' import TocConfig from './config/TocConfig.vue' @@ -125,7 +125,7 @@ export default { PrintPreviewNuxt, CoverConfig, PicassoConfig, - StoryConfig, + SummaryConfig, ProgramConfig, ActivityConfig, TocConfig, @@ -141,7 +141,7 @@ export default { contentComponents: { Cover: CoverConfig, Picasso: PicassoConfig, - Story: StoryConfig, + Summary: SummaryConfig, Program: ProgramConfig, Activity: ActivityConfig, Toc: TocConfig, @@ -205,9 +205,10 @@ export default { this.camp.periods().items.forEach((period) => { contents.push({ - type: 'Story', + type: 'Summary', options: { periods: [period._meta.self], + contentType: 'Storycontext', }, }) contents.push({ diff --git a/frontend/src/components/print/__tests__/repairPrintConfig.spec.js b/frontend/src/components/print/__tests__/repairPrintConfig.spec.js index 54c598658b1..92e27a4cbfe 100644 --- a/frontend/src/components/print/__tests__/repairPrintConfig.spec.js +++ b/frontend/src/components/print/__tests__/repairPrintConfig.spec.js @@ -3,7 +3,7 @@ import PicassoConfig from '../config/PicassoConfig.vue' import ActivityConfig from '../config/ActivityConfig.vue' import CoverConfig from '../config/CoverConfig.vue' import ProgramConfig from '../config/ProgramConfig.vue' -import StoryConfig from '../config/StoryConfig.vue' +import SummaryConfig from '../config/SummaryConfig.vue' import TocConfig from '../config/TocConfig.vue' describe('repairConfig', () => { @@ -25,7 +25,7 @@ describe('repairConfig', () => { CoverConfig, PicassoConfig, ProgramConfig, - StoryConfig, + SummaryConfig, TocConfig, ].map((component) => [component.name.replace(/Config$/, ''), component.repairConfig]) ) @@ -817,14 +817,14 @@ describe('repairConfig', () => { }) }) - describe('story', () => { + describe('summary', () => { test('adds missing options', async () => { // given const config = { camp: '/camps/1a2b3c4d', contents: [ { - type: 'Story', + type: 'Summary', }, ], documentName: 'test camp', @@ -839,8 +839,8 @@ describe('repairConfig', () => { camp: '/camps/1a2b3c4d', contents: [ { - type: 'Story', - options: { periods: [] }, + type: 'Summary', + options: { periods: [], contentType: 'Storycontext' }, }, ], documentName: 'test camp', @@ -854,8 +854,8 @@ describe('repairConfig', () => { camp: '/camps/1a2b3c4d', contents: [ { - type: 'Story', - options: { periods: [] }, + type: 'Summary', + options: { periods: [], contentType: 'Storycontext' }, }, ], documentName: 'test camp', @@ -870,8 +870,8 @@ describe('repairConfig', () => { camp: '/camps/1a2b3c4d', contents: [ { - type: 'Story', - options: { periods: [] }, + type: 'Summary', + options: { periods: [], contentType: 'Storycontext' }, }, ], documentName: 'test camp', @@ -885,9 +885,10 @@ describe('repairConfig', () => { camp: '/camps/1a2b3c4d', contents: [ { - type: 'Story', + type: 'Summary', options: { periods: ['/periods/11112222', '/periods/1a2b3c4d'], + contentType: 'Storycontext', }, }, ], @@ -903,8 +904,48 @@ describe('repairConfig', () => { camp: '/camps/1a2b3c4d', contents: [ { - type: 'Story', - options: { periods: ['/periods/1a2b3c4d'] }, + type: 'Summary', + options: { + periods: ['/periods/1a2b3c4d'], + contentType: 'Storycontext', + }, + }, + ], + documentName: 'test camp', + language: 'en-GB', + }) + }) + + test('uses known contentType', async () => { + // given + const config = { + camp: '/camps/1a2b3c4d', + contents: [ + { + type: 'Summary', + options: { + periods: ['/periods/1a2b3c4d'], + contentType: 'Storyboard', + }, + }, + ], + documentName: 'test camp', + language: 'en-GB', + } + + // when + const result = repairConfig(config, ...args) + + // then + expect(result).toEqual({ + camp: '/camps/1a2b3c4d', + contents: [ + { + type: 'Summary', + options: { + periods: ['/periods/1a2b3c4d'], + contentType: 'Storycontext', + }, }, ], documentName: 'test camp', diff --git a/frontend/src/components/print/config/StoryConfig.vue b/frontend/src/components/print/config/StoryConfig.vue deleted file mode 100644 index 6576b5cc6cc..00000000000 --- a/frontend/src/components/print/config/StoryConfig.vue +++ /dev/null @@ -1,58 +0,0 @@ - - - diff --git a/frontend/src/components/print/config/SummaryConfig.vue b/frontend/src/components/print/config/SummaryConfig.vue new file mode 100644 index 00000000000..637bbb4eb9b --- /dev/null +++ b/frontend/src/components/print/config/SummaryConfig.vue @@ -0,0 +1,95 @@ + + + diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index 4a33fba56d7..4e5cf98a0c1 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -316,7 +316,9 @@ "dayOverview": "Tagesübersicht", "periods": "Lagerabschnitt(e)" }, - "storyConfig": { + "summaryConfig": { + "contentType": "Blockinhalt", + "instanceNameFilter": "Instanznamenfilter", "periods": "Lagerabschnitt(e)" } }, @@ -353,7 +355,7 @@ "Cover": "Titelseite", "Picasso": "Grobprogramm", "Program": "Detailprogramm", - "Story": "Roter Faden", + "Summary": "Zusammenfassung", "Toc": "Inhaltsverzeichnis" } }, @@ -575,8 +577,8 @@ "loginCallback": { "loginInProgress": "Du wirst eingeloggt" }, - "or": "oder mit", "notActivated": "Nicht aktiviert?", + "or": "oder mit", "password": "Passwort", "passwordForgotten": "Passwort vergessen?", "provider": { diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 21d2cf0f4f8..04cb16264ac 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -316,7 +316,9 @@ "dayOverview": "print day overview", "periods": "Period(s)" }, - "storyConfig": { + "summaryConfig": { + "contentType": "Content type", + "instanceNameFilter": "Instancename filter", "periods": "Period(s)" } }, @@ -353,7 +355,7 @@ "Cover": "Cover page", "Picasso": "Picasso", "Program": "Program", - "Story": "Story summary", + "Summary": "Summary", "Toc": "Table of contents" } }, diff --git a/frontend/src/locales/fr.json b/frontend/src/locales/fr.json index 996d2aa0be4..1756cff6928 100644 --- a/frontend/src/locales/fr.json +++ b/frontend/src/locales/fr.json @@ -296,7 +296,7 @@ "dayOverview": "Aperçu des jours", "periods": "Période(s) du camp" }, - "storyConfig": { + "summaryConfig": { "periods": "Période(s) du camp" } }, @@ -333,7 +333,7 @@ "Cover": "Page de couverture", "Picasso": "Picasso", "Program": "Programme", - "Story": "Histoire", + "Summary": "Résumé", "Toc": "Table des matières" } }, diff --git a/frontend/src/locales/it.json b/frontend/src/locales/it.json index db1a87d3a66..a2ae3aa9c7d 100644 --- a/frontend/src/locales/it.json +++ b/frontend/src/locales/it.json @@ -288,7 +288,7 @@ "dayOverview": "Panoramica della giornata di stampa", "periods": "Sezione/i portante/i" }, - "storyConfig": { + "summaryConfig": { "periods": "Sezione/i portante/i" } }, @@ -325,7 +325,7 @@ "Cover": "Pagina di copertina", "Picasso": "Picasso", "Program": "Programma", - "Story": "Riassunto della storia", + "Story": "Riassunto", "Toc": "Indice dei contenuti" } }, diff --git a/frontend/src/locales/rm.json b/frontend/src/locales/rm.json index d50c5de283b..160011891a9 100644 --- a/frontend/src/locales/rm.json +++ b/frontend/src/locales/rm.json @@ -289,7 +289,7 @@ "Cover": "Pagina da titel", "Picasso": "Program general", "Program": "Program en detagl", - "Story": "Fil cotschen", + "Summary": "Riassunto", "Toc": "Tavla da cuntegn" } }, diff --git a/pdf/src/CampPrint.vue b/pdf/src/CampPrint.vue index 6e35c5c6fc8..9694149b291 100644 --- a/pdf/src/CampPrint.vue +++ b/pdf/src/CampPrint.vue @@ -22,7 +22,7 @@ import InterDisplayBoldItalic from '@/assets/fonts/Inter/InterDisplay-BoldItalic import Cover from '@/campPrint/cover/Cover.vue' import TableOfContents from '@/campPrint/tableOfContents/TableOfContents.vue' import Picasso from '@/campPrint/picasso/Picasso.vue' -import Story from '@/campPrint/story/Story.vue' +import Summary from '@/campPrint/summary/Summary.vue' import Program from '@/campPrint/program/Program.vue' import Activity from '@/campPrint/activity/Activity.vue' import { wordHyphenation } from '@react-pdf/textkit' @@ -43,7 +43,7 @@ export default { Picasso, Program, Activity, - Story, + Summary, } }, }, diff --git a/pdf/src/campPrint/story/StoryPeriod.vue b/pdf/src/campPrint/story/StoryPeriod.vue deleted file mode 100644 index 5389c95f913..00000000000 --- a/pdf/src/campPrint/story/StoryPeriod.vue +++ /dev/null @@ -1,35 +0,0 @@ - - - -.story-period-title { - font-size: 10pt; - font-weight: bold; - text-align: center; -} - diff --git a/pdf/src/campPrint/story/Story.vue b/pdf/src/campPrint/summary/Summary.vue similarity index 59% rename from pdf/src/campPrint/story/Story.vue rename to pdf/src/campPrint/summary/Summary.vue index 30573dce910..13298f604f0 100644 --- a/pdf/src/campPrint/story/Story.vue +++ b/pdf/src/campPrint/summary/Summary.vue @@ -1,15 +1,21 @@ -.story-day-title-container { +.summary-day-title-container { display: flex; flex-direction: row; justify-content: space-between; @@ -86,15 +95,15 @@ export default { padding-bottom: 2pt; margin-bottom: 1pt; } -.story-day-title { +.summary-day-title { font-size: 14; font-weight: semibold; margin: 10pt 0 3pt; } -.story-day-date { +.summary-day-date { font-size: 11pt; } -.story-chapter-title { +.summary-chapter-title { display: flex; flex-direction: row; align-items: center; diff --git a/pdf/src/campPrint/summary/SummaryPeriod.vue b/pdf/src/campPrint/summary/SummaryPeriod.vue new file mode 100644 index 00000000000..405643279ce --- /dev/null +++ b/pdf/src/campPrint/summary/SummaryPeriod.vue @@ -0,0 +1,59 @@ + + + +.summary-period-title { + font-size: 10pt; + font-weight: bold; + text-align: center; +} + diff --git a/pdf/src/campPrint/tableOfContents/TableOfContents.vue b/pdf/src/campPrint/tableOfContents/TableOfContents.vue index cbe37ffab34..17a852a3cd8 100644 --- a/pdf/src/campPrint/tableOfContents/TableOfContents.vue +++ b/pdf/src/campPrint/tableOfContents/TableOfContents.vue @@ -23,7 +23,7 @@ import Toc from './entry/Toc.vue' import Picasso from './entry/Picasso.vue' import Program from './entry/Program.vue' import Activity from './entry/Activity.vue' -import Story from './entry/Story.vue' +import Summary from './entry/Summary.vue' export default { name: 'Cover', @@ -40,7 +40,7 @@ export default { Picasso, Program, Activity, - Story, + Summary, } }, }, diff --git a/pdf/src/campPrint/tableOfContents/entry/Story.vue b/pdf/src/campPrint/tableOfContents/entry/Summary.vue similarity index 56% rename from pdf/src/campPrint/tableOfContents/entry/Story.vue rename to pdf/src/campPrint/tableOfContents/entry/Summary.vue index a205af4c879..9898ae563b0 100644 --- a/pdf/src/campPrint/tableOfContents/entry/Story.vue +++ b/pdf/src/campPrint/tableOfContents/entry/Summary.vue @@ -1,13 +1,20 @@ diff --git a/print/components/story/StoryPeriod.vue b/print/components/summary/SummaryPeriod.vue similarity index 56% rename from print/components/story/StoryPeriod.vue rename to print/components/summary/SummaryPeriod.vue index 0f8f65f0bed..ee09132489b 100644 --- a/print/components/story/StoryPeriod.vue +++ b/print/components/summary/SummaryPeriod.vue @@ -4,21 +4,27 @@ :id="`content_${index}_period_${period.id}`" class="tw-text-center tw-font-semibold tw-mb-6" > - {{ $t('print.story.title') }}: {{ period.description }} + {{ $t('print.summary.title') }} + {{ $t(`contentNode.${camelCase(contentType)}.name`) }}: + {{ period.description }} -