Skip to content

Commit

Permalink
feat: Move auto-approval config page into Settings
Browse files Browse the repository at this point in the history
  • Loading branch information
augustuen committed Dec 29, 2024
1 parent f9982a5 commit b2351d5
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 19 deletions.
8 changes: 0 additions & 8 deletions src/components/Layout/Sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,6 @@ const SidebarLinks: SidebarLinkProps[] = [
requiredPermission: Permission.MANAGE_USERS,
dataTestId: 'sidebar-menu-users',
},
{
href: '/approval',
messagesKey: 'autoapproval',
svgIcon: <UsersIcon className="mr-3 h-6 w-6" />,
activeRegExp: /^\/approval/,
requiredPermission: Permission.MANAGE_USERS,
dataTestId: 'sidebar-menu-auto-approval',
},
{
href: '/settings',
messagesKey: 'settings',
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -82,7 +82,7 @@ const ApprovalRuleInstance = ({
);
};

const AutoApprovalList = () => {
const SettingsAutoApproval = () => {
const intl = useIntl();
const movieRuleData = [
{
Expand Down Expand Up @@ -200,4 +200,4 @@ const AutoApprovalList = () => {
);
};

export default AutoApprovalList;
export default SettingsAutoApproval;
6 changes: 6 additions & 0 deletions src/components/Settings/SettingsLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 0 additions & 8 deletions src/pages/approval/index.tsx

This file was deleted.

16 changes: 16 additions & 0 deletions src/pages/settings/autoapproval.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<SettingsLayout>
<SettingsAutoApproval />
</SettingsLayout>
)
}

export default SettingsAutoApprovalPage;

0 comments on commit b2351d5

Please sign in to comment.