From ca9cc6499dcb8657b5a3a38be72adca3675d382b Mon Sep 17 00:00:00 2001 From: IshavSohal Date: Tue, 18 Feb 2025 15:32:20 -0500 Subject: [PATCH] remove redundant schema file, remove modified panel prop --- StorylinesSchema.json | 493 ------------------ ...000000-0000-0000-0000-000000000000_en.json | 18 +- public/StorylinesSlideSchema.json | 32 -- server/index.js | 1 + src/components/chart-editor.vue | 2 +- src/components/image-editor.vue | 5 +- src/components/metadata-editor.vue | 3 +- src/components/slide-editor.vue | 65 +-- src/components/slide-toc.vue | 4 +- src/components/slideshow-editor.vue | 5 +- src/components/video-editor.vue | 2 +- src/definitions.ts | 4 +- 12 files changed, 60 insertions(+), 574 deletions(-) delete mode 100644 StorylinesSchema.json diff --git a/StorylinesSchema.json b/StorylinesSchema.json deleted file mode 100644 index 3e8380bcc..000000000 --- a/StorylinesSchema.json +++ /dev/null @@ -1,493 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Storylines Config Schema", - "type": "object", - "additionalProperties": false, - - "$defs": { - "slide": { - "type": "object", - "description": "A universal StoryRAMP slide", - "properties": { - "title": { - "type": "string", - "description": "The title for the slide." - }, - "panel": { - "$ref": "#/$defs/panel" - } - }, - "required": ["title", "panel"] - }, - - "panel": { - "type": "array", - "description": "A single slide component", - "items": { - "oneOf": [ - { - "$ref": "#/$defs/textPanel" - }, - { - "$ref": "#/$defs/mapPanel" - }, - { - "$ref": "#/$defs/multimediaPanel" - }, - { - "$ref": "#/$defs/dqvchartPanel" - }, - { - "$ref": "#/$defs/dynamicPanel" - } - ] - }, - "properties": { - "width": "number", - "description": "The width of the panel inside the slide (between 0 and 100)." - }, - "minItems": 1, - "maxItems": 2 - }, - - "textPanel": { - "type": "object", - "description": "A text slide component.", - "properties": { - "title": { - "type": "string", - "description": "The title for the text panel." - }, - "titleTag": { - "type": "string", - "description": "An optional tag to use for the panel title. If not supplied h2 is used.", - "default": "h2" - }, - "content": { - "type": "string", - "description": "The main text body." - }, - "type": { - "type": "string", - "enum": ["text"] - } - }, - "required": ["content", "type", "title"] - }, - - "dynamicPanel": { - "type": "object", - "description": "A dynamic slide component.", - "properties": { - "title": { - "type": "string", - "description": "The title for the text panel." - }, - "titleTag": { - "type": "string", - "description": "An optional tag to use for the panel title. If not supplied h2 is used.", - "default": "h2" - }, - "content": { - "type": "string", - "description": "The main text body." - }, - "children": { - "type": "array", - "description": "The panels to display dynamically.", - "items": { - "$ref": "#/$defs/dynamicChildItem" - }, - "minItems": 1 - }, - "type": { - "type": "string", - "enum": ["dynamic"] - }, - "modified": { - "type": "boolean", - "description": "An optional tag that specifies whether the panel has been modified from its default configuration" - } - }, - "required": ["content", "type", "children", "title"] - }, - - "dynamicChildItem": { - "type": "object", - "description": "A child screen of a dynamic panel. Contains an ID and a panel config.", - "properties": { - "id": "string", - "panel": { - "oneOf": [ - { - "$ref": "#/$defs/textPanel" - }, - { - "$ref": "#/$defs/mapPanel" - }, - { - "$ref": "#/$defs/multimediaPanel" - }, - { - "$ref": "#/$defs/dqvchartPanel" - } - ] - } - }, - "required": ["id", "panel"] - }, - - "multimediaPanel": { - "type": "object", - "description": "A multimedia slide component.", - "oneOf": [ - { - "$ref": "#/$defs/multimediaImage" - }, - { - "$ref": "#/$defs/multimediaVideo" - }, - { - "$ref": "#/$defs/multimediaAudio" - }, - { - "$ref": "#/$defs/multimediaSlideshow" - } - ], - "properties": { - "fullscreen": { - "type": "boolean", - "description": "Specifies whether the panel can be expanded to full screen.", - "default": true - } - } - }, - - "mapPanel": { - "type": "object", - "description": "A map slide component.", - "properties": { - "config": { - "type": "string", - "description": "A relative path to a JSON file containing the map config.", - "default": "" - }, - "fullscreen": { - "type": "boolean", - "description": "Specifies whether the panel can be expanded to full screen.", - "default": true - }, - "type": { - "type": "string", - "enum": ["map"] - }, - "scrollguard": { - "type": "boolean", - "description": "Whether or not CTRL is required to scroll this map.", - "default": false - }, - "title": { - "type": "string", - "description": "A title that is displayed centered above this map." - }, - "caption": { - "type": "string", - "description": "Supporting text content for the map." - } - }, - "required": ["config", "type"] - }, - - "dqvchartPanel": { - "type": "object", - "description": "A dqvchart slide component.", - "properties": { - "src": { - "type": "string", - "description": "The source containing the dqvchart json config." - }, - "config": { - "type": "object", - "description": "Configured Highcharts JSON object (from editor)." - }, - "fullscreen": { - "type": "boolean", - "description": "Specifies whether the panel can be expanded to full screen.", - "default": true - }, - "type": { - "type": "string", - "enum": ["chart"] - }, - "options": { - "$ref": "#/$defs/dqvchartOptions" - } - }, - "required": ["src", "type"] - }, - - "multimediaImage": { - "type": "object", - "description": "A multimedia image component.", - "properties": { - "width": { - "type": "number", - "description": "The image width." - }, - "height": { - "type": "number", - "description": "The image height." - }, - "src": { - "type": "string", - "description": "The source for the image." - }, - "altText": { - "type": "string", - "description": "The supporting text for the image." - }, - "caption": { - "type": "string", - "description": "Supporting text content for the image." - }, - "class": { - "type": "string", - "description": "Styling class properties for the image." - }, - "tooltip": { - "type": "string", - "description": "Tooltip content for the image." - }, - "type": { - "type": "string", - "enum": ["image"] - } - }, - "required": ["src", "type"] - }, - - "multimediaVideo": { - "type": "object", - "description": "A multimedia video component.", - "properties": { - "width": { - "type": "number", - "description": "The image width." - }, - "height": { - "type": "number", - "description": "The image height." - }, - "src": { - "type": "string", - "description": "** TODO: the plan just has 'type' here, how do we want to distinguish mp4 vs youtube, etc?" - }, - "caption": { - "type": "string", - "description": "Supporting text content for the video." - }, - "type": { - "type": "string", - "enum": ["video"] - }, - "modified": { - "type": "boolean", - "description": "An optional tag that specifies whether the panel has been modified from its default configuration" - } - }, - "required": ["src", "type"] - }, - - "multimediaAudio": { - "type": "object", - "description": "A multimedia audio component.", - "properties": { - "src": { - "type": "string", - "description": "** TODO: the plan just has 'type' here, how do we want to distinguish mp3, wav, etc?" - }, - "caption": { - "type": "string", - "description": "Supporting text content for the audio." - }, - "type": { - "type": "string", - "enum": ["audio"] - } - }, - "required": ["src", "type"] - }, - - "multimediaSlideshow": { - "type": "object", - "description": "A multimedia slideshow component.", - "properties": { - "images": { - "type": "array", - "items": { - "$ref": "#/$defs/multimediaImage" - }, - "description": "An array of images to display in the slideshow.", - "minItems": 1 - }, - "loop": { - "type": "boolean", - "description": "Determines whether the slideshow loops back around to the beginning when you reach the end.", - "default": false - }, - "caption": { - "type": "text", - "description": "A caption to display below the slideshow." - }, - "type": { - "type": "string", - "enum": ["slideshow"] - } - }, - "required": ["images", "type"] - }, - "dqvchartOptions": { - "type": "object", - "description": "Configuration for a dqvchart.", - "properties": { - "title": { - "type": "string", - "description": "The title of the chart." - }, - "subtitle": { - "type": "string", - "description": "The subtitle of the chart." - }, - "type": { - "type": "string", - "description": "The type of chart.", - "enum": [ - "line", - "spline", - "area", - "areaspline", - "column", - "bar", - "pie", - "scatter", - "gauge", - "arearange", - "areasplinerange", - "columnrange" - ] - }, - "width": { - "type": "number", - "description": "The width of the chart (will not exceed panel container width)." - }, - "height": { - "type": "number", - "description": "The height of chart (will not exceed panel container height on mobile resolutions)." - }, - "colours": { - "type": "array", - "description": "A list of colors to display chart data that corresponds to the order of columns in CSV file.", - "items": { - "type": "string" - } - }, - "export": { - "type": "boolean", - "description": "Specify whether export menu options are enabled.", - "default": true - }, - "credits": { - "type": "boolean", - "description": "Specify whether credits are enabled.", - "default": false - }, - "xAxisLabel": { - "type": "string", - "description": "The title of the x-axis." - }, - "yAxisLabel": { - "type": "string", - "description": "The title of the y-axis." - } - } - } - }, - - "properties": { - "title": { - "type": "string", - "description": "The title of the story map." - }, - - "introSlide": { - "type": "object", - "description": "The introductory slide", - "properties": { - "logo": { - "type": "object", - "description": "Information about the StoryRAMP logo", - "properties": { - "src": { - "type": "string", - "description": "An image source that is displayed at the top of the slide" - }, - "altText": { - "type": "string", - "description": "Alt text for the logo" - } - }, - "required": ["src"] - }, - "title": { - "type": "string", - "description": "The title of the project, displayed under the image" - }, - "subtitle": { - "type": "string", - "description": "An optional subtitle that is displayed under the title." - }, - "blurb": { - "type": "string", - "description": "Any additional information to display on the introductory slide." - }, - "backgroundImage": { - "type": "string", - "description": "A background image for the introduction slide." - } - }, - "required": ["logo", "title"] - }, - - "slides": { - "type": "array", - "description": "A list of StoryRAMP slides. A minimum of one slide is required.", - "items": { - "$ref": "#/$defs/slide" - }, - "minItems": 1 - }, - - "contextLink": { - "type": "string", - "description": "A link pointing to the source information" - }, - - "contextLabel": { - "type": "string", - "description": "A description that explains the context link." - }, - - "lang": { - "type": "string", - "description": "The language to display in the app", - "enum": ["en", "fr"] - }, - - "dateModified": { - "type": "string", - "description": "The last date that this config file was modified." - } - }, - - "required": ["title", "introSlide", "slides"] -} diff --git a/public/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000_en.json b/public/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000_en.json index 25ce4e3eb..1c8c7e8b3 100644 --- a/public/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000_en.json +++ b/public/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000_en.json @@ -30,7 +30,7 @@ "backgroundImage": "00000000-0000-0000-0000-000000000000/assets/en/GettyImages-187242601__1554821467033__w1920.jpg", "panel": [ { - "config": "00000000-0000-0000-0000-000000000000/ramp-config/test-ramp4.json", + "config": "00000000-0000-0000-0000-000000000000/ramp-config/en/OilSandsDeposits.json", "type": "map", "scrollguard": true }, @@ -89,7 +89,7 @@ { "id": "panel-4", "panel": { - "config": "00000000-0000-0000-0000-000000000000/ramp-config/OilSandsFacilityLocations2019.json", + "config": "00000000-0000-0000-0000-000000000000/ramp-config/en/OilSandsFacilityLocations2019.json", "type": "map", "scrollguard": true } @@ -156,7 +156,7 @@ "type": "text" }, { - "config": "00000000-0000-0000-0000-000000000000/ramp-config/OilSandsDeposits.json", + "config": "00000000-0000-0000-0000-000000000000/ramp-config/en/OilSandsDeposits.json", "type": "map", "scrollguard": true } @@ -203,7 +203,7 @@ "type": "text" }, { - "config": "00000000-0000-0000-0000-000000000000/ramp-config/OilSandsFacilityLocations2019.json", + "config": "00000000-0000-0000-0000-000000000000/ramp-config/en/OilSandsFacilityLocations2019.json", "type": "map", "title": "Map Title Test" } @@ -264,7 +264,7 @@ "type": "text" }, { - "config": "00000000-0000-0000-0000-000000000000/ramp-config/ReleasesandDisposalsbyMiningFacilitiesin2019(satellite).json", + "config": "00000000-0000-0000-0000-000000000000/ramp-config/en/ReleasesandDisposalsbyMiningFacilitiesin2019(satellite).json", "type": "map" } ] @@ -306,7 +306,7 @@ "type": "text" }, { - "config": "00000000-0000-0000-0000-000000000000/ramp-config/ReleasesandDisposalsbyMiningFacilitiesin2019(satellite).json", + "config": "00000000-0000-0000-0000-000000000000/ramp-config/en/ReleasesandDisposalsbyMiningFacilitiesin2019(satellite).json", "type": "map" } ], @@ -321,7 +321,7 @@ "type": "text" }, { - "config": "00000000-0000-0000-0000-000000000000/ramp-config/TailingsfromMiningFacilities2010to2019(timeslider).json", + "config": "00000000-0000-0000-0000-000000000000/ramp-config/en/TailingsfromMiningFacilities2010to2019(timeslider).json", "timeSlider": { "range": [2010, 2019], "start": [2010, 2010], @@ -356,7 +356,7 @@ "type": "text" }, { - "config": "00000000-0000-0000-0000-000000000000/ramp-config/ReleasestoAirbyInSituFacilitiesforAllSubstancesin2019.json", + "config": "00000000-0000-0000-0000-000000000000/ramp-config/en/ReleasestoAirbyInSituFacilitiesforAllSubstancesin2019.json", "type": "map" } ], @@ -422,7 +422,7 @@ "customStyles": "border: 2px solid black;" }, { - "config": "00000000-0000-0000-0000-000000000000/ramp-config/ReleasesandDisposalsbyMiningFacilitiesin2019(satellite).json", + "config": "00000000-0000-0000-0000-000000000000/ramp-config/en/ReleasesandDisposalsbyMiningFacilitiesin2019(satellite).json", "type": "map", "scrollguard": true }, diff --git a/public/StorylinesSlideSchema.json b/public/StorylinesSlideSchema.json index e586b3aa1..17aba067c 100644 --- a/public/StorylinesSlideSchema.json +++ b/public/StorylinesSlideSchema.json @@ -107,10 +107,6 @@ "customStyles": { "type": "string", "description": "Additional CSS styles to apply to the panel." - }, - "modified": { - "type": "boolean", - "description": "An optional tag that specifies whether the panel has been modified from its default configuration" } }, "additionalProperties": false, @@ -278,10 +274,6 @@ "type": "object", "description": "A multimedia image component.", "properties": { - "id": { - "type": "string", - "description": "The image ID." - }, "width": { "type": "number", "description": "The image width." @@ -370,10 +362,6 @@ "customStyles": { "type": "string", "description": "Additional CSS styles to apply to the panel." - }, - "modified": { - "type": "boolean", - "description": "An optional tag that specifies whether the panel has been modified from its default configuration" } }, "additionalProperties": false, @@ -419,11 +407,6 @@ "type": "text", "description": "A caption to display below the slideshow." }, - "userCreated": { - "type": "boolean", - "description": "Specifies whether this slideshow was automatically created from an image panel or if this is actually a slideshow panel.", - "default": false - }, "type": { "type": "string", "enum": ["slideshow"] @@ -520,21 +503,6 @@ "type": "boolean", "description": "Optional attribute that indicates whether or not to include slide in table of contents. Defaults to true.", "default": true - }, - "rightOnly": { - "type": "boolean", - "description": "Optional attribute that indicates whether or not the right panel should take up all of the space in the slide. Defaults to false.", - "default": false - }, - "centerSlide": { - "type": "boolean", - "description": "Optional attribute that indicates whether or not to center the content of the slide. Defaults to false. Must be false if centerPanel (below) is true", - "default": false - }, - "centerPanel": { - "type": "boolean", - "description": "Optional attribute that indicates whether or not to center the content of each panel. Defaults to false. Must be false if centerSlide (above) is true", - "default": false } }, diff --git a/server/index.js b/server/index.js index fe5e0c23a..e7759c19b 100644 --- a/server/index.js +++ b/server/index.js @@ -222,6 +222,7 @@ app.route(ROUTE_PREFIX + '/retrieve/:id/:hash').get(function (req, res, next) { // This event listener is fired when the write stream has finished. This means that the // ZIP file should be correctly populated. Now, we can set the correct headers and send the // ZIP file to the client. + output.on('close', () => { // Delete the zip file if the product load was cancelled by the user if (isRequestAborted) { diff --git a/src/components/chart-editor.vue b/src/components/chart-editor.vue index 79574e680..043b2d177 100644 --- a/src/components/chart-editor.vue +++ b/src/components/chart-editor.vue @@ -298,7 +298,7 @@ export default class ChartEditorV extends Vue { onChartsEdited(): void { this.edited = true; - this.$emit('slide-edit', this.chartConfigs.length !== 0); + this.$emit('slide-edit'); } } diff --git a/src/components/image-editor.vue b/src/components/image-editor.vue index d11713e13..11149e0cb 100644 --- a/src/components/image-editor.vue +++ b/src/components/image-editor.vue @@ -364,8 +364,9 @@ export default class ImageEditorV extends Vue { // Turn each of the image configs into an image panel and add them to the slidesow. (this.panel as SlideshowPanel).items = this.imagePreviews.map((imageFile: ImageFile) => { + const { id, ...restOfImage } = imageFile; // we don't need the id return { - ...imageFile, + ...restOfImage, src: `${this.configFileStructure.uuid}/assets/${this.lang}/${imageFile.id}`, type: PanelType.Image } as ImagePanel; @@ -377,7 +378,7 @@ export default class ImageEditorV extends Vue { onImagesEdited(): void { this.edited = true; - this.$emit('slide-edit', this.imagePreviews.length !== 0); + this.$emit('slide-edit'); } } diff --git a/src/components/metadata-editor.vue b/src/components/metadata-editor.vue index 59eebfff2..46646472f 100644 --- a/src/components/metadata-editor.vue +++ b/src/components/metadata-editor.vue @@ -745,7 +745,7 @@ export default class MetadataEditorV extends Vue { }; slides: MultiLanguageSlide[] = []; sourceCounts: SourceCounts = {}; - sessionExpired: boolean = false; + sessionExpired = false; totalTime = import.meta.env.VITE_APP_CURR_ENV ? Number(import.meta.env.VITE_SESSION_END) : 30; mounted(): void { @@ -1349,6 +1349,7 @@ export default class MetadataEditorV extends Vue { // Update the path to the RAMP config in the product config file. panel.config = panel.config.replace(`/${prevUuid}-map-`, `/${this.changeUuid}-map-`); } + break; default: // Base case. This is a panel that doesn't have any children (i.e., not dynamic, slideshow). // Rename the source. diff --git a/src/components/slide-editor.vue b/src/components/slide-editor.vue index 5fe1b4f9f..5e9b4ba84 100644 --- a/src/components/slide-editor.vue +++ b/src/components/slide-editor.vue @@ -77,7 +77,7 @@ id="centerSlide" class="rounded-none cursor-pointer w-4 h-4" v-model="centerSlide" - :disabled="centerPanel" + :disabled="centerPanel || onePanelOnly" @change.stop="toggleCenterSlide()" />