Skip to content

Commit 66586e2

Browse files
Philipcursoragent
andcommitted
feat: prefer report collision probability and re-entry object dimensions
Use collision_probability_report in conjunction tables when present. Use the latest re-entry report for object width, height, and span. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 9338139 commit 66586e2

7 files changed

Lines changed: 97 additions & 53 deletions

File tree

src/__generated__/V1.ts

Lines changed: 22 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/__generated__/data-contracts.ts

Lines changed: 58 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/conjunctions/data-table/ConjunctionsDataTableColumns.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ export const getConjunctionEventsColumns = ({
122122
id: 'collision_probability_uksa',
123123
accessorKey: 'collision_probability_uksa',
124124
header: 'Conjunctions.table.poc_uksa',
125-
cell: ({ getValue }) => {
126-
const collision_probability = getValue<number>();
127-
if (collision_probability === undefined) {
125+
cell: ({ row }) => {
126+
const collision_probability = row.original.collision_probability_report ?? row.original.collision_probability_uksa;
127+
if (collision_probability === undefined || collision_probability === null) {
128128
return '-';
129129
}
130130

src/components/re-entry-alert/ReentryAlertAccordion.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const ReentryAlertAccordion = ({
4545
id: 'additional_object_details',
4646
heading: t('additional_object_details'),
4747
content: (
48-
<ReentryAlertAdditionalObjectDetailsTable event={event} dataPdf={t('additional_object_details')} isClosed={isClosed} />
48+
<ReentryAlertAdditionalObjectDetailsTable event={event} report={lastReport} dataPdf={t('additional_object_details')} isClosed={isClosed} />
4949
),
5050
},
5151
{

src/components/re-entry-alert/tables/ReentryAlertAdditionalObjectDetailsTable.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
import { useTranslations } from 'next-intl';
22
import type { HTMLProps } from 'react';
33

4-
import type { TypeReentryEventOut } from '@/__generated__/data-contracts';
4+
import type { TypeReentryEventOut, TypeReentryEventReportOut } from '@/__generated__/data-contracts';
55
import type { InformationsTableRow } from '@/components/InformationsTable';
66
import { InformationsTable } from '@/components/InformationsTable';
77

8-
type ObjectDetailsData = Pick<TypeReentryEventOut, 'international_designator' | 'norad_id' | 'object_height' | 'object_span' | 'launching_year' | 'apogee' | 'perigee' | 'inclination'>;
8+
type ObjectDetailsData = Pick<TypeReentryEventOut, 'international_designator' | 'norad_id' | 'object_height' | 'object_width' | 'object_span' | 'launching_year' | 'apogee' | 'perigee' | 'inclination'>;
99

1010
type ReentryAlertAdditionalObjectDetailsTableProps = {
1111
event: TypeReentryEventOut;
12+
report?: TypeReentryEventReportOut;
1213
dataPdf?: string;
1314
isClosed?: boolean;
1415
};
1516

16-
const ReentryAlertAdditionalObjectDetailsTable = ({ event, dataPdf, isClosed }: ReentryAlertAdditionalObjectDetailsTableProps) => {
17+
const ReentryAlertAdditionalObjectDetailsTable = ({ event, report, dataPdf, isClosed }: ReentryAlertAdditionalObjectDetailsTableProps) => {
1718
const t = useTranslations('Tables.Reentry_alert_additional_object_details');
1819

1920
const objectDetailsHeaders: HTMLProps<HTMLTableCellElement>[] = [{
@@ -35,13 +36,12 @@ const ReentryAlertAdditionalObjectDetailsTable = ({ event, dataPdf, isClosed }:
3536
},
3637
}, {
3738
header: t('object_dimensions'),
38-
renderCell: ({ object_height, object_span }) => object_height && object_span ? `${t('height')} ${object_height}m x ${t('span')} ${object_span}m` : '-',
39-
cellProps: {
40-
className: 'pl-10',
39+
renderCell: ({ object_height, object_width, object_span }) => {
40+
const width = report?.object_width || object_width;
41+
const span = report?.object_span || object_span;
42+
const height = report?.object_height || object_height;
43+
return width && span && height ? `${t('height')} ${height}m x ${t('width')} ${width}m x ${t('span')} ${span}m` : '-';
4144
},
42-
}, {
43-
header: t('launching_year'),
44-
accessorKey: 'launching_year',
4545
cellProps: {
4646
className: 'pl-10',
4747
},

0 commit comments

Comments
 (0)