Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Commit

Permalink
### Version 0.15.1
Browse files Browse the repository at this point in the history
#### Features
- add dialog "Install Updates?" after updates are downloaded
- add mimeType for mp4
#### Fixes
- don't show config.xml file in log

(Merge branch 'v.0.15.1')
  • Loading branch information
ericpyle committed Nov 12, 2018
2 parents 8bfedfd + 5eca323 commit f082ab7
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 49 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/log-dev.txt
12 changes: 6 additions & 6 deletions app/components/DBLEntryRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ class DBLEntryRow extends PureComponent<Props> {
</div>
<div className={styles.bundleRowTopMiddle}>
<Tooltip title={this.props.entryPageUrl} placement="right">
<Button variant="flat" size="small" className={classes.button}
<Button variant="text" size="small" className={classes.button}
disabled={dblId === undefined}
onKeyPress={this.onOpenDBLEntryLink}
onClick={this.onOpenDBLEntryLink}
Expand Down Expand Up @@ -445,7 +445,7 @@ class DBLEntryRow extends PureComponent<Props> {
</div>
<div className={styles.bundleRowTopRightSide}>
{this.showStoredButton() && (
<Button variant="flat" size="small" className={classes.button}
<Button variant="text" size="small" className={classes.button}
onClick={this.onClickManageResources(resourceManagerMode)}
>
<ControlledHighlighter {...this.getHighlighterSharedProps(displayAs.status)} />
Expand All @@ -458,7 +458,7 @@ class DBLEntryRow extends PureComponent<Props> {
</div>
)}
{this.showDownloadButton() && (
<Button variant="flat" size="small" className={classes.button}
<Button variant="text" size="small" className={classes.button}
onKeyPress={this.onClickManageResources('download')}
onClick={this.onClickManageResources('download')}
>
Expand All @@ -481,7 +481,7 @@ class DBLEntryRow extends PureComponent<Props> {
{this.shouldShowEdit() &&
<Button
disabled={this.shouldDisableDraftRevisionOrEdit()}
variant="flat" size="small" className={classes.button}
variant="text" size="small" className={classes.button}
onKeyPress={this.onClickEditMetadata}
onClick={this.onClickEditMetadata}
>
Expand Down Expand Up @@ -540,7 +540,7 @@ class DBLEntryRow extends PureComponent<Props> {
))}
</Menu>
</div>}
<Button variant="flat" size="small" className={classes.button}
<Button variant="text" size="small" className={classes.button}
disabled={this.shouldDisableSaveTo()}
onKeyPress={this.startSaveBundleTo}
onClick={this.startSaveBundleTo}>
Expand All @@ -549,7 +549,7 @@ class DBLEntryRow extends PureComponent<Props> {
</Button>
<DeleteOrCleanButton {...this.props} shouldDisableCleanResources={this.shouldDisableCleanResources()} />
{this.shouldShowUpload() &&
<ConfirmButton classes={classes} variant="flat" size="small" className={classes.button}
<ConfirmButton classes={classes} variant="text" size="small" className={classes.button}
disabled={this.shouldDisableUpload()}
onKeyPress={this.onClickUploadBundle}
onClick={this.onClickUploadBundle}
Expand Down
4 changes: 2 additions & 2 deletions app/components/DeleteOrCleanButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class DeleteOrCleanButton extends Component<Props> {
const { status, classes, shouldDisableCleanResources } = this.props;
if (status === 'DRAFT') {
return (
<ConfirmButton classes={classes} variant="flat" size="small" className={classes.button}
<ConfirmButton classes={classes} variant="text" size="small" className={classes.button}
onKeyPress={this.onClickDeleteBundle}
onClick={this.onClickDeleteBundle}
>
Expand All @@ -48,7 +48,7 @@ class DeleteOrCleanButton extends Component<Props> {
);
}
return (
<ConfirmButton classes={classes} variant="flat" size="small" className={classes.button}
<ConfirmButton classes={classes} variant="text" size="small" className={classes.button}
disabled={shouldDisableCleanResources}
onKeyPress={this.onClickRemoveResources}
onClick={this.onClickRemoveResources}
Expand Down
2 changes: 1 addition & 1 deletion app/containers/WorkspacesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ class WorkspacesPage extends PureComponent<Props> {
<div style={{ flex: 1 }} />
<ConfirmButton
classes={classes}
variant="flat"
variant="text"
size="small"
onClick={this.onClickDeleteWorkspace(card)}
>
Expand Down
26 changes: 11 additions & 15 deletions app/main-process/autoUpdater.services.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import log from 'electron-log';
import path from 'path';
import { autoUpdater } from 'electron-updater';
import { dialog } from 'electron';

export const autoUpdaterServices = {
setupAutoUpdater
Expand All @@ -22,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/<app name>/log.log
* on OS X: ~/Library/Logs/<app name>/log.log
* on Windows: %USERPROFILE%\AppData\Roaming\<app name>\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
Expand Down Expand Up @@ -111,7 +97,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
Expand Down
19 changes: 17 additions & 2 deletions app/main.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,35 @@
*/
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/<app name>/log.log
* on OS X: ~/Library/Logs/<app name>/log.log
* on Windows: %USERPROFILE%\AppData\Roaming\<app name>\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();
}

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);
}
Expand Down Expand Up @@ -78,7 +93,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');
Expand Down
24 changes: 7 additions & 17 deletions app/menu.js
Original file line number Diff line number Diff line change
@@ -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);
Expand Down Expand Up @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion app/services/dbl_dot_local.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
}

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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\"",
Expand Down

0 comments on commit f082ab7

Please sign in to comment.