Skip to content

Commit a79a51e

Browse files
committed
CCM-11492 Update link on MessagePlansList
1 parent 5f58c0c commit a79a51e

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

frontend/src/__tests__/components/molecules/__snapshots__/MessagePlansList.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ exports[`MessagePlansList matches snapshot when data is available 1`] = `
6565
Name
6666
</span>
6767
<a
68-
href="/message-plan/3"
68+
href="/message-plans/choose-templates/3"
6969
>
7070
Draft Y
7171
</a>

frontend/src/components/molecules/MessagePlansList/MessagePlansList.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Link from 'next/link';
88
import { MarkdownContent } from '@molecules/MarkdownContent/MarkdownContent';
99
import type { RoutingConfigStatusActive } from 'nhs-notify-backend-client';
1010
import { messagePlanStatusToDisplayText } from 'nhs-notify-web-template-management-utils';
11+
import { interpolate } from '@utils/interpolate';
1112

1213
export type MessagePlanListItem = {
1314
name: string;
@@ -41,7 +42,11 @@ export const MessagePlansList = (props: MessagePlansListProps) => {
4142
const rows = props.plans.map((plan) => (
4243
<Table.Row key={plan.id}>
4344
<Table.Cell>
44-
<Link href={messagePlansListComponent.previewLink(plan.id)}>
45+
<Link
46+
href={interpolate(messagePlansListComponent.messagePlanLink, {
47+
routingConfigId: plan.id,
48+
})}
49+
>
4550
{plan.name}
4651
</Link>
4752
</Table.Cell>

frontend/src/content/content.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,7 @@ const messagePlansPage = {
11751175
const messagePlansListComponent = {
11761176
tableHeadings: ['Name', 'Routing Plan ID', 'Last edited'],
11771177
noMessagePlansMessage: 'You do not have any message plans in {{status}} yet.',
1178-
previewLink: (id: string) => `/message-plan/${id}`,
1178+
messagePlanLink: '/message-plans/choose-templates/{{routingConfigId}}',
11791179
};
11801180

11811181
const chooseMessageOrder = {

0 commit comments

Comments
 (0)