Skip to content

Commit

Permalink
Merge pull request #12 from cwrc/user-rework
Browse files Browse the repository at this point in the history
User rework
  • Loading branch information
ajmacdonald authored May 31, 2019
2 parents 782022e + b41a8db commit 5723f6a
Show file tree
Hide file tree
Showing 17 changed files with 4,258 additions and 3,328 deletions.
5,285 changes: 2,768 additions & 2,517 deletions package-lock.json

Large diffs are not rendered by default.

68 changes: 44 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"watch-indexlist": "watchify test/ResultListTest.js -o build/ResultList.js --debug --verbose -t babelify ",
"test-old": "mkdirp coverage && npm run test:electron && npm run generate-coverage",
"test": "",
"test:watch": "mkdirp test/build && watchify test/browser.js --debug -o test/build/test.js -t [ babelify ] -t [ browserify-istanbul ]",
"test:browser": "browserify -t babelify -t browserify-istanbul test/browser.js | browser-run -p 2222 --static . | node test/extract-coverage.js | faucet",
"test:electron": "browserify -t babelify -t browserify-istanbul test/browser.js | browser-run --static . | node test/extract-coverage.js | faucet ",
"test:chrome": "browserify -t browserify-istanbul test/browser.js | browser-run --static . -b chrome | node test/extract-coverage.js | faucet ",
Expand All @@ -35,43 +36,62 @@
"report-coverage": "cat ./coverage/lcov.info | codecov",
"travis-deploy-once": "travis-deploy-once"
},
"dependencies": {
"bootstrap": "^3.4.1",
"cwrc-git-server-client": "^1.7.0",
"jquery": "^3.4.0",
"js-cookie": "2.1.4",
"parse-link-header": "^1.0.1",
"query-string": "^6.5.0",
"react": "^16.8.6",
"react-bootstrap": "^0.32.4",
"react-dom": "^16.8.6",
"semantic-ui-react": "^0.82.5"
},
"devDependencies": {
"babel-core": "^6.26.3",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"babelify": "7.3.0",
"browser-run": "^5.0.0",
"browserify": "14.3.0",
"browserify-istanbul": "2.0.0",
"codecov": "^3.1.0",
"commitizen": "^2.10.1",
"concat-stream": "1.6.0",
"cz-conventional-changelog": "2.0.0",
"babelify": "^8.0.0",
"browser-run": "^5.0.1",
"browserify": "^16.0.0",
"browserify-istanbul": "^3.0.1",
"codecov": "^3.3.0",
"commitizen": "^3.1.1",
"concat-stream": "^1.6.0",
"cz-conventional-changelog": "^2.1.0",
"faucet": "0.0.1",
"husky": "0.13.3",
"istanbul": "0.4.5",
"husky": "^2.1.0",
"istanbul": "^0.4.5",
"mkdirp": "0.5.1",
"semantic-release": "^15.11.0",
"semantic-release": "^15.13.12",
"sinon": "2.2.0",
"tape": "4.6.3",
"travis-deploy-once": "^5.0.9",
"watch": "1.0.2",
"watchify": "3.9.0"
"travis-deploy-once": "^5.0.11",
"watchify": "^3.11.1"
},
"config": {
"commitizen": {
"path": "node_modules/cz-conventional-changelog"
}
},
"dependencies": {
"bootstrap": "3.3.7",
"cwrc-git-server-client": "^1.7.0",
"jquery": "3.2.1",
"js-cookie": "2.1.4",
"parse-link-header": "^1.0.1",
"react": "^16.6.1",
"react-bootstrap": "^0.32.4",
"react-dom": "^16.6.1",
"semantic-ui-react": "^0.82.5"
"husky": {
"hooks": {
"pre-commit": ""
}
},
"browserify": {
"transform": [
[
"babelify",
{
"presets": [
"stage-0",
"react"
]
}
]
]
}
}
62 changes: 0 additions & 62 deletions src/ExistingDocModal.js

This file was deleted.

81 changes: 39 additions & 42 deletions src/FileUpload.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import React, {Component} from 'react'
import ReactDOM from 'react-dom';
import { FormGroup, ControlLabel, FormControl, Label, Button, HelpBlock, Row, Col} from 'react-bootstrap';


import { FormGroup, ControlLabel, FormControl, Label, Button, HelpBlock, Grid, Row, Col, Well} from 'react-bootstrap';

class FileUpload extends Component {

Expand Down Expand Up @@ -55,49 +52,49 @@ class FileUpload extends Component {
}
}


render() {
return (
<form>
<FormGroup>
<ControlLabel htmlFor="fileUpload" style={{ cursor: "pointer"}}><h3><Label bsStyle="success">Choose file</Label></h3>
<FormControl
id="fileUpload"
type="file"
onChange={this.handleUpload.bind(this)}
style={{ display: "none" }}
/>
</ControlLabel>
</FormGroup>


<div style={{padding: '0 0 1.5em 1.5em', background:'#fff'}}> — OR — </div>


<FormGroup
controlId="formBasicText"

>
<ControlLabel></ControlLabel>
<FormControl
componentClass="textarea"
rows="9"
value={this.state.xmlText}
placeholder="Enter your XML here"
onChange={this.handleTextChange}
/>
<FormControl.Feedback />
{this.state.showWarning && <HelpBlock>Please enter some text in the box above.</HelpBlock>}
</FormGroup>

<Button onClick={this.loadText}>Open Text in Editor</Button>
<Grid style={{marginTop: "15px"}} fluid={true}>
<Row>
<Col sm={3}>
<Well>
<FormGroup>
<ControlLabel htmlFor="fileUpload" style={{ cursor: "pointer"}}>
<h4><Label bsStyle="success">Choose File</Label></h4>
<FormControl
id="fileUpload"
type="file"
onChange={this.handleUpload.bind(this)}
style={{ display: "none" }}
/>
</ControlLabel>
</FormGroup>
</Well>
</Col>
<Col sm={1}><h4>Or</h4></Col>
<Col sm={8}>
<Well>
<FormGroup controlId="formBasicText">
<ControlLabel></ControlLabel>
<FormControl
componentClass="textarea"
style={{height: '100px'}}
value={this.state.xmlText}
placeholder="Paste your XML here"
onChange={this.handleTextChange}
/>
<FormControl.Feedback />
{this.state.showWarning && <HelpBlock>Please enter some text in the box above.</HelpBlock>}
</FormGroup>
<Button onClick={this.loadText}>Open Text in Editor</Button>
</Well>
</Col>
</Row>
</Grid>
</form>
)
}
}
function initializeFileUploadComponent(targetElement, fileCB) {
return ReactDOM.render(<FileUpload fileCB={fileCB} />, document.getElementById(targetElement))
}


export default initializeFileUploadComponent
export default FileUpload
Loading

0 comments on commit 5723f6a

Please sign in to comment.