Skip to content

Commit

Permalink
wip: Updated dataset content page text
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobiClark committed Jan 30, 2025
1 parent 0d0ac5b commit ed07d75
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 22 deletions.
53 changes: 33 additions & 20 deletions src/renderer/src/components/shared/DatasetContentSelector/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Card, Stack, Text, Group, Tooltip } from "@mantine/core";
import { Card, Stack, Text, Group, Tooltip, Checkbox, Box } from "@mantine/core";
import { IconCheck } from "@tabler/icons-react";
import FullWidthContainer from "../../containers/FullWidthContainer";
import useGlobalStore from "../../../stores/globalStore";
Expand All @@ -12,31 +12,32 @@ const DatasetContentSelector = () => {
const contentOptions = [
{
value: "subjects",
label: "I collected data from subjects",
description:
"Individual entities, such as humans, animals, or other biological specimens, from which data was collected during the study.",
"Subjects are individual entities, such as humans, animals, or other biological specimens, from which data was collected during the study.",
},
{
value: "samples",
label: "I collected samples from subjects",
description:
"Biological specimens, such as tissue, blood, or fluid, collected from subjects for analysis or experimentation.",
"Samples are biological or physical specimens collected from subjects, such as tissue samples, blood samples, or other biological materials.",
dependsOn: "subjects",
},
{
value: "sites",
description:
"Multiple distinct anatomical or geographical locations where data was collected from subjects during the study.",
label: "I collected data from multiple physical locations on the same subject or sample",
dependsOn: "subjects",
},
{
value: "performances",
description:
"Multiple distinct performances of the same experimental protocol on the same subject or sample (e.g., multiple visits, runs, sessions, or executions).",
label: "I collected data from multiple performances of the same protocol",
dependsOn: "subjects",
},
{
value: "code",
label: "I used code to generate or analyze the collected data",
description:
"Scripts, computational models, analysis pipelines, or other code/tools used during the study for data processing or analysis.",
"Code includes scripts, computational models, analysis pipelines, or other software used to generate, process, or analyze the data.",
},
];

Expand Down Expand Up @@ -67,18 +68,19 @@ const DatasetContentSelector = () => {
<Tooltip
key={option.value}
label={
isDisabled
? `Requires ${upperCaseFirstLetter(option.dependsOn)} to be selected`
: isSelected
? `${upperCaseFirstLetter(option.value)} is selected`
: ""
option.dependsOn &&
`${upperCaseFirstLetter(
option.dependsOn
)} must be selected before choosing this option.`
}
disabled={!isDisabled && !isSelected}
disabled={!isDisabled}
zIndex={2999}
>
<Card
withBorder
shadow="sm"
padding="lg"
ml={option.dependsOn ? "xl" : 0}
style={{
opacity: isDisabled ? 0.6 : 1,
cursor: isDisabled ? "not-allowed" : "pointer",
Expand All @@ -91,15 +93,26 @@ const DatasetContentSelector = () => {
if (!isDisabled) handleEntitySelection(option.value);
}}
>
<Group position="apart" align="flex-start">
<Group position="apart" align="center">
<Checkbox
checked={isSelected}
onChange={() => {
if (!isDisabled) handleEntitySelection(option.value);
}}
style={{
cursor: isDisabled ? "not-allowed" : "pointer",
}}
onClick={(event) => event.stopPropagation()}
/>
<Text fw={700} size="lg">
{upperCaseFirstLetter(option.value)}
{option.label}
</Text>
{isSelected && <IconCheck size={18} color="var(--color-light-green)" />}
</Group>
<Text size="sm" mt="xs">
{option.description}
</Text>
{option.description && (
<Text size="sm" mt="xs">
{option.description}
</Text>
)}
</Card>
</Tooltip>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,7 @@ const savePageChanges = async (pageBeingLeftID) => {
if (selectedEntities.length === 0) {
errorArray.push({
type: "notyf",
message: "Please select at least one entity to continue",
message: "Please select at least one option that applies to your dataset",
});
throw errorArray;
}
Expand Down Expand Up @@ -5258,6 +5258,10 @@ window.openPage = async (targetPageID) => {
guidedUpdateFolderStructureUI("docs/");
setTreeViewDatasetStructure(window.datasetStructureJSONObj, ["docs"]);
}
if (targetPageID === "guided-aux-folder-tab") {
guidedUpdateFolderStructureUI("aux/");
setTreeViewDatasetStructure(window.datasetStructureJSONObj, ["docs"]);
}

if (targetPageID === "guided-dataset-structure-review-tab") {
setTreeViewDatasetStructure(window.datasetStructureJSONObj, []);
Expand Down
19 changes: 18 additions & 1 deletion src/renderer/src/sections/guided_mode/guided_curate_dataset.html
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,9 @@ <h1 class="text-sub-step-title">Before getting started</h1>
>
<h1 class="text-sub-step-title">Describe the content of your dataset</h1>
<div class="guided--section">
<p class="help-text">Select the types of entities that are included in your dataset.</p>
<p class="help-text">
Select all of the following that apply to the data you collected:
</p>
</div>
<div data-component-type="dataset-content-selector" class="guided--section"></div>
</div>
Expand Down Expand Up @@ -1707,6 +1709,21 @@ <h1 class="text-sub-step-title">Docs importation</h1>
class="guided--section"
></div>
</div>
<div id="guided-aux-folder-tab" class="guided--page" data-page-name="Auxiliary data import">
<div class="guided--section">
<h1 class="text-sub-step-title">Auxiliary data importation</h1>
<p class="help-text">
Import any files that may be needed as part of a publication process to support the
needs of a particular publication platform
</p>
</div>
<div
data-component-type="data-importer"
data-data-type="Auxiliary data"
data-relative-folder-path-to-import-data-into="aux/"
class="guided--section"
></div>
</div>

<div
id="guided-dataset-structure-review-tab"
Expand Down

0 comments on commit ed07d75

Please sign in to comment.