Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge dev into master for 1.6.0 #144

Closed
wants to merge 26 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e670c98
fix: plugin refactor v1 (#121)
marcgarreau Aug 2, 2019
fb64311
fix: refactor plugin actions and service (#122)
marcgarreau Aug 2, 2019
85a5090
fix: plugin name refactor v3 (#123)
marcgarreau Aug 2, 2019
8c34def
chore: Renames `ClientConfig` and inside `client` references to `Plug…
ryanio Aug 4, 2019
64917e3
chore: refactor client PluginService funcs into ClientService (#125)
ryanio Aug 5, 2019
983dde1
chore: refactor service to plugin (#127)
marcgarreau Aug 7, 2019
a96ce02
chore: update README with latest links/screenshot (#128)
marcgarreau Aug 7, 2019
32f5518
fix: disable FlagPreview on running (#129)
ryanio Aug 16, 2019
7765008
chore: remove stale files (#130)
marcgarreau Aug 17, 2019
d68188e
feat: Reinstate Node Info (#126)
ryanio Aug 17, 2019
8c37676
feat: About tab (#132)
ryanio Aug 22, 2019
57b29e6
fix: remove popup cruft (#135)
marcgarreau Aug 28, 2019
4cb660b
feat: omits required settings from form UI (#136)
marcgarreau Aug 29, 2019
a367063
chore: bump grid-ui version (#134)
ryanio Aug 30, 2019
981f971
fix: excess width in metadata (#138)
marcgarreau Aug 30, 2019
7ebecd2
feat: App Badges (#141)
ryanio Sep 4, 2019
3a01b15
fix: show 404 on app load fail (#104)
ryanio Sep 4, 2019
724a6fd
UI Improvements (#142)
PhilippLgh Sep 4, 2019
892bb92
bump version
PhilippLgh Sep 4, 2019
fbbbc28
fix: window height
PhilippLgh Sep 4, 2019
87fb134
fix: adjust width
PhilippLgh Sep 4, 2019
52f64c3
fix: node info position (#143)
ryanio Sep 4, 2019
333fde0
fix: pulse on new block (#140)
ryanio Sep 4, 2019
189760e
feat: dispatch `clearPluginErrors` for nano on Terminal tab click or …
ryanio Sep 4, 2019
bfc30b2
Merge branch 'master' into dev
PhilippLgh Sep 5, 2019
1222a51
fix: uncleared peer and sync intervals (#145)
marcgarreau Sep 5, 2019
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

UI Improvements (#142)

* fix: use same bg colors as nano

* remove top nav bar

* fix prevent window scroll bars

* reduce font size in sidebar

* replace file name parser with release metadata

* adjust plugin list

* feat: add custom window ui wrapper

* add fallback to frame on windows

* fix: limit tab container height +custom scrollbars

* change api to functiion

* allow drawer to be collapsed

* limit tab container width to 100%

* fix: terminal width

* fix: typography + dependency list

* show drawer

* feat: add dependency card to about

* make flag preview multiline

* feat: open cache on 'downloaded versions' click

* fix: app overview scrolling

* fix: container without window frame

* feat: show extraction progress

* fix linter warnings

* fix contrast for refresh icon

* fix: linter issue
  • Loading branch information...
PhilippLgh committed Sep 4, 2019
commit 724a6fdd6bd94f62de49acefdafa94156017a4b4
@@ -37,6 +37,7 @@
"prop-types": "^15.6.2",
"react": "^16.4.1",
"react-codemirror2": "^6.0.0",
"react-desktop": "^0.3.9",
"react-dom": "^16.4.1",
"react-md-spinner": "^0.3.0",
"react-minimal-pie-chart": "^3.5.0",
@@ -2,10 +2,10 @@ import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { MuiThemeProvider } from '@material-ui/core/styles'
import CssBaseline from '@material-ui/core/CssBaseline'
import NavTabs from './NavTabs'
import { darkTheme, lightTheme } from '../theme'
import HelpFab from './shared/HelpFab'
import ErrorBoundary from './GenericErrorBoundary'
import Plugins from './Plugins'

export default class NewApp extends Component {
static displayName = 'App'
@@ -21,7 +21,7 @@ export default class NewApp extends Component {
<CssBaseline />
<HelpFab />
<ErrorBoundary>
<NavTabs />
<Plugins />
</ErrorBoundary>
</MuiThemeProvider>
)
@@ -13,7 +13,7 @@ class AppsOverview extends React.Component {

return (
<MuiThemeProvider theme={darkTheme}>
<div style={{ width: '100%', paddingBottom: '64px' }}>
<div style={{ margin: '24px' }}>
<Grid container spacing={24}>
{apps.length ? (
apps.map(app => (
@@ -1,11 +1,12 @@
import React, { Component } from 'react'
import React, { Component, Fragment } from 'react'
import { connect } from 'react-redux'
import PropTypes from 'prop-types'
import { withStyles } from '@material-ui/core/styles'
import Typography from '@material-ui/core/Typography'
import Grid from '@material-ui/core/Grid'
import GridAPI from '../../../API/Grid'
import AppItem from '../../Apps/AppItem'
import DependencyCard from './DependencyCard'

const styles = {
spacing: {
@@ -49,13 +50,13 @@ class AboutPlugin extends Component {

const renderList = links.map(link => (
<a href={link.url} className={classes.link} key={link.name}>
<Typography variant="body1">{link.name}</Typography>
<Typography variant="body2">{link.name}</Typography>
</a>
))

return (
<div>
<Typography variant="body1" className={classes.headerText}>
<Typography variant="h6" className={classes.headerText}>
{name}
</Typography>
{renderList}
@@ -100,7 +101,7 @@ class AboutPlugin extends Component {
return (
<div>
<Typography
variant="body1"
variant="h6"
className={classes.headerText}
style={{ marginTop: 30 }}
>
@@ -111,9 +112,32 @@ class AboutPlugin extends Component {
)
}

renderDependencies = dependencies => {
const { classes } = this.props
const { runtime: runtimeDependencies } = dependencies
return (
<Fragment>
<Typography
variant="h6"
style={{ marginTop: 30 }}
className={classes.headerText}
>
Dependencies
</Typography>
<Grid container spacing={24} style={{ marginTop: 30 }}>
<Grid item xs={4}>
{runtimeDependencies.map(dependency => (
<DependencyCard dependency={dependency} key={dependency.name} />
))}
</Grid>
</Grid>
</Fragment>
)
}

render() {
const { plugin, classes } = this.props
const { about } = plugin
const { about, dependencies } = plugin

if (!about) return <p>Plugin has no about data.</p>

@@ -124,15 +148,15 @@ class AboutPlugin extends Component {
<div>
<div>
<Typography
variant="body1"
variant="h6"
className={classes.headerText}
style={{ marginTop: 30 }}
>
Description
</Typography>
</div>
<div>
<Typography variant="body1">{description}</Typography>
<Typography variant="body2">{description}</Typography>
</div>
</div>
)}
@@ -147,6 +171,7 @@ class AboutPlugin extends Component {
{this.renderLinks(community, 'Community')}
</Grid>
</Grid>
{dependencies && this.renderDependencies(dependencies)}
{this.renderApps()}
</div>
)
@@ -0,0 +1,73 @@
import React from 'react'
import PropTypes from 'prop-types'
import { withStyles } from '@material-ui/core/styles'
import Card from '@material-ui/core/Card'
import CardContent from '@material-ui/core/CardContent'
import CardMedia from '@material-ui/core/CardMedia'
import CardActions from '@material-ui/core/CardActions'
import CardHeader from '@material-ui/core/CardHeader'
import Typography from '@material-ui/core/Typography'
import Button from '../../shared/Button'
import Grid from '../../../API/Grid'

// FIXME don't hotlink
const JAVA_LOGO =
'https://upload.wikimedia.org/wikipedia/de/thumb/e/e1/Java-Logo.svg/364px-Java-Logo.svg.png'

const styles = {
card: {
maxWidth: 230,
background: '#222428'
},
media: {
height: 0,
paddingTop: '75%', // 4:3
padding: '10%'
},
title: {
fontSize: 14
}
}

class AppItem extends React.Component {
static propTypes = {
classes: PropTypes.object.isRequired,
dependency: PropTypes.object.isRequired
}

state = {}

handleAppLaunch = () => {
Grid.openExternalLink(
'http://www.oracle.com/technetwork/java/javase/downloads/index.html'
)
}

render() {
const { classes, dependency } = this.props
const { name, type, version } = dependency
const description = `Required version: ${type} ${version} 64Bit`
const logo = name === 'Java' ? JAVA_LOGO : undefined
return (
<Card className={classes.card}>
{logo ? (
<CardMedia
className={classes.media}
image={logo}
style={{ backgroundSize: 'contain' }}
/>
) : (
<CardHeader title={name} />
)}
<CardContent>
<Typography component="p">{description}</Typography>
</CardContent>
<CardActions style={{ justifyContent: 'center' }}>
<Button onClick={this.handleAppLaunch}>Install {name}</Button>
</CardActions>
</Card>
)
}
}

export default withStyles(styles)(AppItem)
@@ -42,6 +42,7 @@ class FlagPreview extends Component {
<TextField
label="Generated Flags"
variant="outlined"
multiline
value={flags.join(' ')}
onChange={this.handleChange}
disabled={isPluginRunning || !isEditingFlags}
@@ -23,6 +23,8 @@ export default class VersionListItem extends Component {
state = {
isDownloading: false,
downloadProgress: 0,
extractionProgress: 0,
extractedFile: '',
isHovered: false
}

@@ -37,26 +39,9 @@ export default class VersionListItem extends Component {

releaseDisplayName = release => {
const { plugin } = this.props
const { fileName } = release
try {
const nameParts = fileName.split('-')
let name = nameParts[0]
// fixes: "geth alltools" vs clef
if (name !== plugin.displayName) {
name = plugin.displayName
}
const osTypes = ['darwin', 'linux', 'windows']
const os = nameParts.find(p => osTypes.includes(p)) || ''
let arch = nameParts[2]
if (os === 'windows') {
arch = arch === '386' ? '32 Bit' : '64 Bit'
}
const version = nameParts.find(p => p.includes('.'))
// const channel = nameParts[4]
return `${name} ${os} ${version} (${arch})`
} catch (error) {
return fileName
}
const { displayName } = plugin
const { platform, arch, displayVersion } = release
return `${displayName} ${displayVersion} - ${platform} (${arch})`
}

downloadRelease = release => {
@@ -67,14 +52,27 @@ export default class VersionListItem extends Component {
this.setState({ isDownloading: true }, async () => {
let localRelease
try {
localRelease = await plugin.download(release, downloadProgress => {
if (this._isMounted) this.setState({ downloadProgress })
})
localRelease = await plugin.download(
release,
downloadProgress => {
if (this._isMounted) this.setState({ downloadProgress })
},
(extractionProgress, extractedFile) => {
if (this._isMounted) {
this.setState({ extractionProgress, extractedFile })
}
}
)
} catch (error) {
handleDownloadError(error)
}
if (this._isMounted) {
this.setState({ isDownloading: false, downloadProgress: 0 })
this.setState({
isDownloading: false,
downloadProgress: 0,
extractionProgress: 0,
extractedFile: ''
})
}
handleReleaseDownloaded(localRelease)
})
@@ -91,11 +89,20 @@ export default class VersionListItem extends Component {

renderIcon = release => {
const { isSelectedRelease } = this.props
const { downloadProgress, isDownloading, isHovered } = this.state
const {
downloadProgress,
isDownloading,
extractionProgress,
isHovered
} = this.state
let icon = <BlankIconPlaceholder />
if (isDownloading) {
icon = (
<Spinner variant="determinate" size={20} value={downloadProgress} />
<Spinner
variant="determinate"
size={20}
value={extractionProgress || downloadProgress}
/>
)
} else if (release.remote) {
icon = <CloudDownloadIcon color={isHovered ? 'primary' : 'inherit'} />
@@ -114,7 +121,12 @@ export default class VersionListItem extends Component {

render() {
const { isSelectedRelease, release } = this.props
const { downloadProgress, isDownloading } = this.state
const {
downloadProgress,
isDownloading,
extractionProgress,
extractedFile
} = this.state

let actionLabel = 'Use'
if (!release.remote) {
@@ -125,7 +137,7 @@ export default class VersionListItem extends Component {
} else {
actionLabel = 'Download'
if (isDownloading) {
actionLabel = 'Downloading'
actionLabel = extractionProgress > 0 ? 'Extracting' : 'Downloading'
}
}

@@ -145,7 +157,14 @@ export default class VersionListItem extends Component {
<ListItemTextVersion
primary={this.releaseDisplayName(release)}
isLocalRelease={!release.remote}
secondary={downloadProgress > 0 ? `${downloadProgress}%` : null}
secondary={
// eslint-disable-next-line no-nested-ternary
extractionProgress > 0
? `${extractionProgress}% - ${extractedFile}`
: downloadProgress > 0
? `${downloadProgress}%`
: null
}
/>
<StyledListItemAction>
<Typography
@@ -9,7 +9,7 @@ import Spinner from '../../../shared/Spinner'
const styles = () => ({
refreshIcon: {
fontSize: 22,
color: 'rgba(0,0,0,0.25)',
color: 'rgba(100,100,100,0.35)',
marginLeft: 5,
verticalAlign: 'middle',
marginBottom: 4,
@@ -33,7 +33,8 @@ class VersionsAvailableText extends Component {
loadingReleases: PropTypes.bool,
localReleaseCount: PropTypes.number,
totalReleaseCount: PropTypes.number,
lastLoadTimestamp: PropTypes.number
lastLoadTimestamp: PropTypes.number,
onClick: PropTypes.func
}

render() {
@@ -42,7 +43,8 @@ class VersionsAvailableText extends Component {
loadingReleases,
localReleaseCount,
totalReleaseCount,
lastLoadTimestamp
lastLoadTimestamp,
onClick
} = this.props

return (
@@ -67,7 +69,13 @@ class VersionsAvailableText extends Component {
)}

<Typography>
<StyledDownloadedVersions>
<StyledDownloadedVersions
onClick={onClick || (() => {})}
style={{
textDecoration: 'underline',
cursor: 'pointer'
}}
>
{localReleaseCount}{' '}
{localReleaseCount === 1 ? 'release' : 'releases'} downloaded
</StyledDownloadedVersions>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.