Skip to content
Open
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 @@ -106,7 +106,7 @@
font-weight: 600;
font-size: 14px;
text-transform: capitalize;
margin: 2px 0;
margin: 2px 2px;
}

.eventDetailCard :global(.ant-card-body) {
Expand Down
10 changes: 4 additions & 6 deletions client/modules/reconportal/src/ReconSidePanel/ReconSidePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ export const ReconSidePanel: React.FC<LayoutProps> = ({
const title = event.title;
const description = event.location_description;
const date = event.event_date;
const eventType = event.event_type;
const eventType =
eventTypes.find((type) => type.name === event.event_type)?.display_name ||
event.event_type;

return (
<div className={styles.eventContainer}>
Expand All @@ -144,11 +146,7 @@ export const ReconSidePanel: React.FC<LayoutProps> = ({
</Text>
<Tag
color={getReconEventColor(event)}
style={{
fontWeight: 600,
fontSize: 14,
textTransform: 'capitalize',
}}
className={styles.eventDetailTag}
>
{eventType}
</Tag>
Expand Down
24 changes: 24 additions & 0 deletions client/modules/reconportal/src/utils/colors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ export const EVENT_TYPE_COLORS = {
landslide: ' #57D657',
hurricane: ' #47A59D',
tornado: ' #FF5722',
storm_surge: '#2E86AB',
extreme_temperature: '#8B4789',
drought: '#795548',
wind: '#1E3A8A', //Needs to be added to elastic search
fire: '#EC407A',
pandemic: '#FFA726',
multi: '#6B8E23',
thunderstorm: '#607D8B',
};

export function getReconEventColor(
Expand All @@ -49,6 +57,22 @@ export function getReconEventColor(
return EVENT_TYPE_COLORS.hurricane;
case 'tornado':
return EVENT_TYPE_COLORS.tornado;
case 'storm_surge':
return EVENT_TYPE_COLORS.storm_surge;
case 'extreme_temperature':
return EVENT_TYPE_COLORS.extreme_temperature;
case 'drought':
return EVENT_TYPE_COLORS.drought;
case 'wind':
return EVENT_TYPE_COLORS.wind;
case 'fire':
return EVENT_TYPE_COLORS.fire;
case 'pandemic':
return EVENT_TYPE_COLORS.pandemic;
case 'multi':
return EVENT_TYPE_COLORS.multi;
case 'thunderstorm':
return EVENT_TYPE_COLORS.thunderstorm;
default:
return '#666666'; // Default gray color
}
Expand Down
1 change: 1 addition & 0 deletions designsafe/apps/rapid/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def index(request):

def get_event_types(request):
s = RapidNHEventType.search()
s = s.extra(size=40) # Allows up to 40 event types
try:
results = s.execute(ignore_cache=True)
except (TransportError, ConnectionTimeout) as err:
Expand Down