Skip to content

Commit 1314989

Browse files
authored
Merge pull request #182 from os2display/release/2.5.1
Release 2.5.1
2 parents 7866dfc + c6de578 commit 1314989

11 files changed

+53
-20
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ 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+
- [#178](https://github.com/os2display/display-templates/pull/178)
10+
- Fixed news-feed template blocks slide transitions.
11+
- [#177](https://github.com/os2display/display-templates/pull/177)
12+
- Set options.disableLivePreview for iframe templates
13+
714
## [2.5.0] - 2025-05-09
815

916
- [#175](https://github.com/os2display/display-templates/pull/175)

build/iframe-config-develop.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
"id": "01FQBJQ2M3544ZKAADPWBXHY71",
55
"description": "Skabelon til iFrame.",
66
"resources": {
7-
"component": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/iframe.js?ts=1744372285281",
8-
"admin": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/iframe-admin.json?ts=1744372285281",
7+
"component": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/iframe.js?ts=1747385351695",
8+
"admin": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/iframe-admin.json?ts=1747385351695",
99
"schema": "",
1010
"assets": [],
11-
"options": {},
11+
"options": {
12+
"disableLivePreview": true
13+
},
1214
"content": {}
1315
}
1416
}

build/iframe-config-main.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
"id": "01FQBJQ2M3544ZKAADPWBXHY71",
55
"description": "Skabelon til iFrame.",
66
"resources": {
7-
"component": "https://raw.githubusercontent.com/os2display/display-templates/main/build/iframe.js?ts=1744372285281",
8-
"admin": "https://raw.githubusercontent.com/os2display/display-templates/main/build/iframe-admin.json?ts=1744372285281",
7+
"component": "https://raw.githubusercontent.com/os2display/display-templates/main/build/iframe.js?ts=1747385351695",
8+
"admin": "https://raw.githubusercontent.com/os2display/display-templates/main/build/iframe-admin.json?ts=1747385351695",
99
"schema": "",
1010
"assets": [],
11-
"options": {},
11+
"options": {
12+
"disableLivePreview": true
13+
},
1214
"content": {}
1315
}
1416
}

build/news-feed-config-develop.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"id": "01JEWPAFF93YSF418TH72W1SBA",
55
"description": "Mulighed for at vise nyhedsindhold.",
66
"resources": {
7-
"component": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/news-feed.js?ts=1744372285281",
8-
"admin": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/news-feed-admin.json?ts=1744372285281",
7+
"component": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/news-feed.js?ts=1749716391822",
8+
"admin": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/news-feed-admin.json?ts=1749716391822",
99
"schema": "",
1010
"assets": [],
1111
"options": {},

build/news-feed-config-main.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"id": "01JEWPAFF93YSF418TH72W1SBA",
55
"description": "Mulighed for at vise nyhedsindhold.",
66
"resources": {
7-
"component": "https://raw.githubusercontent.com/os2display/display-templates/main/build/news-feed.js?ts=1744372285281",
8-
"admin": "https://raw.githubusercontent.com/os2display/display-templates/main/build/news-feed-admin.json?ts=1744372285281",
7+
"component": "https://raw.githubusercontent.com/os2display/display-templates/main/build/news-feed.js?ts=1749716391822",
8+
"admin": "https://raw.githubusercontent.com/os2display/display-templates/main/build/news-feed-admin.json?ts=1749716391822",
99
"schema": "",
1010
"assets": [],
1111
"options": {},

build/news-feed.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/travel-config-develop.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
"id": "01FZD7K807VAKZ99BGSSCHRJM6",
55
"description": "Skabelon til rejseplanen.",
66
"resources": {
7-
"component": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/travel.js?ts=1744372285281",
8-
"admin": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/travel-admin.json?ts=1744372285281",
7+
"component": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/travel.js?ts=1747385351695",
8+
"admin": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/travel-admin.json?ts=1747385351695",
99
"schema": "",
1010
"assets": [],
11-
"options": {},
11+
"options": {
12+
"disableLivePreview": true
13+
},
1214
"content": {}
1315
}
1416
}

build/travel-config-main.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
"id": "01FZD7K807VAKZ99BGSSCHRJM6",
55
"description": "Skabelon til rejseplanen.",
66
"resources": {
7-
"component": "https://raw.githubusercontent.com/os2display/display-templates/main/build/travel.js?ts=1744372285281",
8-
"admin": "https://raw.githubusercontent.com/os2display/display-templates/main/build/travel-admin.json?ts=1744372285281",
7+
"component": "https://raw.githubusercontent.com/os2display/display-templates/main/build/travel.js?ts=1747385351695",
8+
"admin": "https://raw.githubusercontent.com/os2display/display-templates/main/build/travel-admin.json?ts=1747385351695",
99
"schema": "",
1010
"assets": [],
11-
"options": {},
11+
"options": {
12+
"disableLivePreview": true
13+
},
1214
"content": {}
1315
}
1416
}

src/iframe/iframe-config.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"admin": "https://display-templates.local.itkdev.dk/build/iframe-admin.json",
99
"schema": "",
1010
"assets": [],
11-
"options": {},
11+
"options": {
12+
"disableLivePreview": true
13+
},
1214
"content": {}
1315
}
1416
}

src/news-feed/news-feed.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ function NewsFeed({ slide, content, run, slideDone, executionId }) {
2727
const [currentPost, setCurrentPost] = useState(null);
2828
const [posts, setPosts] = useState([]);
2929
const [qr, setQr] = useState(null);
30+
const transitionRef = useRef(null);
3031

3132
const timerRef = useRef();
3233

@@ -84,8 +85,13 @@ function NewsFeed({ slide, content, run, slideDone, executionId }) {
8485
}, [posts]);
8586

8687
useEffect(() => {
87-
if (feedData && Object.hasOwnProperty.call(feedData, "entries")) {
88+
if (feedData?.entries?.length > 0) {
8889
setPosts(feedData.entries);
90+
} else if (!transitionRef.current) {
91+
// If no content, wait 5 seconds and continue to next slide.
92+
transitionRef.current = setTimeout(() => {
93+
slideDone(slide);
94+
}, 5000);
8995
}
9096
}, [feedData]);
9197

@@ -97,6 +103,14 @@ function NewsFeed({ slide, content, run, slideDone, executionId }) {
97103
}
98104
}, [run]);
99105

106+
useEffect(() => {
107+
return () => {
108+
if (transitionRef.current) {
109+
clearInterval(transitionRef.current);
110+
}
111+
};
112+
}, []);
113+
100114
const getImageUrl = (post) => {
101115
let imageUrl = fallbackImageUrl ?? null;
102116

0 commit comments

Comments
 (0)