Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

- [#283](https://github.com/os2display/display-admin-client/pull/283)
- Fixed preview issues.
- [#275](https://github.com/os2display/display-admin-client/pull/275)
- Added enhanced preview.
- [#276](https://github.com/os2display/display-admin-client/pull/276)
- Added Colibo feed type form.
- Fixed feed type selector when unsupported type.
Expand Down
48 changes: 48 additions & 0 deletions src/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,51 @@ body,
margin-right: 1rem;
}
}

.preview-actions {
display: flex;
justify-content: space-between;
align-items: center;
}

.preview-button-container {
display: none;
position: fixed;
border: 3px solid #f8f9fa;
background: white;
right: 0;
top: 50%;
flex-direction: column;

@media (max-width: 800px) {
display: flex;
z-index: 2;
}
.preview-button {
justify-content: center;
align-content: center;
align-items: center;
}
}

.preview-overlay {
background: white;
z-index: 1021;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: hidden;

button {
position: fixed;
z-index: 20;
}
}

.preview-close-button {
top: 0;
right: 0;
margin: 2em;
}
16 changes: 13 additions & 3 deletions src/components/playlist/playlist-campaign-form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,21 @@ function PlaylistCampaignForm({
</div>
{previewOverlayVisible && (
<div
onClick={() =>
setPreviewOverlayVisible(!previewOverlayVisible)
}
role="presentation"
className="preview-overlay d-flex justify-content-center align-items-center flex-column"
>
<Button
id="close_preview_button"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
id="close_preview_button"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think the id is used

variant="primary"
type="button"
className="preview-close-button"
onClick={() =>
setPreviewOverlayVisible(!previewOverlayVisible)
}
>
{t("preview-close-button")}
</Button>

<Preview
id={idFromUrl(playlist["@id"])}
mode="playlist"
Expand All @@ -248,6 +257,7 @@ function PlaylistCampaignForm({
previewOrientation === "horizontal" ? 1920 : 1080
}
/>

<Alert
key="playlist-preview-about"
variant="info"
Expand Down
16 changes: 13 additions & 3 deletions src/components/screen/screen-form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,23 @@ function ScreenForm({
</div>
{previewOverlayVisible && (
<div
onClick={() =>
setPreviewOverlayVisible(!previewOverlayVisible)
}
role="presentation"
className="preview-overlay d-flex justify-content-center align-items-center flex-column"
>
<Button
id="close_preview_button"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
id="close_preview_button"

variant="primary"
type="button"
className="preview-close-button"
onClick={() =>
setPreviewOverlayVisible(!previewOverlayVisible)
}
>
{t("preview-close-button")}
</Button>

<Preview id={idFromUrl(screen["@id"])} mode="screen" />

<Alert
key="slide-preview-about"
variant="info"
Expand Down
27 changes: 18 additions & 9 deletions src/components/slide/slide-form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -439,19 +439,20 @@ function SlideForm({
<>
{config?.previewClient && (
<div
onClick={() =>
setPreviewOverlayVisible(!previewOverlayVisible)
}
role="presentation"
className="preview-overlay d-flex justify-content-center align-items-center flex-column"
>
<Alert
key="slide-preview-about"
variant="info"
className="mt-3"
<Button
id="close_preview_button"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
id="close_preview_button"

variant="primary"
type="button"
className="preview-close-button"
onClick={() =>
setPreviewOverlayVisible(!previewOverlayVisible)
}
>
{t("slide-preview-about")}
</Alert>
{t("preview-close-button")}
</Button>

<Preview
id={idFromUrl(slide["@id"])}
Expand All @@ -465,6 +466,14 @@ function SlideForm({
previewOrientation === "horizontal" ? 1920 : 1080
}
/>

<Alert
key="slide-preview-about"
variant="info"
className="mt-3"
>
{t("slide-preview-about")}
</Alert>
</div>
)}
{!config?.previewClient && (
Expand Down
42 changes: 0 additions & 42 deletions src/components/slide/slide-form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,45 +15,3 @@
bottom: 0;
}
}

.preview-actions {
display: flex;
justify-content: space-between;
align-items: center;
}

.preview-button-container {
display: none;
position: fixed;
border: 3px solid #f8f9fa;
background: white;
right: 0;
top: 50%;
flex-direction: column;

@media (max-width: 800px) {
display: flex;
z-index: 2;
}
.preview-button {
justify-content: center;
align-content: center;
align-items: center;
}
}

.preview-overlay {
background: white;
z-index: 1021;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: hidden;

button {
position: fixed;
z-index: 20;
}
}
5 changes: 4 additions & 1 deletion src/translations/da/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@
"slide-form": {
"preview-orientation-portrait": "Portræt (9:16)",
"preview-orientation-landscape": "Landskab (16:9)",
"preview-close-button": "Luk",
"slide-template-selected": "Skabelon",
"template-error": "Der skete en fejl da skabelonen skulle hentes:",
"remember-template-error": "Husk at tilknytte en skabelon til dit slide",
Expand Down Expand Up @@ -580,6 +581,7 @@
"playlist-campaign-form": {
"preview-orientation-portrait": "Portræt (9:16)",
"preview-orientation-landscape": "Landskab (16:9)",
"preview-close-button": "Luk",
"title-about": "Om spillelisten",
"title-slides": "Tilknyttede slides",
"save-button": "Gem",
Expand Down Expand Up @@ -836,7 +838,8 @@
"preview-orientation-landscape": "Landskab (16:9)",
"preview-in-full-screen": "Fuld skærm",
"preview-small-about": "Gem for at opdatere indhold.",
"preview": "Forhåndsvisning"
"preview": "Forhåndsvisning",
"preview-close-button": "Luk"
},
"nav-items": {
"shared-playlists": "Delte spillelister",
Expand Down
Loading