Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor story page to summary page #5732

Merged
merged 11 commits into from
Sep 12, 2024
Merged
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
10 changes: 5 additions & 5 deletions common/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"components": {
"story": {
"storyDay": {
"noStory": "The activities on this day do not contain any story content."
"summary": {
"summaryDay": {
"noContent": "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
10 changes: 5 additions & 5 deletions common/locales/fr.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"components": {
"story": {
"storyDay": {
"noStory": "Aucun file rouge trouvé ce jour-là..."
"summary": {
"summaryDay": {
"noContent": "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
10 changes: 5 additions & 5 deletions common/locales/it.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"components": {
"story": {
"storyDay": {
"noStory": "Nessun contenuto di storia trovato in questo giorno..."
"summary": {
"summaryDay": {
"noContent": "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', () => {
BacLuc marked this conversation as resolved.
Show resolved Hide resolved
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
Loading