Skip to content

Commit

Permalink
Merge pull request #1460 from hubmapconsortium/collectionContributors
Browse files Browse the repository at this point in the history
Collection contributors
  • Loading branch information
yuanzhou authored Aug 30, 2024
2 parents a9c9d5e + 50c7141 commit e80cdbc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
12 changes: 6 additions & 6 deletions src/src/components/collections/collections.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ export function CollectionForm (props){
title:"",
description: "",
dataset_uuids: "",
creators: [],
contributors: [],
// contacts: [],
bulk_dataset_uuids:["","",""]
});
var [formValues, setFormValues] = useState({
title: '',
description: '',
dataset_uuids: [],
creators: [],
contributors: [],
group_uuid:"",
// contacts: [],
});
Expand Down Expand Up @@ -109,8 +109,8 @@ export function CollectionForm (props){
formVals.dataset_uuids = UUIDs
setassociatedEntitiesInitial(UUIDs)
}
if (editingCollection.creators && editingCollection.creators.length > 0) {
formVals.contributors = editingCollection.creators
if (editingCollection.contributors && editingCollection.contributors.length > 0) {
formVals.contributors = editingCollection.contributors
}
setFormValues(formVals);
setLoadingDatasets(false);
Expand Down Expand Up @@ -375,8 +375,7 @@ export function CollectionForm (props){
console.debug('%c⊙', 'color:#00ff7b', "contributors",contributors );
if (contributors && (contributors[0] && contributors[0].orcid!==undefined)) {
// formValuesSubmit.contributors = contributors
// Still called creators on the back end
formValuesSubmit.creators = contributors
formValuesSubmit.contributors = contributors
setFormErrors((prevValues) => ({
...prevValues,
'contributors': "",
Expand Down Expand Up @@ -447,6 +446,7 @@ export function CollectionForm (props){
};

const handleCreate = (formSubmit) => {
setOpenGroupModal(false);
entity_api_create_entity("collection", formSubmit, props.authToken)
.then((response) => {
props.onProcessed(response);
Expand Down
12 changes: 6 additions & 6 deletions src/src/components/collections/epicollections.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ export function EPICollectionForm (props){
title:"",
description: "",
dataset_uuids: "",
creators: [],
contributors: [],
// contacts: [],
bulk_dataset_uuids:["","",""]
});
var [formValues, setFormValues] = useState({
title: '',
description: '',
dataset_uuids: [],
creators: [],
contributors: [],
group_uuid:"",
// contacts: [],
});
Expand Down Expand Up @@ -109,8 +109,8 @@ export function EPICollectionForm (props){
formVals.dataset_uuids = UUIDs
setassociatedEntitiesInitial(UUIDs)
}
if (editingCollection.creators && editingCollection.creators.length > 0) {
formVals.contributors = editingCollection.creators
if (editingCollection.contributors && editingCollection.contributors.length > 0) {
formVals.contributors = editingCollection.contributors
}
setFormValues(formVals);
setLoadingDatasets(false);
Expand Down Expand Up @@ -376,8 +376,7 @@ export function EPICollectionForm (props){
console.debug('%c⊙', 'color:#00ff7b', "contributors",contributors );
if (contributors && (contributors[0] && contributors[0].orcid!==undefined)) {
// formValuesSubmit.contributors = contributors
// Still called creators on the back end
formValuesSubmit.creators = contributors
formValuesSubmit.contributors = contributors
setFormErrors((prevValues) => ({
...prevValues,
'contributors': "",
Expand Down Expand Up @@ -454,6 +453,7 @@ export function EPICollectionForm (props){
};

const handleCreate = (formSubmit) => {
setOpenGroupModal(false);
entity_api_create_entity("epicollection", formSubmit, props.authToken)
.then((response) => {
if(response.status === 200){
Expand Down
2 changes: 1 addition & 1 deletion src/src/components/search/searchTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export const RenderSearchTable = (props) => {
}, [allGroups,entityTypeList]);

function handlePageChange(pageInfo) {
console.debug("%c⭗", "color:#ff005d", "AAAAAAAAAAAAAAAAAAA", pageInfo);
// console.debug("%c⭗", "color:#ff005d", "AAAAAAAAAAAAAAAAAAA", pageInfo);
setPage(pageInfo.page);
setPageSize(pageInfo.pageSize);
}
Expand Down
1 change: 0 additions & 1 deletion src/src/components/uuid/groupModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class GroupModal extends Component {

render() {
return (

<Dialog aria-labelledby="group-dialog" open={this.props.show}>
<DialogContent>
<div className="row">
Expand Down

0 comments on commit e80cdbc

Please sign in to comment.