Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions client/src/components/ide/configuration/CodeStageConfig.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,15 @@ const TEST_FRAMEWORK_HINT = 'The framework used for test assertions';
const FORK_MAINNET_BLOCK_HINT = 'The block from which to fork the mainnet Ethereum blockchain';

const languageVersionOptions = [
{ label: 'Solidity v0.4.19', value: '0.4.19' },
{ label: 'Solidity v0.5.0', value: '0.5.0' },
{ label: 'Solidity v0.6.2', value: '0.6.2' },
{ label: 'Solidity v0.7.5', value: '0.7.5' },
{ label: 'Vyper v0.1', value: '0.1.0b3' },
{ label: 'Node 10.x', value: '10.x' },
{ label: 'Node 10.x w/ Babel', value: '10.x/babel' },
{ label: 'Node 8.x', value: '8.x' },
{ label: 'Node 8.x w/ Babel', value: '8.x/babel' },
{ label: 'Node 6.x', value: '6.x' },
{ label: 'Node 6.x w/ Babel', value: '6.x/babel' },
]

const frameworkOptions = [
{ label: 'Mocha', value: 'mocha_bdd' },
{ label: 'Truffle With Mocha', value: 'truffle_with_mocha' },
{ label: 'JavaScript Mocha', value: 'mocha_bdd' },
{ label: 'Hardhat Solidity', value: 'truffle_with_mocha' },
]

class CodeStageConfig extends Component {
Expand Down
46 changes: 1 addition & 45 deletions client/src/components/ide/configuration/ContainerConfig.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { Component } from 'react';
import StyledSwitch from 'components/forms/StyledSwitch';
import StyledSelect from 'components/forms/StyledSelect';
import StyledInput from 'components/forms/StyledInput';
import apiMutation from 'utils/api/mutation';
Expand All @@ -11,12 +10,8 @@ import SVG from 'components/SVG';
import './ContainerConfig.scss';

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

const typeOptions = [
{ label: 'Challenge', value: 'Challenge' },
Expand All @@ -37,10 +32,6 @@ const containerVariables = [
const groupVariables = [
['id', 'String'],
['title', 'String'],
['description', 'String'],
['productionReady', 'Boolean'],
['thumbnailUrl', 'String'],
['estimatedTime', 'Int'],
];

const containerMutation = `
Expand Down Expand Up @@ -119,9 +110,7 @@ class ContainerConfig extends Component {
render() {
const { stageContainer, update, errors } = this.props;
const { type, version,
stageContainerGroup: {
description, estimatedTime, thumbnailUrl, title, productionReady
} } = stageContainer;
stageContainerGroup: { title } } = stageContainer;
const updateStageContainer = (state) => update({ stageContainer: state })
const updateStageContainerGroup = (state) => update({ stageContainer: { stageContainerGroup: state } })
return (
Expand All @@ -136,15 +125,6 @@ class ContainerConfig extends Component {
field="title"
onChange={({ target: { value }}) => updateStageContainerGroup({ title: value })} />

<StyledInput
hint={DESCRIPTION_HINT}
label="Description"
type="text"
value={description}
errors={errors}
field="description"
onChange={({ target: { value }}) => updateStageContainerGroup({ description: value })} />

<StyledInput
hint={VERSION_HINT}
label="Version"
Expand All @@ -154,37 +134,13 @@ class ContainerConfig extends Component {
field="version"
onChange={({ target: { value }}) => updateStageContainer({ version: value })} />

<StyledInput
hint={ESTIMATED_TIME_HINT}
label="Estimated Time in Minutes"
type="number"
value={estimatedTime}
errors={errors}
field="estimatedTime"
onChange={({ target: { value }}) => updateStageContainerGroup({ estimatedTime: +value })} />

<StyledInput
hint={THUMBNAIL_HINT}
label="Thumbnail URL"
type="text"
value={thumbnailUrl}
errors={errors}
field="thumbnailUrl"
onChange={({ target: { value }}) => updateStageContainerGroup({ thumbnailUrl: value })} />

<StyledSelect
label="Type"
hint={TYPE_HINT}
onChange={(type) => updateStageContainer({ type })}
value={type}
options={typeOptions} />

<StyledSwitch
label="Production Ready?"
hint={PRODUCTION_READY_HINT}
onChange={(productionReady) => updateStageContainerGroup({ productionReady })}
checked={!!productionReady} />

<div className="btn btn-primary" onClick={this.destroyContainer}>
<SVG name="trash" />
Destroy this Version (v. { version })
Expand Down
25 changes: 6 additions & 19 deletions client/src/components/ide/sidebar/CodeFilesNavActions.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as dialog from 'utils/dialog';
import AddCodeFile from './dialogs/codeFile/add/AddCodeFile';
import ImportCodeFiles from './dialogs/codeFile/import/ImportCodeFiles';
import React, { Component } from 'react';
import { openTab, openCodeFile } from 'redux/actions';
import { connect } from 'react-redux';
Expand All @@ -15,28 +14,16 @@ class CodeFilesNavActions extends Component {
this.props.openCodeFile(stage.id, id);
});
}
importCodeFiles = () => {
const { stage, stageContainer } = this.props;
dialog.open(ImportCodeFiles, { stage, stageContainer });
}
render() {
const { stage: { type } } = this.props;
if(type === 'CodeStage') {
return (
<React.Fragment>
<li>
<div className="action" onClick={this.addCodeFile}>
<SVG name="file-plus"/>
<span>add code file…</span>
</div>
</li>
<li>
<div className="action" onClick={this.importCodeFiles}>
<SVG name="import-file"/>
<span>import code files…</span>
</div>
</li>
</React.Fragment>
<li>
<div className="action" onClick={this.addCodeFile}>
<SVG name="file-plus"/>
<span>add code file…</span>
</div>
</li>
)
}
return null;
Expand Down
35 changes: 0 additions & 35 deletions client/src/components/ide/sidebar/ContainerSubnav.jsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
import React, { Component } from 'react';
import SVG from 'components/SVG';
import './ContainerSubnav.scss';
import AddBadge from './dialogs/badge/AddBadge';
import * as dialog from 'utils/dialog';
import { IDE_TAB_TYPES } from 'config';
import ActionNav from './ActionNav';
import { connect } from 'react-redux';
import { openTab } from 'redux/actions';

class ContainerSubnav extends Component {
addBadge = () => {
const { stageContainer: { stageContainerGroup } } = this.props;
dialog.open(AddBadge, { stageContainerGroupId: stageContainerGroup.id }).then((id) => {
this.props.openTab(null, IDE_TAB_TYPES.BADGE_CONFIG, id);
});
}
attributesFor(type) {
return { stageId: null, id: null, type }
}
render() {
const { stageContainer: { stageContainerGroup: { badgeTypes } } } = this.props;
const configurationAttrs = this.attributesFor(IDE_TAB_TYPES.STAGE_CONTAINER_CONFIG);
const introAttrs = this.attributesFor(IDE_TAB_TYPES.STAGE_CONTAINER_INTRO);
return (
Expand All @@ -33,37 +24,11 @@ class ContainerSubnav extends Component {
<SVG name="file"/>
<span>intro.md</span>
</ActionNav>

{(badgeTypes || []).map(bt => (
<BadgeTypeNav
key={bt.id}
badgeType={bt} />)
)}

<li>
<div className="action" onClick={this.addBadge}>
<SVG name="empty-badge"/>
<span>add a badge…</span>
</div>
</li>
</ul>
)
}
}

class BadgeTypeNav extends Component {
render() {
const { badgeType: { name, id } } = this.props;
const attrs = { stageId: null, type: IDE_TAB_TYPES.BADGE_CONFIG, id }
return (
<ActionNav attrs={attrs}>
<SVG name="badge"/>
<span>{ name }</span>
</ActionNav>
)
}
}

const mapDispatchToProps = { openTab }

export default connect(
Expand Down
57 changes: 0 additions & 57 deletions client/src/components/ide/sidebar/dialogs/badge/AddBadge.jsx

This file was deleted.

Empty file.
5 changes: 1 addition & 4 deletions client/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ const READ_THE_DOCS = process.env.REACT_APP_READ_THE_DOCS || 'https://chainshotb
const SLACK_INVITE = process.env.REACT_APP_SLACK_INVITE || 'https://join.slack.com/t/chainshotnodes/shared_invite/enQtMzU3ODc5NTM3MTI3LTFlZTY1YzcwM2QzYWI0ODY2ZDczMmYzOTVlYWQwZjkyZDFlYzUxZWM4NDNlNjk3N2EyNGMwOGQ0ZTVkZjQyNjE';

const STAGE_TYPE_OPTIONS = [
{ label: 'Code Stage', value: 'CodeStage' },
{ label: 'Download Stage', value: 'DownloadStage' },
{ label: 'IFrame Stage', value: 'IFrameStage' },
{ label: 'Video Stage', value: 'VideoStage' },
{ label: 'Code Stage', value: 'CodeStage' }
]

const STAGE_LANGUAGE_OPTIONS = [
Expand Down