Skip to content

Commit 257aaf5

Browse files
authored
Merge pull request #296 from os2display/feature/documentation-and-screen-layouts
Screen layout commands and expanded documentation
2 parents c7ded08 + 65020c3 commit 257aaf5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1787
-463
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Ignore custom templates folder.
22
/assets/shared/custom-templates/*
33

4+
# Ignore custom screen layouts folder.
5+
/assets/shared/custom-screen-layouts/*
6+
47
# Ignore the public/fixtures folder.
58
/public/fixtures
69

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ All notable changes to this project will be documented in this file.
2323
- Removed themes.
2424
- Added command to migrate config.json files.
2525
- Fix data fetching bug
26+
- Refactored screen layout commands.
2627

2728
### NB! Prior to 3.x the project was split into separate repositories
2829

README.md

Lines changed: 313 additions & 30 deletions
Large diffs are not rendered by default.

Taskfile.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ tasks:
143143
coding-standards:markdown:apply:
144144
desc: "Apply coding standards for Markdown."
145145
cmds:
146-
- docker compose run --rm --volume "$PWD:/md" markdownlint markdownlint --ignore '**/node_modules/**' --ignore '**/vendor/**' '*.md' 'documentation/*.md' --fix
146+
- docker compose run --rm --volume "$PWD:/md" markdownlint markdownlint --ignore '**/node_modules/**' --ignore '**/vendor/**' '*.md' 'docs/**/*.md' --fix
147147

148148
coding-standards:markdown:check:
149149
desc: "Check coding standards for Markdown."
150150
cmds:
151-
- docker compose run --rm --volume "$PWD:/md" markdownlint markdownlint --ignore '**/node_modules/**' --ignore '**/vendor/**' '*.md' 'documentation/*.md'
151+
- docker compose run --rm --volume "$PWD:/md" markdownlint markdownlint --ignore '**/node_modules/**' --ignore '**/vendor/**' '*.md' 'docs/**/*.md'
152152

153153
coding-standards:php:apply:
154154
desc: "Apply coding standards for PHP."

UPGRADE.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,19 @@ docker compose exec phpfpm bin/console app:templates:install
8282

8383
- Use `--all` option for installing all available templates.
8484
- Use `--update` option for updating existing templates.
85+
86+
#### 6 - Run screen layout list command to see status for installed screen layouts
87+
88+
```shell
89+
docker compose exec phpfpm bin/console app:screen-layouts:list
90+
```
91+
92+
#### 7 - Run screen layout install for enabling screen layouts
93+
94+
```shell
95+
docker compose exec phpfpm bin/console app:screen-layouts:install
96+
```
97+
98+
- Use `--all` option for installing all available templates.
99+
- Use `--update` option for updating existing templates.
100+
- Use `--cleanupRegions` option for cleaning up regions that are no longer connected to a layout.

assets/shared/custom-templates-example/custom-template-example.jsx

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,29 @@ import templateConfig from "./custom-template-example.json";
33
import BaseSlideExecution from "../slide-utils/base-slide-execution.js";
44
import { ThemeStyles } from "../slide-utils/slide-util.jsx";
55

6+
/**
7+
* Get the ULID of the template.
8+
* @return {string} The ULID of the template.
9+
*/
610
function id() {
711
return templateConfig.id;
812
}
913

14+
/**
15+
* Get the config object of the template.
16+
* @return {{title: string, id: string, options: {}, adminForm: {}}}
17+
*/
1018
function config() {
1119
return templateConfig;
1220
}
1321

22+
/**
23+
* Render the slide.
24+
* @param {object} slide The slide data.
25+
* @param {string} run A date string set when the slide should start running.
26+
* @param slideDone A function to invoke when the slide is done playing.
27+
* @return {JSX.Element} The component.
28+
*/
1429
function renderSlide(slide, run, slideDone) {
1530
return (
1631
<CustomTemplateExample
@@ -27,9 +42,9 @@ function renderSlide(slide, run, slideDone) {
2742
* @param {object} props Props.
2843
* @param {object} props.slide The slide.
2944
* @param {object} props.content The slide content.
30-
* @param {boolean} props.run Whether or not the slide should start running.
31-
* @param {Function} props.slideDone Function to invoke when the slide is done playing.
32-
* @param {string} props.executionId Unique id for the instance.
45+
* @param {string} props.run A date string set when the slide should start running.
46+
* @param {Function} props.slideDone A function to invoke when the slide is done playing.
47+
* @param {string} props.executionId A unique id for the instance.
3348
* @returns {JSX.Element} The component.
3449
*/
3550
function CustomTemplateExample({
@@ -60,7 +75,9 @@ function CustomTemplateExample({
6075
<h1 className="title">{title}</h1>
6176
</div>
6277

63-
<ThemeStyles id={executionId} css={slide?.theme?.cssStyles} />
78+
{slide?.theme?.cssStyles && (
79+
<ThemeStyles id={executionId} css={slide.theme.cssStyles} />
80+
)}
6481
</>
6582
);
6683
}

0 commit comments

Comments
 (0)