mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 02:13:48 +00:00
refactor: rename block > group in UI elements
This commit is contained in:
committed by
Carlos Valente
parent
a98c14406d
commit
8728c1450b
@@ -589,7 +589,7 @@ export const useEntryActions = () => {
|
||||
try {
|
||||
await ungroupMutation(blockId);
|
||||
} catch (error) {
|
||||
logAxiosError('Error dissolving block', error);
|
||||
logAxiosError('Error dissolving group', error);
|
||||
}
|
||||
},
|
||||
[ungroupMutation],
|
||||
|
||||
@@ -82,11 +82,11 @@ export function CurrentBlockOverview() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<TimeColumn label='Elapsed in block' value={timeInBlock} className={style.clock} muted={blockStartAt === null} />
|
||||
<TimeColumn label='Elapsed in group' value={timeInBlock} className={style.clock} muted={blockStartAt === null} />
|
||||
<div>
|
||||
<TimeRow label='Block end' value={blockEnd} className={style.end} muted={blockStartAt === null} />
|
||||
<TimeRow label='Group end' value={blockEnd} className={style.end} muted={blockStartAt === null} />
|
||||
<TimeRow
|
||||
label='Projected block end'
|
||||
label='Projected group end'
|
||||
value={projectedBlockEnd}
|
||||
className={style.end}
|
||||
muted={blockStartAt === null}
|
||||
|
||||
@@ -258,11 +258,11 @@ export default function Rundown({ data }: RundownProps) {
|
||||
['alt + shift + E', () => insertAtId({ type: SupportedEntry.Event }, cursor, true), { preventDefault: true }],
|
||||
|
||||
[
|
||||
'alt + B',
|
||||
'alt + G',
|
||||
() => insertAtId({ type: SupportedEntry.Block }, cursor),
|
||||
{ preventDefault: true, usePhysicalKeys: true },
|
||||
],
|
||||
['alt + shift + B', () => insertAtId({ type: SupportedEntry.Block }, cursor, true), { preventDefault: true }],
|
||||
['alt + shift + G', () => insertAtId({ type: SupportedEntry.Block }, cursor, true), { preventDefault: true }],
|
||||
|
||||
[
|
||||
'alt + D',
|
||||
|
||||
@@ -26,7 +26,7 @@ export default function RundownEmpty(props: RundownEmptyProps) {
|
||||
<Editor.Separator />
|
||||
|
||||
<Button onClick={() => handleAddNew(SupportedEntry.Block)} variant='primary' size='large'>
|
||||
<IoAdd /> Create Block
|
||||
<IoAdd /> Create Group
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -58,7 +58,7 @@ export default function BlockEditor({ block }: BlockEditorProps) {
|
||||
return (
|
||||
<div className={style.content}>
|
||||
<div className={style.column}>
|
||||
<Editor.Title>Block schedule</Editor.Title>
|
||||
<Editor.Title>Group schedule</Editor.Title>
|
||||
<div className={style.inline}>
|
||||
<div>
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ function EventEditorEmpty() {
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Select block</td>
|
||||
<td>Select group</td>
|
||||
<td>
|
||||
<Kbd>{deviceAlt}</Kbd>
|
||||
<AuxKey>+</AuxKey>
|
||||
@@ -126,21 +126,21 @@ function EventEditorEmpty() {
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Add block below</td>
|
||||
<td>Add group below</td>
|
||||
<td>
|
||||
<Kbd>{deviceAlt}</Kbd>
|
||||
<AuxKey>+</AuxKey>
|
||||
<Kbd>B</Kbd>
|
||||
<Kbd>G</Kbd>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Add block above</td>
|
||||
<td>Add group above</td>
|
||||
<td>
|
||||
<Kbd>{deviceAlt}</Kbd>
|
||||
<AuxKey>+</AuxKey>
|
||||
<Kbd>Shift</Kbd>
|
||||
<AuxKey>+</AuxKey>
|
||||
<Kbd>B</Kbd>
|
||||
<Kbd>G</Kbd>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -36,7 +36,7 @@ export default function RundownBlock({ data, hasCursor, collapsed, onCollapse }:
|
||||
|
||||
const [onContextMenu] = useContextMenu<HTMLDivElement>([
|
||||
{
|
||||
label: 'Clone Block',
|
||||
label: 'Clone Group',
|
||||
icon: IoDuplicateOutline,
|
||||
onClick: () => clone(data.id),
|
||||
},
|
||||
@@ -47,7 +47,7 @@ export default function RundownBlock({ data, hasCursor, collapsed, onCollapse }:
|
||||
isDisabled: data.entries.length === 0,
|
||||
},
|
||||
{
|
||||
label: 'Delete Block',
|
||||
label: 'Delete Group',
|
||||
icon: IoTrash,
|
||||
onClick: () => deleteEntry([data.id]),
|
||||
withDivider: true,
|
||||
@@ -120,7 +120,7 @@ export default function RundownBlock({ data, hasCursor, collapsed, onCollapse }:
|
||||
</div>
|
||||
<div className={style.header}>
|
||||
<div className={style.titleRow}>
|
||||
<EditableBlockTitle title={data.title} eventId={data.id} placeholder='Block title' />
|
||||
<EditableBlockTitle title={data.title} eventId={data.id} placeholder='Group title' />
|
||||
<IconButton aria-label='Collapse' variant='subtle-white' onClick={() => onCollapse(!collapsed, data.id)}>
|
||||
{collapsed ? <IoChevronUp /> : <IoChevronDown />}
|
||||
</IconButton>
|
||||
@@ -139,7 +139,7 @@ export default function RundownBlock({ data, hasCursor, collapsed, onCollapse }:
|
||||
<div>{formatDuration(data.duration)}</div>
|
||||
</div>
|
||||
<div className={style.metaEntry}>
|
||||
<div>Events</div>
|
||||
<div>Entries</div>
|
||||
<div>{data.entries.length}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ function MakeStart({ getValue, row, table }: CellContext<OntimeEntry, unknown>)
|
||||
|
||||
const event = row.original;
|
||||
if (!isOntimeEvent(event)) {
|
||||
return <MutedText numeric>{formatTime(getValue() as number)}</MutedText>;
|
||||
return <MutedText numeric>{formatTime(getValue() as number, formatOpts)}</MutedText>;
|
||||
}
|
||||
|
||||
const { handleUpdateTimer } = table.options.meta;
|
||||
|
||||
@@ -16,8 +16,8 @@ test('CRUD operations on the rundown', async ({ page }) => {
|
||||
await expect(page.getByTestId('rundown-delay')).toHaveCount(0);
|
||||
await expect(page.getByTestId('rundown-block')).toHaveCount(0);
|
||||
|
||||
// create blocks using the quick add buttons
|
||||
await page.getByRole('button', { name: 'Block' }).nth(1).click();
|
||||
// create groups using the quick add buttons
|
||||
await page.getByRole('button', { name: 'Group' }).nth(1).click();
|
||||
await page.getByRole('button', { name: 'Delay' }).nth(1).click();
|
||||
await page.getByRole('button', { name: 'Event', exact: true }).nth(1).click();
|
||||
await expect(page.getByTestId('rundown-event')).toHaveCount(2);
|
||||
|
||||
@@ -84,13 +84,13 @@ test('Add block', async ({ page }) => {
|
||||
await page.getByTestId('entry-1').click();
|
||||
|
||||
// add block below
|
||||
await page.getByTestId('rundown-event').locator('div').filter({ hasText: '1' }).press('Alt+B');
|
||||
await page.getByTestId('rundown-event').locator('div').filter({ hasText: '1' }).press('Alt+G');
|
||||
await expect(page.getByTestId('rundown-event')).toHaveCount(1);
|
||||
await expect(page.getByTestId('rundown-block')).toHaveCount(1);
|
||||
await page.getByTestId('rundown-block').getByTestId('block__title').fill('block below');
|
||||
|
||||
// add block above
|
||||
await page.getByTestId('rundown-event').locator('div').filter({ hasText: '1' }).press('Alt+Shift+B');
|
||||
await page.getByTestId('rundown-event').locator('div').filter({ hasText: '1' }).press('Alt+Shift+G');
|
||||
await expect(page.getByTestId('rundown-event')).toHaveCount(1);
|
||||
await expect(page.getByTestId('rundown-block')).toHaveCount(2);
|
||||
await page.getByTestId('block__title').first().fill('block above');
|
||||
@@ -172,5 +172,5 @@ test('Delete event', async ({ page }) => {
|
||||
await page.getByTestId('rundown-event').locator('div').filter({ hasText: '1' }).press('Alt+Backspace');
|
||||
await expect(page.getByTestId('rundown-event')).toHaveCount(0);
|
||||
await expect(page.getByRole('button', { name: 'Create Event' })).toBeVisible();
|
||||
await expect(page.getByRole('button', { name: 'Create Block' })).toBeVisible();
|
||||
await expect(page.getByRole('button', { name: 'Create Group' })).toBeVisible();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user