mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
electron-97: completed point 1 in refactoring
This commit is contained in:
parent
5d6a3670a2
commit
7ab0f75e2e
11
js/main.js
11
js/main.js
@ -1,20 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
// Third Party Dependencies
|
||||
const electron = require('electron');
|
||||
const app = electron.app;
|
||||
const nodeURL = require('url');
|
||||
const squirrelStartup = require('electron-squirrel-startup');
|
||||
const AutoLaunch = require('auto-launch');
|
||||
const urlParser = require('url');
|
||||
const { getConfigField } = require('./config.js');
|
||||
const { isMac, isDevEnv } = require('./utils/misc.js');
|
||||
const protocolHandler = require('./protocolHandler');
|
||||
const getCmdLineArg = require('./utils/getCmdLineArg.js');
|
||||
const childProcess = require('child_process');
|
||||
const path = require('path');
|
||||
const AppDirectory = require('appdirectory');
|
||||
const dirs = new AppDirectory('Symphony');
|
||||
|
||||
// Local Dependencies
|
||||
const { getConfigField } = require('./config.js');
|
||||
const { isMac, isDevEnv } = require('./utils/misc.js');
|
||||
const protocolHandler = require('./protocolHandler');
|
||||
const getCmdLineArg = require('./utils/getCmdLineArg.js');
|
||||
|
||||
require('electron-dl')();
|
||||
|
||||
// used to check if a url was opened when the app was already open
|
||||
|
@ -9,7 +9,7 @@ const electron = require('electron');
|
||||
const windowMgr = require('./windowMgr.js');
|
||||
const log = require('./log.js');
|
||||
const logLevels = require('./enums/logLevels');
|
||||
const activityDetection = require('./activityDetection/activityDetection');
|
||||
const activityDetection = require('./activityDetection');
|
||||
const badgeCount = require('./badgeCount.js');
|
||||
const protocolHandler = require('./protocolHandler');
|
||||
const configureNotification = require('./notify/settings/configure-notification-position');
|
||||
|
@ -19,7 +19,7 @@ const apiCmds = apiEnums.cmds;
|
||||
const apiName = apiEnums.apiName;
|
||||
const getMediaSources = require('../desktopCapturer/getSources');
|
||||
|
||||
require('../downloadManager/downloadManager');
|
||||
require('../downloadManager');
|
||||
|
||||
// bug in electron preventing us from using spellchecker in pop outs
|
||||
// https://github.com/electron/electron/issues/4025
|
||||
@ -28,7 +28,7 @@ require('../downloadManager/downloadManager');
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
try {
|
||||
/* eslint-disable global-require */
|
||||
const SpellCheckerHelper = require('../spellChecker/spellChecker').SpellCheckHelper;
|
||||
const SpellCheckerHelper = require('../spellChecker').SpellCheckHelper;
|
||||
/* eslint-enable global-require */
|
||||
// Method to initialize spell checker
|
||||
const spellChecker = new SpellCheckerHelper();
|
||||
@ -102,7 +102,7 @@ function createAPI() {
|
||||
containerIdentifier: appName,
|
||||
containerVer: appVer,
|
||||
apiVer: '1.0.0'
|
||||
}
|
||||
};
|
||||
resolve(verInfo);
|
||||
});
|
||||
},
|
||||
@ -126,9 +126,9 @@ function createAPI() {
|
||||
|
||||
/**
|
||||
* provides api to allow user to capture portion of screen, see api
|
||||
* details in screenSnipper/ScreenSnippet.js
|
||||
* details in screenSnipper/index.js
|
||||
*/
|
||||
ScreenSnippet: remote.require('./screenSnippet/ScreenSnippet.js').ScreenSnippet,
|
||||
ScreenSnippet: remote.require('./screenSnippet/index.js').ScreenSnippet,
|
||||
|
||||
/**
|
||||
* Brings window forward and gives focus.
|
||||
|
@ -120,8 +120,7 @@ function readResult(outputFileName, resolve, reject, childProcessErr) {
|
||||
});
|
||||
} catch (error) {
|
||||
reject(createError(error));
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
// remove tmp file (async)
|
||||
fs.unlink(outputFileName, function(removeErr) {
|
||||
// note: node complains if calling async
|
||||
@ -153,4 +152,4 @@ module.exports = {
|
||||
ScreenSnippet: ScreenSnippet,
|
||||
// note: readResult only exposed for testing purposes
|
||||
readResult: readResult
|
||||
}
|
||||
};
|
7171
package-lock.json
generated
Normal file
7171
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -26,7 +26,9 @@
|
||||
"transformIgnorePatterns": []
|
||||
},
|
||||
"build": {
|
||||
"asarUnpack": ["node_modules/@paulcbetts/cld/build/Release/cld.node"],
|
||||
"asarUnpack": [
|
||||
"node_modules/@paulcbetts/cld/build/Release/cld.node"
|
||||
],
|
||||
"files": [
|
||||
"!coverage/*",
|
||||
"!installer/*",
|
||||
|
@ -1,4 +1,4 @@
|
||||
const downloadManager = require('../js/downloadManager/downloadManager');
|
||||
const downloadManager = require('../js/downloadManager');
|
||||
const electron = require('./__mocks__/electron');
|
||||
|
||||
describe('download manager', function() {
|
||||
|
@ -1,10 +1,9 @@
|
||||
|
||||
const { ScreenSnippet, readResult } = require('../js/screenSnippet/ScreenSnippet.js');
|
||||
const { ScreenSnippet, readResult } = require('../js/screenSnippet');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const os = require('os');
|
||||
|
||||
const { isMac } = require('../js/utils/misc.js')
|
||||
const { isMac } = require('../js/utils/misc.js');
|
||||
|
||||
const snippetBase64 = require('./fixtures/snippet/snippet-base64.js');
|
||||
|
||||
|
@ -10,7 +10,7 @@ describe('Tests for Activity Detection', function () {
|
||||
|
||||
beforeAll(function(done) {
|
||||
childProcess.exec(`npm rebuild --target=${process.version} --build-from-source`, function(err) {
|
||||
activityDetection = require('../js/activityDetection/activityDetection.js');
|
||||
activityDetection = require('../js/activityDetection');
|
||||
activityDetection.setActivityWindow(900000, electron.ipcRenderer);
|
||||
done();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user