Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix: Fix display bug for generic FR collections from 2019 #1448

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export const ProjectCollapse: React.FC<
if (header.length > 0) {
const headerElement = header[0] as HTMLElement;
headerElement.style.backgroundColor =
PROJECT_COLORS[entityName]['fill'];
headerElement.style.border = `1px solid ${PROJECT_COLORS[entityName]['outline']}`;
PROJECT_COLORS[entityName]?.['fill'];
headerElement.style.border = `1px solid ${PROJECT_COLORS[entityName]?.['outline']}`;
}
}
},
Expand All @@ -36,7 +36,8 @@ export const ProjectCollapse: React.FC<
forceRender: true,
label: (
<span>
{DISPLAY_NAMES[entityName]} | <strong>{title}</strong>
{DISPLAY_NAMES[entityName] ?? 'Collection'} |{' '}
<strong>{title}</strong>
</span>
),
children,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ const RecursiveTree: React.FC<{
<div
className={styles['tree-list-badge']}
style={{
backgroundColor: PROJECT_COLORS[treeData.name].fill,
outline: `1px solid ${PROJECT_COLORS[treeData.name].outline}`,
backgroundColor: PROJECT_COLORS[treeData.name]?.fill,
outline: `1px solid ${PROJECT_COLORS[treeData.name]?.outline}`,
}}
>
{DISPLAY_NAMES[treeData.name]}
Expand Down
4 changes: 4 additions & 0 deletions client/modules/datafiles/src/projects/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export const SIMULATION_MODEL = 'designsafe.project.simulation.model';
export const SIMULATION_INPUT = 'designsafe.project.simulation.input';
export const SIMULATION_OUTPUT = 'designsafe.project.simulation.output';
// Field Research
export const FIELD_RECON_COLLECTION =
'designsafe.project.field_recon.collection';
export const FIELD_RECON_MISSION = 'designsafe.project.field_recon.mission';
export const FIELD_RECON_REPORT = 'designsafe.project.field_recon.report';
export const FIELD_RECON_SOCIAL_SCIENCE =
Expand Down Expand Up @@ -72,6 +74,7 @@ export const PROJECT_COLORS: Record<string, { outline: string; fill: string }> =
[HYBRID_SIM_SIM_SUBSTRUCTURE]: { outline: '#BD5717', fill: '#EBCCB9' },
[HYBRID_SIM_SIM_OUTPUT]: { outline: '#B59300', fill: '#ECE4BF' },

[FIELD_RECON_COLLECTION]: { outline: '#43A59D', fill: '#CAE9E6' },
[FIELD_RECON_REPORT]: { outline: '#cccccc', fill: '#f5f5f5' },
[FIELD_RECON_MISSION]: { outline: '#000000', fill: '#ffffff' },
[FIELD_RECON_GEOSCIENCE]: { outline: '#43A59D', fill: '#CAE9E6' },
Expand Down Expand Up @@ -191,6 +194,7 @@ export const DISPLAY_NAMES: Record<string, string> = {
[HYBRID_SIM_SIM_OUTPUT]: 'Simulation Output',
// Field Recon
[FIELD_RECON_MISSION]: 'Mission',
[FIELD_RECON_COLLECTION]: 'Collection',
[FIELD_RECON_GEOSCIENCE]: 'Geoscience Collection',
[FIELD_RECON_SOCIAL_SCIENCE]: 'Social Science Collection',
[FIELD_RECON_REPORT]: 'Document Collection',
Expand Down
Loading