Skip to content

Commit ebb44da

Browse files
authored
Merge pull request #288 from os2display/release/2.5.1
Release 2.5.1
2 parents 68aa7cf + 3679b39 commit ebb44da

File tree

3 files changed

+45
-33
lines changed

3 files changed

+45
-33
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
## [2.5.1] - 2025-06-23
8+
9+
- [#287](https://github.com/os2display/display-admin-client/pull/287)
10+
- Disable live slide preview for templates with option.disableLivePreview.
11+
712
## [2.5.0] - 2025-05-09
813

914
- [#285](https://github.com/os2display/display-admin-client/pull/285)

src/components/slide/slide-form.jsx

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -401,40 +401,46 @@ function SlideForm({
401401
</Button>
402402
</div>
403403

404-
{selectedTemplate?.resources?.component && (
405-
<>
406-
{previewOrientation === "horizontal" && (
407-
<div style={{ width: "100%" }}>
408-
<RemoteComponentWrapper
409-
key="live-preview-horizontal"
410-
url={selectedTemplate?.resources?.component}
411-
slide={slide}
412-
mediaData={mediaData}
413-
showPreview={displayPreview}
414-
themeData={
415-
selectedTheme?.length > 0 ? selectedTheme[0] : {}
416-
}
417-
orientation={previewOrientation}
418-
/>
419-
</div>
420-
)}
421-
{previewOrientation === "vertical" && (
422-
<div style={{ width: "56.25%" }}>
423-
<RemoteComponentWrapper
424-
key="live-preview-vertical"
425-
url={selectedTemplate?.resources?.component}
426-
slide={slide}
427-
mediaData={mediaData}
428-
showPreview={displayPreview}
429-
themeData={
430-
selectedTheme?.length > 0 ? selectedTheme[0] : {}
431-
}
432-
orientation={previewOrientation}
433-
/>
434-
</div>
435-
)}
436-
</>
404+
{selectedTemplate?.resources?.options?.disableLivePreview && (
405+
<Alert variant="secondary" className="mt-3">
406+
{t("slide-preview-disabled-preview")}
407+
</Alert>
437408
)}
409+
{!selectedTemplate?.resources?.options?.disableLivePreview &&
410+
selectedTemplate?.resources?.component && (
411+
<>
412+
{previewOrientation === "horizontal" && (
413+
<div style={{ width: "100%" }}>
414+
<RemoteComponentWrapper
415+
key="live-preview-horizontal"
416+
url={selectedTemplate?.resources?.component}
417+
slide={slide}
418+
mediaData={mediaData}
419+
showPreview={displayPreview}
420+
themeData={
421+
selectedTheme?.length > 0 ? selectedTheme[0] : {}
422+
}
423+
orientation={previewOrientation}
424+
/>
425+
</div>
426+
)}
427+
{previewOrientation === "vertical" && (
428+
<div style={{ width: "56.25%" }}>
429+
<RemoteComponentWrapper
430+
key="live-preview-vertical"
431+
url={selectedTemplate?.resources?.component}
432+
slide={slide}
433+
mediaData={mediaData}
434+
showPreview={displayPreview}
435+
themeData={
436+
selectedTheme?.length > 0 ? selectedTheme[0] : {}
437+
}
438+
orientation={previewOrientation}
439+
/>
440+
</div>
441+
)}
442+
</>
443+
)}
438444
{previewOverlayVisible && (
439445
<>
440446
{config?.previewClient && (

src/translations/da/common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@
396396
}
397397
},
398398
"slide-form": {
399+
"slide-preview-disabled-preview": "Forhåndsvisning ikke tilgængelig for denne skabelon",
399400
"preview-orientation-portrait": "Portræt (9:16)",
400401
"preview-orientation-landscape": "Landskab (16:9)",
401402
"preview-close-button": "Luk",

0 commit comments

Comments
 (0)