diff options
| author | Oliver <oliver@mohlin.dev> | 2025-03-11 14:55:08 +0100 |
|---|---|---|
| committer | Markus Pettersson <markus.pettersson@mullvad.net> | 2025-03-19 15:06:37 +0100 |
| commit | 0f122446c65e59af0bec90630aff2089df5afb49 (patch) | |
| tree | c700c6bc711a943abf09c4898953bd7f018477f9 | |
| parent | ee6c751623ca42a09ab28af0ff91e964c2b215a4 (diff) | |
| download | mullvadvpn-0f122446c65e59af0bec90630aff2089df5afb49.tar.xz mullvadvpn-0f122446c65e59af0bec90630aff2089df5afb49.zip | |
Add open vpn support ending notification
| -rw-r--r-- | desktop/packages/mullvad-vpn/src/renderer/lib/notifications/index.ts | 1 | ||||
| -rw-r--r-- | desktop/packages/mullvad-vpn/src/renderer/lib/notifications/open-vpn-support-ending.ts | 65 |
2 files changed, 66 insertions, 0 deletions
diff --git a/desktop/packages/mullvad-vpn/src/renderer/lib/notifications/index.ts b/desktop/packages/mullvad-vpn/src/renderer/lib/notifications/index.ts index a03af00d06..513b97fefb 100644 --- a/desktop/packages/mullvad-vpn/src/renderer/lib/notifications/index.ts +++ b/desktop/packages/mullvad-vpn/src/renderer/lib/notifications/index.ts @@ -1,2 +1,3 @@ export * from './new-device'; export * from './new-version'; +export * from './open-vpn-support-ending'; diff --git a/desktop/packages/mullvad-vpn/src/renderer/lib/notifications/open-vpn-support-ending.ts b/desktop/packages/mullvad-vpn/src/renderer/lib/notifications/open-vpn-support-ending.ts new file mode 100644 index 0000000000..8ddecd84b5 --- /dev/null +++ b/desktop/packages/mullvad-vpn/src/renderer/lib/notifications/open-vpn-support-ending.ts @@ -0,0 +1,65 @@ +import { sprintf } from 'sprintf-js'; + +import { strings, urls } from '../../../shared/constants'; +import { TunnelProtocol } from '../../../shared/daemon-rpc-types'; +import { messages } from '../../../shared/gettext'; +import { InAppNotification, InAppNotificationProvider } from '../../../shared/notifications'; + +interface OpenVpnSupportEndingNotificationContext { + tunnelProtocol: TunnelProtocol; +} + +export class OpenVpnSupportEndingNotificationProvider implements InAppNotificationProvider { + public constructor(private context: OpenVpnSupportEndingNotificationContext) {} + + public mayDisplay = () => { + return this.context.tunnelProtocol === 'openvpn'; + }; + + public getInAppNotification(): InAppNotification { + const capitalizedOpenVpn = strings.openvpn.toUpperCase(); + return { + indicator: 'warning', + title: sprintf( + // TRANSLATORS: Notification title indicating that OpenVPN support is ending. + // TRANSLATORS: Available placeholders: + // TRANSLATORS: %(openVpn)s - Will be replaced with OPENVPN + messages.pgettext('in-app-notifications', '%(openVpn)s SUPPORT IS ENDING'), + { + openVpn: capitalizedOpenVpn, + }, + ), + subtitle: [ + { + content: sprintf( + // TRANSLATORS: Notification subtitle indicating that OpenVPN support is ending. + // TRANSLATORS: Available placeholders: + // TRANSLATORS: %(wireGuard)s - Will be replaced with WireGuard + messages.pgettext( + 'in-app-notifications', + 'Please change tunnel protocol to %(wireGuard)s.', + ), + { wireGuard: strings.wireguard }, + ), + }, + { + content: + // TRANSLATORS: Link in notication to a blog post about OpenVPN support ending. + messages.pgettext('in-app-notifications', 'Read more'), + action: { + type: 'navigate-external', + link: { + to: urls.removingOpenVpnBlog, + 'aria-label': + // TRANSLATORS: Accessibility label for link to blog post about OpenVPN support ending. + messages.pgettext( + 'accessibility', + 'Go to blog post to read more, opens externally', + ), + }, + }, + }, + ], + }; + } +} |
