From 9ed3bdc5daadb3eeefba6522d2be734db68260d0 Mon Sep 17 00:00:00 2001 From: Jake Rosenberg Date: Tue, 24 Sep 2024 13:33:55 -0500 Subject: [PATCH] Fix display bug for generic FR collections from 2019 --- .../src/projects/ProjectCollapser/ProjectCollapser.tsx | 7 ++++--- .../datafiles/src/projects/ProjectTree/ProjectTree.tsx | 4 ++-- client/modules/datafiles/src/projects/constants.ts | 4 ++++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/client/modules/datafiles/src/projects/ProjectCollapser/ProjectCollapser.tsx b/client/modules/datafiles/src/projects/ProjectCollapser/ProjectCollapser.tsx index aacdf9250..aac0067b4 100644 --- a/client/modules/datafiles/src/projects/ProjectCollapser/ProjectCollapser.tsx +++ b/client/modules/datafiles/src/projects/ProjectCollapser/ProjectCollapser.tsx @@ -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']}`; } } }, @@ -36,7 +36,8 @@ export const ProjectCollapse: React.FC< forceRender: true, label: ( - {DISPLAY_NAMES[entityName]} | {title} + {DISPLAY_NAMES[entityName] ?? 'Collection'} |{' '} + {title} ), children, diff --git a/client/modules/datafiles/src/projects/ProjectTree/ProjectTree.tsx b/client/modules/datafiles/src/projects/ProjectTree/ProjectTree.tsx index 76208dfee..b05ab1915 100644 --- a/client/modules/datafiles/src/projects/ProjectTree/ProjectTree.tsx +++ b/client/modules/datafiles/src/projects/ProjectTree/ProjectTree.tsx @@ -137,8 +137,8 @@ const RecursiveTree: React.FC<{
{DISPLAY_NAMES[treeData.name]} diff --git a/client/modules/datafiles/src/projects/constants.ts b/client/modules/datafiles/src/projects/constants.ts index bda51640b..51eb5d2cd 100644 --- a/client/modules/datafiles/src/projects/constants.ts +++ b/client/modules/datafiles/src/projects/constants.ts @@ -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 = @@ -72,6 +74,7 @@ export const PROJECT_COLORS: Record = [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' }, @@ -191,6 +194,7 @@ export const DISPLAY_NAMES: Record = { [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',