Skip to content

Commit

Permalink
Merge branch 'develop' into chore/ddw-656-log-daedalus-state-snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
DeeJayElly committed Jul 11, 2019
2 parents 59b983c + 06c7b3a commit cff9d70
Show file tree
Hide file tree
Showing 21 changed files with 14,220 additions and 652 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,7 @@ Changelog


### Features ### Features


- Implemented the animated Daedalus logo on the "Loading" screens ([PR 1457](https://github.com/input-output-hk/daedalus/pull/1457))
- Implemented "Delegation Setup wizard" steps 3 & 4 UI ([PR 1439](https://github.com/input-output-hk/daedalus/pull/1439)) - Implemented "Delegation Setup wizard" steps 3 & 4 UI ([PR 1439](https://github.com/input-output-hk/daedalus/pull/1439))
- Improved "Connectivity/Sync trouble notification" ([PR 1453](https://github.com/input-output-hk/daedalus/pull/1453)) - Improved "Connectivity/Sync trouble notification" ([PR 1453](https://github.com/input-output-hk/daedalus/pull/1453))
- Implemented "Delegation Setup wizard" step 2 UI ([PR 1430](https://github.com/input-output-hk/daedalus/pull/1430)) - Implemented "Delegation Setup wizard" step 2 UI ([PR 1430](https://github.com/input-output-hk/daedalus/pull/1430))
Expand Down Expand Up @@ -52,6 +53,8 @@ Changelog


### Chores ### Chores


- Improved the "Ada redemption" menu item UX by disabling the option while Daedalus is out of sync ([PR 1458](https://github.com/input-output-hk/daedalus/pull/1458))
- Added `themes:check` script for checking missing definitions on createTheme object ([PR 1424](https://github.com/input-output-hk/daedalus/pull/1424))
- Refactored the Loading screen, adding containers for each overlay ([PR 1446](https://github.com/input-output-hk/daedalus/pull/1446)) - Refactored the Loading screen, adding containers for each overlay ([PR 1446](https://github.com/input-output-hk/daedalus/pull/1446))
- Added button to open local state directory on Daedalus Diagnostics Screen ([PR 1438](https://github.com/input-output-hk/daedalus/pull/1438)) - Added button to open local state directory on Daedalus Diagnostics Screen ([PR 1438](https://github.com/input-output-hk/daedalus/pull/1438))
- Updated the list of contributors on the "About" screen ([PR 1450](https://github.com/input-output-hk/daedalus/pull/1450)) - Updated the list of contributors on the "About" screen ([PR 1450](https://github.com/input-output-hk/daedalus/pull/1450))
Expand Down
30 changes: 30 additions & 0 deletions gulpfile.js
Expand Up @@ -3,6 +3,7 @@ const webpack = require('webpack');
const webpackStream = require('webpack-stream'); const webpackStream = require('webpack-stream');
const shell = require('gulp-shell'); const shell = require('gulp-shell');
const electronConnect = require('electron-connect'); const electronConnect = require('electron-connect');
const flowRemoveTypes = require('gulp-flow-remove-types');
const mainWebpackConfig = require('./source/main/webpack.config'); const mainWebpackConfig = require('./source/main/webpack.config');
const rendererWebpackConfig = require('./source/renderer/webpack.config'); const rendererWebpackConfig = require('./source/renderer/webpack.config');


Expand Down Expand Up @@ -113,6 +114,30 @@ gulp.task('build:renderer:watch', buildRendererWatch());


gulp.task('build', gulp.series('clean:dist', 'build:main', 'build:renderer')); gulp.task('build', gulp.series('clean:dist', 'build:main', 'build:renderer'));


gulp.task('prepare:themes:utils', () =>
gulp
.src([
'source/renderer/app/themes/utils/checkCreateTheme.js',
'source/renderer/app/themes/utils/constants.js',
'source/renderer/app/themes/utils/createTheme.js',
'source/renderer/app/themes/utils/createShades.js',
'source/renderer/app/themes/utils/index.js',
])
.pipe(flowRemoveTypes())
.pipe(gulp.dest('dist/utils'))
);

gulp.task('prepare:themes:daedalus', () =>
gulp
.src([
'source/renderer/app/themes/daedalus/cardano.js',
'source/renderer/app/themes/daedalus/dark-blue.js',
'source/renderer/app/themes/daedalus/light-blue.js',
])
.pipe(flowRemoveTypes())
.pipe(gulp.dest('dist/daedalus'))
);

gulp.task( gulp.task(
'build:watch', 'build:watch',
gulp.series( gulp.series(
Expand All @@ -124,6 +149,11 @@ gulp.task(
) )
); );


gulp.task(
'build:themes',
gulp.series('clean:dist', 'prepare:themes:utils', 'prepare:themes:daedalus')
);

gulp.task( gulp.task(
'test:e2e:nodemon', 'test:e2e:nodemon',
shell.task( shell.task(
Expand Down
5 changes: 5 additions & 0 deletions package.json
Expand Up @@ -28,6 +28,7 @@
"manage:translations": "gulp purge:translations && gulp clear:cache && gulp build && node ./translations/translation-runner.js", "manage:translations": "gulp purge:translations && gulp clear:cache && gulp build && node ./translations/translation-runner.js",
"storybook": "start-storybook -p 6006 -c storybook", "storybook": "start-storybook -p 6006 -c storybook",
"storybook:build": "build-storybook -c storybook -o dist/storybook", "storybook:build": "build-storybook -c storybook -o dist/storybook",
"themes:check": "gulp build:themes && node -r esm ./dist/utils/index.js",
"clear:cache": "gulp clear:cache", "clear:cache": "gulp clear:cache",
"nix:dev": "nix-shell --arg autoStartBackend true --arg allowFaultInjection true --arg systemStart", "nix:dev": "nix-shell --arg autoStartBackend true --arg allowFaultInjection true --arg systemStart",
"nix:staging": "nix-shell --arg autoStartBackend true --argstr cluster staging" "nix:staging": "nix-shell --arg autoStartBackend true --argstr cluster staging"
Expand Down Expand Up @@ -61,6 +62,7 @@
"bufferutil": "4.0.0", "bufferutil": "4.0.0",
"cache-loader": "2.0.1", "cache-loader": "2.0.1",
"chai": "4.2.0", "chai": "4.2.0",
"chalk": "2.4.2",
"concurrently": "4.1.0", "concurrently": "4.1.0",
"cross-env": "5.2.0", "cross-env": "5.2.0",
"css-loader": "2.0.1", "css-loader": "2.0.1",
Expand All @@ -85,9 +87,11 @@
"eslint-plugin-jsx-a11y": "6.1.2", "eslint-plugin-jsx-a11y": "6.1.2",
"eslint-plugin-promise": "4.0.1", "eslint-plugin-promise": "4.0.1",
"eslint-plugin-react": "7.11.1", "eslint-plugin-react": "7.11.1",
"esm": "3.2.25",
"faker": "4.1.0", "faker": "4.1.0",
"file-loader": "2.0.0", "file-loader": "2.0.0",
"flow-bin": "0.98.1", "flow-bin": "0.98.1",
"gulp-flow-remove-types": "1.0.0",
"gulp-shell": "0.6.5", "gulp-shell": "0.6.5",
"hash.js": "1.1.7", "hash.js": "1.1.7",
"html-loader": "0.5.5", "html-loader": "0.5.5",
Expand Down Expand Up @@ -162,6 +166,7 @@
"react-dom": "16.6.3", "react-dom": "16.6.3",
"react-dropzone": "4.2.3", "react-dropzone": "4.2.3",
"react-intl": "2.7.2", "react-intl": "2.7.2",
"react-lottie": "1.2.3",
"react-markdown": "3.1.0", "react-markdown": "3.1.0",
"react-number-format": "3.0.3", "react-number-format": "3.0.3",
"react-polymorph": "0.8.7", "react-polymorph": "0.8.7",
Expand Down
2 changes: 2 additions & 0 deletions source/main/menus/osx.js
Expand Up @@ -20,6 +20,7 @@ export const osxMenu = (
actions: MenuActions, actions: MenuActions,
translations: {}, translations: {},
supportRequestData: SupportRequests, supportRequestData: SupportRequests,
isNodeInSync: boolean,
translation: Function = getTranslation(translations, id) translation: Function = getTranslation(translations, id)
) => [ ) => [
{ {
Expand All @@ -33,6 +34,7 @@ export const osxMenu = (
}, },
{ {
label: translation('daedalus.adaRedemption'), label: translation('daedalus.adaRedemption'),
enabled: isNodeInSync,
click() { click() {
actions.openAdaRedemptionScreen(); actions.openAdaRedemptionScreen();
}, },
Expand Down
2 changes: 2 additions & 0 deletions source/main/menus/win-linux.js
Expand Up @@ -20,6 +20,7 @@ export const winLinuxMenu = (
actions: MenuActions, actions: MenuActions,
translations: {}, translations: {},
supportRequestData: SupportRequests, supportRequestData: SupportRequests,
isNodeInSync: boolean,
translation: Function = getTranslation(translations, id) translation: Function = getTranslation(translations, id)
) => [ ) => [
{ {
Expand All @@ -33,6 +34,7 @@ export const winLinuxMenu = (
}, },
{ {
label: translation('daedalus.adaRedemption'), label: translation('daedalus.adaRedemption'),
enabled: isNodeInSync,
click() { click() {
actions.openAdaRedemptionScreen(); actions.openAdaRedemptionScreen();
}, },
Expand Down
14 changes: 12 additions & 2 deletions source/main/utils/buildAppMenus.js
@@ -1,5 +1,6 @@
// @flow // @flow
import { app, globalShortcut, Menu, BrowserWindow } from 'electron'; import { app, globalShortcut, Menu, BrowserWindow } from 'electron';
import { get } from 'lodash';
import { environment } from '../environment'; import { environment } from '../environment';
import { winLinuxMenu } from '../menus/win-linux'; import { winLinuxMenu } from '../menus/win-linux';
import { osxMenu } from '../menus/osx'; import { osxMenu } from '../menus/osx';
Expand Down Expand Up @@ -92,9 +93,17 @@ export const buildAppMenus = async (


// Build app menus // Build app menus
let menu; let menu;
const isNodeInSync = get(cardanoNode, 'status.isNodeInSync', false);
if (isMacOS) { if (isMacOS) {
menu = Menu.buildFromTemplate( menu = Menu.buildFromTemplate(
osxMenu(app, mainWindow, menuActions, translations, supportRequestData) osxMenu(
app,
mainWindow,
menuActions,
translations,
supportRequestData,
isNodeInSync
)
); );
Menu.setApplicationMenu(menu); Menu.setApplicationMenu(menu);
} else { } else {
Expand All @@ -104,7 +113,8 @@ export const buildAppMenus = async (
mainWindow, mainWindow,
menuActions, menuActions,
translations, translations,
supportRequestData supportRequestData,
isNodeInSync
) )
); );
mainWindow.setMenu(menu); mainWindow.setMenu(menu);
Expand Down
@@ -1,37 +1,58 @@
// @flow // @flow
import React from 'react'; import React, { Component } from 'react';
import SVGInline from 'react-svg-inline'; import SVGInline from 'react-svg-inline';
import classNames from 'classnames'; import classNames from 'classnames';
import Lottie from 'react-lottie';
import styles from './LogosDisplay.scss'; import styles from './LogosDisplay.scss';
import adaLogo from '../../../assets/images/ada-logo.inline.svg'; import adaLogo from '../../../assets/images/ada-logo.inline.svg';
import daedalusLogo from '../../../assets/images/daedalus-logo-loading-grey.inline.svg';
import cardanoLogo from '../../../assets/images/cardano-logo.inline.svg'; import cardanoLogo from '../../../assets/images/cardano-logo.inline.svg';
import animationData from './logo-animation-data.json';


type Props = { type Props = {
isConnected: boolean, isConnected: boolean,
}; };


const LogosDisplay = ({ isConnected }: Props) => { const logoAnimationOptionsLottie = {
const currencyLogoStyles = classNames([ loop: true,
styles['ada-logo'], autoplay: true,
!isConnected ? styles.connectingLogo : styles.syncingLogo, animationData,
]); rendererSettings: {
const daedalusLogoStyles = classNames([ preserveAspectRatio: 'xMidYMid slice',
styles.daedalusLogo, },
!isConnected ? styles.connectingLogo : styles.syncingLogo,
]);
const apiLogoStyles = classNames([
styles['ada-apiLogo'],
!isConnected ? styles.connectingLogo : styles.syncingLogo,
]);

return (
<div className={styles.component}>
<SVGInline svg={adaLogo} className={currencyLogoStyles} />
<SVGInline svg={daedalusLogo} className={daedalusLogoStyles} />
<SVGInline svg={cardanoLogo} className={apiLogoStyles} />
</div>
);
}; };


export default LogosDisplay; export default class LogosDisplay extends Component<Props> {
componentDidMount() {
// Manual adjustment due to `logo-animation-data.json` canvas size
const svg: Object = document.querySelector(
'.LogosDisplay_daedalusLogo svg'
);
svg.setAttribute('viewBox', '534 250 212 220');
}

render() {
const { isConnected } = this.props;
const currencyLogoStyles = classNames([
styles['ada-logo'],
!isConnected ? styles.connectingLogo : styles.syncingLogo,
]);
const daedalusLogoStyles = classNames([
styles.daedalusLogo,
!isConnected ? styles.connectingLogo : styles.syncingLogo,
]);
const apiLogoStyles = classNames([
styles['ada-apiLogo'],
!isConnected ? styles.connectingLogo : styles.syncingLogo,
]);

return (
<div className={styles.component}>
<SVGInline svg={adaLogo} className={currencyLogoStyles} />
<div className={daedalusLogoStyles}>
<Lottie options={logoAnimationOptionsLottie} />
</div>
<SVGInline svg={cardanoLogo} className={apiLogoStyles} />
</div>
);
}
}
Expand Up @@ -27,19 +27,21 @@ $adaLogoWidth: 43px;
} }


.daedalusLogo { .daedalusLogo {
& > svg { width: 173px;
display: block; height: 135px;
margin: 0 114px;
svg {
width: 173px; width: 173px;
margin: 0 114px; height: 135px;
} }
} }


.connectingLogo { .connectingLogo {
& > svg path { & svg > g > g path {
fill: var(--theme-icon-connecting-logo-color); fill: var(--theme-icon-connecting-logo-color);
} }
} }


.syncingLogo svg path { .syncingLogo svg > g > g path {
fill: var(--theme-icon-syncing-logo-color); fill: var(--theme-icon-syncing-logo-color);
} }

0 comments on commit cff9d70

Please sign in to comment.