mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-13 11:23:50 +00:00
refactor: small ux improvements
- rename dissolve > ungroup - prevent ondrag when clicking - add untitled as block title fallback - move block action to context menu
This commit is contained in:
@@ -97,8 +97,8 @@ export async function postCloneEntry(entryId: EntryId): Promise<AxiosResponse<Ru
|
||||
/**
|
||||
* HTTP request for dissolving of a block
|
||||
*/
|
||||
export async function requestDissolveBlock(blockId: EntryId): Promise<AxiosResponse<Rundown>> {
|
||||
return axios.post(`${rundownPath}/dissolve/${blockId}`);
|
||||
export async function requestUngroup(blockId: EntryId): Promise<AxiosResponse<Rundown>> {
|
||||
return axios.post(`${rundownPath}/ungroup/${blockId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,9 +26,9 @@ import {
|
||||
ReorderEntry,
|
||||
requestApplyDelay,
|
||||
requestDeleteAll,
|
||||
requestDissolveBlock,
|
||||
requestEventSwap,
|
||||
requestGroupEntries,
|
||||
requestUngroup,
|
||||
SwapEntry,
|
||||
} from '../api/rundown';
|
||||
import { logAxiosError } from '../api/utils';
|
||||
@@ -544,8 +544,8 @@ export const useEntryActions = () => {
|
||||
* Calls mutation to dissolve a block
|
||||
* @private
|
||||
*/
|
||||
const _dissolveBlockMutation = useMutation({
|
||||
mutationFn: requestDissolveBlock,
|
||||
const _ungroupMutation = useMutation({
|
||||
mutationFn: requestUngroup,
|
||||
onSuccess: (response) => {
|
||||
if (!response.data) return;
|
||||
|
||||
@@ -565,15 +565,15 @@ export const useEntryActions = () => {
|
||||
/**
|
||||
* Deletes a block and moves its events to the top level
|
||||
*/
|
||||
const dissolveBlock = useCallback(
|
||||
const ungroup = useCallback(
|
||||
async (blockId: EntryId) => {
|
||||
try {
|
||||
await _dissolveBlockMutation.mutateAsync(blockId);
|
||||
await _ungroupMutation.mutateAsync(blockId);
|
||||
} catch (error) {
|
||||
logAxiosError('Error dissolving block', error);
|
||||
}
|
||||
},
|
||||
[_dissolveBlockMutation],
|
||||
[_ungroupMutation],
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -762,7 +762,7 @@ export const useEntryActions = () => {
|
||||
clone,
|
||||
deleteEntry,
|
||||
deleteAllEntries,
|
||||
dissolveBlock,
|
||||
ungroup,
|
||||
getEntryById,
|
||||
groupEntries,
|
||||
reorderEntry,
|
||||
|
||||
Reference in New Issue
Block a user