Skip to content

Commit aff9768

Browse files
authored
Merge pull request #261 from os2display/feature/template-v3
Refactored how templates are handled
2 parents f0b2d0a + 10c3b58 commit aff9768

File tree

160 files changed

+2580
-3075
lines changed

Some content is hidden

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

160 files changed

+2580
-3075
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
/repos
1+
# Ignore custom templates folder.
2+
/assets/shared/custom-templates/*
23

3-
/public/admin
4-
/public/client
4+
# Ignore release json file.
55
/public/release.json
66

77
###> symfony/framework-bundle ###

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file.
1010
* Cleaned up Github Actions workflows.
1111
* Updated PHP dependencies.
1212
* Added Playwright github action.
13+
* Changed how templates are imported.
1314

1415
### NB! Prior to 3.x the project was split into separate repositories
1516

assets/admin/app.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Container from "react-bootstrap/Container";
77
import Row from "react-bootstrap/Row";
88
import Col from "react-bootstrap/Col";
99
import localStorageKeys from "./components/util/local-storage-keys";
10-
import RestrictedRoute from "./restricted-route";
10+
import RestrictedRoute from "./components/restricted-route";
1111
import Topbar from "./components/navigation/topbar/top-bar";
1212
import SideBar from "./components/navigation/sidebar/sidebar";
1313
import ScreenList from "./components/screen/screen-list";
@@ -32,14 +32,14 @@ import UserContext from "./context/user-context";
3232
import ListContext from "./context/list-context";
3333
import SharedPlaylists from "./components/playlist/shared-playlists";
3434
import Logout from "./components/user/logout";
35-
import AuthHandler from "./auth-handler";
35+
import AuthHandler from "./components/auth-handler";
3636
import LoadingComponent from "./components/util/loading-component/loading-component";
3737
import ModalProvider from "./context/modal-context/modal-provider";
3838
import UsersList from "./components/users/users-list";
3939
import ActivationCodeList from "./components/activation-code/activation-code-list";
4040
import ActivationCodeCreate from "./components/activation-code/activation-code-create";
4141
import ActivationCodeActivate from "./components/activation-code/activation-code-activate";
42-
import AdminConfigLoader from "./admin-config-loader.js";
42+
import AdminConfigLoader from "./components/util/admin-config-loader.js";
4343
import "react-toastify/dist/ReactToastify.css";
4444
import "./app.scss";
4545
import FeedSourcesList from "./components/feed-sources/feed-sources-list";
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { React, useContext } from "react";
22
import PropTypes from "prop-types";
3-
import Login from "./components/user/login";
4-
import UserContext from "./context/user-context";
3+
import Login from "./user/login";
4+
import UserContext from "../context/user-context";
55

66
/**
77
* The auth handler wrapper.
File renamed without changes.
File renamed without changes.

assets/admin/restricted-route.jsx renamed to assets/admin/components/restricted-route.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { React, useContext } from "react";
22
import PropTypes from "prop-types";
3-
import UserContext from "./context/user-context";
4-
import NoAccess from "./components/no-access/no-access";
3+
import UserContext from "../context/user-context";
4+
import NoAccess from "./no-access/no-access";
55

66
/**
77
* The restricted route wrapper.

assets/admin/components/screen/screen-list.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
displayError,
1919
} from "../util/list/toast-component/display-toast";
2020
import "./screen-list.scss";
21-
import AdminConfigLoader from "../../admin-config-loader.js";
21+
import AdminConfigLoader from "../util/admin-config-loader.js";
2222

2323
/**
2424
* The screen list component.

assets/admin/components/screen/screen-status.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import idFromUrl from "../util/helpers/id-from-url";
1818
import { api } from "../../redux/api/api.generated.ts";
1919
import { displayError } from "../util/list/toast-component/display-toast";
2020
import FormInput from "../util/forms/form-input";
21-
import AdminConfigLoader from "../../admin-config-loader.js";
21+
import AdminConfigLoader from "../util/admin-config-loader.js";
2222

2323
/**
2424
* Displays screen status.

assets/admin/components/slide/preview/slide-preview.jsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@ import { React, useEffect, useState } from "react";
22
import { Button } from "react-bootstrap";
33
import PropTypes from "prop-types";
44
import { useTranslation } from "react-i18next";
5-
import ErrorBoundary from "../../../error-boundary";
5+
import ErrorBoundary from "../../error-boundary";
66
import "./slide-preview.scss";
7-
import renderSlide from "../../../../shared/template/slide.jsx";
7+
import { renderSlide } from "../../../../shared/slide-utils/templates";
88

99
/**
10-
* A remote component wrapper
10+
* Slide live preview.
1111
*
1212
* @param {object} props Props.
1313
* @param {object} props.slide The slide.
14-
* @param {boolean} props.url The url for the remote component.
1514
* @param {object} props.mediaData Object of loaded media.
1615
* @param {object} props.themeData Object of theme data.
1716
* @param {string} props.orientation Display orientation or horizontal.
@@ -23,7 +22,7 @@ import renderSlide from "../../../../shared/template/slide.jsx";
2322
*/
2423
function SlidePreview({
2524
slide,
26-
templateData,
25+
templateData,
2726
showPreview,
2827
orientation = "",
2928
closeButton = false,
@@ -147,7 +146,6 @@ function SlidePreview({
147146
SlidePreview.propTypes = {
148147
slide: PropTypes.shape({ content: PropTypes.shape({}).isRequired })
149148
.isRequired,
150-
url: PropTypes.string.isRequired,
151149
mediaData: PropTypes.shape({
152150
"@id": PropTypes.string,
153151
}),

0 commit comments

Comments
 (0)