diff --git a/package.json b/package.json
index ec90d5f..88c7de0 100644
--- a/package.json
+++ b/package.json
@@ -1,5 +1,5 @@
{
- "name": "signage",
+ "name": "Artemio",
"version": "1.1.0",
"private": true,
"dependencies": {
diff --git a/public/index.html b/public/index.html
index cc1e1cc..bf66819 100644
--- a/public/index.html
+++ b/public/index.html
@@ -5,11 +5,11 @@
-
+
-
Signage
+ Artemio
diff --git a/public/manifest.json b/public/manifest.json
index c3046be..e62b7d9 100644
--- a/public/manifest.json
+++ b/public/manifest.json
@@ -1,6 +1,6 @@
{
- "short_name": "signage",
- "name": "signage",
+ "short_name": "artemio",
+ "name": "artemio",
"icons": [
{
"src": "favicon.ico",
diff --git a/src/components/header.jsx b/src/components/header.jsx
index 0562b68..04893a6 100644
--- a/src/components/header.jsx
+++ b/src/components/header.jsx
@@ -70,7 +70,7 @@ const HeaderSearch = () => {
navigate('/')} className={classes.link}>
- Signage
+ Artemio
diff --git a/src/pages/auth.jsx b/src/pages/auth.jsx
index 8dff852..b98dd7a 100644
--- a/src/pages/auth.jsx
+++ b/src/pages/auth.jsx
@@ -62,7 +62,7 @@ const Authentication = ({ redirect }) => {
align="center"
sx={(theme) => ({ fontFamily: `Greycliff CF, ${theme.fontFamily}`, fontWeight: 900 })}
>
- Connect to signage
+ Connect to Artemio
diff --git a/src/pages/playlist/content.jsx b/src/pages/playlist/content.jsx
index 0ca6c2e..b645e88 100644
--- a/src/pages/playlist/content.jsx
+++ b/src/pages/playlist/content.jsx
@@ -161,9 +161,6 @@ const Content = ({ form, playlistId, playlist }) => {
form.getInputProps(`files.${index}.seconds`).errors && 'This field is required'
}
/>
-
- Display time: {parseTime(form.getInputProps(`files.${index}.seconds`).value)}
-
handleDelete(index)}>
diff --git a/src/pages/playlist/index.jsx b/src/pages/playlist/index.jsx
index affab61..a22d9c7 100644
--- a/src/pages/playlist/index.jsx
+++ b/src/pages/playlist/index.jsx
@@ -22,7 +22,7 @@ const Playlist = (item) => {
const toggleActivate = () => {
setIsLoading(true);
- (isActive ? API.disactivate : API.activate)(id)
+ (isActive ? API.playlists.disactivate : API.playlists.activate)(id)
.then((res) => {
if (res.status === 200) {
setIsActive(!isActive);
diff --git a/src/pages/playlists/create.jsx b/src/pages/playlists/create.jsx
index e36d594..f8fb81e 100644
--- a/src/pages/playlists/create.jsx
+++ b/src/pages/playlists/create.jsx
@@ -3,7 +3,7 @@ import PlaylistViewEditor from './playlist-view-editor';
import API from '../../services/api';
const ModalCreatePlaylist = ({ opened, handler, addPlaylist }) => {
- const validated = (item) => {
+ const validate = (item) => {
if (item) {
addPlaylist(item);
}
@@ -26,7 +26,7 @@ const ModalCreatePlaylist = ({ opened, handler, addPlaylist }) => {
validated(item)}
+ handler={(item) => validate(item)}
/>
diff --git a/src/pages/playlists/role-selector.jsx b/src/pages/playlists/role-selector.jsx
deleted file mode 100644
index 784102f..0000000
--- a/src/pages/playlists/role-selector.jsx
+++ /dev/null
@@ -1,64 +0,0 @@
-import { MultiSelect } from '@mantine/core';
-import { useEffect, useState } from 'react';
-import setNotification from '../errors/error-notification';
-import API from '../../services/api';
-
-const RoleSelector = ({ defaultRoles, label, value, setValue }) => {
- const [data, setData] = useState([]);
- const [search, setSearch] = useState();
-
- const addRoles = (roles) => {
- if (!roles) return;
- for (let i = 0; i < roles.length; i++) {
- const role = roles[i];
- if (!data.find((r) => r.id === role.id)) {
- role.label = role.name;
- role.value = role.id.toString();
- setData((prev) => [...prev, role]);
- }
- }
- };
-
- useEffect(() => {
- API.roles
- .search(search)
- .then((res) => {
- if (res.status === 200) {
- addRoles(res.data);
- } else {
- setNotification(true, res);
- }
- })
- .catch((err) => {
- setNotification(true, err);
- });
- // eslint-disable-next-line
- }, [search]);
-
- useEffect(() => {
- addRoles(defaultRoles);
- // eslint-disable-next-line
- }, [defaultRoles]);
-
- // creatable
- // getCreateLabel={(query) => `+ Create ${query}`}
- // onCreate={(query) => {
- // const item = { value: query, label: query };
- // setData((current) => [...current, item]);
- // return item;
- // }}
- return (
-
- );
-};
-
-export default RoleSelector;
diff --git a/src/pages/playlists/update.jsx b/src/pages/playlists/update.jsx
index d74e41e..5e99156 100644
--- a/src/pages/playlists/update.jsx
+++ b/src/pages/playlists/update.jsx
@@ -3,8 +3,10 @@ import API from '../../services/api';
import PlaylistViewEditor from './playlist-view-editor';
const ModalUpdatePlaylist = ({ item, opened, handler, updatePlaylist }) => {
- const validated = (playlist) => {
- updatePlaylist(playlist);
+ const validate = (playlist) => {
+ if (playlist) {
+ updatePlaylist(playlist);
+ }
handler();
};
@@ -25,7 +27,7 @@ const ModalUpdatePlaylist = ({ item, opened, handler, updatePlaylist }) => {
item={item}
buttonText="Update"
APICall={API.playlists.update}
- handler={(playlist) => validated(playlist)}
+ handler={(playlist) => validate(playlist)}
/>
diff --git a/src/services/api.js b/src/services/api.js
index 6e362b3..a07d4ec 100644
--- a/src/services/api.js
+++ b/src/services/api.js
@@ -64,10 +64,10 @@ const API = {
},
files: {
upload(data) {
- return caller().post('/file', data);
+ return caller().post('/files', data);
},
list() {
- return caller().get('/file');
+ return caller().get('/files');
},
},
profile() {
diff --git a/src/setupProxy.js b/src/setupProxy.js
index a98f419..0611cbe 100644
--- a/src/setupProxy.js
+++ b/src/setupProxy.js
@@ -4,7 +4,7 @@ module.exports = function(app) {
app.use(
'/api',
createProxyMiddleware({
- target: 'http://192.168.2.183:5500',
+ target: 'http://127.0.0.1:5500',
changeOrigin: true,
})
);