From 5dcdbf31161c3190b333fabfa3f7fe80817bba99 Mon Sep 17 00:00:00 2001 From: Mattermost Build Date: Thu, 12 Dec 2024 14:06:55 +0200 Subject: [PATCH] Remove end user message for unsupported servers (#8404) (#8409) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove end user message for unsupported servers * Update test (cherry picked from commit da38976cff2ae032ddaa5026a0d679952555043f) Co-authored-by: Daniel Espino García --- app/utils/server/index.ts | 23 +---------------------- app/utils/server/server.test.ts | 4 ++-- assets/base/i18n/en.json | 2 -- 3 files changed, 3 insertions(+), 26 deletions(-) diff --git a/app/utils/server/index.ts b/app/utils/server/index.ts index 8705000103d..4a7287165e6 100644 --- a/app/utils/server/index.ts +++ b/app/utils/server/index.ts @@ -21,9 +21,8 @@ export function isSupportedServer(currentVersion: string) { export function unsupportedServer(serverDisplayName: string, isSystemAdmin: boolean, intl: IntlShape, onPress?: () => void) { if (isSystemAdmin) { - return unsupportedServerAdminAlert(serverDisplayName, intl, onPress); + unsupportedServerAdminAlert(serverDisplayName, intl, onPress); } - return unsupportedServerAlert(serverDisplayName, intl, onPress); } export function semverFromServerVersion(value: string) { @@ -245,26 +244,6 @@ function unsupportedServerAdminAlert(serverDisplayName: string, intl: IntlShape, Alert.alert(title, message, buttons, options); } -function unsupportedServerAlert(serverDisplayName: string, intl: IntlShape, onPress?: () => void) { - const title = intl.formatMessage({id: 'unsupported_server.title', defaultMessage: 'Unsupported server version'}); - - const message = intl.formatMessage({ - id: 'unsupported_server.message', - defaultMessage: 'Your server, {serverDisplayName}, is running an unsupported server version. You may experience compatibility issues that cause crashes or severe bugs breaking core functionality of the app. Please contact your System Administrator to upgrade your Mattermost server.', - }, {serverDisplayName}); - - const okButton: AlertButton = { - text: intl.formatMessage({id: 'mobile.server_upgrade.button', defaultMessage: 'OK'}), - style: 'default', - onPress, - }; - - const buttons: AlertButton[] = [okButton]; - const options = {cancelable: false}; - - Alert.alert(title, message, buttons, options); -} - function buildServerModalOptions(theme: Theme, closeButtonId: string) { const closeButton = CompassIcon.getImageSourceSync('close', 24, changeOpacity(theme.centerChannelColor, 0.56)); const closeButtonTestId = `${closeButtonId.replace('close-', 'close.').replace(/-/g, '_')}.button`; diff --git a/app/utils/server/server.test.ts b/app/utils/server/server.test.ts index 62eac99c981..a3178d9d95a 100644 --- a/app/utils/server/server.test.ts +++ b/app/utils/server/server.test.ts @@ -16,9 +16,9 @@ describe('Unsupported Server Alert', () => { expect(alert?.mock?.calls?.[0]?.[2]?.length).toBe(2); }); - it('should show the alert for team admin / user', () => { + it('should not show the alert for team admin / user', () => { const alert = jest.spyOn(Alert, 'alert'); unsupportedServer('Default Server', false, intl); - expect(alert?.mock?.calls?.[0]?.[2]?.length).toBe(1); + expect(alert).not.toHaveBeenCalled(); }); }); diff --git a/assets/base/i18n/en.json b/assets/base/i18n/en.json index 76f2e399ed9..b24aedf195b 100644 --- a/assets/base/i18n/en.json +++ b/assets/base/i18n/en.json @@ -1162,8 +1162,6 @@ "unreads.empty.paragraph": "Turn off the unread filter to show all your channels.", "unreads.empty.show_all": "Show all", "unreads.empty.title": "No more unreads", - "unsupported_server.message": "Your server, {serverDisplayName}, is running an unsupported server version. You may experience compatibility issues that cause crashes or severe bugs breaking core functionality of the app. Please contact your System Administrator to upgrade your Mattermost server.", - "unsupported_server.title": "Unsupported server version", "user_profile.custom_status": "Custom Status", "user_settings.notifications.test_notification.body": "Not receiving notifications? Start by sending a test notification to all your devices to check if they’re working as expected. If issues persist, explore ways to solve them with troubleshooting steps.", "user_settings.notifications.test_notification.go_to_docs": "Troubleshooting docs",