Skip to content

Commit

Permalink
Refactor story page to summary page
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmeister committed Aug 17, 2024
1 parent 19015f9 commit 7c96a29
Show file tree
Hide file tree
Showing 26 changed files with 359 additions and 1,383 deletions.
10 changes: 5 additions & 5 deletions common/locales/de.json
Original file line number Diff line number Diff line change
@@ -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."
}
}
},
Expand Down Expand Up @@ -259,8 +259,8 @@
"program": {
"title": "Detailprogramm"
},
"story": {
"title": "Roter Faden"
"summary": {
"title": "Zusammenfassung"
},
"toc": {
"title": "Inhaltsverzeichnis"
Expand Down
6 changes: 3 additions & 3 deletions common/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
}
},
Expand Down Expand Up @@ -266,8 +266,8 @@
"program": {
"title": "Program"
},
"story": {
"title": "Storyline"
"summary": {
"title": "Summary"
},
"toc": {
"title": "Table of contents"
Expand Down
6 changes: 3 additions & 3 deletions common/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"components": {
"story": {
"storyDay": {
"noStory": "Aucun file rouge trouvé ce jour-là..."
"noStory": "Aucun {contentType} trouvé ce jour-là..."
}
}
},
Expand Down Expand Up @@ -246,8 +246,8 @@
"program": {
"title": "Programme"
},
"story": {
"title": "Histoire"
"summary": {
"title": "Résumé"
},
"toc": {
"title": "Table des matières"
Expand Down
6 changes: 3 additions & 3 deletions common/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"components": {
"story": {
"storyDay": {
"noStory": "Nessun contenuto di storia trovato in questo giorno..."
"noStory": "Nessun contenuto '{contentType}' trovato in questo giorno..."
}
}
},
Expand Down Expand Up @@ -230,8 +230,8 @@
"program": {
"title": "Programma"
},
"story": {
"title": "Trama"
"summary": {
"title": "Sommario"
},
"toc": {
"title": "Indice dei contenuti"
Expand Down
9 changes: 5 additions & 4 deletions frontend/src/components/print/PrintConfigurator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -125,7 +125,7 @@ export default {
PrintPreviewNuxt,
CoverConfig,
PicassoConfig,
StoryConfig,
SummaryConfig,
ProgramConfig,
ActivityConfig,
TocConfig,
Expand All @@ -141,7 +141,7 @@ export default {
contentComponents: {
Cover: CoverConfig,
Picasso: PicassoConfig,
Story: StoryConfig,
Summary: SummaryConfig,
Program: ProgramConfig,
Activity: ActivityConfig,
Toc: TocConfig,
Expand Down Expand Up @@ -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({
Expand Down
67 changes: 54 additions & 13 deletions frontend/src/components/print/__tests__/repairPrintConfig.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -25,7 +25,7 @@ describe('repairConfig', () => {
CoverConfig,
PicassoConfig,
ProgramConfig,
StoryConfig,
SummaryConfig,
TocConfig,
].map((component) => [component.name.replace(/Config$/, ''), component.repairConfig])
)
Expand Down Expand Up @@ -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',
Expand All @@ -839,8 +839,8 @@ describe('repairConfig', () => {
camp: '/camps/1a2b3c4d',
contents: [
{
type: 'Story',
options: { periods: [] },
type: 'Summary',
options: { periods: [], contentType: 'Storycontext' },
},
],
documentName: 'test camp',
Expand All @@ -854,8 +854,8 @@ describe('repairConfig', () => {
camp: '/camps/1a2b3c4d',
contents: [
{
type: 'Story',
options: { periods: [] },
type: 'Summary',
options: { periods: [], contentType: 'Storycontext' },
},
],
documentName: 'test camp',
Expand All @@ -870,8 +870,8 @@ describe('repairConfig', () => {
camp: '/camps/1a2b3c4d',
contents: [
{
type: 'Story',
options: { periods: [] },
type: 'Summary',
options: { periods: [], contentType: 'Storycontext' },
},
],
documentName: 'test camp',
Expand All @@ -885,9 +885,10 @@ describe('repairConfig', () => {
camp: '/camps/1a2b3c4d',
contents: [
{
type: 'Story',
type: 'Summary',
options: {
periods: ['/periods/11112222', '/periods/1a2b3c4d'],
contentType: 'Storycontext',
},
},
],
Expand All @@ -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',
Expand Down
58 changes: 0 additions & 58 deletions frontend/src/components/print/config/StoryConfig.vue

This file was deleted.

Loading

0 comments on commit 7c96a29

Please sign in to comment.