Skip to content

Commit

Permalink
added foundational data placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Thompson committed Dec 17, 2024
1 parent 7d739d6 commit aa41514
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 37 deletions.
95 changes: 60 additions & 35 deletions app/src/features/support/SupportPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ type DataMap = Partial<Record<SupportPageView, IDataItem[]>>;
const EnumMarkdownTypes: Partial<Record<SupportPageView, MarkdownTypeSupportNameEnum[]>> = {
[SupportPageView.GENERAL]: [MarkdownTypeSupportNameEnum.GENERAL],
[SupportPageView.STRUCTURE]: [MarkdownTypeSupportNameEnum.STRUCTURE],
[SupportPageView.FOUNDATION]: [MarkdownTypeSupportNameEnum.FOUNDATION],
[SupportPageView.FOUNDATION]: [
MarkdownTypeSupportNameEnum.FOUNDATION_BLOCKS_STRATA,
MarkdownTypeSupportNameEnum.FOUNDATION_TECHNIQUE,
MarkdownTypeSupportNameEnum.FOUNDATION_SAMPLING_SITE
],
[SupportPageView.DATA_STANDARDS]: [MarkdownTypeSupportNameEnum.DATA_STANDARDS],
[SupportPageView.ANIMALS]: [
MarkdownTypeSupportNameEnum.ANIMAL_ENTITY,
Expand All @@ -68,8 +72,8 @@ const dataMap: DataMap = {
label: 'General Overview',
description: [
<Typography variant="body1" gutterBottom>
Discover the purpose and functionality of SIMS, including its objectives, appropriate use cases, and the
roles and responsibilities of users within the system.
Discover the purpose and functionality of SIMS, including its objectives, appropriate use cases, and the roles
and responsibilities of users within the system.
</Typography>
],
markdownType: EnumMarkdownTypes[SupportPageView.GENERAL]?.[0] || MarkdownTypeSupportNameEnum.GENERAL
Expand All @@ -87,18 +91,43 @@ const dataMap: DataMap = {
markdownType: EnumMarkdownTypes[SupportPageView.STRUCTURE]?.[0] || MarkdownTypeSupportNameEnum.STRUCTURE
}
],

[SupportPageView.FOUNDATION]: [
{
label: 'Foundational Data',
description: [
<Typography variant="body1" gutterBottom>
Explore the core elements needed to organize ecological data, such as sites, blocks, strata, and techniques,
which form the foundation for effective data management in SIMS.
This foundational data section will detail the elements of your survey that are required to establish the
structure and context needed to support meaningful ecological data collection.
</Typography>,
<Typography variant="body1" gutterBottom>
By defining key components like strata, blocks, sampling techniques, sampling sites, and attachments,
foundational data ensure that survey observation records and broader sampling effort are organized and aligned
within the objectives of the survey.
</Typography>,
<Typography variant="body1" gutterBottom>
Establishing foundational data in your survey ensures that sampling objectives are clearly defined and that
metadata for sampling efforts are well-documented, accessible and interpretable.
</Typography>
],
markdownType: EnumMarkdownTypes[SupportPageView.FOUNDATION]?.[0] || MarkdownTypeSupportNameEnum.FOUNDATION
]
},
{
label: 'Blocks and Strata',
description: [],
markdownType: EnumMarkdownTypes[SupportPageView.FOUNDATION]?.[0]
},
{
label: 'Techniques',
description: [],
markdownType: EnumMarkdownTypes[SupportPageView.FOUNDATION]?.[1]
},
{
label: 'Sampling Sites',
description: [],
markdownType: EnumMarkdownTypes[SupportPageView.FOUNDATION]?.[2]
}
],

[SupportPageView.DATA_STANDARDS]: [
{
label: 'Data Standards Overview',
Expand All @@ -107,9 +136,7 @@ const dataMap: DataMap = {
Understand the importance of consistent formatting and adherence to data standards in SIMS. Gain guidance on
taxonomy, measurement protocols, and templates for reliable data submission.
</Typography>
],
markdownType:
EnumMarkdownTypes[SupportPageView.DATA_STANDARDS]?.[0] || MarkdownTypeSupportNameEnum.DATA_STANDARDS
]
}
],
[SupportPageView.ANIMALS]: [
Expand All @@ -133,7 +160,11 @@ const dataMap: DataMap = {
]
},
{
label: <Typography variant="h5" gutterBottom>Animal Profile</Typography>,
label: (
<Typography variant="h5" gutterBottom>
Animal Profile
</Typography>
),
description: [
<Typography variant="body1" gutterBottom>
Animal data in SIMS is managed through the “Animals” page in your survey. There are two components to animal
Expand All @@ -152,11 +183,15 @@ const dataMap: DataMap = {
markdownType: EnumMarkdownTypes[SupportPageView.ANIMALS]?.[1]
},
{
label: <Typography variant="h5" gutterBottom>Data Loading</Typography>,
label: (
<Typography variant="h5" gutterBottom>
Data Loading
</Typography>
),
description: [
<Typography variant="body1" gutterBottom>
<strong>Data Loading</strong>
</Typography>,
<strong>Data Loading</strong>
</Typography>,
<Typography variant="body1" gutterBottom>
SIMS provides flexible options for adding animal data to your system. You can either add animals individually,
one at a time using the site interface, or upload data in bulk using pre-formatted CSV files. Formatting
Expand All @@ -183,7 +218,9 @@ const dataMap: DataMap = {
making that available in SIMS.
</Typography>,
<Typography variant="body1" gutterBottom>
<strong>I placed a GPS collar on my animal during its capture event, but I am unable to add this as a marking</strong>
<strong>
I placed a GPS collar on my animal during its capture event, but I am unable to add this as a marking
</strong>
</Typography>,
<Typography variant="body1" gutterBottom>
GPS collars are associated with an animal on the telemetry page of SIMS, through a functionality called
Expand All @@ -193,6 +230,7 @@ const dataMap: DataMap = {
]
}
],

[SupportPageView.TELEMETRY]: [
{
label: 'Telemetry Overview',
Expand All @@ -214,8 +252,7 @@ const dataMap: DataMap = {
measurements. See how observations tie into foundational data and learn about data upload options.
</Typography>
],
markdownType:
EnumMarkdownTypes[SupportPageView.OBSERVATIONS]?.[0] || MarkdownTypeSupportNameEnum.OBSERVATIONS
markdownType: EnumMarkdownTypes[SupportPageView.OBSERVATIONS]?.[0] || MarkdownTypeSupportNameEnum.OBSERVATIONS
}
],
[SupportPageView.CONTACT]: [
Expand Down Expand Up @@ -278,8 +315,7 @@ const SupportPage = () => {
borderColor: grey[300],
borderRadius: '8px',
bgcolor: grey[50]
}}
>
}}>
<Stack gap={2}>
{dataMap[currentView]?.map((item, index) => (
<Box key={index}>
Expand All @@ -289,11 +325,7 @@ const SupportPage = () => {
</Box>
))}
{item.markdownType && (
<AccordionSupportCard
label={item.label}
colour={grey[100]}
markdownType={item.markdownType}
/>
<AccordionSupportCard label={item.label} colour={grey[100]} markdownType={item.markdownType} />
)}
</Box>
)) || <Typography>No content available for this section.</Typography>}
Expand All @@ -302,15 +334,10 @@ const SupportPage = () => {
<Stack
direction="row"
justifyContent={
currentIndex === 0
? 'flex-end'
: currentIndex === views.length - 1
? 'flex-start'
: 'space-between'
currentIndex === 0 ? 'flex-end' : currentIndex === views.length - 1 ? 'flex-start' : 'space-between'
}
alignItems="center"
sx={{ mt: 2 }}
>
sx={{ mt: 2 }}>
{currentIndex > 0 && (
<Box
component="button"
Expand All @@ -323,8 +350,7 @@ const SupportPage = () => {
cursor: 'pointer',
color: grey[700],
'&:hover': { color: grey[900] }
}}
>
}}>
<svg style={{ width: 24, height: 24, marginRight: 8 }}>
<path d={mdiChevronLeft} fill="currentColor" />
</svg>
Expand All @@ -344,8 +370,7 @@ const SupportPage = () => {
cursor: 'pointer',
color: grey[700],
'&:hover': { color: grey[900] }
}}
>
}}>
<Typography>Next Topic</Typography>
<svg style={{ width: 24, height: 24, marginLeft: 8 }}>
<path d={mdiChevronRight} fill="currentColor" />
Expand Down
3 changes: 3 additions & 0 deletions app/src/interfaces/useMarkdownApi.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export enum MarkdownTypeSupportNameEnum {
GENERAL = 'Support General',
STRUCTURE = 'Support Structure',
FOUNDATION = 'Support Foundation',
FOUNDATION_BLOCKS_STRATA = 'Foundation Blocks/Strata',
FOUNDATION_TECHNIQUE = 'Techniques',
FOUNDATION_SAMPLING_SITE = 'Foundation Sampling Site',
DATA_STANDARDS = 'Support Standards',
ANIMAL_ENTITY = 'Animal Entity',
ANIMAL_EVENT = 'Animal Event',
Expand Down
12 changes: 10 additions & 2 deletions database/src/migrations/20241211104011_support_markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ export async function up(knex: Knex): Promise<void> {
await knex.raw(`
SET SEARCH_PATH=biohub, public;
----------------------------------------------------------------------------------------
-- Insert into markdown_type
----------------------------------------------------------------------------------------
INSERT INTO markdown_type (name, description)
VALUES
('Animal Entity', 'Animal entity markdown text details the fields that form an animal'),
('Animal Event', 'Animal event markdown text details the fields that form animal events'),
('Animal Bulk Upload', 'Animal bulk upload markdown text details');
('Animal Bulk Upload', 'Animal bulk upload markdown text details'),
('Foundation Blocks/Strata', 'Blocks and Strata section to appropriate use'),
('Foundation Samping Site, 'Placeholder for Sampling Site Info');
----------------------------------------------------------------------------------------
-- Insert into markdown by selecting markdown_type_id based on markdown_type.name
Expand All @@ -33,11 +36,16 @@ SELECT
'Once your animal has been created, you can start attributing events to your animal. Events include both animal captures and animal mortalities.\n\n##### Capture Events\nCapture events, also referred to as animal handling events, are directly associated with an individual animal.\n Each capture event records key details such as the date, location, comments, release information, and any markings or measurements recorded for the animal at that specific point in time.\n\n##### Mortality Events\nMortality events can be reported for individual animals in your dataset.\n Each mortality event records key details such as the date, location, comments, cause of death, and any markings or measurements taken at that specific point in time.\n\nBy managing animal data and mortality events with a long-term perspective in SIMS, you can choose to contribute to building a robust dataset that supports survival analysis and informs conservation and management strategies.\n\n##### Measurements\nBody and life history measurements for an animal can be linked to its animal event, providing a detailed record of changes over time.\n The measurements are tailored to your selected species and will differ depending on the animal loaded to your surveys.\n\n##### Markings\nMarking information, whether current or newly placed, can be recorded during an event and attributed to a specific body marking location on the animal.\n These marking locations are tailored to specific taxa and will vary based on the species selected.'
WHEN mt.name = 'Animal Bulk Upload' THEN
'When using the bulk import option, the following fields can be included:\n\n##### ANIMAL\n- **Nickname**\n- **Species**: Must use ITIS numeric codes for species identification.\n- **Sex**\n- **Description**\n- **Ecological Unit Value and Option**\n\n##### CAPTURES\n- **Animal Alias**: A reference to the associated animal.\n- **Capture and Release Date**: In YYYY-MM-DD format.\n- **Capture and Release Time**: In military time, HH:MM:SS format.\n- **Capture and Release Comments**: in WGS 1984 decimal degrees format.\n\n##### MEASUREMENTS\n- **Animal Alias**: A reference to the associated animal.\n- **Capture Date and Time**: To associate the measurement with the correct capture event.\n- **Measurement Options**: A list of valid measurements for your chosen species can be found on the SIMS Standards page.\n\n##### MARKINGS\n- **Animal Alias**: A reference to the associated animal.\n- **Capture Date and Time**: To associate the marking with the correct capture event.\n- **Marking Type**: A list of valid markings can be found on the SIMS Standards page.\n- **Marking Body Location**: A list of valid marking body locations for your chosen species can be found on the SIMS Standards page.\n- **Marking Identifier**\n- **Marking Colours**: A list of valid colours can be found on the SIMS Standards page.'
WHEN mt.name = 'Foundation Blocks/Strata' THEN
'testing for blocks and strats we can put lots of text in here to explain what blocks and strata re. \n after a dash n '
WHEN mt.name = 'Foundation Sampling Site' THEN
'testing for blocks and strats we can put lots of text in here to explain what blocks and strata re. \n after a dash n '
END AS data
FROM
markdown_type mt
WHERE
mt.name IN ('Animal Entity', 'Animal Event', 'Animal Bulk Upload');
mt.name IN ('Animal Entity', 'Animal Event', 'Animal Bulk Upload', 'Foundation Blocks/Strata');
`);
}
Expand Down

0 comments on commit aa41514

Please sign in to comment.