Skip to content
Permalink
Browse files

Merge #1347

1347: [DDW-597] Fix pre-push hook r=nikolaglumac a=DominikGuzei

This PR changes the `pre-push` hook to just do a formatting check … so the developer has to fix the formatting manually and commit those changes appropriately.

## NO QA NEEDED

---

## Review Checklist:

### Basics

- [ ] PR is updated to the most recent version of target branch (and there are no conflicts)
- [ ] PR has good description that summarizes all changes and shows some screenshots or animated GIFs of important UI changes
- [ ] CHANGELOG entry has been added and is linked to the correct PR on GitHub
- [ ] Automated tests: All acceptance tests are passing (`yarn run test`)
- [ ] Manual tests (minimum tests should cover newly added feature/fix): App works correctly in *development* build (`yarn run dev`)
- [ ] Manual tests (minimum tests should cover newly added feature/fix): App works correctly in *production* build (`yarn run package` / CI builds)
- [ ] There are no *flow* errors or warnings (`yarn run flow:test`)
- [ ] There are no *lint* errors or warnings (`yarn run lint`)
- [ ] Text changes are proofread and approved (Jane Wild)
- [ ] There are no missing translations (running `yarn run manage:translations` produces no changes)
- [ ] UI changes look good in all themes (Alexander Rukin)
- [ ] Storybook works and no stories are broken (`yarn run storybook`)
- [ ] In case of dependency changes `yarn.lock` file is updated

### Code Quality
- [ ] Important parts of the code are properly documented and commented
- [ ] Code is properly typed with flow
- [ ] React components are split-up enough to avoid unnecessary re-rendering
- [ ] Any code that only works in Electron is neatly separated from components

### Testing
- [ ] New feature / change is covered by acceptance tests
- [ ] All existing acceptance tests are still up-to-date
- [ ] New feature / change is covered by Daedalus Testing scenario
- [ ] All existing Daedalus Testing scenarios are still up-to-date

### After Review:
- [ ] Merge PR
- [ ] Delete source branch
- [ ] Move ticket to `done` on the Youtrack board


Co-authored-by: Dominik Guzei <dominik.guzei@gmail.com>
Co-authored-by: nglumac <niglumac@gmail.com>
  • Loading branch information...
3 people committed Mar 13, 2019
2 parents a8fcb1e + c7299f2 commit 575fd05c533f7df6d93331c6e421e0952fec3d6b
Showing with 42 additions and 22 deletions.
  1. +23 −0 .prettierignore
  2. +1 −1 CHANGELOG.md
  3. +5 −3 package.json
  4. +11 −15 source/main/windows/main.js
  5. +2 −3 source/renderer/app/containers/Root.js
@@ -0,0 +1,23 @@
# Let's start by ignoring everything
/*

# But not the following folders
!source/
!features/
!storybook/

# Now we ignore all files
*.*

# But not these file types
!*.js
!*.scss
!*.json

# Ignore any top-level json file except package.json
/*.json
!package.json

# Ignore the following special folders and files
source/renderer/app/i18n/locales/
features/support/default-wallet.json
@@ -5,7 +5,7 @@ Changelog

### Chores

- Implemented `pretier` formatting tool and set up automation for basic maintainance tasks ([PR 1335](https://github.com/input-output-hk/daedalus/pull/1335))
- Implemented `pretier` formatting tool and set up automation for basic maintainance tasks ([PR 1335](https://github.com/input-output-hk/daedalus/pull/1335), [PR 1347](https://github.com/input-output-hk/daedalus/pull/1347))
- Replaced "Ada" with "ada" ([PR 1317](https://github.com/input-output-hk/daedalus/pull/1317), [PR 1336](https://github.com/input-output-hk/daedalus/pull/1336))
- Improved the internal IPC communication ([PR 1332](https://github.com/input-output-hk/daedalus/pull/1332))
- Improved Webpack 4 build performance ([PR 1320](https://github.com/input-output-hk/daedalus/pull/1320))
@@ -23,7 +23,9 @@
"cucumber:watch:debug": "KEEP_APP_AFTER_TESTS=true npm run cucumber -- --tags @watch",
"lint": "eslint --format=node_modules/eslint-formatter-pretty source features storybook *.js",
"flow:test": "flow; test $? -eq 0 -o $? -eq 2",
"prettier": "./node_modules/.bin/prettier --write --ignore-path .eslintignore --loglevel warn \"./**/*.{js,scss,json}\"",
"prettier": "./node_modules/.bin/prettier \"**/*.*\"",
"prettier:check": "yarn prettier --check",
"prettier:format": "yarn prettier --write --loglevel warn",
"manage:translations": "gulp purge:translations && gulp clear:cache && gulp build && node ./translations/translation-runner.js",
"storybook": "start-storybook -p 6006 -c storybook",
"clear:cache": "gulp clear:cache",
@@ -182,8 +184,8 @@
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged --pattern \"./**/*.{js,scss,json}\"",
"pre-push": "yarn prettier && yarn lint && yarn flow:test && yarn manage:translations"
"pre-commit": "pretty-quick --staged",
"pre-push": "yarn prettier:check && yarn lint && yarn flow:test && yarn manage:translations"
}
}
}
@@ -13,10 +13,7 @@ const { isDev, isTest, buildLabel, isLinux } = environment;

const id = 'window';

const getWindowTitle = (
isInSafeMode: boolean,
locale: string,
): string => {
const getWindowTitle = (isInSafeMode: boolean, locale: string): string => {
const translations = require(`../locales/${locale}`);
const translation = getTranslation(translations, id);
let title = buildLabel;
@@ -37,10 +34,7 @@ type WindowOptionsType = {
icon?: string,
};

export const createMainWindow = (
isInSafeMode: boolean,
locale: string,
) => {
export const createMainWindow = (isInSafeMode: boolean, locale: string) => {
const windowOptions: WindowOptionsType = {
show: false,
width: 1150,
@@ -49,8 +43,8 @@ export const createMainWindow = (
nodeIntegration: isTest,
webviewTag: false,
enableRemoteModule: isTest,
preload: path.join(__dirname, './preload.js')
}
preload: path.join(__dirname, './preload.js'),
},
};

if (isLinux) {
@@ -74,13 +68,15 @@ export const createMainWindow = (
});

// Provide render process with an api to close the main window
ipcMain.on('close-window', (event) => {
ipcMain.on('close-window', event => {
if (event.sender !== window.webContents) return;
window.close();
});

window.loadURL(`file://${__dirname}/../renderer/index.html`);
window.on('page-title-updated', event => { event.preventDefault(); });
window.on('page-title-updated', event => {
event.preventDefault();
});
window.setTitle(getWindowTitle(isInSafeMode, locale));

window.webContents.on('context-menu', (e, props) => {
@@ -95,7 +91,7 @@ export const createMainWindow = (
label: 'Inspect element',
click() {
window.inspectElement(x, y);
}
},
});
}

@@ -127,11 +123,11 @@ export const createMainWindow = (
app.quit();
});

window.webContents.on('did-fail-load', (err) => {
window.webContents.on('did-fail-load', err => {
rendererErrorHandler.onError('did-fail-load', err);
});

window.webContents.on('crashed', (err) => {
window.webContents.on('crashed', err => {
rendererErrorHandler.onError('crashed', err);
});

@@ -25,10 +25,9 @@ export default class Root extends Component<Props> {
isNotEnoughDiskSpace,
} = networkStatus;

const isPageThatDoesntNeedWallets = (
const isPageThatDoesntNeedWallets =
isBlockConsolidationStatusPage ||
(isAdaRedemptionPage && hasLoadedWallets && isSynced)
);
(isAdaRedemptionPage && hasLoadedWallets && isSynced);

// In case node is in stopping sequence we must show the "Connecting" screen
// with the "Stopping Cardano node..." and "Cardano node stopped" messages

0 comments on commit 575fd05

Please sign in to comment.
You can’t perform that action at this time.