mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-08 00:43:54 +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 ProjectPanel from './panel/project-panel/ProjectPanel';
|
||||
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 PanelList from './panel-list/PanelList';
|
||||
import { useSettingsStore } from './settingsStore';
|
||||
@@ -31,7 +31,7 @@ export default function AppSettings() {
|
||||
{selectedPanel === 'project' && <ProjectPanel />}
|
||||
{selectedPanel === 'integrations' && <IntegrationsPanel />}
|
||||
{selectedPanel === 'project_settings' && <ProjectSettingsPanel />}
|
||||
{selectedPanel === 'url_alias' && <UrlAliasPanel />}
|
||||
{selectedPanel === 'url_presets' && <UrlPresetPanel />}
|
||||
{selectedPanel === 'about' && <AboutPanel />}
|
||||
{selectedPanel === 'log' && <LogPanel />}
|
||||
</PanelContent>
|
||||
|
||||
+7
-7
@@ -2,37 +2,37 @@ import { useEffect } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
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;
|
||||
pathAndParams?: string;
|
||||
enabled?: boolean;
|
||||
};
|
||||
|
||||
interface UrlAliasFormProps {
|
||||
interface UrlPresetFormProps {
|
||||
alias?: string;
|
||||
enabled?: boolean;
|
||||
pathAndParams?: string;
|
||||
onCancel: () => void;
|
||||
onSubmit: (values: UrlAliasFormValues) => Promise<void>;
|
||||
onSubmit: (values: UrlPresetFormValues) => Promise<void>;
|
||||
submitError: string | null;
|
||||
}
|
||||
|
||||
export default function UrlAliasForm({
|
||||
export default function UrlPresetForm({
|
||||
onSubmit,
|
||||
onCancel,
|
||||
submitError,
|
||||
alias,
|
||||
enabled,
|
||||
pathAndParams,
|
||||
}: UrlAliasFormProps) {
|
||||
}: UrlPresetFormProps) {
|
||||
const {
|
||||
handleSubmit,
|
||||
register,
|
||||
formState: { isSubmitting, isValid },
|
||||
setFocus,
|
||||
} = useForm<UrlAliasFormValues>({
|
||||
} = useForm<UrlPresetFormValues>({
|
||||
defaultValues: { alias, pathAndParams, enabled },
|
||||
values: { alias, pathAndParams, enabled },
|
||||
resetOptions: {
|
||||
+4
-4
@@ -1,10 +1,10 @@
|
||||
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 UrlAliasListItem from './UrlAliasListItem';
|
||||
import UrlPresetListItem from './UrlPresetListItem';
|
||||
|
||||
export default function UrlAliasList() {
|
||||
export default function UrlPresetList() {
|
||||
const { data, isFetching, refetch } = useAliases();
|
||||
|
||||
const handleRefetch = async () => {
|
||||
@@ -28,7 +28,7 @@ export default function UrlAliasList() {
|
||||
<tbody>
|
||||
{(data || []).map((alias) => {
|
||||
return (
|
||||
<UrlAliasListItem
|
||||
<UrlPresetListItem
|
||||
alias={alias.alias}
|
||||
enabled={alias.enabled}
|
||||
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 UrlAliasForm, { UrlAliasFormValues } from './UrlAliasForm';
|
||||
import UrlAliasForm, { UrlPresetFormValues } from './UrlPresetForm';
|
||||
|
||||
interface UrlAliasListItemProps {
|
||||
interface UrlPresetListItemProps {
|
||||
alias: string;
|
||||
enabled: boolean;
|
||||
pathAndParams: string;
|
||||
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 handleToggle = useCallback(async () => {
|
||||
@@ -32,7 +32,7 @@ export default function UrlAliasListItem({ alias, enabled, pathAndParams, onRefe
|
||||
}, [isEditing]);
|
||||
|
||||
const handleSubmitUpdate = useCallback(
|
||||
async (values: UrlAliasFormValues) => {
|
||||
async (values: UrlPresetFormValues) => {
|
||||
try {
|
||||
await updateAliases(values);
|
||||
await onRefetch();
|
||||
+8
-8
@@ -1,27 +1,27 @@
|
||||
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 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';
|
||||
|
||||
export default function UrlAliasPanel() {
|
||||
export default function UrlPresetPanel() {
|
||||
return (
|
||||
<>
|
||||
<Panel.Header>URL Aliases</Panel.Header>
|
||||
<Panel.Header>URL Presets</Panel.Header>
|
||||
<Panel.Section>
|
||||
<Panel.Card>
|
||||
<main>
|
||||
<Alert status='info' variant='ontime-on-light-info'>
|
||||
<AlertIcon />
|
||||
<div className={style.column}>
|
||||
<AlertTitle>URL Aliases</AlertTitle>
|
||||
<AlertTitle>URL Presets</AlertTitle>
|
||||
<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 />
|
||||
- Providing dynamic URLs for automation or unattended screens <br />- Simplifying complex URLs
|
||||
<ModalLink href={aliasesDocsUrl}>For more information, see the docs</ModalLink>
|
||||
@@ -33,7 +33,7 @@ export default function UrlAliasPanel() {
|
||||
marginTop: '1rem',
|
||||
}}
|
||||
>
|
||||
<UrlAliasList />
|
||||
<UrlPresetList />
|
||||
</div>
|
||||
</main>
|
||||
</Panel.Card>
|
||||
@@ -35,7 +35,7 @@ export const settingPanels: Readonly<SettingsOption[]> = [
|
||||
],
|
||||
},
|
||||
{ id: 'log', label: 'Log', split: true },
|
||||
{ id: 'url_alias', label: 'URL Aliases' },
|
||||
{ id: 'url_presets', label: 'URL Presets' },
|
||||
{
|
||||
id: 'about',
|
||||
label: 'About',
|
||||
|
||||
@@ -26,7 +26,7 @@ export default function SettingsModal(props: ModalManagerProps) {
|
||||
<Tab>Editor</Tab>
|
||||
<Tab>Cuesheet</Tab>
|
||||
<Tab>Views</Tab>
|
||||
<Tab>URL Aliases</Tab>
|
||||
<Tab>URL Presets</Tab>
|
||||
</TabList>
|
||||
<TabPanels>
|
||||
<TabPanel>
|
||||
|
||||
Reference in New Issue
Block a user