From 023361e409a119bce88924c4e14f16311d5c6194 Mon Sep 17 00:00:00 2001 From: Daniel Nolan Date: Fri, 21 May 2021 23:45:00 -0400 Subject: [PATCH 1/4] removes unused stage container fields --- .../ide/configuration/ContainerConfig.jsx | 46 +------------------ 1 file changed, 1 insertion(+), 45 deletions(-) diff --git a/client/src/components/ide/configuration/ContainerConfig.jsx b/client/src/components/ide/configuration/ContainerConfig.jsx index fbce1fa8..c79aad77 100644 --- a/client/src/components/ide/configuration/ContainerConfig.jsx +++ b/client/src/components/ide/configuration/ContainerConfig.jsx @@ -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'; @@ -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' }, @@ -37,10 +32,6 @@ const containerVariables = [ const groupVariables = [ ['id', 'String'], ['title', 'String'], - ['description', 'String'], - ['productionReady', 'Boolean'], - ['thumbnailUrl', 'String'], - ['estimatedTime', 'Int'], ]; const containerMutation = ` @@ -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 ( @@ -136,15 +125,6 @@ class ContainerConfig extends Component { field="title" onChange={({ target: { value }}) => updateStageContainerGroup({ title: value })} /> - updateStageContainerGroup({ description: value })} /> - updateStageContainer({ version: value })} /> - updateStageContainerGroup({ estimatedTime: +value })} /> - - updateStageContainerGroup({ thumbnailUrl: value })} /> - - updateStageContainerGroup({ productionReady })} - checked={!!productionReady} /> -
Destroy this Version (v. { version }) From 308a677d65c65e1637cf46010e1b3c798184a78d Mon Sep 17 00:00:00 2001 From: Daniel Nolan Date: Fri, 21 May 2021 23:47:21 -0400 Subject: [PATCH 2/4] removes add badge --- .../ide/sidebar/ContainerSubnav.jsx | 35 ------------ .../ide/sidebar/dialogs/badge/AddBadge.jsx | 57 ------------------- .../ide/sidebar/dialogs/badge/AddBadge.scss | 0 3 files changed, 92 deletions(-) delete mode 100644 client/src/components/ide/sidebar/dialogs/badge/AddBadge.jsx delete mode 100644 client/src/components/ide/sidebar/dialogs/badge/AddBadge.scss diff --git a/client/src/components/ide/sidebar/ContainerSubnav.jsx b/client/src/components/ide/sidebar/ContainerSubnav.jsx index edbc774f..6cbec6cd 100644 --- a/client/src/components/ide/sidebar/ContainerSubnav.jsx +++ b/client/src/components/ide/sidebar/ContainerSubnav.jsx @@ -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 ( @@ -33,37 +24,11 @@ class ContainerSubnav extends Component { intro.md - - {(badgeTypes || []).map(bt => ( - ) - )} - -
  • -
    - - add a badge… -
    -
  • ) } } -class BadgeTypeNav extends Component { - render() { - const { badgeType: { name, id } } = this.props; - const attrs = { stageId: null, type: IDE_TAB_TYPES.BADGE_CONFIG, id } - return ( - - - { name } - - ) - } -} - const mapDispatchToProps = { openTab } export default connect( diff --git a/client/src/components/ide/sidebar/dialogs/badge/AddBadge.jsx b/client/src/components/ide/sidebar/dialogs/badge/AddBadge.jsx deleted file mode 100644 index c97b0f30..00000000 --- a/client/src/components/ide/sidebar/dialogs/badge/AddBadge.jsx +++ /dev/null @@ -1,57 +0,0 @@ -import React, { Component } from 'react'; -import Dialog from 'components/Dialog'; -import './AddBadge.scss'; -import { close } from 'utils/dialog'; -import apiMutation from 'utils/api/mutation'; -import allFields from 'fragments/stageContainer/allFields'; - -const mutation = ` -${allFields} -mutation createBadgeType($name: String, $stageContainerGroupId: String) { - createBadgeType(name: $name, stageContainerGroupId: $stageContainerGroupId, badgeLimit: 0) { - id - stageContainer { - ...allFields - } - } -} -`; - -class AddBadge extends Component { - state = { - name: "" - } - onSubmit(evt) { - evt && evt.preventDefault(); - const { name } = this.state; - const { stageContainerGroupId } = this.props; - apiMutation(mutation, { name, stageContainerGroupId }, true).then(({ id }) => { - close(id); - }); - } - handleChange(prop, value) { - this.setState({[prop]: value}); - } - render() { - const { name } = this.state; - return ( - -
    - - -
    -
    this.onSubmit()}> - Add Badge -
    -
    -
    -
    - ); - } -} - -export default AddBadge; diff --git a/client/src/components/ide/sidebar/dialogs/badge/AddBadge.scss b/client/src/components/ide/sidebar/dialogs/badge/AddBadge.scss deleted file mode 100644 index e69de29b..00000000 From 7e8ab9fef585718e4438ff192edf6346db246832 Mon Sep 17 00:00:00 2001 From: Daniel Nolan Date: Fri, 21 May 2021 23:49:06 -0400 Subject: [PATCH 3/4] removes import code files --- .../ide/sidebar/CodeFilesNavActions.jsx | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/client/src/components/ide/sidebar/CodeFilesNavActions.jsx b/client/src/components/ide/sidebar/CodeFilesNavActions.jsx index 0a1c3b11..1d956543 100644 --- a/client/src/components/ide/sidebar/CodeFilesNavActions.jsx +++ b/client/src/components/ide/sidebar/CodeFilesNavActions.jsx @@ -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'; @@ -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 ( - -
  • -
    - - add code file… -
    -
  • -
  • -
    - - import code files… -
    -
  • -
    +
  • +
    + + add code file… +
    +
  • ) } return null; From 53796a2c083c42c9cf70e59c7149c6dabcf6d5b7 Mon Sep 17 00:00:00 2001 From: Daniel Nolan Date: Fri, 21 May 2021 23:53:21 -0400 Subject: [PATCH 4/4] Limits Language and Stage Type Options --- .../components/ide/configuration/CodeStageConfig.jsx | 11 ++--------- client/src/config.js | 5 +---- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/client/src/components/ide/configuration/CodeStageConfig.jsx b/client/src/components/ide/configuration/CodeStageConfig.jsx index d71fe792..77a563d2 100644 --- a/client/src/components/ide/configuration/CodeStageConfig.jsx +++ b/client/src/components/ide/configuration/CodeStageConfig.jsx @@ -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 { diff --git a/client/src/config.js b/client/src/config.js index 22bab438..74b8aa30 100644 --- a/client/src/config.js +++ b/client/src/config.js @@ -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 = [