From aef0b4d0679e0b793a145ec594fe74802be8155a Mon Sep 17 00:00:00 2001 From: Gauthier Date: Sun, 19 Jan 2025 00:16:35 +0100 Subject: [PATCH 1/3] refactor(settings): move network settings to their own settings tab This PR moves the network settings out of the General Settings section to a new Netowrk Settings tab. --- src/components/Settings/SettingsLayout.tsx | 6 + .../Settings/SettingsMain/index.tsx | 334 ------------- .../Settings/SettingsNetwork/index.tsx | 461 ++++++++++++++++++ src/pages/settings/network.tsx | 16 + 4 files changed, 483 insertions(+), 334 deletions(-) create mode 100644 src/components/Settings/SettingsNetwork/index.tsx create mode 100644 src/pages/settings/network.tsx diff --git a/src/components/Settings/SettingsLayout.tsx b/src/components/Settings/SettingsLayout.tsx index 6336bad01..dd7cd6fa5 100644 --- a/src/components/Settings/SettingsLayout.tsx +++ b/src/components/Settings/SettingsLayout.tsx @@ -13,6 +13,7 @@ const messages = defineMessages('components.Settings', { menuPlexSettings: 'Plex', menuJellyfinSettings: '{mediaServerName}', menuServices: 'Services', + menuNetwork: 'Network', menuNotifications: 'Notifications', menuLogs: 'Logs', menuJobs: 'Jobs & Cache', @@ -53,6 +54,11 @@ const SettingsLayout = ({ children }: SettingsLayoutProps) => { route: '/settings/services', regex: /^\/settings\/services/, }, + { + text: intl.formatMessage(messages.menuNetwork), + route: '/settings/network', + regex: /^\/settings\/network/, + }, { text: intl.formatMessage(messages.menuNotifications), route: '/settings/notifications/email', diff --git a/src/components/Settings/SettingsMain/index.tsx b/src/components/Settings/SettingsMain/index.tsx index fb1df6b5e..5ccfaaa2a 100644 --- a/src/components/Settings/SettingsMain/index.tsx +++ b/src/components/Settings/SettingsMain/index.tsx @@ -2,7 +2,6 @@ import Button from '@app/components/Common/Button'; import LoadingSpinner from '@app/components/Common/LoadingSpinner'; import PageTitle from '@app/components/Common/PageTitle'; import SensitiveInput from '@app/components/Common/SensitiveInput'; -import Tooltip from '@app/components/Common/Tooltip'; import LanguageSelector from '@app/components/LanguageSelector'; import RegionSelector from '@app/components/RegionSelector'; import CopyButton from '@app/components/Settings/CopyButton'; @@ -42,39 +41,15 @@ const messages = defineMessages('components.Settings.SettingsMain', { toastSettingsSuccess: 'Settings saved successfully!', toastSettingsFailure: 'Something went wrong while saving settings.', hideAvailable: 'Hide Available Media', - csrfProtection: 'Enable CSRF Protection', - csrfProtectionTip: 'Set external API access to read-only (requires HTTPS)', - csrfProtectionHoverTip: - 'Do NOT enable this setting unless you understand what you are doing!', cacheImages: 'Enable Image Caching', cacheImagesTip: 'Cache externally sourced images (requires a significant amount of disk space)', - trustProxy: 'Enable Proxy Support', - trustProxyTip: - 'Allow Jellyseerr to correctly register client IP addresses behind a proxy', validationApplicationTitle: 'You must provide an application title', validationApplicationUrl: 'You must provide a valid URL', validationApplicationUrlTrailingSlash: 'URL must not end in a trailing slash', partialRequestsEnabled: 'Allow Partial Series Requests', enableSpecialEpisodes: 'Allow Special Episodes Requests', - forceIpv4First: 'IPv4 Resolution First', - forceIpv4FirstTip: - 'Force Jellyseerr to resolve IPv4 addresses first instead of IPv6', - dnsServers: 'Custom DNS Servers', - dnsServersTip: - 'Comma-separated list of custom DNS servers, e.g. "1.1.1.1,[2606:4700:4700::1111]"', locale: 'Display Language', - proxyEnabled: 'HTTP(S) Proxy', - proxyHostname: 'Proxy Hostname', - proxyPort: 'Proxy Port', - proxySsl: 'Use SSL For Proxy', - proxyUser: 'Proxy Username', - proxyPassword: 'Proxy Password', - proxyBypassFilter: 'Proxy Ignored Addresses', - proxyBypassFilterTip: - "Use ',' as a separator, and '*.' as a wildcard for subdomains", - proxyBypassLocalAddresses: 'Bypass Proxy for Local Addresses', - validationProxyPort: 'You must provide a valid port', }); const SettingsMain = () => { @@ -105,12 +80,6 @@ const SettingsMain = () => { intl.formatMessage(messages.validationApplicationUrlTrailingSlash), (value) => !value || !value.endsWith('/') ), - proxyPort: Yup.number().when('proxyEnabled', { - is: (proxyEnabled: boolean) => proxyEnabled, - then: Yup.number().required( - intl.formatMessage(messages.validationProxyPort) - ), - }), }); const regenerate = async () => { @@ -158,7 +127,6 @@ const SettingsMain = () => { initialValues={{ applicationTitle: data?.applicationTitle, applicationUrl: data?.applicationUrl, - csrfProtection: data?.csrfProtection, hideAvailable: data?.hideAvailable, locale: data?.locale ?? 'en', discoverRegion: data?.discoverRegion, @@ -166,18 +134,7 @@ const SettingsMain = () => { streamingRegion: data?.streamingRegion || 'US', partialRequestsEnabled: data?.partialRequestsEnabled, enableSpecialEpisodes: data?.enableSpecialEpisodes, - forceIpv4First: data?.forceIpv4First, - dnsServers: data?.dnsServers, - trustProxy: data?.trustProxy, cacheImages: data?.cacheImages, - proxyEnabled: data?.proxy?.enabled, - proxyHostname: data?.proxy?.hostname, - proxyPort: data?.proxy?.port, - proxySsl: data?.proxy?.useSsl, - proxyUser: data?.proxy?.user, - proxyPassword: data?.proxy?.password, - proxyBypassFilter: data?.proxy?.bypassFilter, - proxyBypassLocalAddresses: data?.proxy?.bypassLocalAddresses, }} enableReinitialize validationSchema={MainSettingsSchema} @@ -191,7 +148,6 @@ const SettingsMain = () => { body: JSON.stringify({ applicationTitle: values.applicationTitle, applicationUrl: values.applicationUrl, - csrfProtection: values.csrfProtection, hideAvailable: values.hideAvailable, locale: values.locale, discoverRegion: values.discoverRegion, @@ -199,20 +155,7 @@ const SettingsMain = () => { originalLanguage: values.originalLanguage, partialRequestsEnabled: values.partialRequestsEnabled, enableSpecialEpisodes: values.enableSpecialEpisodes, - forceIpv4First: values.forceIpv4First, - dnsServers: values.dnsServers, - trustProxy: values.trustProxy, cacheImages: values.cacheImages, - proxy: { - enabled: values.proxyEnabled, - hostname: values.proxyHostname, - port: values.proxyPort, - useSsl: values.proxySsl, - user: values.proxyUser, - password: values.proxyPassword, - bypassFilter: values.proxyBypassFilter, - bypassLocalAddresses: values.proxyBypassLocalAddresses, - }, }), }); if (!res.ok) throw new Error(); @@ -321,58 +264,6 @@ const SettingsMain = () => { )} -
- -
- { - setFieldValue('trustProxy', !values.trustProxy); - }} - /> -
-
-
- -
- - { - setFieldValue( - 'csrfProtection', - !values.csrfProtection - ); - }} - /> - -
-
-
- -
- { - setFieldValue('forceIpv4First', !values.forceIpv4First); - }} - /> -
-
-
- -
-
- -
- {errors.dnsServers && - touched.dnsServers && - typeof errors.dnsServers === 'string' && ( -
{errors.dnsServers}
- )} -
-
-
- -
- { - setFieldValue('proxyEnabled', !values.proxyEnabled); - }} - /> -
-
- {values.proxyEnabled && ( - <> -
-
- -
-
- -
- {errors.proxyHostname && - touched.proxyHostname && - typeof errors.proxyHostname === 'string' && ( -
- {errors.proxyHostname} -
- )} -
-
-
- -
-
- -
- {errors.proxyPort && - touched.proxyPort && - typeof errors.proxyPort === 'string' && ( -
{errors.proxyPort}
- )} -
-
-
- -
- { - setFieldValue('proxySsl', !values.proxySsl); - }} - /> -
-
-
- -
-
- -
- {errors.proxyUser && - touched.proxyUser && - typeof errors.proxyUser === 'string' && ( -
{errors.proxyUser}
- )} -
-
-
- -
-
- -
- {errors.proxyPassword && - touched.proxyPassword && - typeof errors.proxyPassword === 'string' && ( -
- {errors.proxyPassword} -
- )} -
-
-
- -
-
- -
- {errors.proxyBypassFilter && - touched.proxyBypassFilter && - typeof errors.proxyBypassFilter === 'string' && ( -
- {errors.proxyBypassFilter} -
- )} -
-
-
- -
- { - setFieldValue( - 'proxyBypassLocalAddresses', - !values.proxyBypassLocalAddresses - ); - }} - /> -
-
-
- - )}
diff --git a/src/components/Settings/SettingsNetwork/index.tsx b/src/components/Settings/SettingsNetwork/index.tsx new file mode 100644 index 000000000..445e29f9c --- /dev/null +++ b/src/components/Settings/SettingsNetwork/index.tsx @@ -0,0 +1,461 @@ +import Button from '@app/components/Common/Button'; +import LoadingSpinner from '@app/components/Common/LoadingSpinner'; +import PageTitle from '@app/components/Common/PageTitle'; +import Tooltip from '@app/components/Common/Tooltip'; +import SettingsBadge from '@app/components/Settings/SettingsBadge'; +import globalMessages from '@app/i18n/globalMessages'; +import defineMessages from '@app/utils/defineMessages'; +import { ArrowDownOnSquareIcon } from '@heroicons/react/24/outline'; +import type { MainSettings } from '@server/lib/settings'; +import { Field, Form, Formik } from 'formik'; +import { useIntl } from 'react-intl'; +import { useToasts } from 'react-toast-notifications'; +import useSWR, { mutate } from 'swr'; +import * as Yup from 'yup'; + +const messages = defineMessages('components.Settings.SettingsNetwork', { + toastSettingsSuccess: 'Settings saved successfully!', + toastSettingsFailure: 'Something went wrong while saving settings.', + network: 'Network', + networksettings: 'Network Settings', + networksettingsDescription: + 'Configure network settings for your Jellyseerr instance.', + csrfProtection: 'Enable CSRF Protection', + csrfProtectionTip: 'Set external API access to read-only (requires HTTPS)', + csrfProtectionHoverTip: + 'Do NOT enable this setting unless you understand what you are doing!', + trustProxy: 'Enable Proxy Support', + trustProxyTip: + 'Allow Jellyseerr to correctly register client IP addresses behind a proxy', + forceIpv4First: 'IPv4 Resolution First', + forceIpv4FirstTip: + 'Force Jellyseerr to resolve IPv4 addresses first instead of IPv6', + dnsServers: 'Custom DNS Servers', + dnsServersTip: + 'Comma-separated list of custom DNS servers, e.g. "1.1.1.1,[2606:4700:4700::1111]"', + proxyEnabled: 'HTTP(S) Proxy', + proxyHostname: 'Proxy Hostname', + proxyPort: 'Proxy Port', + proxySsl: 'Use SSL For Proxy', + proxyUser: 'Proxy Username', + proxyPassword: 'Proxy Password', + proxyBypassFilter: 'Proxy Ignored Addresses', + proxyBypassFilterTip: + "Use ',' as a separator, and '*.' as a wildcard for subdomains", + proxyBypassLocalAddresses: 'Bypass Proxy for Local Addresses', + validationProxyPort: 'You must provide a valid port', +}); + +const SettingsMain = () => { + const { addToast } = useToasts(); + const intl = useIntl(); + const { + data, + error, + mutate: revalidate, + } = useSWR('/api/v1/settings/main'); + + const NetworkSettingsSchema = Yup.object().shape({ + proxyPort: Yup.number().when('proxyEnabled', { + is: (proxyEnabled: boolean) => proxyEnabled, + then: Yup.number().required( + intl.formatMessage(messages.validationProxyPort) + ), + }), + }); + + if (!data && !error) { + return ; + } + + return ( + <> + +
+

+ {intl.formatMessage(messages.networksettings)} +

+

+ {intl.formatMessage(messages.networksettingsDescription)} +

+
+
+ { + try { + const res = await fetch('/api/v1/settings/main', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + csrfProtection: values.csrfProtection, + forceIpv4First: values.forceIpv4First, + dnsServers: values.dnsServers, + trustProxy: values.trustProxy, + proxy: { + enabled: values.proxyEnabled, + hostname: values.proxyHostname, + port: values.proxyPort, + useSsl: values.proxySsl, + user: values.proxyUser, + password: values.proxyPassword, + bypassFilter: values.proxyBypassFilter, + bypassLocalAddresses: values.proxyBypassLocalAddresses, + }, + }), + }); + if (!res.ok) throw new Error(); + mutate('/api/v1/settings/public'); + mutate('/api/v1/status'); + + addToast(intl.formatMessage(messages.toastSettingsSuccess), { + autoDismiss: true, + appearance: 'success', + }); + } catch (e) { + addToast(intl.formatMessage(messages.toastSettingsFailure), { + autoDismiss: true, + appearance: 'error', + }); + } finally { + revalidate(); + } + }} + > + {({ + errors, + touched, + isSubmitting, + isValid, + values, + setFieldValue, + }) => { + return ( +
+
+ +
+ { + setFieldValue('trustProxy', !values.trustProxy); + }} + /> +
+
+
+ +
+ + { + setFieldValue( + 'csrfProtection', + !values.csrfProtection + ); + }} + /> + +
+
+
+ +
+ { + setFieldValue('forceIpv4First', !values.forceIpv4First); + }} + /> +
+
+
+ +
+
+ +
+ {errors.dnsServers && + touched.dnsServers && + typeof errors.dnsServers === 'string' && ( +
{errors.dnsServers}
+ )} +
+
+
+ +
+ { + setFieldValue('proxyEnabled', !values.proxyEnabled); + }} + /> +
+
+ {values.proxyEnabled && ( + <> +
+
+ +
+
+ +
+ {errors.proxyHostname && + touched.proxyHostname && + typeof errors.proxyHostname === 'string' && ( +
+ {errors.proxyHostname} +
+ )} +
+
+
+ +
+
+ +
+ {errors.proxyPort && + touched.proxyPort && + typeof errors.proxyPort === 'string' && ( +
{errors.proxyPort}
+ )} +
+
+
+ +
+ { + setFieldValue('proxySsl', !values.proxySsl); + }} + /> +
+
+
+ +
+
+ +
+ {errors.proxyUser && + touched.proxyUser && + typeof errors.proxyUser === 'string' && ( +
{errors.proxyUser}
+ )} +
+
+
+ +
+
+ +
+ {errors.proxyPassword && + touched.proxyPassword && + typeof errors.proxyPassword === 'string' && ( +
+ {errors.proxyPassword} +
+ )} +
+
+
+ +
+
+ +
+ {errors.proxyBypassFilter && + touched.proxyBypassFilter && + typeof errors.proxyBypassFilter === 'string' && ( +
+ {errors.proxyBypassFilter} +
+ )} +
+
+
+ +
+ { + setFieldValue( + 'proxyBypassLocalAddresses', + !values.proxyBypassLocalAddresses + ); + }} + /> +
+
+
+ + )} +
+
+ + + +
+
+
+ ); + }} +
+
+ + ); +}; + +export default SettingsMain; diff --git a/src/pages/settings/network.tsx b/src/pages/settings/network.tsx new file mode 100644 index 000000000..f5aeeaa95 --- /dev/null +++ b/src/pages/settings/network.tsx @@ -0,0 +1,16 @@ +import SettingsLayout from '@app/components/Settings/SettingsLayout'; +import SettingsNetwork from '@app/components/Settings/SettingsNetwork'; +import useRouteGuard from '@app/hooks/useRouteGuard'; +import { Permission } from '@app/hooks/useUser'; +import type { NextPage } from 'next'; + +const SettingsNetworkPage: NextPage = () => { + useRouteGuard(Permission.ADMIN); + return ( + + + + ); +}; + +export default SettingsNetworkPage; From 39fc47b0fda173f6c50ca62546b7633779b22af6 Mon Sep 17 00:00:00 2001 From: Gauthier Date: Sun, 19 Jan 2025 00:17:51 +0100 Subject: [PATCH 2/3] fix: add missing translations --- src/i18n/locale/en.json | 44 +++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/src/i18n/locale/en.json b/src/i18n/locale/en.json index 9704b14ba..e43035bd5 100644 --- a/src/i18n/locale/en.json +++ b/src/i18n/locale/en.json @@ -915,16 +915,9 @@ "components.Settings.SettingsMain.applicationurl": "Application URL", "components.Settings.SettingsMain.cacheImages": "Enable Image Caching", "components.Settings.SettingsMain.cacheImagesTip": "Cache externally sourced images (requires a significant amount of disk space)", - "components.Settings.SettingsMain.csrfProtection": "Enable CSRF Protection", - "components.Settings.SettingsMain.csrfProtectionHoverTip": "Do NOT enable this setting unless you understand what you are doing!", - "components.Settings.SettingsMain.csrfProtectionTip": "Set external API access to read-only (requires HTTPS)", "components.Settings.SettingsMain.discoverRegion": "Discover Region", "components.Settings.SettingsMain.discoverRegionTip": "Filter content by regional availability", - "components.Settings.SettingsMain.dnsServers": "Custom DNS Servers", - "components.Settings.SettingsMain.dnsServersTip": "Comma-separated list of custom DNS servers, e.g. \"1.1.1.1,[2606:4700:4700::1111]\"", "components.Settings.SettingsMain.enableSpecialEpisodes": "Allow Special Episodes Requests", - "components.Settings.SettingsMain.forceIpv4First": "IPv4 Resolution First", - "components.Settings.SettingsMain.forceIpv4FirstTip": "Force Jellyseerr to resolve IPv4 addresses first instead of IPv6", "components.Settings.SettingsMain.general": "General", "components.Settings.SettingsMain.generalsettings": "General Settings", "components.Settings.SettingsMain.generalsettingsDescription": "Configure global and default settings for Jellyseerr.", @@ -933,27 +926,39 @@ "components.Settings.SettingsMain.originallanguage": "Discover Language", "components.Settings.SettingsMain.originallanguageTip": "Filter content by original language", "components.Settings.SettingsMain.partialRequestsEnabled": "Allow Partial Series Requests", - "components.Settings.SettingsMain.proxyBypassFilter": "Proxy Ignored Addresses", - "components.Settings.SettingsMain.proxyBypassFilterTip": "Use ',' as a separator, and '*.' as a wildcard for subdomains", - "components.Settings.SettingsMain.proxyBypassLocalAddresses": "Bypass Proxy for Local Addresses", - "components.Settings.SettingsMain.proxyEnabled": "HTTP(S) Proxy", - "components.Settings.SettingsMain.proxyHostname": "Proxy Hostname", - "components.Settings.SettingsMain.proxyPassword": "Proxy Password", - "components.Settings.SettingsMain.proxyPort": "Proxy Port", - "components.Settings.SettingsMain.proxySsl": "Use SSL For Proxy", - "components.Settings.SettingsMain.proxyUser": "Proxy Username", "components.Settings.SettingsMain.streamingRegion": "Streaming Region", "components.Settings.SettingsMain.streamingRegionTip": "Show streaming sites by regional availability", "components.Settings.SettingsMain.toastApiKeyFailure": "Something went wrong while generating a new API key.", "components.Settings.SettingsMain.toastApiKeySuccess": "New API key generated successfully!", "components.Settings.SettingsMain.toastSettingsFailure": "Something went wrong while saving settings.", "components.Settings.SettingsMain.toastSettingsSuccess": "Settings saved successfully!", - "components.Settings.SettingsMain.trustProxy": "Enable Proxy Support", - "components.Settings.SettingsMain.trustProxyTip": "Allow Jellyseerr to correctly register client IP addresses behind a proxy", "components.Settings.SettingsMain.validationApplicationTitle": "You must provide an application title", "components.Settings.SettingsMain.validationApplicationUrl": "You must provide a valid URL", "components.Settings.SettingsMain.validationApplicationUrlTrailingSlash": "URL must not end in a trailing slash", - "components.Settings.SettingsMain.validationProxyPort": "You must provide a valid port", + "components.Settings.SettingsNetwork.csrfProtection": "Enable CSRF Protection", + "components.Settings.SettingsNetwork.csrfProtectionHoverTip": "Do NOT enable this setting unless you understand what you are doing!", + "components.Settings.SettingsNetwork.csrfProtectionTip": "Set external API access to read-only (requires HTTPS)", + "components.Settings.SettingsNetwork.dnsServers": "Custom DNS Servers", + "components.Settings.SettingsNetwork.dnsServersTip": "Comma-separated list of custom DNS servers, e.g. \"1.1.1.1,[2606:4700:4700::1111]\"", + "components.Settings.SettingsNetwork.forceIpv4First": "IPv4 Resolution First", + "components.Settings.SettingsNetwork.forceIpv4FirstTip": "Force Jellyseerr to resolve IPv4 addresses first instead of IPv6", + "components.Settings.SettingsNetwork.network": "Network", + "components.Settings.SettingsNetwork.networksettings": "Network Settings", + "components.Settings.SettingsNetwork.networksettingsDescription": "Configure network settings for your Jellyseerr instance.", + "components.Settings.SettingsNetwork.proxyBypassFilter": "Proxy Ignored Addresses", + "components.Settings.SettingsNetwork.proxyBypassFilterTip": "Use ',' as a separator, and '*.' as a wildcard for subdomains", + "components.Settings.SettingsNetwork.proxyBypassLocalAddresses": "Bypass Proxy for Local Addresses", + "components.Settings.SettingsNetwork.proxyEnabled": "HTTP(S) Proxy", + "components.Settings.SettingsNetwork.proxyHostname": "Proxy Hostname", + "components.Settings.SettingsNetwork.proxyPassword": "Proxy Password", + "components.Settings.SettingsNetwork.proxyPort": "Proxy Port", + "components.Settings.SettingsNetwork.proxySsl": "Use SSL For Proxy", + "components.Settings.SettingsNetwork.proxyUser": "Proxy Username", + "components.Settings.SettingsNetwork.toastSettingsFailure": "Something went wrong while saving settings.", + "components.Settings.SettingsNetwork.toastSettingsSuccess": "Settings saved successfully!", + "components.Settings.SettingsNetwork.trustProxy": "Enable Proxy Support", + "components.Settings.SettingsNetwork.trustProxyTip": "Allow Jellyseerr to correctly register client IP addresses behind a proxy", + "components.Settings.SettingsNetwork.validationProxyPort": "You must provide a valid port", "components.Settings.SettingsUsers.defaultPermissions": "Default Permissions", "components.Settings.SettingsUsers.defaultPermissionsTip": "Initial permissions assigned to new users", "components.Settings.SettingsUsers.localLogin": "Enable Local Sign-In", @@ -1069,6 +1074,7 @@ "components.Settings.menuJellyfinSettings": "{mediaServerName}", "components.Settings.menuJobs": "Jobs & Cache", "components.Settings.menuLogs": "Logs", + "components.Settings.menuNetwork": "Network", "components.Settings.menuNotifications": "Notifications", "components.Settings.menuPlexSettings": "Plex", "components.Settings.menuServices": "Services", From c619c455fc0d9cdce113a8c5c3444c43ba4b0adc Mon Sep 17 00:00:00 2001 From: Gauthier Date: Sun, 19 Jan 2025 22:57:39 +0100 Subject: [PATCH 3/3] fix: fix cypress tests for network settings --- cypress/e2e/settings/general-settings.cy.ts | 6 +++--- src/components/Settings/SettingsNetwork/index.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cypress/e2e/settings/general-settings.cy.ts b/cypress/e2e/settings/general-settings.cy.ts index bcfce1a32..59649ed6b 100644 --- a/cypress/e2e/settings/general-settings.cy.ts +++ b/cypress/e2e/settings/general-settings.cy.ts @@ -13,10 +13,10 @@ describe('General Settings', () => { }); it('modifies setting that requires restart', () => { - cy.visit('/settings'); + cy.visit('/settings/network'); cy.get('#trustProxy').click(); - cy.get('[data-testid=settings-main-form]').submit(); + cy.get('[data-testid=settings-network-form]').submit(); cy.get('[data-testid=modal-title]').should( 'contain', 'Server Restart Required' @@ -26,7 +26,7 @@ describe('General Settings', () => { cy.get('[data-testid=modal-title]').should('not.exist'); cy.get('[type=checkbox]#trustProxy').click(); - cy.get('[data-testid=settings-main-form]').submit(); + cy.get('[data-testid=settings-network-form]').submit(); cy.get('[data-testid=modal-title]').should('not.exist'); }); }); diff --git a/src/components/Settings/SettingsNetwork/index.tsx b/src/components/Settings/SettingsNetwork/index.tsx index 445e29f9c..a27e948d7 100644 --- a/src/components/Settings/SettingsNetwork/index.tsx +++ b/src/components/Settings/SettingsNetwork/index.tsx @@ -153,7 +153,7 @@ const SettingsMain = () => { setFieldValue, }) => { return ( -
+