Skip to content

Commit

Permalink
Fix display bug for generic FR collections from 2019 (#1448)
Browse files Browse the repository at this point in the history
  • Loading branch information
jarosenb authored Sep 24, 2024
1 parent f0168a3 commit 4a5e0f8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
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

0 comments on commit 4a5e0f8

Please sign in to comment.