diff --git a/VERSION b/VERSION index 8f9174b4..abae0d9a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.2 \ No newline at end of file +2.1.3 \ No newline at end of file diff --git a/src/package.json b/src/package.json index 13527fa1..2e65d965 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "ingest-ui", - "version": "2.1.2", + "version": "2.1.3", "private": true, "homepage": ".", "dependencies": { diff --git a/src/src/components/ingest/dataset_edit.jsx b/src/src/components/ingest/dataset_edit.jsx index 39b5042f..168cefde 100644 --- a/src/src/components/ingest/dataset_edit.jsx +++ b/src/src/components/ingest/dataset_edit.jsx @@ -121,7 +121,7 @@ class DatasetEdit extends Component { get_assay_type(other_dt, JSON.parse(localStorage.getItem("info")).nexus_token) .then((resp) => { if (resp.status === 200) { - console.log('Assay Type info...', resp.results); + //console.log('Assay Type info...', resp.results); if (resp.results) { this.setState({ @@ -150,7 +150,7 @@ class DatasetEdit extends Component { ingest_api_allowable_edit_states(this.props.editingDataset.uuid, JSON.parse(localStorage.getItem("info")).nexus_token) .then((resp) => { if (resp.status === 200) { - console.log('edit states...', resp.results); + //console.log('edit states...', resp.results); this.setState({ writeable: resp.results.has_write_priv, @@ -448,7 +448,7 @@ class DatasetEdit extends Component { break; } if (id.startsWith("dt")) { - //////console.log('ping!', id); + console.log('ping!', id); if (id === "dt_other") { const data_types = this.state.data_types; this.setState({ @@ -469,7 +469,38 @@ class DatasetEdit extends Component { } } else { //////console.log(id, e.target.checked) - if (e.target.checked) { + if (value === "other") { + const data_types = this.state.data_types; + data_types.clear(); + data_types.add(value); + this.setState({ + data_types: data_types, + has_other_datatype: value === "other", + }); + console.log("other", this.state.has_other_datatype); + if (value !== "other") { + const data_type_options = new Set(this.state.data_type_dicts.map((elt, idx) => {return elt.name})); + const data_types = this.state.data_types; + const other_dt = Array.from(data_types).filter( + (dt) => !data_type_options.has(dt) + )[0]; + data_types.delete(other_dt); + this.setState({ + data_types: data_types, + other_dt: "", + }); + } + + } else { + const data_types = this.state.data_types; + data_types.clear(); + data_types.add(value); + this.setState({ + has_other_datatype: false, + data_types: data_types, + }); + console.log("data types is ", data_types); + }/*if (e.target.checked) { const data_types = this.state.data_types; data_types.add(name); this.setState({ @@ -481,7 +512,7 @@ class DatasetEdit extends Component { this.setState({ data_types: data_types, }); - } + }*/ } //////console.log('data_types', this.state.data_types) @@ -1376,8 +1407,10 @@ class DatasetEdit extends Component { renderOneAssay(val, idx) { var idstr = 'dt_' + val.name.toLowerCase().replace(' ','_'); - return (
- + @@ -1407,49 +1440,105 @@ class DatasetEdit extends Component { } renderAssayColumn(min, max) { - return (
- {this.state.data_type_dicts.slice(min, max).map((val, idx) => - {return this.renderOneAssay(val, idx)})}
+ return ( + this.state.data_type_dicts.slice(min, max).map((val, idx) => + {return this.renderAssay(val, idx)}) ) } + + renderAssay(val, idx) { + var idstr = 'dt_' + val.name.toLowerCase().replace(' ','_'); + return ( + + ) + } + + renderListAssay(val) { + return ( +
  • {val}
  • + ) + } + + renderMultipleAssays() { + var arr = Array.from(this.state.data_types) + return ( + arr.map((val) => + {return this.renderListAssay(val)}) + ) + } + + + + renderAssayArray() { if (this.state.data_type_dicts.length) { var len = this.state.data_type_dicts.length; - var entries_per_col = Math.ceil(len / 3); + //var entries_per_col = Math.ceil(len / 3); //var num_cols = Math.ceil(len / entries_per_col); - return (<> -
    {this.renderAssayColumn(0, entries_per_col)}
    -
    {this.renderAssayColumn(entries_per_col, 2*entries_per_col)}
    -
    {this.renderAssayColumn(2*entries_per_col, len+1)} -
    - - -
    - {this.state.has_other_datatype && ( + console.log("length is ", this.state.data_types.size) + console.log("other ", this.state.has_other_datatype) + + if (this.state.data_types.size === 1 && this.state.has_other_datatype) { + console.log("runs") + return (<> + + + + {this.state.has_other_datatype && ( +
    + className={"form-control " + + this.errorClass(this.state.formErrors.other_dt) + } + placeholder='Other Data Type' + value={this.state.other_dt} + onChange={this.handleInputChange} + />
    - )} -
    - - ) + )} + + ) + } else if (this.state.data_types.size === 1 || this.state.data_types.size === 0) { + + return (<> + + + + {this.state.has_other_datatype && ( + +
    + +
    + )} + + ) + } else if (this.state.data_types.size > 1) { + return (<> + + + + ) + } + } else { return

    Loading assay types...

    ; @@ -1843,7 +1932,7 @@ class DatasetEdit extends Component {
    {this.state.formErrors.data_types && (
    - At least one Dataa Type is Required. + At least one Data Type is Required.
    )}
    diff --git a/src/src/components/search/SearchComponent.jsx b/src/src/components/search/SearchComponent.jsx index 0f8b8a80..41892f0e 100644 --- a/src/src/components/search/SearchComponent.jsx +++ b/src/src/components/search/SearchComponent.jsx @@ -15,7 +15,7 @@ import { COLUMN_DEF_DONOR, COLUMN_DEF_SAMPLE, COLUMN_DEF_DATASET, COLUMN_DEF_UPL import { entity_api_get_entity } from '../../service/entity_api'; import { ingest_api_allowable_edit_states, ingest_api_users_groups } from '../../service/ingest_api'; -import 'url-search-params-polyfill'; +// import 'url-search-params-polyfill'; // Creation donor_form_components diff --git a/src/src/components/uploads/editUploads.jsx b/src/src/components/uploads/editUploads.jsx index c2441d3f..362d67f4 100644 --- a/src/src/components/uploads/editUploads.jsx +++ b/src/src/components/uploads/editUploads.jsx @@ -24,7 +24,9 @@ import TableHead from '@material-ui/core/TableHead'; import TableRow from '@material-ui/core/TableRow'; import { ingest_api_get_globus_url, ingest_api_validate_upload, - ingest_api_submit_upload } from '../../service/ingest_api'; + ingest_api_submit_upload, + ingest_api_users_groups } from '../../service/ingest_api'; +//import { GROUPS } from '../../service/groups' import { COLUMN_DEF_DATASET} from '../search/table_constants'; class EditUploads extends Component { @@ -370,13 +372,20 @@ class EditUploads extends Component { renderButtonBar(){ return ( -
    +
    {this.renderHelperText()} -
    + +
    + {this.renderValidateButton()} +
    + + +
    + {this.renderActionButton()} + + ) + } + } + ) + } + }); + } + } + + tempAlert() { + window.alert("This function has not yet been implemented."); + } renderActionButton() { + var local = JSON.parse(localStorage.getItem("info")); + console.debug(local); if (["NEW", "INVALID", "ERROR"].includes( this.state.status.toUpperCase() )){ diff --git a/src/src/components/uuid/tissue_form_components/tissueForm.jsx b/src/src/components/uuid/tissue_form_components/tissueForm.jsx index 714e21a4..3954fc7d 100644 --- a/src/src/components/uuid/tissue_form_components/tissueForm.jsx +++ b/src/src/components/uuid/tissue_form_components/tissueForm.jsx @@ -321,7 +321,7 @@ class TissueForm extends Component { } ); - this.getSourceAncestorOrgan(this.state.editingEntity); + //this.getSourceAncestorOrgan(this.state.editingEntity); } else { @@ -505,7 +505,7 @@ class TissueForm extends Component { //////console.debug('Entity ancestors...', response.results); if (response.results.length > 0) { - ////////console.debug('Entity ancestors...ORGAN', ancestor_organ); + console.debug('Entity ancestors...', response.results); this.setState({ source_entity: response.results[0], ancestor_organ: response.results[0].organ // use "top" ancestor organ