Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/workflows/javascript.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
docker network create frontend

- run: |
docker compose run --rm prettier 'assets/**/*.js' --check
docker compose run --rm prettier 'assets/**/*.{js,jsx}' --check
4 changes: 2 additions & 2 deletions assets/admin/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function App() {
useEffect(() => {
AdminConfigLoader.loadConfig().then((loadedConfig) => {
setConfig(loadedConfig);
})
});
}, []);

const handleReauthenticate = () => {
Expand Down Expand Up @@ -122,7 +122,7 @@ function App() {
// If there is a selected tenant, fetch from local storage and use
if (localStorage.getItem(localStorageKeys.SELECTED_TENANT)) {
setSelectedTenant(
JSON.parse(localStorage.getItem(localStorageKeys.SELECTED_TENANT))
JSON.parse(localStorage.getItem(localStorageKeys.SELECTED_TENANT)),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function getActivationCodeColumns() {
const ActivationCodeColumns = ColumnHoc(getActivationCodeColumns, true, true);
const SelectActivationCodeColumns = SelectColumnHoc(
getActivationCodeColumns,
true
true,
);

export { SelectActivationCodeColumns, ActivationCodeColumns };
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function ActivationCodeList() {
const [isDeleting, setIsDeleting] = useState(false);
const [listData, setListData] = useState();
const [loadingMessage, setLoadingMessage] = useState(
t("loading-messages.loading-activation-code")
t("loading-messages.loading-activation-code"),
);

// Remove from tenant call
Expand Down Expand Up @@ -104,7 +104,7 @@ function ActivationCodeList() {
setIsDeleting(false);
displayError(
t("error-messages.activation-code-delete-error"),
isDeleteError
isDeleteError,
);
}
}, [isDeleteError]);
Expand All @@ -120,7 +120,7 @@ function ActivationCodeList() {
if (activationCodeGetError) {
displayError(
t("error-messages.activation-code-load-error"),
activationCodeGetError
activationCodeGetError,
);
}
}, [activationCodeGetError]);
Expand All @@ -139,7 +139,7 @@ function ActivationCodeList() {
userActivationCodeActivationCode: JSON.stringify({
activationCode: item[0].code,
}),
})
}),
)
.then((response) => {
if (response.data) {
Expand Down
6 changes: 3 additions & 3 deletions assets/admin/components/feed-sources/feed-source-manager.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ function FeedSourceManager({

// State
const [headerText] = useState(
saveMethod === "PUT" ? t("edit-feed-source") : t("create-new-feed-source")
saveMethod === "PUT" ? t("edit-feed-source") : t("create-new-feed-source"),
);

const [loadingMessage, setLoadingMessage] = useState(
t("loading-messages.loading-feed-source")
t("loading-messages.loading-feed-source"),
);

const [submitting, setSubmitting] = useState(false);
Expand Down Expand Up @@ -171,7 +171,7 @@ function FeedSourceManager({
if (loadingError) {
displayError(
t("error-messages.load-feed-source-error", { id }),
loadingError
loadingError,
);
}
}, [loadingError]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function getFeedSourcesColumns({ apiCall, infoModalRedirect, infoModalTitle }) {
tenants?.length === 0 ||
!tenants.find(
(tenant) =>
tenant.tenantKey === context.selectedTenant.get.tenantKey
tenant.tenantKey === context.selectedTenant.get.tenantKey,
)
);
},
Expand Down
4 changes: 2 additions & 2 deletions assets/admin/components/feed-sources/feed-sources-list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function FeedSourcesList() {
const [listData, setListData] = useState();
const [isDeleting, setIsDeleting] = useState(false);
const [loadingMessage, setLoadingMessage] = useState(
t("loading-messages.loading-feed-sources")
t("loading-messages.loading-feed-sources"),
);

// Delete call
Expand Down Expand Up @@ -123,7 +123,7 @@ function FeedSourcesList() {
if (feedSourcesGetError) {
displayError(
t("error-messages.feed-sources-load-error"),
feedSourcesGetError
feedSourcesGetError,
);
}
}, [feedSourcesGetError]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const CalendarApiFeedType = ({

useEffect(() => {
if (feedSourceId && feedSourceId !== "") {
const endpoint = "/" + feedSourceId + "/config/locations";
setOptionsEndpoint(endpoint);
const endpoint = "/" + feedSourceId + "/config/locations";
setOptionsEndpoint(endpoint);
}
}, [feedSourceId]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const ColiboFeedType = ({

useEffect(() => {
if (feedSourceId && feedSourceId !== "") {
const endpoint = '/' + feedSourceId + "/config/recipients";
const endpoint = "/" + feedSourceId + "/config/recipients";
setOptionsEndpoint(endpoint);
}
}, [feedSourceId]);
Expand Down
4 changes: 2 additions & 2 deletions assets/admin/components/groups/group-edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function GroupEdit() {
const [formStateObject, setFormStateObject] = useState();
const [savingGroup, setSavingGroup] = useState(false);
const [loadingMessage, setLoadingMessage] = useState(
t("loading-messages.loading-group")
t("loading-messages.loading-group"),
);
const { id } = useParams();
const [PutV2ScreenGroup, { error: saveError, isSuccess: isSaveSuccess }] =
Expand Down Expand Up @@ -68,7 +68,7 @@ function GroupEdit() {
? loadError.error
: loadError.data["hydra:description"],
id,
})
}),
);
}
}, [loadError]);
Expand Down
2 changes: 1 addition & 1 deletion assets/admin/components/groups/groups-list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function GroupsList() {
const [isDeleting, setIsDeleting] = useState(false);
const [listData, setListData] = useState();
const [loadingMessage, setLoadingMessage] = useState(
t("loading-messages.loading-groups")
t("loading-messages.loading-groups"),
);

// Delete call
Expand Down
2 changes: 1 addition & 1 deletion assets/admin/components/media/media-create.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function MediaCreate() {
setLoadingMessage(
t("loading-messages.saving-media", {
title: element.title || t("unamed"),
})
}),
);
const formData = new FormData();
formData.append("file", element.file);
Expand Down
4 changes: 2 additions & 2 deletions assets/admin/components/media/media-list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ function MediaList({ fromModal = false, multiple = true }) {
const [media, setMedia] = useState([]);
const [page, setPage] = useState(parseInt(pageParams || 1, 10));
const [searchText, setSearchText] = useState(
searchParams === null ? "" : searchParams
searchParams === null ? "" : searchParams,
);
const [loadingMessage, setLoadingMessage] = useState(
t("loading-messages.loading-media")
t("loading-messages.loading-media"),
);

// Delete method
Expand Down
2 changes: 1 addition & 1 deletion assets/admin/components/navigation/logo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import DisplayLogo from "./logo.svg";
const Logo = () => {
return (
<div className="mx-3 mt-md-0 mb-3 mb-md-0">
<DisplayLogo style={{width: "70px"}} alt="logo" />
<DisplayLogo style={{ width: "70px" }} alt="logo" />
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function RestrictedNavRoute({ children, roles }) {

// If the user has a role with access to children.
const userHasRequiredRole = context.selectedTenant.get?.roles.find((value) =>
roles.includes(value)
roles.includes(value),
);

if (!userHasRequiredRole) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function TenantSelector() {
setSelectedTenant(newTenant);
localStorage.setItem(
localStorageKeys.SELECTED_TENANT,
JSON.stringify(newTenant)
JSON.stringify(newTenant),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function PlaylistCampaignForm({
},
];
const [previewOrientation, setPreviewOrientation] = useState(
previewOrientationOptions[0].value
previewOrientationOptions[0].value,
);
const navigate = useNavigate();
const [publishedFromError, setPublishedFromError] = useState(false);
Expand Down
4 changes: 2 additions & 2 deletions assets/admin/components/playlist/playlist-campaign-list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function PlaylistCampaignList({ location }) {
const [isDeleting, setIsDeleting] = useState(false);
const [listData, setListData] = useState();
const [loadingMessage, setLoadingMessage] = useState(
t(`${location}.loading-messages.loading`)
t(`${location}.loading-messages.loading`),
);

// Delete call
Expand Down Expand Up @@ -135,7 +135,7 @@ function PlaylistCampaignList({ location }) {
if (playlistsGetError) {
displayError(
t(`${location}.error-messages.load-error`),
playlistsGetError
playlistsGetError,
);
}
}, [playlistsGetError]);
Expand Down
16 changes: 8 additions & 8 deletions assets/admin/components/playlist/playlist-campaign-manager.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ function PlaylistCampaignManager({
// Set published to format accepted by bootstrap date component
if (localFormStateObject.published.from) {
localFormStateObject.published.from = dayjs(
localFormStateObject.published.from
localFormStateObject.published.from,
).format("YYYY-MM-DDTHH:mm");
}
if (localFormStateObject.published.to) {
localFormStateObject.published.to = dayjs(
localFormStateObject.published.to
localFormStateObject.published.to,
).format("YYYY-MM-DDTHH:mm");
}

Expand Down Expand Up @@ -119,13 +119,13 @@ function PlaylistCampaignManager({
enhancedApi.endpoints.putV2ScreensByIdCampaigns.initiate({
id: playlistId,
body: JSON.stringify(selectedScreens),
})
}),
)
.then((response) => {
if (response.error) {
displayError(
t(`${location}.error-messages.save-screens-error`),
response.error
response.error,
);
reject(response.error);
} else {
Expand Down Expand Up @@ -154,13 +154,13 @@ function PlaylistCampaignManager({
enhancedApi.endpoints.putV2ScreenGroupsByIdCampaigns.initiate({
id: playlistId,
body: JSON.stringify(selectedScreenGroups),
})
}),
)
.then((response) => {
if (response.error) {
displayError(
t(`${location}.error-messages.save-group-error`),
response.error
response.error,
);
reject(response.error);
} else {
Expand Down Expand Up @@ -188,13 +188,13 @@ function PlaylistCampaignManager({
enhancedApi.endpoints.putV2PlaylistsByIdSlides.initiate({
id: playlistId,
body: JSON.stringify(selectedSlides),
})
}),
)
.then((response) => {
if (response.error) {
displayError(
t(`${location}.error-messages.save-slides-error`),
response.error
response.error,
);
reject(response.error);
} else {
Expand Down
6 changes: 3 additions & 3 deletions assets/admin/components/playlist/playlist-gantt-chart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function PlaylistGanttChart({ slides }) {
/** Get show from local storage */
useEffect(() => {
const localStorageShow = localStorage.getItem(
localStorageKeys.VIEW_GANT_PLAYLIST
localStorageKeys.VIEW_GANT_PLAYLIST,
);
setShowGantt(localStorageShow === "true");
}, []);
Expand All @@ -31,7 +31,7 @@ function PlaylistGanttChart({ slides }) {
const inAYear = new Date(
today.getFullYear() + 1,
today.getMonth(),
today.getDate()
today.getDate(),
);
setDataForGantChart(
slides.map((slide) => {
Expand All @@ -44,7 +44,7 @@ function PlaylistGanttChart({ slides }) {
stroke: "black",
title: slide.title,
};
})
}),
);
}
}, [slides]);
Expand Down
2 changes: 1 addition & 1 deletion assets/admin/components/playlist/playlists-columns.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function getPlaylistColumns({
tenants?.length === 0 ||
!tenants.find(
(tenant) =>
tenant.tenantKey === context.selectedTenant.get.tenantKey
tenant.tenantKey === context.selectedTenant.get.tenantKey,
)
);
},
Expand Down
6 changes: 2 additions & 4 deletions assets/admin/components/preview/preview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ function Preview({
urlSearchParams.set("preview-id", id);
urlSearchParams.set(
"preview-token",
localStorage.getItem(LocalStorageKeys.API_TOKEN)
);
const tenantEntry = localStorage.getItem(
LocalStorageKeys.SELECTED_TENANT
localStorage.getItem(LocalStorageKeys.API_TOKEN),
);
const tenantEntry = localStorage.getItem(LocalStorageKeys.SELECTED_TENANT);
urlSearchParams.set("preview-tenant", JSON.parse(tenantEntry).tenantKey);

setPreviewClientUrl(`/client?${urlSearchParams}`);
Expand Down
2 changes: 1 addition & 1 deletion assets/admin/components/restricted-route.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function RestrictedRoute({ children, roles }) {

// If the user has a role with access to children.
const userHasRequiredRole = context.selectedTenant.get?.roles.find((value) =>
roles.includes(value)
roles.includes(value),
);
if (context.authenticated.get && !userHasRequiredRole) {
return <NoAccess />;
Expand Down
4 changes: 2 additions & 2 deletions assets/admin/components/screen/screen-form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function ScreenForm({
},
];
const [previewOrientation, setPreviewOrientation] = useState(
previewOrientationOptions[0].value
previewOrientationOptions[0].value,
);

/**
Expand Down Expand Up @@ -116,7 +116,7 @@ function ScreenForm({
useEffect(() => {
if (layoutOptions) {
const localSelectedLayout = layoutOptions.find(
(layout) => layout["@id"] === screen.layout
(layout) => layout["@id"] === screen.layout,
);
if (localSelectedLayout) {
setSelectedLayout(localSelectedLayout);
Expand Down
2 changes: 1 addition & 1 deletion assets/admin/components/screen/screen-list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function ScreenList() {
const [isDeleting, setIsDeleting] = useState(false);
const [listData, setListData] = useState();
const [loadingMessage, setLoadingMessage] = useState(
t("loading-messages.loading-screens")
t("loading-messages.loading-screens"),
);
const [showScreenStatus, setShowScreenStatus] = useState(false);

Expand Down
Loading