Skip to content
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

Uber uploads #513

Merged
merged 5 commits into from
Jun 9, 2021
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
25 changes: 18 additions & 7 deletions src/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ handleMenuSelection = (event) => {
};

handleClose = () => {
console.log("handleClose");
console.log("App.js handleClose");
this.setState({
creatingNewUpload: false,
anchorEl: null,
show_menu_popup: false,
open_edit_dialog: false,
creatingNewEntity: false,
creatingNewUpload: false
creatingNewEntity: false
})
};

Expand Down Expand Up @@ -264,7 +264,7 @@ handleMenuSelection = (event) => {
</Button>
*/}
<Button aria-controls="simple-menu" aria-haspopup="true" onClick={this.handleClick}>
Register New Item
Register New Item
</Button>
<Menu
id="simple-menu"
Expand All @@ -279,7 +279,6 @@ handleMenuSelection = (event) => {
<MenuItem id="mi_dataset" onClick={this.handleMenuSelection}>Dataset</MenuItem>
<Divider />
<MenuItem id="mi_dataupload" onClick={this.handleUploadsDialog}>Data Upload</MenuItem>

</Menu>


Expand Down Expand Up @@ -503,11 +502,23 @@ handleMenuSelection = (event) => {

{this.state.isAuthenticated && this.state.creatingNewUpload && (
<div className="col-sm-12">
<Dialog fullWidth={true} maxWidth="lg" onClose={this.handleClose} aria-labelledby="source-lookup-dialog" open={this.state.creatingNewUpload}>
<Dialog
open={this.state.creatingNewUpload}
fullWidth={true}
maxWidth="lg"
aria-labelledby="source-lookup-dialog"
// onClose={this.handleClose}
onClose={(event, reason) => {
if (reason !== 'backdropClick') {
this.handleClose()
}
}}
>
<DialogContent>
<UploadsForm
testVal="fnord"
testVal="ERIS"
onCreated={this.onCreated}
cancelEdit={this.handleClose}
/>
</DialogContent>
</Dialog>
Expand Down
242 changes: 141 additions & 101 deletions src/src/components/uploads/createUploads.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class CreateUploads extends Component {
errorMessage:" ",
showNewUpload:true,
formErrors: {
title: "",
description: ""
},
title: "",
description: ""
},
};

}
Expand All @@ -34,6 +34,7 @@ class CreateUploads extends Component {
var tgl = this.getUserGroups();
console.log(tgl);
console.debug(this.state);
console.debug(this.props);
}


Expand Down Expand Up @@ -110,7 +111,14 @@ class CreateUploads extends Component {


cancelEdit = () => {
this.setState({ creatingNewSubmission: false, editingSubmission: null });
console.debug("form js cancelEdit!!");
this.setState({
creatingNewSubmission: false,
editingSubmission: null ,
processingUpload:false,
submitting: false,
creatingNewUpload:false
});
};


Expand Down Expand Up @@ -138,7 +146,7 @@ class CreateUploads extends Component {

renderLoadingSpinner() {
return (
<div className='text-center'>
<div className='text-center mx-2 my-4'>
<FontAwesomeIcon icon={faSpinner} spin size='6x' />
<h3>Generating your new folder.</h3>
<h6>Please do not refresh or leave this page</h6>
Expand Down Expand Up @@ -190,6 +198,7 @@ class CreateUploads extends Component {
}

renderGroupSelect(){
//Select the data provider group that this data belongs to
return (
<div className="col3">
<select
Expand Down Expand Up @@ -226,125 +235,156 @@ class CreateUploads extends Component {
className="inline-icon"
icon={faSpinner}
spin
/>
/>
)}
{!this.state.submitting && "Create"}
</button>
<button
type="button"
className="btn btn-secondary"
onClick={() => this.props.onClose}
onClick={this.props.cancelEdit}
>
Cancel
</button>
</div>
</div>
</div>
);

}


render() {
return (
<React.Fragment>
{(this.state.processingUpload) && (
this.renderLoadingSpinner()
)}
{(!this.state.processingUpload) && (
<div>
<div className="row">
<div className="col-12">
<h3 className='float-left'>
Create a new Data Upload
</h3>
</div>
</div>


<form>
<div className='row mt-3 mb-3'>
<div className='col-sm-12'>
<h3 className='float-left'>
New Upload
</h3>
</div>
</div>

<div className='form-group'>
<label htmlFor='title'>
Upload Title <span className='text-danger'>*</span>
</label>
<span className="px-2">
<FontAwesomeIcon
icon={faQuestionCircle}
data-tip
data-for='title_tooltip'
/>
<ReactTooltip
id='title_tooltip'
place='top'
type='info'
effect='solid'
>
<p>Upload Title Tips</p>
</ReactTooltip>
</span>
<input
type='text'
name='title'
id='Submission_Name'
className={
"form-control " +
this.errorClass(this.state.formErrors.name)
}
placeholder='Upload Title'
onChange={this.updateInputValue}
value={this.state.e_title}
/>
</div>

<div className='form-group'>
<label
htmlFor='description'>
Description
</label>
<span className="px-2">
<FontAwesomeIcon
icon={faQuestionCircle}
data-tip
data-for='description_tooltip'
/>
<ReactTooltip
id='description_tooltip'
place='top'
type='info'
effect='solid'
>
<p>Description Tips</p>
</ReactTooltip>
</span>
<React.Fragment>
<div>
<textarea
type='text'
name='description'
id='Submission_Desc'
cols='30'
rows='5'
className='form-control'
placeholder='Description'
onChange={this.updateInputValue}
value={this.state.e_desc}
/>
<div className="row">
<div className="col-md-9">

{(this.state.processingUpload) && (
this.renderLoadingSpinner()
)}
{(!this.state.processingUpload) && (
<div>
<form>

<div className='form-group'>
<label htmlFor='title'>
Title <span className='text-danger'>*</span>
</label>
<span className="px-2">
<FontAwesomeIcon
icon={faQuestionCircle}
data-tip
data-for='title_tooltip'
/>
<ReactTooltip
id='title_tooltip'
place='top'
type='info'
effect='solid'
>
<p>A name for this upload. This will be used internally by Consortium members for the purposes of finding this Data Upload</p>
</ReactTooltip>
</span>
<input
type='text'
name='title'
id='Submission_Name'
className={
"form-control " +
this.errorClass(this.state.formErrors.name)
}
placeholder='Upload Title'
onChange={this.updateInputValue}
value={this.state.e_title}
/>
</div>

<div className='form-group'>
<label
htmlFor='description'>
Description
</label>
<span className="px-2">
<FontAwesomeIcon
icon={faQuestionCircle}
data-tip
data-for='description_tooltip'
/>
<ReactTooltip
id='description_tooltip'
place='top'
type='info'
effect='solid'
>
<p>A full description of this Data Upload which will be used internally by the Consortium (not displayed publicly) for the purposes of searching for the Data Upload.</p>
</ReactTooltip>
</span>
<React.Fragment>
<div>
<textarea
type='text'
name='description'
id='Submission_Desc'
cols='30'
rows='5'
className='form-control'
placeholder='Description'
onChange={this.updateInputValue}
value={this.state.e_desc}
/>
</div>
</React.Fragment>
</div>
</React.Fragment>

{this.renderGroupSelect()}
<div className='form-group'>
<label
htmlFor='Submission_Group'>
Select the data provider group that this data belongs to
</label>
<span className="px-2">
<FontAwesomeIcon
icon={faQuestionCircle}
data-tip
data-for='group_tooltip'
/>
<ReactTooltip
id='group_tooltip'
place='top'
type='info'
effect='solid'
>
<p>Choose the Data Provider group which the data included in this Data Upload will be associated with/is being uploaded by.</p>
</ReactTooltip>
</span>
{this.renderGroupSelect()}


{this.state.submit_error && (
<div className='alert alert-danger col-sm-12' role='alert'>
Oops! Something went wrong. Please contact administrator for help.
</div>
)}
</div>
{this.renderActionButtons()}
</form>
{this.state.submit_error && (
<div className='alert alert-danger col-sm-12' role='alert'>
Oops! Something went wrong. Please contact administrator for help.
</div>
)}
</div>
{this.renderActionButtons()}
</form>
</div>
)}
</React.Fragment>
);

</div>
<div className='col-md-3 mt-4'>
Register a new Data Upload which will be used to bulk upload data which will organized by the HIVE into multiple Datasets. For more information about registering and uploading data see the <a href="https://docs.google.com/document/d/1KR2TC2y-NIjbBRHTu0giSZATMUfPKxN_/edit" target="new"> Data Submission Guide.</a>
</div>
</div>
</div>
);
}
}

Expand Down