From 023b8402262069ed096066681bb70a1e5a762d16 Mon Sep 17 00:00:00 2001 From: Eric Pyle Date: Fri, 9 Nov 2018 10:41:04 -0600 Subject: [PATCH 1/6] add dialog "Install Updates?" after updates are downloaded --- app/main-process/autoUpdater.services.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/main-process/autoUpdater.services.js b/app/main-process/autoUpdater.services.js index 7a3e2f7084..3dc9820469 100644 --- a/app/main-process/autoUpdater.services.js +++ b/app/main-process/autoUpdater.services.js @@ -1,6 +1,7 @@ import log from 'electron-log'; import path from 'path'; import { autoUpdater } from 'electron-updater'; +import { dialog } from 'electron'; export const autoUpdaterServices = { setupAutoUpdater @@ -111,7 +112,17 @@ function setupAutoUpdater(browserWindow) { }); autoUpdater.on('update-downloaded', () => { sendStatusToWindow('Update downloaded'); + dialog.showMessageBox({ + title: 'Install Updates?', + message: 'Updates downloaded. Quit now to apply updates?', + buttons: ['Yes (apply updates)', 'No (I will quit later)'] + }, (buttonIndex) => { + if (buttonIndex === 0) { + setImmediate(() => autoUpdater.quitAndInstall()); + } + }); }); + /* app.on('ready', () => { // Create the Menu From 4f97856dce2e39464afb631ac3a4d1e5b548b8d8 Mon Sep 17 00:00:00 2001 From: Eric Pyle Date: Fri, 9 Nov 2018 10:41:56 -0600 Subject: [PATCH 2/6] remove/refactor unused code in menu --- app/main.dev.js | 2 +- app/menu.js | 24 +++++++----------------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/app/main.dev.js b/app/main.dev.js index c29eaa3f12..7237ea026f 100644 --- a/app/main.dev.js +++ b/app/main.dev.js @@ -78,7 +78,7 @@ app.on('ready', async () => { mainWindow.show(); mainWindow.focus(); const autoUpdater = autoUpdaterServices.setupAutoUpdater(mainWindow); - const menuBuilder = new MenuBuilder(mainWindow, autoUpdater); + const menuBuilder = new MenuBuilder(mainWindow); menuBuilder.buildMenu(); autoUpdater.logger.info('Request checkForUpdatesAndNotify'); diff --git a/app/menu.js b/app/menu.js index 8a6a2cdb52..e0df3911b6 100644 --- a/app/menu.js +++ b/app/menu.js @@ -1,30 +1,25 @@ // @flow -import { app, Menu, shell, BrowserWindow, ipcMain } from 'electron'; +import { app, Menu, shell, BrowserWindow } from 'electron'; +import log from 'electron-log'; import { ipcRendererConstants } from './constants/ipcRenderer.constants'; import { navigationConstants } from './constants/navigation.constants'; -import { dblDotLocalService } from './services/dbl_dot_local.service'; export default class MenuBuilder { mainWindow: BrowserWindow; - autoUpdater; initializedMenu = false; - constructor(mainWindow: BrowserWindow, autoUpdater) { + constructor(mainWindow: BrowserWindow) { this.mainWindow = mainWindow; - this.autoUpdater = autoUpdater; - ipcMain.on(ipcRendererConstants.KEY_IPC_USER_AUTHENTICATION, (event, authentication) => { - this.buildMenu(authentication); - }); } - buildMenu(authentication) { + buildMenu() { if (!this.initializedMenu && (process.env.NODE_ENV === 'development' || process.env.DEBUG_PROD === 'true')) { this.setupDevelopmentEnvironment(); } const template = process.platform === 'darwin' ? this.buildDarwinTemplate() - : this.buildDefaultTemplate(authentication); + : this.buildDefaultTemplate(); const menu = Menu.buildFromTemplate(template); Menu.setApplicationMenu(menu); @@ -130,13 +125,8 @@ export default class MenuBuilder { } } - buildDefaultTemplate(authentication) { - let loginLabel = '&Login'; - if (authentication && authentication.loggedIn) { - const username = (authentication.user ? authentication.user.username : null) || ''; - loginLabel = `&Logout ${username}`; - } - const logFile = this.autoUpdater.logger.transports.file.file; + buildDefaultTemplate() { + const logFile = log.transports.file.file; // console.log('menu/buildDefaultTemplate'); // console.log(loginLabel); const templateDefault = [ From f620e51e39569451adfd7333a72de1f0c6889b95 Mon Sep 17 00:00:00 2001 From: Eric Pyle Date: Thu, 8 Nov 2018 22:21:41 -0600 Subject: [PATCH 3/6] update Button variant flat -> text (cherry picked from commit d093c70e7da8866adb76950af6e4873a71939830) --- app/components/DBLEntryRow.js | 12 ++++++------ app/components/DeleteOrCleanButton.js | 4 ++-- app/containers/WorkspacesPage.js | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/components/DBLEntryRow.js b/app/components/DBLEntryRow.js index 7fac3df07a..81902ac554 100644 --- a/app/components/DBLEntryRow.js +++ b/app/components/DBLEntryRow.js @@ -417,7 +417,7 @@ class DBLEntryRow extends PureComponent {
-
{this.showStoredButton() && ( -
)} {this.showDownloadButton() && ( - {this.shouldShowUpload() && - { const { status, classes, shouldDisableCleanResources } = this.props; if (status === 'DRAFT') { return ( - @@ -48,7 +48,7 @@ class DeleteOrCleanButton extends Component { ); } return ( - {
From 989c65d35aa839eae52b2e1083ac8d052c56ef16 Mon Sep 17 00:00:00 2001 From: Eric Pyle Date: Fri, 9 Nov 2018 10:48:22 -0600 Subject: [PATCH 4/6] refactor logger out of autoUpdater service --- app/.gitignore | 1 + app/main-process/autoUpdater.services.js | 15 --------------- app/main.dev.js | 17 ++++++++++++++++- 3 files changed, 17 insertions(+), 16 deletions(-) create mode 100644 app/.gitignore diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000000..53ca5490e7 --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/log-dev.txt diff --git a/app/main-process/autoUpdater.services.js b/app/main-process/autoUpdater.services.js index 3dc9820469..a2f914ade3 100644 --- a/app/main-process/autoUpdater.services.js +++ b/app/main-process/autoUpdater.services.js @@ -1,5 +1,4 @@ import log from 'electron-log'; -import path from 'path'; import { autoUpdater } from 'electron-updater'; import { dialog } from 'electron'; @@ -23,22 +22,8 @@ function setupAutoUpdater(browserWindow) { // This logging setup is not required for auto-updates to work, // but it sure makes debugging easier :) //------------------------------------------------------------------- - /* - * from https://github.com/megahertz/electron-log - * on Linux: ~/.config//log.log - * on OS X: ~/Library/Logs//log.log - * on Windows: %USERPROFILE%\AppData\Roaming\\log.log - */ autoUpdater.logger = log; autoUpdater.allowPrerelease = true; - if (process.env.NODE_ENV === 'development') { - log.transports.file.level = 'debug'; - log.transports.file.file = path.join(__dirname, 'log-dev.txt'); - } else { - log.transports.file.level = 'info'; - } - log.info('App starting...'); - log.info(`Log file: ${log.transports.file.file}`); //------------------------------------------------------------------- // Define the menu diff --git a/app/main.dev.js b/app/main.dev.js index 7237ea026f..dfcf451eb1 100644 --- a/app/main.dev.js +++ b/app/main.dev.js @@ -12,12 +12,28 @@ */ import { app, BrowserWindow, /* session */} from 'electron'; import log from 'electron-log'; +import path from 'path'; import MenuBuilder from './menu'; import { autoUpdaterServices } from './main-process/autoUpdater.services'; import { navigationConstants } from './constants/navigation.constants'; let mainWindow = null; +/* + * from https://github.com/megahertz/electron-log + * on Linux: ~/.config//log.log + * on OS X: ~/Library/Logs//log.log + * on Windows: %USERPROFILE%\AppData\Roaming\\log.log + */ +if (process.env.NODE_ENV === 'development') { + log.transports.file.level = 'debug'; + log.transports.file.file = path.join(__dirname, 'log-dev.txt'); +} else { + log.transports.file.level = 'info'; +} +log.info('App starting...'); +log.info(`Log file: ${log.transports.file.file}`); + if (process.env.NODE_ENV === 'production') { const sourceMapSupport = require('source-map-support'); sourceMapSupport.install(); @@ -25,7 +41,6 @@ if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'development' || process.env.DEBUG_PROD === 'true') { require('electron-debug')(); - const path = require('path'); const p = path.join(__dirname, '..', 'app', 'node_modules'); require('module').globalPaths.push(p); } From a5ab5104c606463ee5c23db41fafb44ccbfb8178 Mon Sep 17 00:00:00 2001 From: Eric Pyle Date: Fri, 9 Nov 2018 10:58:57 -0600 Subject: [PATCH 5/6] don't show config.xml file in log --- app/services/dbl_dot_local.service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/dbl_dot_local.service.js b/app/services/dbl_dot_local.service.js index 2e1d277a68..69d22c0b42 100644 --- a/app/services/dbl_dot_local.service.js +++ b/app/services/dbl_dot_local.service.js @@ -304,7 +304,7 @@ function updateAndWriteConfigXmlSettings({ configXmlSettings, workspace }) { const xml = builder.buildObject(newConfigXmlSettings); const configXmlPath = dblDotLocalService.getConfigXmlFullPath(workspace); fs.writeFileSync(configXmlPath, xml); - console.log(xml); + // console.log(xml); /* security issue for passwords */ return { xml, configXmlSettings: newConfigXmlSettings }; } From 5eca323c9ba8134b5b941c373cdd3ce84797c505 Mon Sep 17 00:00:00 2001 From: Eric Pyle Date: Mon, 12 Nov 2018 16:37:23 -0600 Subject: [PATCH 6/6] ### Version 0.15.1 #### Features - add dialog "Install Updates?" after updates are downloaded - add mimeType for mp4 #### Fixes - don't show config.xml file in log --- CHANGELOG.md | 8 +++++++- app/package-lock.json | 2 +- app/package.json | 2 +- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4921df13b0..4ee4f5ff50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,15 @@ +### Version 0.15.1 +#### Features +- add dialog "Install Updates?" after updates are downloaded +- add mimeType for mp4 +#### Fixes +- don't show config.xml file in log + ### Version 0.14.1 #### Fixes - don't shut down SSE channel on first error (detect when dbl_dot_local_app has really shutdown) - sort by medium before revision - ### Version 0.14.0 #### Features - increase height of progress bar diff --git a/app/package-lock.json b/app/package-lock.json index 1deb7593e5..e08fe89b03 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -1,5 +1,5 @@ { "name": "nathanael", - "version": "0.14.1", + "version": "0.15.1", "lockfileVersion": 1 } diff --git a/app/package.json b/app/package.json index c5e4ad74e6..61f1da2d47 100644 --- a/app/package.json +++ b/app/package.json @@ -1,7 +1,7 @@ { "name": "nathanael", "productName": "nathanael", - "version": "0.14.1", + "version": "0.15.1", "description": "Electron frontend to DBL dot Local", "main": "./main.prod.js", "author": { diff --git a/package-lock.json b/package-lock.json index 6ef96d9812..71f5fdb4cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "nathanael", - "version": "0.14.1", + "version": "0.15.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 908e2bc952..386c5e554b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nathanael", "productName": "nathanael", - "version": "0.14.1", + "version": "0.15.1", "description": "Electron frontend to DBL dot Local", "scripts": { "build": "concurrently \"npm run build-main\" \"npm run build-renderer\"",