Skip to content

Commit 9714217

Browse files
authored
Merge pull request #254 from Dan-Nolan/task/remove_unused_fields
Cleanup Unused Features
2 parents 85dab8c + 53796a2 commit 9714217

7 files changed

Lines changed: 10 additions & 169 deletions

File tree

client/src/components/ide/configuration/CodeStageConfig.jsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,15 @@ const TEST_FRAMEWORK_HINT = 'The framework used for test assertions';
99
const FORK_MAINNET_BLOCK_HINT = 'The block from which to fork the mainnet Ethereum blockchain';
1010

1111
const languageVersionOptions = [
12-
{ label: 'Solidity v0.4.19', value: '0.4.19' },
13-
{ label: 'Solidity v0.5.0', value: '0.5.0' },
1412
{ label: 'Solidity v0.6.2', value: '0.6.2' },
1513
{ label: 'Solidity v0.7.5', value: '0.7.5' },
16-
{ label: 'Vyper v0.1', value: '0.1.0b3' },
1714
{ label: 'Node 10.x', value: '10.x' },
1815
{ label: 'Node 10.x w/ Babel', value: '10.x/babel' },
19-
{ label: 'Node 8.x', value: '8.x' },
20-
{ label: 'Node 8.x w/ Babel', value: '8.x/babel' },
21-
{ label: 'Node 6.x', value: '6.x' },
22-
{ label: 'Node 6.x w/ Babel', value: '6.x/babel' },
2316
]
2417

2518
const frameworkOptions = [
26-
{ label: 'Mocha', value: 'mocha_bdd' },
27-
{ label: 'Truffle With Mocha', value: 'truffle_with_mocha' },
19+
{ label: 'JavaScript Mocha', value: 'mocha_bdd' },
20+
{ label: 'Hardhat Solidity', value: 'truffle_with_mocha' },
2821
]
2922

3023
class CodeStageConfig extends Component {

client/src/components/ide/configuration/ContainerConfig.jsx

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { Component } from 'react';
2-
import StyledSwitch from 'components/forms/StyledSwitch';
32
import StyledSelect from 'components/forms/StyledSelect';
43
import StyledInput from 'components/forms/StyledInput';
54
import apiMutation from 'utils/api/mutation';
@@ -11,12 +10,8 @@ import SVG from 'components/SVG';
1110
import './ContainerConfig.scss';
1211

1312
const TITLE_HINT = 'Short name displayed to the user';
14-
const DESCRIPTION_HINT = 'Description of this Contents purpose';
1513
const VERSION_HINT = 'Uniquely identifies this Content in its group';
16-
const ESTIMATED_TIME_HINT = 'How long a user should expect to complete this';
17-
const THUMBNAIL_HINT = 'You give us a web URL of an image, we\'ll show it the user';
1814
const TYPE_HINT = 'Tells the user what kind of content to expect';
19-
const PRODUCTION_READY_HINT = 'When deployed, should this be shown to users?';
2015

2116
const typeOptions = [
2217
{ label: 'Challenge', value: 'Challenge' },
@@ -37,10 +32,6 @@ const containerVariables = [
3732
const groupVariables = [
3833
['id', 'String'],
3934
['title', 'String'],
40-
['description', 'String'],
41-
['productionReady', 'Boolean'],
42-
['thumbnailUrl', 'String'],
43-
['estimatedTime', 'Int'],
4435
];
4536

4637
const containerMutation = `
@@ -119,9 +110,7 @@ class ContainerConfig extends Component {
119110
render() {
120111
const { stageContainer, update, errors } = this.props;
121112
const { type, version,
122-
stageContainerGroup: {
123-
description, estimatedTime, thumbnailUrl, title, productionReady
124-
} } = stageContainer;
113+
stageContainerGroup: { title } } = stageContainer;
125114
const updateStageContainer = (state) => update({ stageContainer: state })
126115
const updateStageContainerGroup = (state) => update({ stageContainer: { stageContainerGroup: state } })
127116
return (
@@ -136,15 +125,6 @@ class ContainerConfig extends Component {
136125
field="title"
137126
onChange={({ target: { value }}) => updateStageContainerGroup({ title: value })} />
138127

139-
<StyledInput
140-
hint={DESCRIPTION_HINT}
141-
label="Description"
142-
type="text"
143-
value={description}
144-
errors={errors}
145-
field="description"
146-
onChange={({ target: { value }}) => updateStageContainerGroup({ description: value })} />
147-
148128
<StyledInput
149129
hint={VERSION_HINT}
150130
label="Version"
@@ -154,37 +134,13 @@ class ContainerConfig extends Component {
154134
field="version"
155135
onChange={({ target: { value }}) => updateStageContainer({ version: value })} />
156136

157-
<StyledInput
158-
hint={ESTIMATED_TIME_HINT}
159-
label="Estimated Time in Minutes"
160-
type="number"
161-
value={estimatedTime}
162-
errors={errors}
163-
field="estimatedTime"
164-
onChange={({ target: { value }}) => updateStageContainerGroup({ estimatedTime: +value })} />
165-
166-
<StyledInput
167-
hint={THUMBNAIL_HINT}
168-
label="Thumbnail URL"
169-
type="text"
170-
value={thumbnailUrl}
171-
errors={errors}
172-
field="thumbnailUrl"
173-
onChange={({ target: { value }}) => updateStageContainerGroup({ thumbnailUrl: value })} />
174-
175137
<StyledSelect
176138
label="Type"
177139
hint={TYPE_HINT}
178140
onChange={(type) => updateStageContainer({ type })}
179141
value={type}
180142
options={typeOptions} />
181143

182-
<StyledSwitch
183-
label="Production Ready?"
184-
hint={PRODUCTION_READY_HINT}
185-
onChange={(productionReady) => updateStageContainerGroup({ productionReady })}
186-
checked={!!productionReady} />
187-
188144
<div className="btn btn-primary" onClick={this.destroyContainer}>
189145
<SVG name="trash" />
190146
Destroy this Version (v. { version })

client/src/components/ide/sidebar/CodeFilesNavActions.jsx

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as dialog from 'utils/dialog';
22
import AddCodeFile from './dialogs/codeFile/add/AddCodeFile';
3-
import ImportCodeFiles from './dialogs/codeFile/import/ImportCodeFiles';
43
import React, { Component } from 'react';
54
import { openTab, openCodeFile } from 'redux/actions';
65
import { connect } from 'react-redux';
@@ -15,28 +14,16 @@ class CodeFilesNavActions extends Component {
1514
this.props.openCodeFile(stage.id, id);
1615
});
1716
}
18-
importCodeFiles = () => {
19-
const { stage, stageContainer } = this.props;
20-
dialog.open(ImportCodeFiles, { stage, stageContainer });
21-
}
2217
render() {
2318
const { stage: { type } } = this.props;
2419
if(type === 'CodeStage') {
2520
return (
26-
<React.Fragment>
27-
<li>
28-
<div className="action" onClick={this.addCodeFile}>
29-
<SVG name="file-plus"/>
30-
<span>add code file…</span>
31-
</div>
32-
</li>
33-
<li>
34-
<div className="action" onClick={this.importCodeFiles}>
35-
<SVG name="import-file"/>
36-
<span>import code files…</span>
37-
</div>
38-
</li>
39-
</React.Fragment>
21+
<li>
22+
<div className="action" onClick={this.addCodeFile}>
23+
<SVG name="file-plus"/>
24+
<span>add code file…</span>
25+
</div>
26+
</li>
4027
)
4128
}
4229
return null;

client/src/components/ide/sidebar/ContainerSubnav.jsx

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
11
import React, { Component } from 'react';
22
import SVG from 'components/SVG';
33
import './ContainerSubnav.scss';
4-
import AddBadge from './dialogs/badge/AddBadge';
5-
import * as dialog from 'utils/dialog';
64
import { IDE_TAB_TYPES } from 'config';
75
import ActionNav from './ActionNav';
86
import { connect } from 'react-redux';
97
import { openTab } from 'redux/actions';
108

119
class ContainerSubnav extends Component {
12-
addBadge = () => {
13-
const { stageContainer: { stageContainerGroup } } = this.props;
14-
dialog.open(AddBadge, { stageContainerGroupId: stageContainerGroup.id }).then((id) => {
15-
this.props.openTab(null, IDE_TAB_TYPES.BADGE_CONFIG, id);
16-
});
17-
}
1810
attributesFor(type) {
1911
return { stageId: null, id: null, type }
2012
}
2113
render() {
22-
const { stageContainer: { stageContainerGroup: { badgeTypes } } } = this.props;
2314
const configurationAttrs = this.attributesFor(IDE_TAB_TYPES.STAGE_CONTAINER_CONFIG);
2415
const introAttrs = this.attributesFor(IDE_TAB_TYPES.STAGE_CONTAINER_INTRO);
2516
return (
@@ -33,37 +24,11 @@ class ContainerSubnav extends Component {
3324
<SVG name="file"/>
3425
<span>intro.md</span>
3526
</ActionNav>
36-
37-
{(badgeTypes || []).map(bt => (
38-
<BadgeTypeNav
39-
key={bt.id}
40-
badgeType={bt} />)
41-
)}
42-
43-
<li>
44-
<div className="action" onClick={this.addBadge}>
45-
<SVG name="empty-badge"/>
46-
<span>add a badge…</span>
47-
</div>
48-
</li>
4927
</ul>
5028
)
5129
}
5230
}
5331

54-
class BadgeTypeNav extends Component {
55-
render() {
56-
const { badgeType: { name, id } } = this.props;
57-
const attrs = { stageId: null, type: IDE_TAB_TYPES.BADGE_CONFIG, id }
58-
return (
59-
<ActionNav attrs={attrs}>
60-
<SVG name="badge"/>
61-
<span>{ name }</span>
62-
</ActionNav>
63-
)
64-
}
65-
}
66-
6732
const mapDispatchToProps = { openTab }
6833

6934
export default connect(

client/src/components/ide/sidebar/dialogs/badge/AddBadge.jsx

Lines changed: 0 additions & 57 deletions
This file was deleted.

client/src/components/ide/sidebar/dialogs/badge/AddBadge.scss

Whitespace-only changes.

client/src/config.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ const READ_THE_DOCS = process.env.REACT_APP_READ_THE_DOCS || 'https://chainshotb
88
const SLACK_INVITE = process.env.REACT_APP_SLACK_INVITE || 'https://join.slack.com/t/chainshotnodes/shared_invite/enQtMzU3ODc5NTM3MTI3LTFlZTY1YzcwM2QzYWI0ODY2ZDczMmYzOTVlYWQwZjkyZDFlYzUxZWM4NDNlNjk3N2EyNGMwOGQ0ZTVkZjQyNjE';
99

1010
const STAGE_TYPE_OPTIONS = [
11-
{ label: 'Code Stage', value: 'CodeStage' },
12-
{ label: 'Download Stage', value: 'DownloadStage' },
13-
{ label: 'IFrame Stage', value: 'IFrameStage' },
14-
{ label: 'Video Stage', value: 'VideoStage' },
11+
{ label: 'Code Stage', value: 'CodeStage' }
1512
]
1613

1714
const STAGE_LANGUAGE_OPTIONS = [

0 commit comments

Comments
 (0)