Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/table #105

Merged
merged 123 commits into from
Apr 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
3be23e5
feat/table add react-table
cpvalente Jan 23, 2022
bf5dfbe
feat/table add protected table route
cpvalente Jan 23, 2022
e357e27
feat/table draft components
cpvalente Jan 23, 2022
a0bb301
Merge branch 'master' into feat/table
cpvalente Jan 23, 2022
aa9b2d5
feat/table upgrade dependencies
cpvalente Jan 23, 2022
80bae84
feat/table merge master
cpvalente Jan 23, 2022
cc88bc9
feat/table typo
cpvalente Jan 26, 2022
10faacc
feat/table build table manually
cpvalente Jan 26, 2022
df6d162
feat/table upgrade dependencies
cpvalente Jan 26, 2022
5742ec8
feat/table format data
cpvalente Jan 26, 2022
afdfa6e
feat/table style draft
cpvalente Jan 26, 2022
d0342e5
feat/table fix: prevent issue with whitespace in strings
cpvalente Jan 27, 2022
9726e6b
feat/table filter columns
cpvalente Jan 27, 2022
4e0a539
feat/table make table
cpvalente Jan 27, 2022
ee0dcda
feat/table add new data fields
cpvalente Jan 29, 2022
d77e82d
feat/table build table
cpvalente Jan 29, 2022
d45c60d
feat/table build table
cpvalente Jan 29, 2022
9777129
feat/table cap maximum events to 99
cpvalente Jan 29, 2022
530eb26
feat/table chore: upgrade dependencies
cpvalente Jan 29, 2022
fc74dbe
feat/table support parsing of new properties
cpvalente Jan 29, 2022
ba04975
feat/table duration is data
cpvalente Jan 29, 2022
8a0e34f
feat/table fix: issues with duration entry
cpvalente Jan 30, 2022
4c3c865
feat/table improve time entry
cpvalente Jan 30, 2022
c0879c6
feat/table styles: table column size + scroll
cpvalente Jan 31, 2022
c7ee31e
feat/table styles: theme from local storage
cpvalente Jan 31, 2022
efa4980
feat/table refract: extract functions
cpvalente Jan 31, 2022
0313126
feat/table refract: ontime prefix in local storage
cpvalente Jan 31, 2022
2b938cc
feat/table style: indicate fetch
cpvalente Jan 31, 2022
f480cb0
feat/table refact: code format
cpvalente Jan 31, 2022
c342318
feat/table style: scrollbar
cpvalente Feb 1, 2022
4e19fbf
feat/table style: fix theme issues in checkboxes
cpvalente Feb 1, 2022
cdd20c2
feat/table refact: fix proptype def
cpvalente Feb 1, 2022
c92f9e8
feat/table test editable component
cpvalente Feb 3, 2022
90f0f8d
feat/table style: scrollbar style in light mode
cpvalente Feb 3, 2022
21dd4ad
feat/table cleanup
cpvalente Feb 3, 2022
7535e2a
feat/table config: upgrade dependencies
cpvalente Feb 3, 2022
b1ad56d
feat/table style: draft print styles
cpvalente Feb 5, 2022
734b449
feat/table populate data from socket
cpvalente Feb 5, 2022
fcab363
feat/table add additional routes
cpvalente Feb 5, 2022
0840082
feat/table import new data from excel
cpvalente Feb 5, 2022
8361d70
feat/table draft mutation
cpvalente Feb 5, 2022
061e291
feat/table extract mutation to reusable hook
cpvalente Feb 5, 2022
e3e7fad
feat/table config: tighten rules
cpvalente Feb 6, 2022
f377b1e
feat/table config: use react-table
cpvalente Feb 9, 2022
3f027d2
feat/table filter and reorder draft
cpvalente Feb 9, 2022
f896c7e
feat/table resize draft
cpvalente Feb 9, 2022
9643d0c
feat/table hightlight selected
cpvalente Feb 9, 2022
d0ae11c
feat/table resizing
cpvalente Feb 13, 2022
59d6173
feat/table recover table styling
cpvalente Feb 13, 2022
27aed80
feat/table refact: small linting compliance issues
cpvalente Feb 16, 2022
4e5c0dc
feat/table style tweaks
cpvalente Feb 17, 2022
c456a98
feat/table style tweaks
cpvalente Feb 18, 2022
b8ca7b7
feat/table settings
cpvalente Feb 18, 2022
8f0a504
feat/table cleanup
cpvalente Feb 20, 2022
2a46d37
feat/table: show negative timers
cpvalente Mar 3, 2022
19e036c
feat/table: upgrade dependencies
cpvalente Mar 3, 2022
c83525a
feat/table: auto resizable text area
cpvalente Mar 3, 2022
0a7cffb
Merge branch 'master' into feat/table
cpvalente Mar 3, 2022
ad0829b
feat/table: refact, allow value to be function
cpvalente Mar 4, 2022
0cce8d4
feat/table: persist column resizing
cpvalente Mar 4, 2022
b83d269
feat/table: render event types
cpvalente Mar 4, 2022
c0bd4c5
feat/table: show delay time
cpvalente Mar 4, 2022
dfe9ae7
feat/table: reset overrides
cpvalente Mar 4, 2022
5b877b9
feat/table: feature mockup dnd
cpvalente Mar 4, 2022
a3a43ac
feat/table: feature dnd sort table headers
cpvalente Mar 5, 2022
82909e4
feat/table: cleanup
cpvalente Mar 5, 2022
9cce786
feat/table: small ux improvements
cpvalente Mar 5, 2022
cf4da97
feat/table: cleanup
cpvalente Mar 5, 2022
818653c
feat/table: refact: extract settings into component
cpvalente Mar 5, 2022
ab98e1b
feat/table: reset toggles
cpvalente Mar 5, 2022
7792b3e
feat/table: cleanup
cpvalente Mar 5, 2022
67eb1a3
feat/table: show playback state
cpvalente Mar 5, 2022
6f70349
feat/table: fix proptype
cpvalente Mar 5, 2022
57e6067
feat/table: style
cpvalente Mar 5, 2022
1e9cd09
feat/table: ensure contrast between text and bg
cpvalente Mar 6, 2022
5b360d8
feat/table: style selected event row
cpvalente Mar 6, 2022
f1fa3f8
feat/table: add smoke tests to new routes
cpvalente Mar 6, 2022
b48a35e
feat/table: refact code format
cpvalente Mar 6, 2022
5c4527e
feat/table: collapse in context
cpvalente Mar 7, 2022
bea6d42
feat/table: import custom fields
cpvalente Mar 7, 2022
0c3dd72
feat/table refact: explicit encoding
cpvalente Mar 14, 2022
187ca51
Update .deepsource.toml
deepsourcebot Mar 14, 2022
fefe518
feat/table feat: parse user fields
cpvalente Mar 14, 2022
9678a78
feat/table: import custom fields
cpvalente Mar 21, 2022
32866b7
feat/table: create API endpoints
cpvalente Mar 25, 2022
99e2351
feat/table: create API endpoints
cpvalente Mar 25, 2022
51ac155
feat/table: edit user fields in app
cpvalente Mar 25, 2022
05a773f
feat/table: edit user fields in app
cpvalente Mar 25, 2022
722c45a
feat/table: delete unused fields
cpvalente Mar 25, 2022
abf98e4
feat/table: delete unused fields
cpvalente Mar 25, 2022
4675f32
config: move cra to dev dependencies
cpvalente Mar 26, 2022
1a721e1
feat/table: cleanup models
cpvalente Mar 26, 2022
6a8fed8
feat/table: populate custom fields in table
cpvalente Mar 26, 2022
1271fc0
feat/table: add routes
cpvalente Mar 26, 2022
0bb30d3
feat/table: update README
cpvalente Mar 26, 2022
5f5ce8f
fix: prevent issue opening external links
cpvalente Mar 26, 2022
c64bab1
feat/table: hide custom fields by defaukt
cpvalente Mar 26, 2022
0a424b1
feat/table: upgrade dnd dependencies
cpvalente Mar 26, 2022
e61ca11
feat/table: handle column visibility
cpvalente Mar 26, 2022
79ab480
feat/table: handle reordering
cpvalente Mar 26, 2022
5bfec54
Merge branch 'feat/table' of https://github.com/cpvalente/ontime into…
cpvalente Mar 26, 2022
f887713
feat/table: update test route
cpvalente Apr 4, 2022
0315363
feat/table: no default return
cpvalente Apr 4, 2022
91ab275
feat/table: several CSS improvements
cpvalente Apr 4, 2022
b301b92
feat/table: show running event
cpvalente Apr 4, 2022
35033ef
feat/table: add user colours to events
cpvalente Apr 6, 2022
48478e0
feat/table: user field help text
cpvalente Apr 6, 2022
e582783
feat/table: no user colours in backstage
cpvalente Apr 6, 2022
a4ca5d7
feat/table: fix inconsistent data in isPublic
cpvalente Apr 8, 2022
5019200
feat/table: fix table header z-index
cpvalente Apr 8, 2022
a11165b
feat/table: fix pagination props
cpvalente Apr 8, 2022
426b502
feat/table: update parser tests
cpvalente Apr 8, 2022
a2a4033
feat/table: update parser tests
cpvalente Apr 8, 2022
a2c6f81
feat/table: smoke tests on router
cpvalente Apr 8, 2022
89901cb
feat/table: configure deepsource
cpvalente Apr 8, 2022
895c6a1
feat/table: address code smells
cpvalente Apr 8, 2022
e2fa49e
feat/table: update frontend tests
cpvalente Apr 8, 2022
a55842e
feat/table: prevent undefined in query mutation
cpvalente Apr 9, 2022
8e07afd
feat/table: scroll to current
cpvalente Apr 9, 2022
ee11ec5
feat/table: table settings is context
cpvalente Apr 9, 2022
028d536
refact logic
cpvalente Apr 9, 2022
8a20e7b
feat/table style table header
cpvalente Apr 9, 2022
c3693c8
feat/table style table header
cpvalente Apr 9, 2022
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
16 changes: 13 additions & 3 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
version = 1

test_patterns = [
"__mocks__/**",
"__tests__/**",
"cypress/**",
"*.test.*",
"*.mock.*",
"*.spec.*"
]

[[analyzers]]
name = "javascript"
enabled = true
name = "javascript"
enabled = true

[analyzers.meta]
plugins = ["react"]
plugins = ["react"]
environment = ["nodejs","browser","jest"]
13 changes: 13 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ IP.ADDRESS:4001/public > Public / Foyer view
IP.ADDRESS:4001/pip > Picture in Picture view
IP.ADDRESS:4001/lower > Lower Thirds
IP.ADDRESS:4001/studio > Studio Clock
IP.ADDRESS:4001/cuesheet > Cue Sheet

...and for the editor (the control interface, same as the app)
-------------------------------------------------------------
Expand All @@ -48,7 +49,9 @@ More documentation available [here](https://cpvalente.gitbook.io/ontime/)
- Backstage Info
- Public Info
- Picture in Picture
- Studio Clock
- [x] Configurable realtime Lower Thirds
- [x] Cuesheets with additional custom fields
- [x] Send live messages to different screen types
- [x] Ability to differentiate between backstage and public data
- [x] Manage delays workflow
Expand All @@ -62,7 +65,6 @@ More documentation available [here](https://cpvalente.gitbook.io/ontime/)
## Unopinionated
We are not interested in forcing workflows and have made ontime, so it is flexible to whichever way you would like to work.


- [x] You do not need an order list to use the timer. Create an empty event and the OSC API works just the same
- [x] If you want just the info screens, no need to use the timer!
- [x] Don't have or care for a schedule?
Expand Down
77 changes: 73 additions & 4 deletions client/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,82 @@
{
"extends": [
"react-app",
"react-app/jest"
"react-app/jest",
"plugin:react/recommended"
],
"plugins": [
"react",
"testing-library",
"jest"
],
"plugins": ["react", "testing-library", "jest"],
"rules": {
"jest/no-mocks-import": "warn",
"no-useless-concat": "warn",
"prefer-template": "warn"

"prefer-template": "warn",
"react/jsx-no-bind": [
"error",
{
"ignoreRefs": true,
"allowArrowFunctions": true,
"allowFunctions": false,
"allowBind": false,
"ignoreDOMComponents": true
}
],
"react/jsx-boolean-value": [
"error",
"never",
{
"always": []
}
],
"react/jsx-handler-names": [
"off",
{
"eventHandlerPrefix": "handle",
"eventHandlerPropPrefix": "on"
}
],
"react/no-danger": "warn",
"react/no-deprecated": [
"error"
],
"react/jsx-no-undef": "error",
"react/jsx-closing-tag-location": "warn",
"react/jsx-no-useless-fragment": "warn",
"react/no-unescaped-entities": "error",
"react/jsx-tag-spacing": [
"error",
{
"closingSlash": "never",
"beforeSelfClosing": "always",
"afterOpening": "never",
"beforeClosing": "never"
}
],
"react/jsx-space-before-closing": [
"off",
"always"
],
"react/jsx-curly-brace-presence": [
"error",
{
"props": "never",
"children": "never"
}
],
"react/destructuring-assignment": [
"error",
"always"
],
"react/no-unsafe": "off",
"react/prop-types": [
"error",
{
"ignore": [],
"customValidators": [],
"skipUndeclared": true
}
]
}
}
29 changes: 17 additions & 12 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,30 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@chakra-ui/react": "^1.7.4",
"@chakra-ui/react": "^1.8.6",
"@dnd-kit/core": "^5.0.3",
"@dnd-kit/sortable": "^6.0.1",
"@dnd-kit/utilities": "^3.1.0",
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0",
"@react-icons/all-files": "^4.1.0",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"axios": "^0.24.0",
"framer-motion": "^4.1.6",
"jotai": "^0.16.5",
"autosize": "^5.0.1",
"axios": "^0.25.0",
"color": "^4.2.1",
"framer-motion": "4.1.17",
"ontime-utils": "link: ../server/utils/",
"react": "17.0.2",
"react-beautiful-dnd": "^13.1.0",
"react-dom": "^17.0.1",
"react-fast-compare": "^3.2.0",
"react-qr-code": "2.0.3",
"react-query": "^3.34.5",
"react-query": "^3.34.12",
"react-router-dom": "^6.2.1",
"react-scripts": "5.0.0",
"socket.io-client": "4.4.0",
"react-table": "^7.7.0",
"socket.io-client": "^4.4.1",
"typeface-open-sans": "^1.1.13",
"use-fit-text": "^2.4.0",
"web-vitals": "^1.0.1"
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "set BROWSER=none&&react-scripts start",
Expand All @@ -47,9 +48,13 @@
]
},
"devDependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^12.1.2",
"@testing-library/react-hooks": "^7.0.2",
"@testing-library/user-event": "^13.5.0",
"prop-types": "^15.8.1",
"react-scripts": "^5.0.0",
"react-test-renderer": "^17.0.2",
"sass": "^1.44.0"
"sass": "^1.49.0"
}
}
51 changes: 28 additions & 23 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { lazy, Suspense, useCallback, useEffect } from 'react';
import React, { lazy, Suspense, useCallback, useEffect } from 'react';
import { Route, Routes, useLocation, useNavigate } from 'react-router-dom';
import './App.scss';
import withSocket from 'features/viewers/ViewWrapper';
Expand All @@ -7,23 +7,17 @@ import ProtectRoute from './common/components/protectRoute/ProtectRoute';
import { useFetch } from './app/hooks/useFetch';
import { ALIASES } from './app/api/apiConstants';
import { getAliases } from './app/api/ontimeApi';
import { TableSettingsProvider } from './app/context/TableSettingsContext';

const Editor = lazy(() => import('features/editors/Editor'));
const Table = lazy(() => import('features/table/TableWrapper'));

const TimerView = lazy(() =>
import('features/viewers/timer/Timer')
);
const MinimalTimerView = lazy(() =>
import('features/viewers/timer/MinimalTimer')
);
const TimerView = lazy(() => import('features/viewers/timer/Timer'));
const MinimalTimerView = lazy(() => import('features/viewers/timer/MinimalTimer'));

const StageManager = lazy(() =>
import('features/viewers/backstage/StageManager')
);
const StageManager = lazy(() => import('features/viewers/backstage/StageManager'));
const Public = lazy(() => import('features/viewers/foh/Public'));
const Lower = lazy(() =>
import('features/viewers/production/lower/LowerWrapper')
);
const Lower = lazy(() => import('features/viewers/production/lower/LowerWrapper'));
const Pip = lazy(() => import('features/viewers/production/Pip'));
const StudioClock = lazy(() => import('features/viewers/studio/StudioClock'));

Expand All @@ -35,6 +29,20 @@ const SLowerThird = withSocket(Lower);
const SPip = withSocket(Pip);
const SStudio = withSocket(StudioClock);

const ProtectedEditor = () => (
<ProtectRoute>
<Editor />
</ProtectRoute>
);

const ProtectedTable = () => (
<ProtectRoute>
<TableSettingsProvider>
<Table />
</TableSettingsProvider>
</ProtectRoute>
);

function App() {
const { data } = useFetch(ALIASES, getAliases);
const location = useLocation();
Expand All @@ -48,8 +56,7 @@ function App() {
if (e.altKey) {
if (e.key === 't' || e.key === 'T') {
// if we are in electron
if (window.process?.type === undefined) return;
if (window.process.type === 'renderer') {
if (window.process?.type === 'renderer') {
// ask to see debug
window.ipcRenderer.send('set-window', 'show-dev');
}
Expand Down Expand Up @@ -101,15 +108,13 @@ function App() {
<Route path='/studio' element={<SStudio />} />
{/*/!* Lower cannot have fallback *!/*/}
<Route path='/lower' element={<SLowerThird />} />

{/*/!* Protected Routes *!/*/}
<Route
path='/editor'
element={
<ProtectRoute>
<Editor />
</ProtectRoute>
}
/>
<Route path='/editor' element={<ProtectedEditor />} />
<Route path='/cuesheet' element={<ProtectedTable />} />
<Route path='/cuelist' element={<ProtectedTable />} />
<Route path='/table' element={<ProtectedTable />} />

{/* Send to default if nothing found */}
<Route path='*' element={<STimer />} />
</Routes>
Expand Down
5 changes: 3 additions & 2 deletions client/src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
body,
html,
.App {
margin: 0px auto;
margin: 0 auto;
overflow: hidden;
overflow: clip;
height: 100vh;
Expand All @@ -23,7 +23,8 @@ option {

/* width */
::-webkit-scrollbar {
width: 0.5em;
width: 0.5rem;
height: 0.5rem;
}

/* Track */
Expand Down
5 changes: 3 additions & 2 deletions client/src/app/api/apiConstants.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export const NODE_PORT = 4001;
export const EVENT_TABLE = 'event';
export const ALIASES = 'aliases';
export const USERFIELDS = 'userFields';
export const EVENTS_TABLE = 'events';
export const APP_TABLE = 'appinfo';
export const OSC_SETTINGS = 'oscSettings';
Expand All @@ -13,5 +14,5 @@ const calculateServer = () => {
export const serverURL = calculateServer();
export const eventURL = serverURL + EVENT_TABLE;
export const eventsURL = serverURL + EVENTS_TABLE;
export const playbackURL = serverURL + 'playback';
export const ontimeURL = serverURL + 'ontime';
export const playbackURL = `${serverURL}playback`;
export const ontimeURL = `${serverURL}ontime`;
13 changes: 6 additions & 7 deletions client/src/app/api/eventsApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,19 @@ export const fetchAllEvents = async () => {
};

export const requestPost = async (data) => {
return await axios.post(eventsURL, data);
await axios.post(eventsURL, data);
};

export const requestPut = async (data) => {
return await axios.put(eventsURL, data);
await axios.put(eventsURL, data);
};

export const requestPatch = async (data) => {
return await axios.patch(eventsURL, data);
await axios.patch(eventsURL, data);
};

export const requestReorder = async (data) => {
const action = 'reorder';
return await axios.patch(`${eventsURL}/${action}`, data);
await axios.patch(`${eventsURL}/reorder`, data);
};

export const requestApplyDelay = async (eventId) => {
Expand All @@ -29,9 +28,9 @@ export const requestApplyDelay = async (eventId) => {
};

export const requestDelete = async (eventId) => {
return await axios.delete(`${eventsURL}/${eventId}`);
await axios.delete(`${eventsURL}/${eventId}`);
};

export const requestDeleteAll = async () => {
return await axios.delete(`${eventsURL}/all`);
await axios.delete(`${eventsURL}/all`);
};
Loading