mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 18:33:53 +00:00
V1 (#118)
* chore: upgrade minor versions * chore: upgrade cypress * chore: upgrade fe dependencies * update readme * update osx images * update readme * upgrade dependencies * upgrade test dependency * feat: add option to input autofill * feat: autofill to the left * chore: update docs * chore: cleanup ci * version bump * style: prevent zero height bar * fix: prevent loosing menu * ux: improve input, no spellcheck or autocomplete * small ux improvements in cuesheets * feat 111/increase maximum number of events * fix: optimistic delete issue with filter * refact: pincode workflow * chore: add versioning to packages
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
// get environment vars
|
||||
import 'dotenv/config.js';
|
||||
|
||||
import ua from 'universal-analytics';
|
||||
import { nanoid } from 'nanoid';
|
||||
|
||||
export const sessionId = nanoid();
|
||||
export const user = ua(process.env.ANALYTICS_ID);
|
||||
|
||||
// Track session
|
||||
user.set('uid', sessionId);
|
||||
|
||||
// Allows filtering by the 'Application?' field in GA
|
||||
user.set('ds', 'app');
|
||||
@@ -1,4 +1,8 @@
|
||||
import { customAlphabet } from 'nanoid';
|
||||
const nanoid = customAlphabet('1234567890abcdef', 5);
|
||||
|
||||
/**
|
||||
* @description generates a random id from the defined alphabet
|
||||
* @return {string}
|
||||
*/
|
||||
export const generateId = () => nanoid();
|
||||
|
||||
@@ -2853,8 +2853,12 @@ const object = [
|
||||
'Lieuwe',
|
||||
];
|
||||
|
||||
/**
|
||||
* @description returns a random name from the dictionary
|
||||
* @return {`${string} ${string}`}
|
||||
*/
|
||||
export default function getRandomName() {
|
||||
return `${adjective[Math.floor(Math.random() * adjective.length)]} ${
|
||||
object[Math.floor(Math.random() * object.length)]
|
||||
}`;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ import { generateId } from './generate_id.js';
|
||||
|
||||
export const EXCEL_MIME = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
|
||||
export const JSON_MIME = 'application/json';
|
||||
export const MAX_EVENTS = 99;
|
||||
|
||||
/**
|
||||
* @description Excel array parser
|
||||
@@ -55,7 +54,7 @@ export const parseExcel_v1 = async (excelData) => {
|
||||
.forEach((row) => {
|
||||
let eventTitleNext = false;
|
||||
let eventUrlNext = false;
|
||||
let event = {};
|
||||
const event = {};
|
||||
|
||||
row.forEach((column, j) => {
|
||||
// check flags
|
||||
|
||||
@@ -19,7 +19,6 @@ export const makeString = (val, fallback = '') => {
|
||||
* @returns {number}
|
||||
*/
|
||||
export const validateDuration = (timeStart, timeEnd) => {
|
||||
// Todo: this would go into a switch statement when expanded
|
||||
// Durations must be positive
|
||||
return Math.max(timeEnd - timeStart, 0);
|
||||
};
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { block as blockDef, delay as delayDef } from '../models/eventsDefinition.js';
|
||||
import { dbModelv1 } from '../models/dataModel.js';
|
||||
import { MAX_EVENTS, validateEvent_v1 } from './parser.js';
|
||||
import { validateEvent_v1 } from './parser.js';
|
||||
import { generateId } from './generate_id.js';
|
||||
import { MAX_EVENTS } from '../settings.js';
|
||||
|
||||
/**
|
||||
* Parse events array of an entry
|
||||
@@ -129,7 +130,6 @@ export const parseOsc_v1 = (data, enforce) => {
|
||||
if (s.portOut) osc.portOut = s.portOut;
|
||||
if (s.targetIP) osc.targetIP = s.targetIP;
|
||||
if (typeof s.enabled !== 'undefined') osc.enabled = s.enabled;
|
||||
|
||||
// write to db
|
||||
newOsc = {
|
||||
...dbModelv1.osc,
|
||||
@@ -153,7 +153,7 @@ export const parseHttp_v1 = (data, enforce) => {
|
||||
if ('http' in data) {
|
||||
console.log('Found HTTP definition, importing...');
|
||||
const h = data.osc;
|
||||
let http = {};
|
||||
const http = {};
|
||||
|
||||
if (h.user) http.user = h.user;
|
||||
if (h.pwd) http.pwd = h.pwd;
|
||||
@@ -176,7 +176,7 @@ export const parseHttp_v1 = (data, enforce) => {
|
||||
* @returns {object} - event object data
|
||||
*/
|
||||
export const parseAliases_v1 = (data) => {
|
||||
let newAliases = [];
|
||||
const newAliases = [];
|
||||
if ('aliases' in data) {
|
||||
console.log('Found Aliases definition, importing...');
|
||||
const ids = [];
|
||||
|
||||
@@ -32,6 +32,11 @@ export const stringFromMillis = (ms, showSeconds = true, delim = ':', ifNull = '
|
||||
const isNegative = ms < 0 ? '-' : '';
|
||||
const millis = Math.abs(ms);
|
||||
|
||||
/**
|
||||
* @description ensures value is double digit
|
||||
* @param value
|
||||
* @return {string|*}
|
||||
*/
|
||||
const showWith0 = (value) => (value < 10 ? `0${value}` : value);
|
||||
const hours = showWith0(Math.floor(((millis / mth) % 60) % 24));
|
||||
const minutes = showWith0(Math.floor((millis / mtm) % 60));
|
||||
@@ -39,9 +44,9 @@ export const stringFromMillis = (ms, showSeconds = true, delim = ':', ifNull = '
|
||||
|
||||
return showSeconds
|
||||
? `${isNegative}${
|
||||
parseInt(hours) ? `${hours}${delim}` : `00${delim}`
|
||||
parseInt(hours, 10) ? `${hours}${delim}` : `00${delim}`
|
||||
}${minutes}${delim}${seconds}`
|
||||
: `${isNegative}${parseInt(hours) ? `${hours}` : '00'}${delim}${minutes}`;
|
||||
: `${isNegative}${parseInt(hours, 10) ? `${hours}` : '00'}${delim}${minutes}`;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user