Skip to content

Commit

Permalink
feat: ✨ fixed page skipping
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobiClark committed Nov 28, 2023
1 parent b29fbfa commit db78e03
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 72 deletions.
22 changes: 12 additions & 10 deletions scripts/guided-mode/guided-curate-dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -1132,18 +1132,20 @@ const savePageChanges = async (pageBeingLeftID) => {
const datasetHasCode = sodaJSONObj["dataset-contains-code"];

if (datasetHasSubjects) {
guidedUnSkipPage("guided-subjects-specification-tab");
guidedUnSkipPage("guided-subjects-pooling-tab");
guidedUnSkipPage("guided-samples-specification-tab");
guidedUnSkipPage("guided-subjects-dataset-structure-specification-tab");
guidedUnSkipPage("guided-subjects-addition-tab");

guidedUnSkipPage("guided-primary-data-organization-tab");
guidedUnSkipPage("guided-source-data-organization-tab");
guidedUnSkipPage("guided-derivative-data-organization-tab");
guidedUnSkipPage("guided-create-subjects-metadata-tab");
guidedUnSkipPage("guided-create-subjects-metadata-tab");
guidedUnSkipPage("guided-create-samples-metadata-tab");
} else {
guidedSkipPage("guided-subjects-specification-tab");
guidedSkipPage("guided-subjects-dataset-structure-specification-tab");
guidedSkipPage("guided-subjects-addition-tab");
guidedSkipPage("guided-subjects-pooling-tab");
guidedSkipPage("guided-samples-specification-tab");
guidedSkipPage("guided-samples-addition-tab");

guidedSkipPage("guided-primary-data-organization-tab");
guidedSkipPage("guided-source-data-organization-tab");
guidedSkipPage("guided-derivative-data-organization-tab");
Expand Down Expand Up @@ -1196,7 +1198,7 @@ const savePageChanges = async (pageBeingLeftID) => {
//have any pools
if (Object.keys(pools).length === 0) {
errorArray.push({
type: "error",
type: "notyf",
message:
"Please add at least one pool or indicate that your dataset does not contain pools.",
});
Expand All @@ -1219,7 +1221,7 @@ const savePageChanges = async (pageBeingLeftID) => {
}
}

if (pageBeingLeftID === "guided-subjects-specification-tab") {
if (pageBeingLeftID === "guided-subjects-dataset-structure-specification-tab") {
const userSelectedDatasetHasPools = document
.getElementById("guided-button-subjects-are-pooled")
.classList.contains("selected");
Expand Down Expand Up @@ -5023,7 +5025,7 @@ const openPage = async (targetPageID) => {
importProgressCircle.classList.add("hidden");
}

if (targetPageID === "guided-subjects-specification-tab") {
if (targetPageID === "guided-subjects-dataset-structure-specification-tab") {
const subjectPoolingQuerySection = document.getElementById(
"guided-section-subject-pooling-yes-no"
);
Expand Down Expand Up @@ -15779,7 +15781,7 @@ const saveSubPageChanges = async (openSubPageID) => {
errorArray.push({
type: "error",
message:
"Please add at least one pool or indicate that your dataset does not contain pools.",
"Please add at least one pool or go back and indicate that your dataset does not contain pools.",
});
throw errorArray;
}
Expand Down
67 changes: 5 additions & 62 deletions sections/guided_mode/guided_curate_dataset.html
Original file line number Diff line number Diff line change
Expand Up @@ -1155,13 +1155,14 @@ <h1 class="text-sub-step-title">Dataset name and subtitle</h1>
>
<div class="guided--capsule-container">
<div class="guided--capsule" id="guided-dataset-structure-intro-capsule"></div>
<div class="guided--capsule" id="guided-subjects-specification-capsule"></div>
<div
class="guided--capsule"
id="guided-subjects-dataset-structure-specification-capsule"
></div>
<div class="guided--capsule" id="guided-subjects-addition-capsule"></div>
<div class="guided--capsule" id="guided-subjects-pooling-capsule"></div>
<div class="guided--capsule" id="guided-samples-addition-capsule"></div>
<div class="guided--capsule" id="guided-samples-specification-capsule"></div>
<div class="guided--capsule" id="guided-primary-data-organization-capsule"></div>
<div class="guided--capsule" id="guided-subjects-folder-capsule"></div>
<div class="guided--capsule" id="guided-source-data-organization-capsule"></div>
<div class="guided--capsule" id="guided-derivative-data-organization-capsule"></div>
<div class="guided--capsule" id="guided-code-folder-capsule"></div>
Expand Down Expand Up @@ -1194,7 +1195,7 @@ <h2 class="guided--text-user-directions">
</div>

<div
id="guided-subjects-specification-tab"
id="guided-subjects-dataset-structure-specification-tab"
class="guided--page"
data-page-name="Dataset structure"
>
Expand Down Expand Up @@ -1497,64 +1498,6 @@ <h1 class="text-sub-step-title">Samples specification</h1>
<div class="guided--section" id="guided-section-samples-tables"></div>
</div>

<!--<div
id="guided-subjects-folder-tab"
class="guided--page"
data-page-name="Dataset structuring"
>
<h1 class="text-sub-step-title">Dataset structuring</h1>
<div class="guided--section">
<p class="help-text">
The core folders that contain data in a SPARC dataset are the primary, source, and
derivative folders, which are structured based off of the characteristics of your
subjects that data was extracted from. In the interface below, you can specify the
structure of subjects which SODA will use to automatically generate the structure of
the primary, source, and derivative folders.
</p>
<p class="help-text">
If your dataset contains a large number of subjects or samples, you can also use the
spreadsheet import feature which will allow you to insert the data in an external
spreadsheet and import it in to SODA.
</p>
<p class="help-text">
To download the spreadsheet template, click the button below.<br />
</p>
<button class="guided-subject-sample-pool-structure-download-button">
Download subject/pool/samples template
</button>
<p class="help-text">
Once you have added your structure to the spreadsheet, import it below.<br />
</p>
<div
class="file-import-container horizontal"
id="guided-container-subjects-pools-samples-structure-import"
data-file-name="subjects_pools_samples_structure"
>
<div
id="guided-lottie-import-subjects-pools-samples-excel-file"
class="lottieAnimationContainer guided--container-lottie-small"
></div>
<p class="help-text text-center">
Drag and Drop <b>subjects_pools_samples_structure.xslx</b>
</p>
<p class="help-text text-center mt-md mb-md">OR</p>
<button
class="ui primary basic button mt-sm"
onclick="importMetadataFiles(this, 'code_description', ['.xlsx'], 'guided-code-description-para-text', 'guided')"
>
<i class="fas fa-file-import" style="margin-right: 7px"></i>Import
subjects_pools_samples_structure.xslx
</button>
<p
class="help-text small text-center mt-sm"
id="guided-code-description-para-text"
style="max-width: 240px; overflow-wrap: break-word"
></p>
</div>
</div>
<button id="guided-button-add-a-subject">Add an individual subject</button>
<button>Add subjects from folders</button>
</div>-->
<div
id="guided-primary-data-organization-tab"
class="guided--page"
Expand Down

0 comments on commit db78e03

Please sign in to comment.