ELECTRON-582: upgrade electron version (#417)

- upgrade electron version
- upgrade other dependencies
- fix linting issues
This commit is contained in:
Vishwas Shashidhar 2018-07-02 17:14:30 +05:30 committed by GitHub
parent e46edcc157
commit e1c22ea360
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 163 additions and 163 deletions

View File

@ -17,7 +17,7 @@ let ignoreAllCertErrors = false;
* user provides a response.
*/
electron.app.on('certificate-error', function(event, webContents, url, error,
certificate, callback) {
certificate, callback) {
if (ignoreAllCertErrors) {
event.preventDefault();

View File

@ -59,19 +59,19 @@ require('./memoryMonitor.js');
const windowMgr = require('./windowMgr.js');
getConfigField('url')
.then(initializeCrashReporter)
.catch(app.quit);
.then(initializeCrashReporter)
.catch(app.quit);
function initializeCrashReporter(podUrl) {
getConfigField('crashReporter')
.then((crashReporterConfig) => {
crashReporter.start({companyName: crashReporterConfig.companyName, submitURL: crashReporterConfig.submitURL, uploadToServer: crashReporterConfig.uploadToServer, extra: {'process': 'main', podUrl: podUrl}});
log.send(logLevels.INFO, 'initialized crash reporter on the main process!');
})
.catch((err) => {
log.send(logLevels.ERROR, 'Unable to initialize crash reporter in the main process. Error is -> ' + err);
});
.then((crashReporterConfig) => {
crashReporter.start({companyName: crashReporterConfig.companyName, submitURL: crashReporterConfig.submitURL, uploadToServer: crashReporterConfig.uploadToServer, extra: {'process': 'main', podUrl: podUrl}});
log.send(logLevels.INFO, 'initialized crash reporter on the main process!');
})
.catch((err) => {
log.send(logLevels.ERROR, 'Unable to initialize crash reporter in the main process. Error is -> ' + err);
});
}

View File

@ -71,7 +71,7 @@ function getTemplate(app) {
submenu: [
buildMenuItem('undo', i18n.getMessageFor('Undo')),
buildMenuItem('redo', i18n.getMessageFor('Redo')),
{ type: 'separator' },
{ type: 'separator' },
buildMenuItem('cut', i18n.getMessageFor('Cut')),
buildMenuItem('copy', i18n.getMessageFor('Copy')),
buildMenuItem('paste', i18n.getMessageFor('Paste')),
@ -91,12 +91,12 @@ function getTemplate(app) {
}
}
},
{ type: 'separator' },
buildMenuItem('resetzoom', i18n.getMessageFor('Actual Size')),
buildMenuItem('zoomin', i18n.getMessageFor('Zoom In')),
buildMenuItem('zoomout', i18n.getMessageFor('Zoom Out')),
{ type: 'separator' },
buildMenuItem('togglefullscreen', i18n.getMessageFor('Toggle Full Screen')),
{ type: 'separator' },
buildMenuItem('resetzoom', i18n.getMessageFor('Actual Size')),
buildMenuItem('zoomin', i18n.getMessageFor('Zoom In')),
buildMenuItem('zoomout', i18n.getMessageFor('Zoom Out')),
{ type: 'separator' },
buildMenuItem('togglefullscreen', i18n.getMessageFor('Toggle Full Screen')),
]
},
{
@ -153,18 +153,18 @@ function getTemplate(app) {
let destination = electron.app.getPath('downloads') + destPath + timestamp + '.zip';
archiveHandler.generateArchiveForDirectory(source, destination, FILE_EXTENSIONS)
.then(() => {
electron.shell.showItemInFolder(destination);
})
.catch((err) => {
if (focusedWindow && !focusedWindow.isDestroyed()) {
electron.dialog.showMessageBox(focusedWindow, {
type: 'error',
title: i18n.getMessageFor('Failed!'),
message: i18n.getMessageFor('Unable to generate logs due to ') + err
});
}
});
.then(() => {
electron.shell.showItemInFolder(destination);
})
.catch((err) => {
if (focusedWindow && !focusedWindow.isDestroyed()) {
electron.dialog.showMessageBox(focusedWindow, {
type: 'error',
title: i18n.getMessageFor('Failed!'),
message: i18n.getMessageFor('Unable to generate logs due to ') + err
});
}
});
}
},
@ -175,7 +175,7 @@ function getTemplate(app) {
const crashesDirectory = electron.crashReporter.getCrashesDirectory();
let source = isMac ? crashesDirectory + '/completed' : crashesDirectory;
// TODO: Add support to get diagnostic reports from ~/Library/Logs/DiagnosticReports
// TODO: Add support to get diagnostic reports from ~/Library/Logs/DiagnosticReports
if (!fs.existsSync(source) || fs.readdirSync(source).length === 0 && focusedWindow && !focusedWindow.isDestroyed()) {
electron.dialog.showMessageBox(focusedWindow, {
type: 'error',
@ -191,18 +191,18 @@ function getTemplate(app) {
let destination = electron.app.getPath('downloads') + destPath + timestamp + '.zip';
archiveHandler.generateArchiveForDirectory(source, destination, FILE_EXTENSIONS)
.then(() => {
electron.shell.showItemInFolder(destination);
})
.catch((err) => {
if (focusedWindow && !focusedWindow.isDestroyed()) {
electron.dialog.showMessageBox(focusedWindow, {
type: 'error',
title: i18n.getMessageFor('Failed!'),
message: i18n.getMessageFor('Unable to generate crash reports due to ') + err
});
}
});
.then(() => {
electron.shell.showItemInFolder(destination);
})
.catch((err) => {
if (focusedWindow && !focusedWindow.isDestroyed()) {
electron.dialog.showMessageBox(focusedWindow, {
type: 'error',
title: i18n.getMessageFor('Failed!'),
message: i18n.getMessageFor('Unable to generate crash reports due to ') + err
});
}
});
}
}
]
@ -250,7 +250,7 @@ function getTemplate(app) {
}
]
});
// Edit menu.
// Edit menu.
template[1].submenu.push({
type: 'separator'
}, {
@ -265,7 +265,7 @@ function getTemplate(app) {
}
]
});
// Window menu.
// Window menu.
template[3].submenu = [{
accelerator: 'CmdOrCtrl+W',
role: 'close',
@ -299,7 +299,7 @@ function getTemplate(app) {
type: 'separator'
});
// Window menu -> launchOnStartup.
// Window menu -> launchOnStartup.
template[index].submenu.push({
label: i18n.getMessageFor('Auto Launch On Startup'),
type: 'checkbox',
@ -307,37 +307,37 @@ function getTemplate(app) {
click: function (item, focusedWindow) {
if (item.checked) {
symphonyAutoLauncher.enable()
.catch(function (err) {
let title = 'Error setting AutoLaunch configuration';
log.send(logLevels.ERROR, 'MenuTemplate: ' + title + ': auto launch error ' + err);
if (focusedWindow && !focusedWindow.isDestroyed()) {
electron.dialog.showMessageBox(focusedWindow, {
type: 'error',
title: i18n.getMessageFor(title),
message: i18n.getMessageFor(title) + ': ' + err
});
}
});
.catch(function (err) {
let title = 'Error setting AutoLaunch configuration';
log.send(logLevels.ERROR, 'MenuTemplate: ' + title + ': auto launch error ' + err);
if (focusedWindow && !focusedWindow.isDestroyed()) {
electron.dialog.showMessageBox(focusedWindow, {
type: 'error',
title: i18n.getMessageFor(title),
message: i18n.getMessageFor(title) + ': ' + err
});
}
});
} else {
symphonyAutoLauncher.disable()
.catch(function (err) {
let title = 'Error setting AutoLaunch configuration';
log.send(logLevels.ERROR, 'MenuTemplate: ' + title + ': auto launch error ' + err);
if (focusedWindow && !focusedWindow.isDestroyed()) {
electron.dialog.showMessageBox(focusedWindow, {
type: 'error',
title: i18n.getMessageFor(title),
message: i18n.getMessageFor(title) + ': ' + err
});
}
});
.catch(function (err) {
let title = 'Error setting AutoLaunch configuration';
log.send(logLevels.ERROR, 'MenuTemplate: ' + title + ': auto launch error ' + err);
if (focusedWindow && !focusedWindow.isDestroyed()) {
electron.dialog.showMessageBox(focusedWindow, {
type: 'error',
title: i18n.getMessageFor(title),
message: i18n.getMessageFor(title) + ': ' + err
});
}
});
}
launchOnStartup = item.checked;
updateConfigField('launchOnStartup', launchOnStartup);
}
});
// Window menu -> alwaysOnTop.
// Window menu -> alwaysOnTop.
template[index].submenu.push({
label: i18n.getMessageFor('Always on Top'),
type: 'checkbox',
@ -352,8 +352,8 @@ function getTemplate(app) {
}
});
// Window menu -> minimizeOnClose.
// ToDo: Add behavior on Close.
// Window menu -> minimizeOnClose.
// ToDo: Add behavior on Close.
template[index].submenu.push({
label: i18n.getMessageFor('Minimize on Close'),
type: 'checkbox',
@ -364,7 +364,7 @@ function getTemplate(app) {
}
});
// Window menu -> bringToFront
// Window menu -> bringToFront
template[index].submenu.push({
label: isWindowsOS ? i18n.getMessageFor('Flash Notification in Taskbar') : i18n.getMessageFor('Bring to Front on Notifications'),
type: 'checkbox',
@ -375,12 +375,12 @@ function getTemplate(app) {
}
});
// Window/View menu -> separator
// Window/View menu -> separator
template[index].submenu.push({
type: 'separator',
});
// Window - View menu -> memoryRefresh
// Window - View menu -> memoryRefresh
template[index].submenu.push({
label: i18n.getMessageFor('Refresh app when idle'),
type: 'checkbox',
@ -394,7 +394,7 @@ function getTemplate(app) {
if (!isMac) {
if (isWindows10()) {
/* eslint-disable no-param-reassign */
/* eslint-disable no-param-reassign */
template[index].submenu.push({
label: i18n.getMessageFor('Title Bar Style'),
submenu: [
@ -422,7 +422,7 @@ function getTemplate(app) {
}, {
type: 'separator'
});
/* eslint-enable no-param-reassign */
/* eslint-enable no-param-reassign */
}
template[index].submenu.push({
@ -432,7 +432,7 @@ function getTemplate(app) {
}
});
// This adds About Symphony under help menu for windows
// This adds About Symphony under help menu for windows
template[3].submenu.push({
label: i18n.getMessageFor('About Symphony'),
click(focusedWindow) {
@ -451,58 +451,58 @@ function getTemplate(app) {
*/
function setCheckboxValues() {
return new Promise((resolve) => {
/**
/**
* Method that reads multiple config fields
*/
getMultipleConfigField(configFields)
.then(function (configData) {
for (let key in configData) {
if (configData.hasOwnProperty(key)) { // eslint-disable-line no-prototype-builtins
switch (key) {
case 'minimizeOnClose':
minimizeOnClose = configData[key];
break;
case 'launchOnStartup':
launchOnStartup = configData[key];
break;
case 'alwaysOnTop':
isAlwaysOnTop = configData[key];
eventEmitter.emit('isAlwaysOnTop', {
isAlwaysOnTop: configData[key],
shouldActivateMainWindow: true
.then(function (configData) {
for (let key in configData) {
if (configData.hasOwnProperty(key)) { // eslint-disable-line no-prototype-builtins
switch (key) {
case 'minimizeOnClose':
minimizeOnClose = configData[key];
break;
case 'launchOnStartup':
launchOnStartup = configData[key];
break;
case 'alwaysOnTop':
isAlwaysOnTop = configData[key];
eventEmitter.emit('isAlwaysOnTop', {
isAlwaysOnTop: configData[key],
shouldActivateMainWindow: true
});
break;
case 'notificationSettings':
eventEmitter.emit('notificationSettings', configData[key]);
break;
case 'bringToFront':
bringToFront = configData[key];
break;
case 'isCustomTitleBar':
titleBarStyle = configData[key] ? titleBarStyles.CUSTOM : titleBarStyles.NATIVE_WITH_CUSTOM;
break;
case 'memoryRefresh':
memoryRefresh = configData[key];
break;
default:
break;
}
}
}
return resolve();
})
.catch((err) => {
let title = 'Error loading configuration';
log.send(logLevels.ERROR, 'MenuTemplate: error reading configuration fields, error: ' + err);
if (electron.BrowserWindow.getFocusedWindow() && !electron.BrowserWindow.getFocusedWindow().isDestroyed()) {
electron.dialog.showMessageBox(electron.BrowserWindow.getFocusedWindow(), {
type: 'error',
title: i18n.getMessageFor(title),
message: i18n.getMessageFor(title) + ': ' + err
});
break;
case 'notificationSettings':
eventEmitter.emit('notificationSettings', configData[key]);
break;
case 'bringToFront':
bringToFront = configData[key];
break;
case 'isCustomTitleBar':
titleBarStyle = configData[key] ? titleBarStyles.CUSTOM : titleBarStyles.NATIVE_WITH_CUSTOM;
break;
case 'memoryRefresh':
memoryRefresh = configData[key];
break;
default:
break;
}
}
}
return resolve();
})
.catch((err) => {
let title = 'Error loading configuration';
log.send(logLevels.ERROR, 'MenuTemplate: error reading configuration fields, error: ' + err);
if (electron.BrowserWindow.getFocusedWindow() && !electron.BrowserWindow.getFocusedWindow().isDestroyed()) {
electron.dialog.showMessageBox(electron.BrowserWindow.getFocusedWindow(), {
type: 'error',
title: i18n.getMessageFor(title),
message: i18n.getMessageFor(title) + ': ' + err
});
}
return resolve();
});
}
return resolve();
});
});
}
@ -523,7 +523,7 @@ function buildMenuItem(role, label) {
if (isWindowsOS) {
return label ? { role: role, label: label, accelerator: windowsAccelerator[role] || '' }
: { role: role, accelerator: windowsAccelerator[role] || '' }
: { role: role, accelerator: windowsAccelerator[role] || '' }
}
return label ? { role: role, label: label } : { role: role }

View File

@ -33,22 +33,22 @@ AnimationQueue.prototype.push = function(object) {
*/
AnimationQueue.prototype.animate = function(object) {
object.func.apply(null, object.args)
.then(function() {
if (this.queue.length > 0) {
// Run next animation
this.animate.call(this, this.queue.shift());
} else {
this.running = false;
}
}.bind(this))
.catch(function(err) {
log.send(logLevels.ERROR, 'animationQueue: encountered an error: ' + err +
.then(function() {
if (this.queue.length > 0) {
// Run next animation
this.animate.call(this, this.queue.shift());
} else {
this.running = false;
}
}.bind(this))
.catch(function(err) {
log.send(logLevels.ERROR, 'animationQueue: encountered an error: ' + err +
' with stack trace:' + err.stack);
/* eslint-disable no-console */
console.error('animation queue encountered an error: ' + err +
' with stack trace:' + err.stack);
/* eslint-disable no-console */
console.error('animation queue encountered an error: ' + err +
' with stack trace:' + err.stack);
/* eslint-enable no-console */
})
/* eslint-enable no-console */
})
};
/**

View File

@ -591,12 +591,12 @@ function moveOneDown(startPos) {
resolve();
return
}
// Build array with index of affected notifications
// Build array with index of affected notifications
let notificationPosArray = [];
for (let i = startPos; i < activeNotifications.length; i++) {
notificationPosArray.push(i)
}
// Start to animate all notifications at once or in parallel
// Start to animate all notifications at once or in parallel
let asyncFunc = asyncMap; // Best performance
if (config.animateInParallel === false) {
asyncFunc = asyncMapSeries // Sluggish

View File

@ -209,7 +209,7 @@ function Queue(emitter) {
this.emit.apply(this, arguments);
} else {
(this._queue[topic] = this._queue[topic] || [])
.push([].slice.call(arguments, 1));
.push([].slice.call(arguments, 1));
}
};

View File

@ -229,7 +229,7 @@ class Search {
* @returns {Promise}
*/
searchQuery(query, senderIds, threadIds, fileType, startDate,
endDate, limit, offset, sortOrder) {
endDate, limit, offset, sortOrder) {
let _limit = limit;
let _offset = offset;

View File

@ -2,7 +2,7 @@
const os = require('os');
const isDevEnv = process.env.ELECTRON_DEV ?
process.env.ELECTRON_DEV.trim().toLowerCase() === 'true' : false;
process.env.ELECTRON_DEV.trim().toLowerCase() === 'true' : false;
const isMac = (process.platform === 'darwin');
const isWindowsOS = (process.platform === 'win32');

View File

@ -32,7 +32,7 @@
"includeFailureMsg": true,
"includeConsoleLog": true,
"theme": "lightTheme",
"outputPath": "./dist/jest_test_report.html",
"outputPath": "./dist/Jest Test Report.html",
"sort": "status"
},
"build": {
@ -92,25 +92,25 @@
},
"devDependencies": {
"bluebird": "3.5.1",
"browserify": "14.5.0",
"cross-env": "3.2.4",
"electron": "2.0.2",
"electron-builder": "20.10.0",
"browserify": "16.2.2",
"cross-env": "5.2.0",
"electron": "2.0.3",
"electron-builder": "20.16.4",
"electron-builder-squirrel-windows": "12.3.0",
"electron-chromedriver": "1.8.0",
"electron-packager": "8.7.2",
"electron-rebuild": "1.6.0",
"eslint": "3.19.0",
"electron-chromedriver": "2.0.0",
"electron-packager": "12.1.0",
"electron-rebuild": "1.7.3",
"eslint": "5.0.1",
"eslint-config-airbnb": "14.1.0",
"eslint-plugin-import": "2.8.0",
"eslint-plugin-jsx-a11y": "4.0.0",
"eslint-plugin-react": "6.10.3",
"eslint-plugin-import": "2.13.0",
"eslint-plugin-jsx-a11y": "6.0.3",
"eslint-plugin-react": "7.10.0",
"glob": "7.1.2",
"jest": "19.0.2",
"jest-html-reporter": "^2.3.0",
"jest-html-reporter": "2.4.1",
"ncp": "2.0.0",
"robotjs": "0.4.7",
"spectron": "3.7.2"
"robotjs": "0.5.1",
"spectron": "3.8.0"
},
"dependencies": {
"@paulcbetts/system-idle-time": "1.0.4",
@ -118,12 +118,12 @@
"async.map": "0.5.2",
"async.mapseries": "0.5.2",
"auto-launch": "5.0.5",
"electron-dl": "1.10.0",
"electron-log": "2.2.13",
"electron-dl": "1.12.0",
"electron-log": "2.2.15",
"electron-spellchecker": "1.1.2",
"electron-squirrel-startup": "1.0.0",
"ffi": "2.2.0",
"filesize": "3.5.11",
"filesize": "3.6.1",
"keymirror": "0.1.1",
"lodash.difference": "4.5.0",
"lodash.isequal": "4.5.0",