From f07cc2e46056bf5d660b8324425eaa785cc7a773 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Fri, 20 Sep 2024 14:54:53 +0100 Subject: [PATCH] refactor: description renamed to summary --- .../src/component/events/EventTimeline/EventTimeline.tsx | 2 +- .../EventTimelineEventTooltip.tsx | 2 +- src/lib/features/events/event-search-controller.ts | 4 ++-- src/lib/openapi/spec/event-schema.ts | 7 +++---- src/lib/types/events.ts | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/frontend/src/component/events/EventTimeline/EventTimeline.tsx b/frontend/src/component/events/EventTimeline/EventTimeline.tsx index 9326754f0f..915ed492e4 100644 --- a/frontend/src/component/events/EventTimeline/EventTimeline.tsx +++ b/frontend/src/component/events/EventTimeline/EventTimeline.tsx @@ -13,7 +13,7 @@ import { export type EnrichedEvent = EventSchema & { label: string; - description: string; + summary: string; }; const StyledRow = styled('div')({ diff --git a/frontend/src/component/events/EventTimeline/EventTimelineEvent/EventTimelineEventTooltip/EventTimelineEventTooltip.tsx b/frontend/src/component/events/EventTimeline/EventTimelineEvent/EventTimelineEventTooltip/EventTimelineEventTooltip.tsx index 553daf9916..db09f744d8 100644 --- a/frontend/src/component/events/EventTimeline/EventTimelineEvent/EventTimelineEventTooltip/EventTimelineEventTooltip.tsx +++ b/frontend/src/component/events/EventTimeline/EventTimelineEvent/EventTimelineEventTooltip/EventTimelineEventTooltip.tsx @@ -44,7 +44,7 @@ export const EventTimelineEventTooltip = ({ {event.label} {eventDateTime} - {event.description} + {event.summary} ); }; diff --git a/src/lib/features/events/event-search-controller.ts b/src/lib/features/events/event-search-controller.ts index 61bc47203a..ee005a837b 100644 --- a/src/lib/features/events/event-search-controller.ts +++ b/src/lib/features/events/event-search-controller.ts @@ -112,13 +112,13 @@ export default class EventSearchController extends Controller { enrichEvents(events: IEvent[]): IEvent[] | IEnrichedEvent[] { if (this.flagResolver.isEnabled('eventTimeline')) { return events.map((event) => { - const { label, text: description } = + const { label, text: summary } = this.msgFormatter.format(event); return { ...event, label, - description, + summary, }; }); } diff --git a/src/lib/openapi/spec/event-schema.ts b/src/lib/openapi/spec/event-schema.ts index c3470ba74d..fe33fbe732 100644 --- a/src/lib/openapi/spec/event-schema.ts +++ b/src/lib/openapi/spec/event-schema.ts @@ -95,13 +95,12 @@ export const eventSchema = { label: { type: 'string', nullable: true, - description: 'A concise, human-readable name for the event.', + description: 'The concise, human-readable name of the event.', }, - description: { + summary: { type: 'string', nullable: true, - description: - 'A detailed description of the event, formatted in markdown.', + description: 'A markdown-formatted summary of the event.', }, }, components: { diff --git a/src/lib/types/events.ts b/src/lib/types/events.ts index f685d029f5..d71c28df5f 100644 --- a/src/lib/types/events.ts +++ b/src/lib/types/events.ts @@ -376,7 +376,7 @@ export interface IEvent extends Omit { export interface IEnrichedEvent extends IEvent { label: string; - description: string; + summary: string; } export interface IEventList {