Skip to content

Commit 99380b1

Browse files
committed
feat: ✨ Merge in latest from main
2 parents 655b668 + b1a83a5 commit 99380b1

10 files changed

+202
-137
lines changed

.zenodo.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"upload_type": "software",
33
"title": "SODA (Software to Organize Data Automatically) for SPARC",
4-
"publication_date": "2023-09-08",
4+
"publication_date": "2023-09-21",
55
"creators": [
66
{
77
"name": "Patel, Bhavesh",
@@ -32,5 +32,5 @@
3232
"access_right": "open",
3333
"license": "MIT",
3434
"keywords": ["SPARC", "FAIR", "data", "curation", "mac", "sparc-dataset", "ubuntu", "windows"],
35-
"version": "12.2.3"
35+
"version": "12.3.1"
3636
}

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to SODA will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## v.12.3.1 - 2023-09-21
9+
10+
- Fixed a bug allowing subjects and samples to be created without a name.
11+
812
## v.12.3.0 - 2023-09-13
913

1014
## Feature Additions:

CITATION.cff

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ authors:
2121
family-names: Portillo
2222
given-names: Dorian
2323
cff-version: 1.2.0
24-
date-released: '2023-09-08'
24+
date-released: '2023-09-21'
2525
identifiers:
2626
- description: DOI for this software's record on Zenodo
2727
type: doi
28-
value: https://doi.org/10.5281/zenodo.8329961
28+
value: https://doi.org/10.5281/zenodo.8368612
2929
keywords:
3030
- SPARC
3131
- FAIR
@@ -42,4 +42,4 @@ repository-code: https://github.com/fairdataihub/SODA-for-SPARC
4242
title: SODA (Software to Organize Data Automatically) for SPARC
4343
type: software
4444
url: https://fairdataihub.org/
45-
version: 12.2.3
45+
version: 12.3.1

codemeta.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
"codeRepository": "https://github.com/fairdataihub/SODA-for-SPARC",
66
"dateCreated": "2021-10-08",
77
"datePublished": "2021-10-08",
8-
"dateModified": "2023-09-08",
8+
"dateModified": "2023-09-21",
99
"downloadUrl": "https://fairdataihub.org/sodaforsparc",
1010
"issueTracker": "https://github.com/fairdataihub/SODA-for-SPARC/issues",
1111
"name": "SODA (Software to Organize Data Automatically) for SPARC",
12-
"version": "12.2.3",
13-
"identifier": "https://doi.org/10.5281/zenodo.8329961",
12+
"version": "12.3.1",
13+
"identifier": "https://doi.org/10.5281/zenodo.8368612",
1414
"description": "Simplifying data curation for researchers funded by the NIH SPARC initiative",
1515
"applicationCategory": "Scientific",
1616
"releaseNotes": "# v.10.0.4 - 2023-02-24\n\n## Bug fixes:\n\n- Imported datasets with manifests that carry incorrect headers for the standard columns (filename, timestamp, description, file type, Additional Metadata) will be preserved as extra columns.\n- Auto generating manifests will preserve column headers for each individual high level folder rather than giving the same headers to all manifests.",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
,MILK/jacob,milk,27.09.2023 12:35,file:///C:/Users/jacob/AppData/Roaming/LibreOffice/4;
Binary file not shown.
Binary file not shown.

scripts/guided-mode/guided-curate-dataset.js

+111-108
Original file line numberDiff line numberDiff line change
@@ -10324,8 +10324,12 @@ const openCopySampleMetadataPopup = async () => {
1032410324

1032510325
const specifySubject = (event, subjectNameInput) => {
1032610326
if (event.which == 13) {
10327+
const userEnteredSubjectName = subjectNameInput.val().trim();
10328+
if (userEnteredSubjectName.length === 0) {
10329+
return;
10330+
}
1032710331
try {
10328-
const subjectName = `sub-${subjectNameInput.val().trim()}`;
10332+
const subjectName = `sub-${userEnteredSubjectName}`;
1032910333
const subjectNameElement = `
1033010334
<div class="space-between w-100">
1033110335
<span class="subject-id">${subjectName}</span>
@@ -10342,28 +10346,26 @@ const specifySubject = (event, subjectNameInput) => {
1034210346
subjectIdCellToAddNameTo[0].parentElement.nextElementSibling.children[0];
1034310347
trashCanElement.style.display = "block";
1034410348

10345-
if (subjectName.length > 0) {
10346-
const subjectNameIsValid = evaluateStringAgainstSdsRequirements(
10347-
subjectName,
10348-
"string-adheres-to-identifier-conventions"
10349-
);
10350-
if (!subjectNameIsValid) {
10351-
generateAlertMessage(subjectNameInput);
10352-
return;
10353-
}
10354-
//remove the add subject help text
10355-
document.getElementById("guided-add-subject-instructions").classList.add("hidden");
10356-
removeAlertMessageIfExists(subjectNameInput);
10357-
if (subjectNameInput.attr("data-prev-name")) {
10358-
const subjectToRename = subjectNameInput.attr("data-prev-name");
10359-
sodaJSONObj.renameSubject(subjectToRename, subjectName);
10360-
} else {
10361-
//case where subject name is valid and not being renamed:
10362-
sodaJSONObj.addSubject(subjectName);
10363-
}
10364-
subjectIdCellToAddNameTo.html(subjectNameElement);
10365-
addSubjectSpecificationTableRow();
10349+
const subjectNameIsValid = evaluateStringAgainstSdsRequirements(
10350+
subjectName,
10351+
"string-adheres-to-identifier-conventions"
10352+
);
10353+
if (!subjectNameIsValid) {
10354+
generateAlertMessage(subjectNameInput);
10355+
return;
10356+
}
10357+
//remove the add subject help text
10358+
document.getElementById("guided-add-subject-instructions").classList.add("hidden");
10359+
removeAlertMessageIfExists(subjectNameInput);
10360+
if (subjectNameInput.attr("data-prev-name")) {
10361+
const subjectToRename = subjectNameInput.attr("data-prev-name");
10362+
sodaJSONObj.renameSubject(subjectToRename, subjectName);
10363+
} else {
10364+
//case where subject name is valid and not being renamed:
10365+
sodaJSONObj.addSubject(subjectName);
1036610366
}
10367+
subjectIdCellToAddNameTo.html(subjectNameElement);
10368+
addSubjectSpecificationTableRow();
1036710369
} catch (error) {
1036810370
notyf.open({
1036910371
duration: "3000",
@@ -10380,9 +10382,14 @@ const specifySample = (event, sampleNameInput) => {
1038010382
.previousElementSibling;
1038110383

1038210384
let addSampleButton = buttonContainer.children[0].children[0].children[1];
10385+
1038310386
if (event.which == 13) {
10387+
const userEnteredSample = sampleNameInput.val().trim();
10388+
if (userEnteredSample.length === 0) {
10389+
return;
10390+
}
1038410391
try {
10385-
const sampleName = `sam-${sampleNameInput.val().trim()}`;
10392+
const sampleName = `sam-${userEnteredSample}`;
1038610393
const sampleRenameElement = `
1038710394
<div class="space-between w-100">
1038810395
<span class="sample-id">${sampleName}</span>
@@ -10404,40 +10411,34 @@ const specifySample = (event, sampleNameInput) => {
1040410411
.text();
1040510412
const subjectToAddSampleTo = subjectSampleAdditionTable.find(".samples-subject-name").text();
1040610413

10407-
if (sampleName.length > 0) {
10408-
const sampleNameIsValid = evaluateStringAgainstSdsRequirements(
10414+
const sampleNameIsValid = evaluateStringAgainstSdsRequirements(
10415+
sampleName,
10416+
"string-adheres-to-identifier-conventions"
10417+
);
10418+
if (!sampleNameIsValid) {
10419+
//show alert message below pool name input if input is invalid and abort function
10420+
generateAlertMessage(sampleNameInput);
10421+
return;
10422+
}
10423+
removeAlertMessageIfExists(sampleNameInput);
10424+
10425+
if (sampleNameInput.attr("data-prev-name")) {
10426+
const sampleToRename = sampleNameInput.attr("data-prev-name");
10427+
sodaJSONObj.renameSample(
10428+
sampleToRename,
1040910429
sampleName,
10410-
"string-adheres-to-identifier-conventions"
10430+
subjectsPoolToAddSampleTo,
10431+
subjectToAddSampleTo
1041110432
);
10412-
if (!sampleNameIsValid) {
10413-
//show alert message below pool name input if input is invalid and abort function
10414-
generateAlertMessage(sampleNameInput);
10415-
return;
10416-
}
10417-
removeAlertMessageIfExists(sampleNameInput);
10418-
10419-
if (sampleNameInput.attr("data-prev-name")) {
10420-
const sampleToRename = sampleNameInput.attr("data-prev-name");
10421-
sodaJSONObj.renameSample(
10422-
sampleToRename,
10423-
sampleName,
10424-
subjectsPoolToAddSampleTo,
10425-
subjectToAddSampleTo
10426-
);
10427-
} else {
10428-
//Add the new sample to sodaJSONObj
10429-
sodaJSONObj.addSampleToSubject(
10430-
sampleName,
10431-
subjectsPoolToAddSampleTo,
10432-
subjectToAddSampleTo
10433-
);
10434-
//then show trash can svg
10435-
sampleTrashCan.style.display = "block";
10436-
}
10437-
sampleIdCellToAddNameTo.html(sampleRenameElement);
10438-
if (!sampleNameInput.attr("data-prev-name")) {
10439-
addSampleSpecificationTableRow(addSampleButton);
10440-
}
10433+
} else {
10434+
//Add the new sample to sodaJSONObj
10435+
sodaJSONObj.addSampleToSubject(sampleName, subjectsPoolToAddSampleTo, subjectToAddSampleTo);
10436+
//then show trash can svg
10437+
sampleTrashCan.style.display = "block";
10438+
}
10439+
sampleIdCellToAddNameTo.html(sampleRenameElement);
10440+
if (!sampleNameInput.attr("data-prev-name")) {
10441+
addSampleSpecificationTableRow(addSampleButton);
1044110442
}
1044210443
} catch (error) {
1044310444
console.log(error);
@@ -10452,8 +10453,12 @@ const specifySample = (event, sampleNameInput) => {
1045210453

1045310454
const specifyPool = (event, poolNameInput) => {
1045410455
if (event.which == 13) {
10456+
const userEnteredPoolName = poolNameInput.val().trim();
10457+
if (userEnteredPoolName.length === 0) {
10458+
return;
10459+
}
1045510460
try {
10456-
const poolName = `pool-${poolNameInput.val().trim()}`;
10461+
const poolName = `pool-${userEnteredPoolName}`;
1045710462
const poolNameElement = `
1045810463
<div class="space-between" style="width: 250px;">
1045910464
<span class="pool-id">${poolName}</span>
@@ -10477,65 +10482,63 @@ const specifyPool = (event, poolNameInput) => {
1047710482
const poolTrashcan = poolSubjectsDropdownCell[0].nextElementSibling.children[0];
1047810483
const poolIdCellToAddNameTo = poolNameInput.parent();
1047910484
let poolsTable = $("#pools-table");
10480-
if (poolName !== "pool-") {
10481-
const poolNameIsValid = evaluateStringAgainstSdsRequirements(
10482-
poolName,
10483-
"string-adheres-to-identifier-conventions"
10484-
);
10485-
if (!poolNameIsValid) {
10486-
notyf.open({
10487-
duration: "3000",
10488-
type: "error",
10489-
message: "Pool IDs may not contain spaces or special characters",
10490-
});
10491-
return;
10492-
}
10493-
removeAlertMessageIfExists(poolsTable);
10494-
if (poolNameInput.attr("data-prev-name")) {
10495-
const poolFolderToRename = poolNameInput.attr("data-prev-name");
10485+
const poolNameIsValid = evaluateStringAgainstSdsRequirements(
10486+
poolName,
10487+
"string-adheres-to-identifier-conventions"
10488+
);
10489+
if (!poolNameIsValid) {
10490+
notyf.open({
10491+
duration: "3000",
10492+
type: "error",
10493+
message: "Pool IDs may not contain spaces or special characters",
10494+
});
10495+
return;
10496+
}
10497+
removeAlertMessageIfExists(poolsTable);
10498+
if (poolNameInput.attr("data-prev-name")) {
10499+
const poolFolderToRename = poolNameInput.attr("data-prev-name");
1049610500

10497-
sodaJSONObj.renamePool(poolFolderToRename, poolName);
10501+
sodaJSONObj.renamePool(poolFolderToRename, poolName);
1049810502

10499-
//refresh the UI to update the dropdowns to avoid having to update select2 dropdowns
10500-
setActiveSubPage("guided-organize-subjects-into-pools-page");
10501-
return;
10502-
} else {
10503-
//Add left border back to subject dropdown cell to separate pool name and subject dropdown
10504-
poolSubjectsDropdownCell.removeClass("remove-left-border");
10503+
//refresh the UI to update the dropdowns to avoid having to update select2 dropdowns
10504+
setActiveSubPage("guided-organize-subjects-into-pools-page");
10505+
return;
10506+
} else {
10507+
//Add left border back to subject dropdown cell to separate pool name and subject dropdown
10508+
poolSubjectsDropdownCell.removeClass("remove-left-border");
1050510509

10506-
//Add the new pool to sodaJSONObj
10507-
sodaJSONObj.addPool(poolName);
10508-
poolTrashcan.style.display = "block";
10510+
//Add the new pool to sodaJSONObj
10511+
sodaJSONObj.addPool(poolName);
10512+
poolTrashcan.style.display = "block";
1050910513

10510-
//Add the select2 base element
10511-
poolSubjectsDropdownCell.html(poolSubjectSelectElement);
10514+
//Add the select2 base element
10515+
poolSubjectsDropdownCell.html(poolSubjectSelectElement);
1051210516

10513-
//Get the newly created select2 element
10514-
const newPoolSubjectsSelectElement = document.querySelector(
10515-
`select[name="${poolName}-subjects-selection-dropdown"]`
10516-
);
10517+
//Get the newly created select2 element
10518+
const newPoolSubjectsSelectElement = document.querySelector(
10519+
`select[name="${poolName}-subjects-selection-dropdown"]`
10520+
);
1051710521

10518-
//create a select2 dropdown for the pool subjects
10519-
$(newPoolSubjectsSelectElement).select2({
10520-
placeholder: "Select subjects",
10521-
tags: true,
10522-
width: "100%",
10523-
closeOnSelect: false,
10524-
});
10525-
$(newPoolSubjectsSelectElement).on("select2:open", (e) => {
10526-
updatePoolDropdown($(e.currentTarget), poolName);
10527-
});
10528-
$(newPoolSubjectsSelectElement).on("select2:unselect", (e) => {
10529-
const subjectToRemove = e.params.data.id;
10530-
sodaJSONObj.moveSubjectOutOfPool(subjectToRemove, poolName);
10531-
});
10532-
$(newPoolSubjectsSelectElement).on("select2:select", function (e) {
10533-
const selectedSubject = e.params.data.id;
10534-
sodaJSONObj.moveSubjectIntoPool(selectedSubject, poolName);
10535-
});
10536-
}
10537-
poolIdCellToAddNameTo.html(poolNameElement);
10522+
//create a select2 dropdown for the pool subjects
10523+
$(newPoolSubjectsSelectElement).select2({
10524+
placeholder: "Select subjects",
10525+
tags: true,
10526+
width: "100%",
10527+
closeOnSelect: false,
10528+
});
10529+
$(newPoolSubjectsSelectElement).on("select2:open", (e) => {
10530+
updatePoolDropdown($(e.currentTarget), poolName);
10531+
});
10532+
$(newPoolSubjectsSelectElement).on("select2:unselect", (e) => {
10533+
const subjectToRemove = e.params.data.id;
10534+
sodaJSONObj.moveSubjectOutOfPool(subjectToRemove, poolName);
10535+
});
10536+
$(newPoolSubjectsSelectElement).on("select2:select", function (e) {
10537+
const selectedSubject = e.params.data.id;
10538+
sodaJSONObj.moveSubjectIntoPool(selectedSubject, poolName);
10539+
});
1053810540
}
10541+
poolIdCellToAddNameTo.html(poolNameElement);
1053910542
} catch (error) {
1054010543
notyf.open({
1054110544
duration: "3000",

scripts/meta/announcements.json

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
{
2+
"12.3.1": {
3+
"announcements": {
4+
"bug-fixes": ["Fixed a bug allowing subjects and samples to be created without a name."],
5+
"features": []
6+
}
7+
},
28
"12.3.0": {
39
"announcements": {
410
"bug-fixes": [

0 commit comments

Comments
 (0)