diff --git a/apps/client/src/common/components/radio-group/RadioGroup.module.scss b/apps/client/src/common/components/radio-group/RadioGroup.module.scss index 9e4b9ba52..7dbb056cc 100644 --- a/apps/client/src/common/components/radio-group/RadioGroup.module.scss +++ b/apps/client/src/common/components/radio-group/RadioGroup.module.scss @@ -10,6 +10,7 @@ align-items: center; flex-direction: row; gap: 1rem; + width: 100%; } .vertical { @@ -21,6 +22,7 @@ display: flex; align-items: center; gap: 0.5rem; + height: 2rem; &:has([data-checked]) { color: $ui-white; diff --git a/apps/client/src/common/utils/socket.ts b/apps/client/src/common/utils/socket.ts index d6890952e..d0738ad39 100644 --- a/apps/client/src/common/utils/socket.ts +++ b/apps/client/src/common/utils/socket.ts @@ -10,7 +10,7 @@ import { } from 'ontime-types'; import { isProduction, websocketUrl } from '../../externals'; -import { CLIENT_LIST, CUSTOM_FIELDS, REPORT, RUNDOWN, RUNTIME, VIEW_SETTINGS } from '../api/constants'; +import { CLIENT_LIST, CUSTOM_FIELDS, PROJECT_DATA, REPORT, RUNDOWN, RUNTIME, VIEW_SETTINGS } from '../api/constants'; import { invalidateAllCaches } from '../api/utils'; import { ontimeQueryClient } from '../queryClient'; import { @@ -155,6 +155,12 @@ export const connectSocket = () => { case RefetchKey.CustomFields: ontimeQueryClient.invalidateQueries({ queryKey: CUSTOM_FIELDS }); break; + case RefetchKey.ProjectData: + ontimeQueryClient.invalidateQueries({ queryKey: PROJECT_DATA }); + break; + case RefetchKey.Report: + ontimeQueryClient.invalidateQueries({ queryKey: REPORT }); + break; case RefetchKey.Rundown: if (revision === (ontimeQueryClient.getQueryData(RUNDOWN) as Rundown).revision) break; ontimeQueryClient.invalidateQueries({ queryKey: RUNDOWN }); @@ -163,9 +169,6 @@ export const connectSocket = () => { case RefetchKey.ViewSettings: ontimeQueryClient.invalidateQueries({ queryKey: VIEW_SETTINGS }); break; - case RefetchKey.Report: - ontimeQueryClient.invalidateQueries({ queryKey: REPORT }); - break; default: { target satisfies never; break; diff --git a/apps/client/src/features/app-settings/panel/project-panel/ProjectCreateForm.tsx b/apps/client/src/features/app-settings/panel/project-panel/ProjectCreateForm.tsx index ed3c2c604..776cd68f5 100644 --- a/apps/client/src/features/app-settings/panel/project-panel/ProjectCreateForm.tsx +++ b/apps/client/src/features/app-settings/panel/project-panel/ProjectCreateForm.tsx @@ -1,16 +1,11 @@ import { useEffect, useState } from 'react'; -import { useFieldArray, useForm } from 'react-hook-form'; -import { IoAdd, IoTrash } from 'react-icons/io5'; -import { useQueryClient } from '@tanstack/react-query'; +import { useForm } from 'react-hook-form'; -import { PROJECT_LIST } from '../../../../common/api/constants'; import { createProject } from '../../../../common/api/db'; import { maybeAxiosError } from '../../../../common/api/utils'; import Button from '../../../../common/components/buttons/Button'; import Input from '../../../../common/components/input/input/Input'; -import Textarea from '../../../../common/components/input/textarea/Textarea'; import { preventEscape } from '../../../../common/utils/keyEvent'; -import { documentationUrl } from '../../../../externals'; import * as Panel from '../../panel-utils/PanelUtils'; import style from './ProjectPanel.module.scss'; @@ -31,12 +26,10 @@ export default function ProjectCreateForm(props: ProjectCreateFromProps) { const { onClose } = props; const [error, setError] = useState(null); - const queryClient = useQueryClient(); const { handleSubmit, register, - control, formState: { isSubmitting, isValid }, setFocus, } = useForm({ @@ -47,11 +40,6 @@ export default function ProjectCreateForm(props: ProjectCreateFromProps) { }, }); - const { fields, append, remove } = useFieldArray({ - control, - name: 'custom', - }); - // set focus to first field useEffect(() => { setFocus('title'); @@ -63,22 +51,14 @@ export default function ProjectCreateForm(props: ProjectCreateFromProps) { const filename = values.title ?? 'untitled'; - await createProject({ - ...values, - filename, - }); + await createProject({ filename }); - await queryClient.invalidateQueries({ queryKey: PROJECT_LIST }); onClose(); } catch (error) { setError(maybeAxiosError(error)); } }; - const handleAddCustom = () => { - append({ title: '', value: '' }); - }; - return ( - -