Skip to content

Commit

Permalink
Remove end user message for unsupported servers (#8404)
Browse files Browse the repository at this point in the history
* Remove end user message for unsupported servers

* Update test

(cherry picked from commit da38976)
  • Loading branch information
larkox authored and mattermost-build committed Dec 12, 2024
1 parent 63889c0 commit b928104
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 26 deletions.
23 changes: 1 addition & 22 deletions app/utils/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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`;
Expand Down
4 changes: 2 additions & 2 deletions app/utils/server/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
2 changes: 0 additions & 2 deletions assets/base/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit b928104

Please sign in to comment.