diff --git a/src/components/Layout/Sidebar/index.tsx b/src/components/Layout/Sidebar/index.tsx index 9985f18cb..a26f3a77d 100644 --- a/src/components/Layout/Sidebar/index.tsx +++ b/src/components/Layout/Sidebar/index.tsx @@ -105,14 +105,6 @@ const SidebarLinks: SidebarLinkProps[] = [ requiredPermission: Permission.MANAGE_USERS, dataTestId: 'sidebar-menu-users', }, - { - href: '/approval', - messagesKey: 'autoapproval', - svgIcon: , - activeRegExp: /^\/approval/, - requiredPermission: Permission.MANAGE_USERS, - dataTestId: 'sidebar-menu-auto-approval', - }, { href: '/settings', messagesKey: 'settings', diff --git a/src/components/ApprovalRuleList/RuleModal/index.tsx b/src/components/Settings/SettingsAutoApproval/ApprovalRuleList/RuleModal/index.tsx similarity index 100% rename from src/components/ApprovalRuleList/RuleModal/index.tsx rename to src/components/Settings/SettingsAutoApproval/ApprovalRuleList/RuleModal/index.tsx diff --git a/src/components/ApprovalRuleList/index.tsx b/src/components/Settings/SettingsAutoApproval/index.tsx similarity index 97% rename from src/components/ApprovalRuleList/index.tsx rename to src/components/Settings/SettingsAutoApproval/index.tsx index 1f0a8b483..07d8b724e 100644 --- a/src/components/ApprovalRuleList/index.tsx +++ b/src/components/Settings/SettingsAutoApproval/index.tsx @@ -1,4 +1,4 @@ -import RuleModal from '@app/components/ApprovalRuleList/RuleModal'; +import RuleModal from '@app/components/Settings/SettingsAutoApproval/ApprovalRuleList/RuleModal'; import Badge from '@app/components/Common/Badge'; import Button from '@app/components/Common/Button'; import Header from '@app/components/Common/Header'; @@ -82,7 +82,7 @@ const ApprovalRuleInstance = ({ ); }; -const AutoApprovalList = () => { +const SettingsAutoApproval = () => { const intl = useIntl(); const movieRuleData = [ { @@ -200,4 +200,4 @@ const AutoApprovalList = () => { ); }; -export default AutoApprovalList; +export default SettingsAutoApproval; diff --git a/src/components/Settings/SettingsLayout.tsx b/src/components/Settings/SettingsLayout.tsx index 6336bad01..82bf45247 100644 --- a/src/components/Settings/SettingsLayout.tsx +++ b/src/components/Settings/SettingsLayout.tsx @@ -14,6 +14,7 @@ const messages = defineMessages('components.Settings', { menuJellyfinSettings: '{mediaServerName}', menuServices: 'Services', menuNotifications: 'Notifications', + menuAutoApproval: 'Auto Approval', menuLogs: 'Logs', menuJobs: 'Jobs & Cache', menuAbout: 'About', @@ -58,6 +59,11 @@ const SettingsLayout = ({ children }: SettingsLayoutProps) => { route: '/settings/notifications/email', regex: /^\/settings\/notifications/, }, + { + text: intl.formatMessage(messages.menuAutoApproval), + route: '/settings/autoapproval', + regex: /^\/settings\/autoapproval/, + }, { text: intl.formatMessage(messages.menuLogs), route: '/settings/logs', diff --git a/src/i18n/locale/en.json b/src/i18n/locale/en.json index 3fce7abd7..ad60d235a 100644 --- a/src/i18n/locale/en.json +++ b/src/i18n/locale/en.json @@ -1064,6 +1064,7 @@ "components.Settings.menuJobs": "Jobs & Cache", "components.Settings.menuLogs": "Logs", "components.Settings.menuNotifications": "Notifications", + "components.Settings.menuAutoApproval": "Auto Approval", "components.Settings.menuPlexSettings": "Plex", "components.Settings.menuServices": "Services", "components.Settings.menuUsers": "Users", diff --git a/src/pages/approval/index.tsx b/src/pages/approval/index.tsx deleted file mode 100644 index 52ade3557..000000000 --- a/src/pages/approval/index.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import ApprovalRuleList from '@app/components/ApprovalRuleList'; -import type { NextPage } from 'next'; - -const ApprovalRulePage: NextPage = () => { - return ; -}; - -export default ApprovalRulePage; diff --git a/src/pages/settings/autoapproval.tsx b/src/pages/settings/autoapproval.tsx new file mode 100644 index 000000000..00d522f49 --- /dev/null +++ b/src/pages/settings/autoapproval.tsx @@ -0,0 +1,16 @@ +import SettingsLayout from '@app/components/Settings/SettingsLayout'; +import SettingsAutoApproval from '@app/components/Settings/SettingsAutoApproval'; +import useRouteGuard from '@app/hooks/useRouteGuard'; +import {Permission} from '@app/hooks/useUser'; +import type { NextPage } from 'next'; + +const SettingsAutoApprovalPage: NextPage = () => { + useRouteGuard(Permission.ADMIN); + return ( + + + + ) +} + +export default SettingsAutoApprovalPage;