Skip to content

Commit c455471

Browse files
author
Philip
committed
feat: organisation page, distribution list, and alert UI updates
- Add /organisations/[id] page with title and heading from getOrganisation - Link activity operator names to /organisations/:id - Reorder distribution list (re-entry, fragmentation, conjunction); add fragmentation help copy - Move conjunction alerts section later in alert settings accordion - Show conjunction potential impact accordion only when impact comments exist Made-with: Cursor
1 parent 30a6395 commit c455471

6 files changed

Lines changed: 144 additions & 73 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { getOrganisation } from '@/actions/getOrganisation';
2+
3+
type PageProps = {
4+
params: Promise<{ id: string }>;
5+
};
6+
7+
export async function generateMetadata({
8+
params,
9+
}: PageProps) {
10+
const { id } = await params;
11+
const organisations = await getOrganisation(id);
12+
return {
13+
title: organisations.name,
14+
};
15+
}
16+
17+
export default async function OrganisationPage({
18+
params,
19+
}: PageProps) {
20+
const { id } = await params;
21+
const organisations = await getOrganisation(id);
22+
23+
return (
24+
<div>
25+
<h1 className="govuk-heading-xl">
26+
{organisations.name}
27+
</h1>
28+
{/* <ContentNavigation className="mb-8" /> */}
29+
</div>
30+
);
31+
}

src/components/account/alert-settings/AlertSettingsForm.tsx

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -119,43 +119,6 @@ const AlertSettingsForm = ({ defaultValues, selfEdit = true, onSubmit: onSubmitA
119119
<Accordion
120120
id="alert-settings"
121121
initialItems={[
122-
{
123-
id: 'conjunction_alerts',
124-
heading: t('conjunction_alerts'),
125-
content: (
126-
<>
127-
<Checkboxes
128-
aria-label="Conjunction Alerts"
129-
legend={t(
130-
`${selfEdit ? 'self_which' : 'their_which'}`,
131-
{ type: 'conjunction' },
132-
)}
133-
hint={t('select_one_option')}
134-
items={[{
135-
id: 'receive_all_conjunction_alerts',
136-
value: 'standard',
137-
children: t('receive_all_conjunction_alerts'),
138-
hint: t('recommended_for'),
139-
...register('conjunctionAlerts'),
140-
}, {
141-
id: 'only_priority_conjunction_alerts',
142-
value: 'priority',
143-
children: t('only_priority_conjunction_alerts'),
144-
hint: t('recommended_for_all_other'),
145-
...register('conjunctionAlerts'),
146-
}]}
147-
/>
148-
<AlertSettingsDetails type="conjunction" />
149-
<Option
150-
id="receiveConjunction"
151-
name="receiveConjunction"
152-
hint={t('select_one_option')}
153-
label={t('how_would_you_like_conjunction')}
154-
register={register}
155-
/>
156-
</>
157-
),
158-
},
159122
{
160123
id: 're_entry_alerts',
161124
heading: t('re_entry_alerts'),
@@ -251,6 +214,43 @@ const AlertSettingsForm = ({ defaultValues, selfEdit = true, onSubmit: onSubmitA
251214
</>
252215
),
253216
},
217+
{
218+
id: 'conjunction_alerts',
219+
heading: t('conjunction_alerts'),
220+
content: (
221+
<>
222+
<Checkboxes
223+
aria-label="Conjunction Alerts"
224+
legend={t(
225+
`${selfEdit ? 'self_which' : 'their_which'}`,
226+
{ type: 'conjunction' },
227+
)}
228+
hint={t('select_one_option')}
229+
items={[{
230+
id: 'receive_all_conjunction_alerts',
231+
value: 'standard',
232+
children: t('receive_all_conjunction_alerts'),
233+
hint: t('recommended_for'),
234+
...register('conjunctionAlerts'),
235+
}, {
236+
id: 'only_priority_conjunction_alerts',
237+
value: 'priority',
238+
children: t('only_priority_conjunction_alerts'),
239+
hint: t('recommended_for_all_other'),
240+
...register('conjunctionAlerts'),
241+
}]}
242+
/>
243+
<AlertSettingsDetails type="conjunction" />
244+
<Option
245+
id="receiveConjunction"
246+
name="receiveConjunction"
247+
hint={t('select_one_option')}
248+
label={t('how_would_you_like_conjunction')}
249+
register={register}
250+
/>
251+
</>
252+
),
253+
},
254254
]}
255255
/>
256256
<div className="govuk-button-group">

src/components/account/distribution-list/DistributionListAccordion.tsx

Lines changed: 60 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,44 @@ const DistributionListAccordions = ({ alerts }: DistributionListAccordionsProps)
1717
return (
1818
<>
1919
<h2 className="govuk-heading-l">
20-
{t('distribution_list', { type: 'conjunction' })}
20+
{t('distribution_list', { type: 're-entry' })}
2121
</h2>
22-
2322
<Accordion
24-
id="conjunction-list"
23+
id="re-entries-list"
2524
initialItems={[
2625
{
27-
id: 'all-conjunction',
28-
heading: t('receive_alerts_standard', { type: 'conjunction' }),
26+
id: 'all-re-entries',
27+
heading: t('receive_alerts_standard', { type: 're-entry' }),
2928
content: (
3029
<div className="overflow-auto">
3130
<DataTable
32-
data={alerts.filter(alert => alert.conjunction_alert_settings?.chosen_options?.includes('standard'))}
31+
data={alerts.filter(alert => alert.reentry_alert_settings?.chosen_options?.includes('standard'))}
3332
columns={distributionListColumns}
3433
largerText
3534
/>
3635
</div>
3736
),
3837
},
3938
{
40-
id: 'only-priority-conjunctions',
41-
heading: t('receive_alerts_priority', { type: 'conjunction' }),
39+
id: 'only-priority-re-entries',
40+
heading: t('receive_alerts_priority', { type: 're-entry' }),
4241
content: (
4342
<div className="overflow-auto">
4443
<DataTable
45-
data={alerts.filter(alert => alert.conjunction_alert_settings?.chosen_options?.includes('priority'))}
44+
data={alerts.filter(alert => alert.reentry_alert_settings?.chosen_options?.includes('priority'))}
45+
columns={distributionListColumns}
46+
largerText
47+
/>
48+
</div>
49+
),
50+
},
51+
{
52+
id: 'only-uk-re-entries',
53+
heading: t('receive_alerts_uk_satellites_only'),
54+
content: (
55+
<div className="overflow-auto">
56+
<DataTable
57+
data={alerts.filter(alert => alert.reentry_alert_settings?.chosen_options?.includes('uk-licensed'))}
4658
columns={distributionListColumns}
4759
largerText
4860
/>
@@ -51,51 +63,72 @@ const DistributionListAccordions = ({ alerts }: DistributionListAccordionsProps)
5163
},
5264
]}
5365
/>
54-
55-
<Details summary={t.rich('conjunctions_help.summary')}>
56-
{t.rich('conjunctions_help.content')}
66+
<Details summary={t.rich('reentry_help.summary')}>
67+
{t.rich('reentry_help.content')}
5768
</Details>
58-
5969
<h2 className="govuk-heading-l">
60-
{t('distribution_list', { type: 're-entry' })}
70+
{t('distribution_list', { type: 'fragmentation' })}
6171
</h2>
62-
6372
<Accordion
64-
id="re-entries-list"
73+
id="fragmentation-list"
6574
initialItems={[
6675
{
67-
id: 'all-re-entries',
68-
heading: t('receive_alerts_standard', { type: 're-entry' }),
76+
id: 'all-fragmentation',
77+
heading: t('receive_alerts_standard', { type: 'fragmentation' }),
6978
content: (
7079
<div className="overflow-auto">
7180
<DataTable
72-
data={alerts.filter(alert => alert.reentry_alert_settings?.chosen_options?.includes('standard'))}
81+
data={alerts.filter(alert => alert.fragmentation_alert_settings?.chosen_options?.includes('standard'))}
7382
columns={distributionListColumns}
7483
largerText
7584
/>
7685
</div>
7786
),
7887
},
7988
{
80-
id: 'only-priority-re-entries',
81-
heading: t('receive_alerts_priority', { type: 're-entry' }),
89+
id: 'only-priority-fragmentation',
90+
heading: t('receive_alerts_priority', { type: 'fragmentation' }),
8291
content: (
8392
<div className="overflow-auto">
8493
<DataTable
85-
data={alerts.filter(alert => alert.reentry_alert_settings?.chosen_options?.includes('priority'))}
94+
data={alerts.filter(alert => alert.fragmentation_alert_settings?.chosen_options?.includes('priority'))}
8695
columns={distributionListColumns}
8796
largerText
8897
/>
8998
</div>
9099
),
91100
},
101+
]}
102+
/>
103+
<Details summary={t.rich('fragmentation_help.summary')}>
104+
{t.rich('fragmentation_help.content')}
105+
</Details>
106+
<h2 className="govuk-heading-l">
107+
{t('distribution_list', { type: 'conjunction' })}
108+
</h2>
109+
<Accordion
110+
id="conjunction-list"
111+
initialItems={[
92112
{
93-
id: 'only-uk-re-entries',
94-
heading: t('receive_alerts_uk_satellites_only'),
113+
id: 'all-conjunction',
114+
heading: t('receive_alerts_standard', { type: 'conjunction' }),
95115
content: (
96116
<div className="overflow-auto">
97117
<DataTable
98-
data={alerts.filter(alert => alert.reentry_alert_settings?.chosen_options?.includes('uk-licensed'))}
118+
data={alerts.filter(alert => alert.conjunction_alert_settings?.chosen_options?.includes('standard'))}
119+
columns={distributionListColumns}
120+
largerText
121+
/>
122+
</div>
123+
),
124+
},
125+
{
126+
id: 'only-priority-conjunctions',
127+
heading: t('receive_alerts_priority', { type: 'conjunction' }),
128+
content: (
129+
<div className="overflow-auto">
130+
<DataTable
131+
data={alerts.filter(alert => alert.conjunction_alert_settings?.chosen_options?.includes('priority'))}
99132
columns={distributionListColumns}
100133
largerText
101134
/>
@@ -104,9 +137,8 @@ const DistributionListAccordions = ({ alerts }: DistributionListAccordionsProps)
104137
},
105138
]}
106139
/>
107-
108-
<Details summary={t.rich('reentry_help.summary')}>
109-
{t.rich('reentry_help.content')}
140+
<Details summary={t.rich('conjunctions_help.summary')}>
141+
{t.rich('conjunctions_help.content')}
110142
</Details>
111143
</>
112144
);

src/components/activities/data-table/ActivitiesDataTableColumns.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const activitiesColumns: TranslatedColumnDef<TypeActivityEventOut>[] = [
5151
const operatorId = row.original.operator;
5252
return (
5353
<Link
54-
href={`/operators/${operatorId}`}
54+
href={`/organisations/${operatorId}`}
5555
className="govuk-link"
5656
>
5757
{value}

src/components/conjunction-alert/ConjunctionAlertAccordion.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ const ConjunctionAlertAccordion = ({
2929
}: ConjunctionAlertAccordionProps) => {
3030
const t = useTranslations('Conjunction_alert.accordion');
3131

32+
const hasImpact = event.immediate_impact_comment || event.short_term_impact_comment || event.long_term_impact_comment;
33+
3234
return (
3335
<>
3436
<h2 data-anchor="information" className="govuk-heading-l">{t('event_details')}</h2>
@@ -60,13 +62,15 @@ const ConjunctionAlertAccordion = ({
6062
id="conjunction-potential-impact"
6163
addAnchor={false}
6264
initialItems={[
63-
{
64-
id: 'potential_impact_of_event',
65-
heading: t('potential_impact_of_event'),
66-
content: (
67-
<ConjunctionAlertPotentialImpact immediateImpactComment={searchParams?.immediate_impact_comment ?? event.immediate_impact_comment} shortTermImpactComment={searchParams?.short_term_impact_comment ?? event.short_term_impact_comment} longTermImpactComment={searchParams?.long_term_impact_comment ?? event.long_term_impact_comment} dataPdf={t('potential_impact_of_event')} />
68-
),
69-
},
65+
...(hasImpact
66+
? [{
67+
id: 'potential_impact_of_event',
68+
heading: t('potential_impact_of_event'),
69+
content: (
70+
<ConjunctionAlertPotentialImpact immediateImpactComment={searchParams?.immediate_impact_comment ?? event.immediate_impact_comment} shortTermImpactComment={searchParams?.short_term_impact_comment ?? event.short_term_impact_comment} longTermImpactComment={searchParams?.long_term_impact_comment ?? event.long_term_impact_comment} dataPdf={t('potential_impact_of_event')} />
71+
),
72+
}]
73+
: []),
7074
{
7175
id: 'additional_risk',
7276
heading: t('additional_risk'),

src/locales/en.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,10 @@
330330
"reentry_help": {
331331
"summary": "Re-entry alert criteria",
332332
"content": "<h3>Level 1 (Standard) re-entry alert</h3><p>The criteria for producing a Level 1 (Standard) re-entry alert is as follows:</p><list><item>Less than 36 hours until re-entry, and one or more of the following:</item><item>Any “large” object in US SATCAT (except designed for demise) with overflights of the UK mainland, and/or</item><item>Any “large” object in US SATCAT (except designed for demise) with more than 0.1% chance of impact in overseas territories, and/or</item><item>Press interest, and/or</item><item>Nominated for escalation by the National Space Operations Centre</item></list><h3>Level 2 (Priority) re-entry alert</h3><p>The criteria for producing a Level 2 (Priority) re-entry alert is as follows:</p><list><item>Debris likely to survive to the ground, and one or more of the following:</item><item>More than 0.1% chance of impact in the UK (and overseas territories on case by case basis, and/or</item><item>UK-licensed object, and/or</item><item>Significant press interest, and/or</item><item>Nominated for escalation by the National Space Operations Centre</item></list><h3>Alert distribution</h3><p>If this report is classified as a Level 1 (Standard) re-entry alert, it has been distributed only to key UK Government organisations (for example the National Space Operations Centre, Ministry of Defence and Civil Aviation Authority) and international partners.</p><p>If this report is classified as a Level 2 (Priority) re-entry alert, it has been distributed only to specific users directly involved in the Government response.</p><p>Please note: distribution lists for Level 1 and Level 2 alerts are separate. Recipients will only receive reports for the level(s) for which they are specifically included.</p>"
333+
},
334+
"fragmentation_help": {
335+
"summary": "Fragmentation alert criteria",
336+
"content": "<h3>Level 1 (Standard) fragmentation alert</h3><p>The criteria for producing a Level 1 (Standard) fragmentation alert are as follows:</p><list><item>The event involves a UK satellite, and/or</item><item>The event generates more than 50 pieces of debris and presents a high risk to UK licensed objects or human spaceflight, and/or</item><item>The event is likely to generate press interest</item></list><h3>Alert distribution</h3><p>If this report is classified as a Level 1 (Standard) fragmentation alert, it has been distributed to key UK Government organisations (for example the National Space Operations Centre, Ministry of Defence and Civil Aviation Authority) and international partners.</p><p>In addition to the Level 1 (Standard) distribution, the following teams are notified in specific circumstances:</p><list><item>If the licensing country is the UK: Department for Science, Innovation and Technology</item><item>If there is a potential risk to the International Space Station: UK Space Agency Exploration team</item></list>"
333337
}
334338
}
335339
},

0 commit comments

Comments
 (0)