Skip to content

Commit

Permalink
wip: separate open page cont'd - curation prep
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronm-2112 committed Feb 10, 2025
1 parent a59b5b1 commit bdbdf7c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { clientError } from "../../../others/http-error-handler/error-handler";
import { guidedShowOptionalRetrySwal } from "../../swals/helperSwals";
import { userErrorMessage } from "../../../others/http-error-handler/error-handler";
import { setPageLoadingState } from "../../pageNavigation/pageLoading";
import { setSelectedEntities } from "../../../../stores/slices/datasetContentSelectorSlice.js";
import client from "../../../client";

// TODO: Place this inside of a SODAJSONObj accessing file/function that is imported across all guided mode files
Expand Down Expand Up @@ -108,4 +109,22 @@ export const openPageCurationPreparation = async (targetPageID) => {
setGuidedDatasetSubtitle(datasetSubtitle);
}
}

if (targetPageID === "guided-prepare-dataset-structure-tab") {
setSelectedEntities(window.sodaJSONObj["selected-entities"] || []);
/*
// If the user has already added subjects, disallow them from selecting no (they have to go to the subject
// page to delete subjects but this would be a very strange case anyways)
const [subjectsInPools, subjectsOutsidePools] = window.sodaJSONObj.getAllSubjects();
const subjects = [...subjectsInPools, ...subjectsOutsidePools];
const subjectQuerySectioin = document.getElementById("guided-section-subject-yes-no");
const infoText = document.getElementById("subject-deletion-block-text");
if (subjects.length > 0) {
subjectQuerySectioin.classList.add("section-disabled");
infoText.classList.remove("hidden");
} else {
subjectQuerySectioin.classList.remove("section-disabled");
infoText.classList.add("hidden");
}*/
}
};
19 changes: 0 additions & 19 deletions src/renderer/src/scripts/guided-mode/pages/openPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { externallySetSearchFilterValue } from "../../../stores/slices/datasetTr
import { guidedSetNavLoadingState } from "../pageNavigation/pageLoading.js";
import Swal from "sweetalert2";
import { userErrorMessage } from "../../others/http-error-handler/error-handler.js";
import { setSelectedEntities } from "../../../stores/slices/datasetContentSelectorSlice.js";
import { getNonSkippedGuidedModePages } from "../pageNavigation/pageSkipping.js";
import { startOrStopAnimationsInContainer } from "../lotties/lottie.js";

Expand Down Expand Up @@ -438,24 +437,6 @@ export const openPage = async (targetPageID) => {
importProgressCircle.classList.add("hidden");
}

if (targetPageID === "guided-prepare-dataset-structure-tab") {
setSelectedEntities(window.sodaJSONObj["selected-entities"] || []);
/*
// If the user has already added subjects, disallow them from selecting no (they have to go to the subject
// page to delete subjects but this would be a very strange case anyways)
const [subjectsInPools, subjectsOutsidePools] = window.sodaJSONObj.getAllSubjects();
const subjects = [...subjectsInPools, ...subjectsOutsidePools];
const subjectQuerySectioin = document.getElementById("guided-section-subject-yes-no");
const infoText = document.getElementById("subject-deletion-block-text");
if (subjects.length > 0) {
subjectQuerySectioin.classList.add("section-disabled");
infoText.classList.remove("hidden");
} else {
subjectQuerySectioin.classList.remove("section-disabled");
infoText.classList.add("hidden");
}*/
}

await openPageCurationPreparation(targetPageID);

// if (targetPageID === "guided-prepare-helpers-tab") {
Expand Down

0 comments on commit bdbdf7c

Please sign in to comment.