mirror of
https://github.com/cpvalente/ontime.git
synced 2026-07-26 10:38:55 +00:00
Small clean-up (#1815)
* chore: remove old comment * chore: smal lclean up of a e2e test * chore: bump to beta.6 * chore: cleanup imports * fix integration values com in ms * allow linkStart and timeStrategy from API * remove local mac dist
This commit is contained in:
committed by
GitHub
parent
4a27973de1
commit
da7c0d4ff2
@@ -82,9 +82,6 @@ From the project root, run the following commands
|
||||
|
||||
The build distribution assets will be at `.apps/electron/dist`
|
||||
|
||||
Note: The MacOS build will only work in CI, locally it will fail due to notarisation issues.
|
||||
Use the `pnpm dist-mac:local` command to build a MacOS distribution locally and skip the notary process.
|
||||
|
||||
## DOCKER
|
||||
|
||||
Ontime provides a docker-compose file to aid with building and running docker images.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getontime/cli",
|
||||
"version": "4.0.0-beta.5",
|
||||
"version": "4.0.0-beta.6",
|
||||
"author": "Carlos Valente",
|
||||
"description": "Time keeping for live events",
|
||||
"repository": "https://github.com/cpvalente/ontime",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ontime-ui",
|
||||
"version": "4.0.0-beta.5",
|
||||
"version": "4.0.0-beta.6",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { PropsWithChildren, useRef, useState } from 'react';
|
||||
import { IoCheckmark } from 'react-icons/io5';
|
||||
import { IoCopy } from 'react-icons/io5';
|
||||
import { IoCheckmark, IoCopy } from 'react-icons/io5';
|
||||
|
||||
import copyToClipboard from '../../utils/copyToClipboard';
|
||||
import { cx } from '../../utils/styleUtils';
|
||||
|
||||
+1
-2
@@ -1,5 +1,4 @@
|
||||
import { IoApps } from 'react-icons/io5';
|
||||
import { IoSettingsOutline } from 'react-icons/io5';
|
||||
import { IoApps, IoSettingsOutline } from 'react-icons/io5';
|
||||
|
||||
import { useFadeOutOnInactivity } from '../../../hooks/useFadeOutOnInactivity';
|
||||
import { cx } from '../../../utils/styleUtils';
|
||||
|
||||
@@ -77,7 +77,7 @@ export default function OntimeActionForm({
|
||||
New time
|
||||
<Input
|
||||
{...register(`outputs.${index}.time`, {
|
||||
required: { value: true, message: 'Required field' }, //TODO:(automation set aux) not sure what way around to have the string and where to have the ms value
|
||||
required: { value: true, message: 'Required field' },
|
||||
})}
|
||||
fluid
|
||||
placeholder='eg: 10m5s'
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import React from 'react';
|
||||
import { createRoutesFromChildren, matchRoutes, useLocation, useNavigationType } from 'react-router';
|
||||
import { Routes } from 'react-router';
|
||||
import { createRoutesFromChildren, matchRoutes, Routes, useLocation, useNavigationType } from 'react-router';
|
||||
import * as Sentry from '@sentry/react';
|
||||
|
||||
import { ONTIME_VERSION } from './ONTIME_VERSION';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ontime-electron",
|
||||
"version": "4.0.0-beta.5",
|
||||
"version": "4.0.0-beta.6",
|
||||
"author": "Carlos Valente",
|
||||
"description": "Time keeping for live events",
|
||||
"repository": "https://github.com/cpvalente/ontime",
|
||||
@@ -25,7 +25,6 @@
|
||||
"lint": "eslint . --quiet",
|
||||
"dist-win": "electron-builder --publish=never --x64 --win",
|
||||
"dist-mac": "electron-builder --publish=never --mac",
|
||||
"dist-mac:local": "electron-builder --publish=never --mac -c.mac.identity=null",
|
||||
"dist-linux": "electron-builder --publish=never --x64 --linux"
|
||||
},
|
||||
"build": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getontime/resolver",
|
||||
"version": "4.0.0-beta.5",
|
||||
"version": "4.0.0-beta.6",
|
||||
"type": "module",
|
||||
"repository": "https://github.com/cpvalente/ontime",
|
||||
"types": "./dist/main.d.ts",
|
||||
|
||||
@@ -13,8 +13,15 @@ export { SimplePlayback, SimpleDirection } from 'ontime-types';
|
||||
|
||||
// entries
|
||||
export type { OntimeEvent, OntimeGroup, EntryCustomFields, CustomFields, Rundown } from 'ontime-types';
|
||||
export { SupportedEntry, isOntimeEvent, isOntimeGroup, isOntimeDelay, isOntimeMilestone } from 'ontime-types';
|
||||
export {
|
||||
SupportedEntry,
|
||||
isOntimeEvent,
|
||||
isOntimeGroup,
|
||||
isOntimeDelay,
|
||||
isOntimeMilestone,
|
||||
TimeStrategy,
|
||||
} from 'ontime-types';
|
||||
|
||||
// functions
|
||||
export { isWsPacketToClient } from './websocket.js';
|
||||
export type { SocketSender } from './websocket.js';
|
||||
export type { SocketSender } from './websocket.js';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "ontime-server",
|
||||
"type": "module",
|
||||
"main": "src/index.ts",
|
||||
"version": "4.0.0-beta.5",
|
||||
"version": "4.0.0-beta.6",
|
||||
"exports": "./src/index.js",
|
||||
"dependencies": {
|
||||
"@googleapis/sheets": "^5.0.5",
|
||||
|
||||
@@ -199,7 +199,7 @@ function parseOntimeAction(maybeOntimeAction: object): OntimeAction {
|
||||
return {
|
||||
type: 'ontime',
|
||||
action: maybeOntimeAction.action,
|
||||
time: maybeOntimeAction.time, //TODO:(automation set aux) not sure what way around to have the string and where to have the ms value
|
||||
time: maybeOntimeAction.time,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
import { EndAction, TimerType, isKeyOfType } from 'ontime-types';
|
||||
import { MILLIS_PER_SECOND, maxDuration } from 'ontime-utils';
|
||||
import { EndAction, TimeStrategy, TimerType, isKeyOfType } from 'ontime-types';
|
||||
import { maxDuration } from 'ontime-utils';
|
||||
|
||||
import { coerceBoolean, coerceColour, coerceEnum, coerceNumber, coerceString } from '../utils/coerceType.js';
|
||||
import { getDataProvider } from '../classes/data-provider/DataProvider.js';
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {number} value time amount in seconds
|
||||
* @param {number} value time amount in milliseconds
|
||||
* @returns {number} time in milliseconds clamped to 0 and max duration
|
||||
*/
|
||||
function clampDuration(value: number): number {
|
||||
const valueInMillis = value * MILLIS_PER_SECOND;
|
||||
if (valueInMillis > maxDuration || valueInMillis < 0) {
|
||||
if (value > maxDuration || value < 0) {
|
||||
throw new Error('Times should be from 0 to 23:59:59');
|
||||
}
|
||||
return valueInMillis;
|
||||
return value;
|
||||
}
|
||||
|
||||
const propertyConversion = {
|
||||
@@ -34,6 +33,9 @@ const propertyConversion = {
|
||||
endAction: (value: unknown) => coerceEnum<EndAction>(value, EndAction),
|
||||
timerType: (value: unknown) => coerceEnum<TimerType>(value, TimerType),
|
||||
|
||||
linkStart: coerceBoolean,
|
||||
timeStrategy: (value: unknown) => coerceEnum<TimeStrategy>(value, TimeStrategy),
|
||||
|
||||
duration: (value: unknown) => clampDuration(coerceNumber(value)),
|
||||
timeStart: (value: unknown) => clampDuration(coerceNumber(value)),
|
||||
timeEnd: (value: unknown) => clampDuration(coerceNumber(value)),
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
// TODO: can we replace the clicks with something else?
|
||||
test.describe('pages routes are available', () => {
|
||||
test.use({ viewport: { width: 1920, height: 1080 } });
|
||||
test.describe('main views', () => {
|
||||
test('editor', async ({ page }) => {
|
||||
await page.goto('http://localhost:4001/editor');
|
||||
await page.goto('/editor');
|
||||
|
||||
await expect(page).toHaveTitle(/ontime/);
|
||||
await expect(page.getByTestId('editor-container')).toBeVisible();
|
||||
@@ -15,44 +14,41 @@ test.describe('pages routes are available', () => {
|
||||
});
|
||||
|
||||
test('cuesheet', async ({ page }) => {
|
||||
await page.goto('http://localhost:4001/cuesheet');
|
||||
await page.goto('/cuesheet');
|
||||
|
||||
await expect(page).toHaveTitle(/ontime/);
|
||||
await page.getByTestId('cuesheet').click();
|
||||
await expect(page.getByTestId('cuesheet')).toBeVisible();
|
||||
});
|
||||
|
||||
test('operator', async ({ page }) => {
|
||||
await page.goto('http://localhost:4001/op');
|
||||
await page.goto('/op');
|
||||
|
||||
await expect(page).toHaveTitle(/ontime/);
|
||||
});
|
||||
|
||||
test('timer', async ({ page }) => {
|
||||
await page.goto('http://localhost:4001/timer');
|
||||
await page.goto('/timer');
|
||||
|
||||
await expect(page).toHaveTitle(/ontime/);
|
||||
});
|
||||
|
||||
test('backstage', async ({ page }) => {
|
||||
await page.goto('http://localhost:4001/backstage');
|
||||
await page.goto('/backstage');
|
||||
|
||||
await expect(page).toHaveTitle(/ontime/);
|
||||
});
|
||||
|
||||
test('studio', async ({ page }) => {
|
||||
await page.goto('http://localhost:4001/studio');
|
||||
await page.goto('/studio');
|
||||
|
||||
await expect(page).toHaveTitle(/ontime/);
|
||||
});
|
||||
|
||||
test('countdown', async ({ page }) => {
|
||||
await page.goto('http://localhost:4001/countdown');
|
||||
await page.goto('/countdown?sub=32d31');
|
||||
|
||||
await expect(page).toHaveTitle(/ontime/);
|
||||
|
||||
await page.getByRole('button', { name: 'Add' }).click();
|
||||
await page.getByText('Albania').click();
|
||||
await page.getByRole('button', { name: 'Save' }).click();
|
||||
await expect(page.getByText('Albania')).toBeVisible();
|
||||
await expect(page.getByText('Latvia')).toBeHidden();
|
||||
});
|
||||
@@ -60,15 +56,15 @@ test.describe('pages routes are available', () => {
|
||||
|
||||
test.describe('detached views', () => {
|
||||
test('rundown', async ({ page }) => {
|
||||
await page.goto('http://localhost:4001/rundown');
|
||||
await page.goto('/rundown');
|
||||
await expect(page.getByTestId('panel-rundown')).toBeVisible();
|
||||
});
|
||||
test('timer control', async ({ page }) => {
|
||||
await page.goto('http://localhost:4001/timercontrol');
|
||||
await page.goto('/timercontrol');
|
||||
await expect(page.getByTestId('panel-timer-control')).toBeVisible();
|
||||
});
|
||||
test('message control', async ({ page }) => {
|
||||
await page.goto('http://localhost:4001/messagecontrol');
|
||||
await page.goto('/messagecontrol');
|
||||
await expect(page.getByTestId('panel-messages-control')).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -62,9 +62,4 @@ test('smoke test operator', async ({ page }) => {
|
||||
await expect(page.getByTestId('--1')).toHaveCSS('opacity', '1'); // BUG: ensure event doesn't inherit the past state of the group
|
||||
await expect(page.getByText('title 2')).toBeInViewport();
|
||||
await expect(page.getByText('title 3')).toBeInViewport();
|
||||
|
||||
// TODO: this part seems particularly flaky, to revise
|
||||
// await expect(page.getByText('00:01 - 00:02')).toBeInViewport();
|
||||
// await expect(page.getByText('00:02 - 00:03')).toBeInViewport();
|
||||
// await expect(page.getByText('00:03 - 00:04')).toBeInViewport();
|
||||
});
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
//TODO:
|
||||
|
||||
test('show warning when event crosses midnight', async ({ page }) => {
|
||||
await page.goto('http://localhost:4001/editor');
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { expect, Locator, Page, test } from '@playwright/test';
|
||||
import { expect, Locator, test } from '@playwright/test';
|
||||
|
||||
test('time until absolute', async ({ context }) => {
|
||||
const editor = await context.newPage();
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ontime",
|
||||
"version": "4.0.0-beta.5",
|
||||
"version": "4.0.0-beta.6",
|
||||
"description": "Time keeping for live events",
|
||||
"keywords": [
|
||||
"ontime",
|
||||
|
||||
@@ -90,7 +90,7 @@ export type OntimeAction =
|
||||
| {
|
||||
type: 'ontime';
|
||||
action: OntimeAuxSetAction;
|
||||
time: string; //TODO:(automation set aux) not sure what way around to have the string and where to have the ms value
|
||||
time: string;
|
||||
}
|
||||
| {
|
||||
type: 'ontime';
|
||||
|
||||
@@ -14,7 +14,7 @@ export {
|
||||
type OntimeEvent,
|
||||
type PlayableEvent,
|
||||
type TimeField,
|
||||
SupportedEntry as SupportedEntry,
|
||||
SupportedEntry,
|
||||
} from './definitions/core/OntimeEntry.js';
|
||||
export type { RundownEntries, Rundown, ProjectRundowns } from './definitions/core/Rundown.type.js';
|
||||
export { TimeStrategy } from './definitions/TimeStrategy.type.js';
|
||||
|
||||
@@ -46,10 +46,6 @@
|
||||
"dependsOn": ["build"],
|
||||
"outputs": ["dist/**"]
|
||||
},
|
||||
"dist-mac:local": {
|
||||
"dependsOn": ["build"],
|
||||
"outputs": ["dist/**"]
|
||||
},
|
||||
"dist-linux": {
|
||||
"dependsOn": ["build"],
|
||||
"outputs": ["dist/**"]
|
||||
|
||||
Reference in New Issue
Block a user