mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-22 07:29:08 +00:00
feat: renaming
This commit is contained in:
@@ -7,7 +7,7 @@ import IntegrationsPanel from './panel/integrations-panel/IntegrationsPanel';
|
|||||||
import LogPanel from './panel/log-panel/LogPanel';
|
import LogPanel from './panel/log-panel/LogPanel';
|
||||||
import ProjectPanel from './panel/project-panel/ProjectPanel';
|
import ProjectPanel from './panel/project-panel/ProjectPanel';
|
||||||
import ProjectSettingsPanel from './panel/project-settings-panel/ProjectSettingsPanel';
|
import ProjectSettingsPanel from './panel/project-settings-panel/ProjectSettingsPanel';
|
||||||
import UrlAliasPanel from './panel/url-alias-panel/UrlAliasPanel';
|
import UrlPresetPanel from './panel/url-preset-panel/UrlPresetPanel';
|
||||||
import PanelContent from './panel-content/PanelContent';
|
import PanelContent from './panel-content/PanelContent';
|
||||||
import PanelList from './panel-list/PanelList';
|
import PanelList from './panel-list/PanelList';
|
||||||
import { useSettingsStore } from './settingsStore';
|
import { useSettingsStore } from './settingsStore';
|
||||||
@@ -31,7 +31,7 @@ export default function AppSettings() {
|
|||||||
{selectedPanel === 'project' && <ProjectPanel />}
|
{selectedPanel === 'project' && <ProjectPanel />}
|
||||||
{selectedPanel === 'integrations' && <IntegrationsPanel />}
|
{selectedPanel === 'integrations' && <IntegrationsPanel />}
|
||||||
{selectedPanel === 'project_settings' && <ProjectSettingsPanel />}
|
{selectedPanel === 'project_settings' && <ProjectSettingsPanel />}
|
||||||
{selectedPanel === 'url_alias' && <UrlAliasPanel />}
|
{selectedPanel === 'url_presets' && <UrlPresetPanel />}
|
||||||
{selectedPanel === 'about' && <AboutPanel />}
|
{selectedPanel === 'about' && <AboutPanel />}
|
||||||
{selectedPanel === 'log' && <LogPanel />}
|
{selectedPanel === 'log' && <LogPanel />}
|
||||||
</PanelContent>
|
</PanelContent>
|
||||||
|
|||||||
+7
-7
@@ -2,37 +2,37 @@ import { useEffect } from 'react';
|
|||||||
import { useForm } from 'react-hook-form';
|
import { useForm } from 'react-hook-form';
|
||||||
import { Button, Input } from '@chakra-ui/react';
|
import { Button, Input } from '@chakra-ui/react';
|
||||||
|
|
||||||
import style from './UrlAliasPanel.module.scss';
|
import style from './UrlPresetPanel.module.scss';
|
||||||
|
|
||||||
export type UrlAliasFormValues = {
|
export type UrlPresetFormValues = {
|
||||||
alias?: string;
|
alias?: string;
|
||||||
pathAndParams?: string;
|
pathAndParams?: string;
|
||||||
enabled?: boolean;
|
enabled?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
interface UrlAliasFormProps {
|
interface UrlPresetFormProps {
|
||||||
alias?: string;
|
alias?: string;
|
||||||
enabled?: boolean;
|
enabled?: boolean;
|
||||||
pathAndParams?: string;
|
pathAndParams?: string;
|
||||||
onCancel: () => void;
|
onCancel: () => void;
|
||||||
onSubmit: (values: UrlAliasFormValues) => Promise<void>;
|
onSubmit: (values: UrlPresetFormValues) => Promise<void>;
|
||||||
submitError: string | null;
|
submitError: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function UrlAliasForm({
|
export default function UrlPresetForm({
|
||||||
onSubmit,
|
onSubmit,
|
||||||
onCancel,
|
onCancel,
|
||||||
submitError,
|
submitError,
|
||||||
alias,
|
alias,
|
||||||
enabled,
|
enabled,
|
||||||
pathAndParams,
|
pathAndParams,
|
||||||
}: UrlAliasFormProps) {
|
}: UrlPresetFormProps) {
|
||||||
const {
|
const {
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
register,
|
register,
|
||||||
formState: { isSubmitting, isValid },
|
formState: { isSubmitting, isValid },
|
||||||
setFocus,
|
setFocus,
|
||||||
} = useForm<UrlAliasFormValues>({
|
} = useForm<UrlPresetFormValues>({
|
||||||
defaultValues: { alias, pathAndParams, enabled },
|
defaultValues: { alias, pathAndParams, enabled },
|
||||||
values: { alias, pathAndParams, enabled },
|
values: { alias, pathAndParams, enabled },
|
||||||
resetOptions: {
|
resetOptions: {
|
||||||
+4
-4
@@ -1,10 +1,10 @@
|
|||||||
import useAliases from '../../../../common/hooks-query/useAliases';
|
import useAliases from '../../../../common/hooks-query/useAliases';
|
||||||
import ModalLoader from '../../../../features/modals/modal-loader/ModalLoader';
|
import ModalLoader from '../../../modals/modal-loader/ModalLoader';
|
||||||
import * as Panel from '../PanelUtils';
|
import * as Panel from '../PanelUtils';
|
||||||
|
|
||||||
import UrlAliasListItem from './UrlAliasListItem';
|
import UrlPresetListItem from './UrlPresetListItem';
|
||||||
|
|
||||||
export default function UrlAliasList() {
|
export default function UrlPresetList() {
|
||||||
const { data, isFetching, refetch } = useAliases();
|
const { data, isFetching, refetch } = useAliases();
|
||||||
|
|
||||||
const handleRefetch = async () => {
|
const handleRefetch = async () => {
|
||||||
@@ -28,7 +28,7 @@ export default function UrlAliasList() {
|
|||||||
<tbody>
|
<tbody>
|
||||||
{(data || []).map((alias) => {
|
{(data || []).map((alias) => {
|
||||||
return (
|
return (
|
||||||
<UrlAliasListItem
|
<UrlPresetListItem
|
||||||
alias={alias.alias}
|
alias={alias.alias}
|
||||||
enabled={alias.enabled}
|
enabled={alias.enabled}
|
||||||
pathAndParams={alias.pathAndParams}
|
pathAndParams={alias.pathAndParams}
|
||||||
+4
-4
@@ -4,16 +4,16 @@ import { IoEllipsisHorizontal } from '@react-icons/all-files/io5/IoEllipsisHoriz
|
|||||||
|
|
||||||
import { deleteAlias, updateAliases } from '../../../../common/api/ontimeApi';
|
import { deleteAlias, updateAliases } from '../../../../common/api/ontimeApi';
|
||||||
|
|
||||||
import UrlAliasForm, { UrlAliasFormValues } from './UrlAliasForm';
|
import UrlAliasForm, { UrlPresetFormValues } from './UrlPresetForm';
|
||||||
|
|
||||||
interface UrlAliasListItemProps {
|
interface UrlPresetListItemProps {
|
||||||
alias: string;
|
alias: string;
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
pathAndParams: string;
|
pathAndParams: string;
|
||||||
onRefetch: () => Promise<void>;
|
onRefetch: () => Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function UrlAliasListItem({ alias, enabled, pathAndParams, onRefetch }: UrlAliasListItemProps) {
|
export default function UrlPresetListItem({ alias, enabled, pathAndParams, onRefetch }: UrlPresetListItemProps) {
|
||||||
const [isEditing, setIsEditing] = useState(false);
|
const [isEditing, setIsEditing] = useState(false);
|
||||||
|
|
||||||
const handleToggle = useCallback(async () => {
|
const handleToggle = useCallback(async () => {
|
||||||
@@ -32,7 +32,7 @@ export default function UrlAliasListItem({ alias, enabled, pathAndParams, onRefe
|
|||||||
}, [isEditing]);
|
}, [isEditing]);
|
||||||
|
|
||||||
const handleSubmitUpdate = useCallback(
|
const handleSubmitUpdate = useCallback(
|
||||||
async (values: UrlAliasFormValues) => {
|
async (values: UrlPresetFormValues) => {
|
||||||
try {
|
try {
|
||||||
await updateAliases(values);
|
await updateAliases(values);
|
||||||
await onRefetch();
|
await onRefetch();
|
||||||
+8
-8
@@ -1,27 +1,27 @@
|
|||||||
import { Alert, AlertDescription, AlertIcon, AlertTitle } from '@chakra-ui/react';
|
import { Alert, AlertDescription, AlertIcon, AlertTitle } from '@chakra-ui/react';
|
||||||
|
|
||||||
import ModalLink from '../../../../features/modals/ModalLink';
|
import ModalLink from '../../../modals/ModalLink';
|
||||||
import * as Panel from '../PanelUtils';
|
import * as Panel from '../PanelUtils';
|
||||||
|
|
||||||
import UrlAliasList from './UrlAliasList';
|
import UrlPresetList from './UrlPresetList';
|
||||||
|
|
||||||
import style from './UrlAliasPanel.module.scss';
|
import style from './UrlPresetPanel.module.scss';
|
||||||
|
|
||||||
const aliasesDocsUrl = 'https://ontime.gitbook.io/v2/features/url-aliases';
|
const aliasesDocsUrl = 'https://ontime.gitbook.io/v2/features/url-aliases';
|
||||||
|
|
||||||
export default function UrlAliasPanel() {
|
export default function UrlPresetPanel() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Panel.Header>URL Aliases</Panel.Header>
|
<Panel.Header>URL Presets</Panel.Header>
|
||||||
<Panel.Section>
|
<Panel.Section>
|
||||||
<Panel.Card>
|
<Panel.Card>
|
||||||
<main>
|
<main>
|
||||||
<Alert status='info' variant='ontime-on-light-info'>
|
<Alert status='info' variant='ontime-on-light-info'>
|
||||||
<AlertIcon />
|
<AlertIcon />
|
||||||
<div className={style.column}>
|
<div className={style.column}>
|
||||||
<AlertTitle>URL Aliases</AlertTitle>
|
<AlertTitle>URL Presets</AlertTitle>
|
||||||
<AlertDescription>
|
<AlertDescription>
|
||||||
Custom aliases allow providing a short name for any ontime URL. <br />
|
Custom presets allow providing a short name for any ontime URL. <br />
|
||||||
It serves two primary purposes: <br />
|
It serves two primary purposes: <br />
|
||||||
- Providing dynamic URLs for automation or unattended screens <br />- Simplifying complex URLs
|
- Providing dynamic URLs for automation or unattended screens <br />- Simplifying complex URLs
|
||||||
<ModalLink href={aliasesDocsUrl}>For more information, see the docs</ModalLink>
|
<ModalLink href={aliasesDocsUrl}>For more information, see the docs</ModalLink>
|
||||||
@@ -33,7 +33,7 @@ export default function UrlAliasPanel() {
|
|||||||
marginTop: '1rem',
|
marginTop: '1rem',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<UrlAliasList />
|
<UrlPresetList />
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</Panel.Card>
|
</Panel.Card>
|
||||||
@@ -35,7 +35,7 @@ export const settingPanels: Readonly<SettingsOption[]> = [
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{ id: 'log', label: 'Log', split: true },
|
{ id: 'log', label: 'Log', split: true },
|
||||||
{ id: 'url_alias', label: 'URL Aliases' },
|
{ id: 'url_presets', label: 'URL Presets' },
|
||||||
{
|
{
|
||||||
id: 'about',
|
id: 'about',
|
||||||
label: 'About',
|
label: 'About',
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export default function SettingsModal(props: ModalManagerProps) {
|
|||||||
<Tab>Editor</Tab>
|
<Tab>Editor</Tab>
|
||||||
<Tab>Cuesheet</Tab>
|
<Tab>Cuesheet</Tab>
|
||||||
<Tab>Views</Tab>
|
<Tab>Views</Tab>
|
||||||
<Tab>URL Aliases</Tab>
|
<Tab>URL Presets</Tab>
|
||||||
</TabList>
|
</TabList>
|
||||||
<TabPanels>
|
<TabPanels>
|
||||||
<TabPanel>
|
<TabPanel>
|
||||||
|
|||||||
Reference in New Issue
Block a user