diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 0b110c0521ea..dddfddede96f 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -619,6 +619,10 @@ "message": "Show Keyboard Shortcuts", "description": "Item under the help menu, pops up a screen showing the application's keyboard shortcuts" }, + "contactUs": { + "message": "Contact Us", + "description": "Item under the help menu, takes you to the contact us support page" + }, "goToReleaseNotes": { "message": "Go to Release Notes", "description": "Item under the help menu, takes you to GitHub page for release notes" @@ -631,9 +635,13 @@ "message": "Go to Support Page", "description": "Item under the Help menu, takes you to the support page" }, - "menuReportIssue": { - "message": "Report an Issue", - "description": "Item under the Help menu, takes you to GitHub new issue form (title case)" + "goToGithub": { + "message": "Go to Github", + "description": "Item under the Help menu, takes you to the GitHub repository for Signal Desktop" + }, + "joinTheBeta": { + "message": "Join the Beta", + "description": "Item under the Help menu, takes you to an article describing how to install the beta release of Signal Desktop" }, "signalDesktopPreferences": { "message": "Signal Desktop Preferences", diff --git a/app/menu.js b/app/menu.js index a87d16ab2028..f78297b00423 100644 --- a/app/menu.js +++ b/app/menu.js @@ -6,9 +6,12 @@ exports.createTemplate = (options, messages) => { } const { + isBeta, includeSetup, + openContactUs, + openGithub, openForums, - openNewBugForm, + openJoinTheBeta, openReleaseNotes, openSupportPage, platform, @@ -144,6 +147,10 @@ exports.createTemplate = (options, messages) => { { type: 'separator', }, + { + label: messages.contactUs.message, + click: openContactUs, + }, { label: messages.goToReleaseNotes.message, click: openReleaseNotes, @@ -157,9 +164,17 @@ exports.createTemplate = (options, messages) => { click: openSupportPage, }, { - label: messages.menuReportIssue.message, - click: openNewBugForm, + label: messages.goToGithub.message, + click: openGithub, }, + ...(isBeta + ? [ + { + label: messages.joinTheBeta.message, + click: openJoinTheBeta, + }, + ] + : []), { type: 'separator', }, diff --git a/app/version.js b/app/version.js new file mode 100644 index 000000000000..0e4defd0dc0b --- /dev/null +++ b/app/version.js @@ -0,0 +1,3 @@ +const semver = require('semver'); + +exports.isBeta = version => semver.parse(version).prerelease[0] === 'beta'; diff --git a/main.js b/main.js index 4b6b531ea924..e679d232221f 100644 --- a/main.js +++ b/main.js @@ -16,6 +16,7 @@ const electron = require('electron'); const packageJson = require('./package.json'); const GlobalErrors = require('./app/global_errors'); +const { isBeta } = require('./app/version'); const { setup: setupSpellChecker } = require('./app/spell_check'); GlobalErrors.addHandler(); @@ -473,14 +474,24 @@ ipc.once('ready-for-updates', readyForUpdates); const TEN_MINUTES = 10 * 60 * 1000; setTimeout(readyForUpdates, TEN_MINUTES); +function openContactUs() { + shell.openExternal( + 'https://support.signal.org/hc/en-us/requests/new?desktop' + ); +} + +function openJoinTheBeta() { + shell.openExternal('https://support.signal.org/hc/articles/360007318471'); +} + function openReleaseNotes() { shell.openExternal( `https://github.com/signalapp/Signal-Desktop/releases/tag/v${app.getVersion()}` ); } -function openNewBugForm() { - shell.openExternal('https://github.com/signalapp/Signal-Desktop/issues/new'); +function openGithub() { + shell.openExternal('https://github.com/signalapp/Signal-Desktop'); } function openSupportPage() { @@ -944,14 +955,17 @@ function setupMenu(options) { const menuOptions = { ...options, development, + isBeta: isBeta(app.getVersion()), showDebugLog: showDebugLogWindow, showKeyboardShortcuts, showWindow, showAbout, showSettings: showSettingsWindow, showStickerCreator, + openContactUs, + openGithub, + openJoinTheBeta, openReleaseNotes, - openNewBugForm, openSupportPage, openForums, platform, diff --git a/prepare_beta_build.js b/prepare_beta_build.js index 1117ddc2e507..6b6ddf84fe2a 100644 --- a/prepare_beta_build.js +++ b/prepare_beta_build.js @@ -4,9 +4,9 @@ const fs = require('fs'); const _ = require('lodash'); const packageJson = require('./package.json'); +const { isBeta } = require('./app/version'); const { version } = packageJson; -const beta = /beta/; // You might be wondering why this file is necessary. It comes down to our desire to allow // side-by-side installation of production and beta builds. Electron-Builder uses @@ -14,7 +14,7 @@ const beta = /beta/; // debian package name, the install directory under /opt on linux, etc. We tried // adding the ${channel} macro to these values, but Electron-Builder didn't like that. -if (!beta.test(version)) { +if (!isBeta(version)) { process.exit(); } diff --git a/test/app/fixtures/menu-mac-os-setup.json b/test/app/fixtures/menu-mac-os-setup.json index aab31348004c..cbb996255356 100644 --- a/test/app/fixtures/menu-mac-os-setup.json +++ b/test/app/fixtures/menu-mac-os-setup.json @@ -192,6 +192,10 @@ { "type": "separator" }, + { + "label": "Contact Us", + "click": null + }, { "label": "Go to Release Notes", "click": null @@ -205,7 +209,11 @@ "click": null }, { - "label": "Report an Issue", + "label": "Go to Github", + "click": null + }, + { + "label": "Join the Beta", "click": null } ] diff --git a/test/app/fixtures/menu-mac-os.json b/test/app/fixtures/menu-mac-os.json index b4a70569003b..f6891d1428fd 100644 --- a/test/app/fixtures/menu-mac-os.json +++ b/test/app/fixtures/menu-mac-os.json @@ -185,6 +185,10 @@ { "type": "separator" }, + { + "label": "Contact Us", + "click": null + }, { "label": "Go to Release Notes", "click": null @@ -198,7 +202,11 @@ "click": null }, { - "label": "Report an Issue", + "label": "Go to Github", + "click": null + }, + { + "label": "Join the Beta", "click": null } ] diff --git a/test/app/fixtures/menu-windows-linux-setup.json b/test/app/fixtures/menu-windows-linux-setup.json index 34802bc692b6..f78003319a39 100644 --- a/test/app/fixtures/menu-windows-linux-setup.json +++ b/test/app/fixtures/menu-windows-linux-setup.json @@ -128,6 +128,10 @@ { "type": "separator" }, + { + "label": "Contact Us", + "click": null + }, { "label": "Go to Release Notes", "click": null @@ -141,7 +145,11 @@ "click": null }, { - "label": "Report an Issue", + "label": "Go to Github", + "click": null + }, + { + "label": "Join the Beta", "click": null }, { diff --git a/test/app/fixtures/menu-windows-linux.json b/test/app/fixtures/menu-windows-linux.json index 207c8494a6d4..4cef9d27f61d 100644 --- a/test/app/fixtures/menu-windows-linux.json +++ b/test/app/fixtures/menu-windows-linux.json @@ -121,6 +121,10 @@ { "type": "separator" }, + { + "label": "Contact Us", + "click": null + }, { "label": "Go to Release Notes", "click": null @@ -134,7 +138,11 @@ "click": null }, { - "label": "Report an Issue", + "label": "Go to Github", + "click": null + }, + { + "label": "Join the Beta", "click": null }, { diff --git a/test/app/menu_test.js b/test/app/menu_test.js index 013c4bfab3e3..4b504b6514df 100644 --- a/test/app/menu_test.js +++ b/test/app/menu_test.js @@ -46,8 +46,11 @@ describe('SignalMenu', () => { }, }; const options = { + isBeta: true, + openContactUs: null, openForums: null, - openNewBugForm: null, + openGithub: null, + openJoinTheBeta: null, openReleaseNotes: null, openSupportPage: null, platform,