mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 19:03:47 +00:00
many hotfixes (#465)
* style: disable menu bar in run mode * fix: external devices in dev mode * fix: add missing elements to translations * ux: improve translation strings * refactor: improve typing * style: blink on event change * refactor: param options is object --------- Co-authored-by: Hannes Rüger <hannesrueger@gmx.de>
This commit is contained in:
@@ -15,12 +15,12 @@ export default function ParamInput({ paramField }: EditFormInputProps) {
|
||||
|
||||
if (type === 'option') {
|
||||
const optionFromParams = searchParams.get(id);
|
||||
const defaultOptionValue = paramField.values.find((value) => value === optionFromParams);
|
||||
const defaultOptionValue = optionFromParams || undefined;
|
||||
|
||||
return (
|
||||
<Select placeholder='Select an option' variant='ontime' name={id} defaultValue={defaultOptionValue}>
|
||||
{paramField.values.map((value) => (
|
||||
<option key={value} value={value}>
|
||||
{Object.entries(paramField.values).map(([key, value]) => (
|
||||
<option key={key} value={key}>
|
||||
{value}
|
||||
</option>
|
||||
))}
|
||||
|
||||
@@ -5,7 +5,7 @@ export const TIME_FORMAT_OPTION: ParamField = {
|
||||
title: '12 / 24 hour timer',
|
||||
description: 'Whether to show the time in 12 or 24 hour mode. Overrides the global setting from preferences',
|
||||
type: 'option',
|
||||
values: ['12', '24'],
|
||||
values: { '12': '12 hour AM/PM', '24': '24 hour' },
|
||||
};
|
||||
|
||||
export const CLOCK_OPTIONS: ParamField[] = [
|
||||
@@ -45,7 +45,7 @@ export const CLOCK_OPTIONS: ParamField[] = [
|
||||
title: 'Align Horizontal',
|
||||
description: 'Moves the horizontally in page to start = left | center | end = right',
|
||||
type: 'option',
|
||||
values: ['start', 'center', 'end'],
|
||||
values: { start: 'Start', center: 'Center', end: 'End' },
|
||||
},
|
||||
{
|
||||
id: 'offsetx',
|
||||
@@ -58,7 +58,7 @@ export const CLOCK_OPTIONS: ParamField[] = [
|
||||
title: 'Align Vertical',
|
||||
description: 'Moves the vertically in page to start = left | center | end = right',
|
||||
type: 'option',
|
||||
values: ['start', 'center', 'end'],
|
||||
values: { start: 'Start', center: 'Center', end: 'End' },
|
||||
},
|
||||
{
|
||||
id: 'offsety',
|
||||
@@ -106,7 +106,7 @@ export const MINIMAL_TIMER_OPTIONS: ParamField[] = [
|
||||
title: 'Align Horizontal',
|
||||
description: 'Moves the horizontally in page to start = left | center | end = right',
|
||||
type: 'option',
|
||||
values: ['start', 'center', 'end'],
|
||||
values: { start: 'Start', center: 'Center', end: 'End' },
|
||||
},
|
||||
{
|
||||
id: 'offsetx',
|
||||
@@ -119,7 +119,7 @@ export const MINIMAL_TIMER_OPTIONS: ParamField[] = [
|
||||
title: 'Align Vertical',
|
||||
description: 'Moves the vertically in page to start = left | center | end = right',
|
||||
type: 'option',
|
||||
values: ['start', 'center', 'end'],
|
||||
values: { start: 'Start', center: 'Center', end: 'End' },
|
||||
},
|
||||
{
|
||||
id: 'offsety',
|
||||
|
||||
@@ -4,7 +4,7 @@ type BaseField = {
|
||||
description: string;
|
||||
};
|
||||
|
||||
type OptionsField = { type: 'option'; values: string[] };
|
||||
type OptionsField = { type: 'option'; values: Record<string, string> };
|
||||
type StringField = { type: 'string' };
|
||||
type BooleanField = { type: 'boolean' };
|
||||
type NumberField = { type: 'number' };
|
||||
|
||||
Reference in New Issue
Block a user