-
Notifications
You must be signed in to change notification settings - Fork 138
Allow Datapoint/Segmentations upload via Frontend #53
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
Draft
DumbMachine
wants to merge
8
commits into
midas-research:master
Choose a base branch
from
DumbMachine:react-upload
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
dffe8e8
initial support for uploading via frontend
DumbMachine 898d2c1
removed merge conf 1
DumbMachine e56ffa4
uploading and segmentation uploading works now
DumbMachine ffc90d7
minor logging changes
DumbMachine b0beb5b
added dependency
DumbMachine cfe0529
all tests have passed
DumbMachine 49b4f07
upload better
DumbMachine 2cd49b1
upload refactor
DumbMachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| import React from 'react'; | ||
| import { withRouter } from "react-router"; | ||
| import Dropzone from 'react-dropzone-uploader'; | ||
| import { withStore } from "@spyna/react-store"; | ||
| import 'react-dropzone-uploader/dist/styles.css' | ||
|
|
||
| class UploadDataForm extends React.Component { | ||
| constructor(props) { | ||
| super(props); | ||
|
|
||
| const projectId = this.props.projectId; | ||
| const userId = this.props.userId; | ||
|
|
||
| this.initialState = { | ||
| userId, | ||
| projectId, | ||
| addDataUrl: `/api/datazip`, | ||
| }; | ||
|
|
||
| this.state = Object.assign({}, this.initialState); | ||
| console.log(this.props); | ||
| } | ||
|
|
||
| getUploadParams = ({ file, meta }) => { | ||
| const body = new FormData() | ||
| body.append('fileField', file) | ||
| body.append('userId', this.state.userId) | ||
| body.append('projectId', this.state.projectId) | ||
| return { url: this.state.addDataUrl, body } | ||
| } | ||
| handleChangeStatus = ({ meta, file }, status) => { console.log(status, meta, file) } | ||
|
|
||
| render() { | ||
| return ( | ||
| <Dropzone | ||
| getUploadParams={this.getUploadParams} | ||
| onChangeStatus={this.handleChangeStatus} | ||
| accept="application/zip,application/x-zip,application/x-zip-compressed,application/octet-stream" | ||
| // accept="image/*,audio/*,video/*" | ||
| /> | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| export default withStore(withRouter(UploadDataForm)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.