Fix Context Menu Popup Parameters (#1957)

* Revamp app status to be event listener based

* Move test scripts to their own folder, set scripts to fail on any command failure

* Make scripts executable

* Fix context menu params
This commit is contained in:
HenryNguyen5 2018-06-15 19:26:09 -04:00 committed by Daniel Ternyak
parent cb92f59e57
commit 4b45f813b3
4 changed files with 43 additions and 20 deletions

View File

@ -35,29 +35,19 @@ before_install:
sh -e /etc/init.d/xvfb start
# uncomment once integration tests are included in CI
# docker pull dternyak/eth-priv-to-addr:latest
sudo apt-get install libusb-1.0
sudo apt-get install libusb-1.0
fi
install:
- yarn --silent
script:
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
npm run prettier:diff
npm run test:coverage -- --maxWorkers=2
npm run report-coverage
npm run tslint
npm run tscheck
npm run freezer
npm run freezer:validate
fi
before_script:
- chmod +x ./travis-scripts/test-{linux,osx}.sh
script:
- ./travis-scripts/test-linux.sh
- ./travis-scripts/test-osx.sh
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
npm run build:electron
ls -la dist/electron-builds
fi
notifications:
email:

View File

@ -1,4 +1,11 @@
import { MenuItemConstructorOptions, shell, BrowserWindow, Menu, clipboard } from 'electron';
import {
MenuItemConstructorOptions,
shell,
BrowserWindow,
Menu,
clipboard,
PopupOptions
} from 'electron';
import { URL } from 'url';
function popupContextMenu(
@ -86,7 +93,14 @@ function popupContextMenu(
}
const ctxMenu = Menu.buildFromTemplate(ctxMenuTmpl);
ctxMenu.popup(window, props);
const popupOpts: PopupOptions = {
window,
x: props.x,
y: props.y
};
ctxMenu.popup(popupOpts);
}
export default popupContextMenu;

12
travis-scripts/test-linux.sh Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -ev # return value 1 (error) if any command fails, and display each command before its run
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
yarn prettier:diff
yarn test:coverage -- --maxWorkers=2
yarn report-coverage
yarn tslint
yarn tscheck
yarn freezer
yarn freezer:validate
fi

7
travis-scripts/test-osx.sh Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -ev # return value 1 (error) if any command fails, and display each command before its run
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
yarn build:electron
ls -la dist/electron-builds
fi