diff --git a/src/renderer/src/scripts/guided-mode/pages/curationPreparation/openPage.js b/src/renderer/src/scripts/guided-mode/pages/curationPreparation/openPage.js index e93a4cdb8..316a66c8c 100644 --- a/src/renderer/src/scripts/guided-mode/pages/curationPreparation/openPage.js +++ b/src/renderer/src/scripts/guided-mode/pages/curationPreparation/openPage.js @@ -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 @@ -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"); + }*/ + } }; diff --git a/src/renderer/src/scripts/guided-mode/pages/openPage.js b/src/renderer/src/scripts/guided-mode/pages/openPage.js index 92e9b1bfc..7ec995dad 100644 --- a/src/renderer/src/scripts/guided-mode/pages/openPage.js +++ b/src/renderer/src/scripts/guided-mode/pages/openPage.js @@ -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"; @@ -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") {