Help Menu changes

This commit is contained in:
Ken Powers 2020-06-10 12:56:10 -04:00 committed by Scott Nonnenberg
parent 205ee6c6ac
commit b842b69660
10 changed files with 91 additions and 16 deletions

View File

@ -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",

View File

@ -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',
},

3
app/version.js Normal file
View File

@ -0,0 +1,3 @@
const semver = require('semver');
exports.isBeta = version => semver.parse(version).prerelease[0] === 'beta';

20
main.js
View File

@ -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,

View File

@ -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();
}

View File

@ -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
}
]

View File

@ -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
}
]

View File

@ -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
},
{

View File

@ -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
},
{

View File

@ -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,