File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
__tests__/components/molecules/__snapshots__
components/molecules/ManageTemplates Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -269,7 +269,7 @@ exports[`ManageTemplates component matches snapshot with not submitted status 1`
269269 >
270270 Type
271271 </span >
272- Letter
272+ Letter - French
273273 </td >
274274 <td
275275 class = " nhsuk-table__cell"
@@ -580,7 +580,7 @@ exports[`ManageTemplates component matches snapshot with submitted status 1`] =
580580 >
581581 Type
582582 </span >
583- Letter
583+ Letter - French
584584 </td >
585585 <td
586586 class = " nhsuk-table__cell"
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import content from '@content/content';
77import { format } from 'date-fns' ;
88import Link from 'next/link' ;
99import {
10+ letterTypeDisplayMappings ,
1011 previewTemplatePages ,
1112 TemplateStatus ,
1213 templateStatusToDisplayMappings ,
@@ -25,6 +26,15 @@ const generateViewTemplateLink = (template: TemplateDTO): string => {
2526 return `/${ previewTemplatePages ( template . templateType ) } /${ template . id } ` ;
2627} ;
2728
29+ const typeDisplayMappings = ( template : TemplateDTO ) =>
30+ template . templateType === TemplateType . LETTER &&
31+ 'letterType' in template &&
32+ template . letterType &&
33+ 'language' in template &&
34+ template . language
35+ ? letterTypeDisplayMappings ( template . letterType , template . language )
36+ : templateTypeDisplayMappings ( template . templateType ) ;
37+
2838export function ManageTemplates ( {
2939 templateList,
3040} : {
@@ -66,9 +76,7 @@ export function ManageTemplates({
6676 { template . name }
6777 </ Link >
6878 </ Table . Cell >
69- < Table . Cell >
70- { templateTypeDisplayMappings ( template . templateType ) }
71- </ Table . Cell >
79+ < Table . Cell > { typeDisplayMappings ( template ) } </ Table . Cell >
7280 < Table . Cell >
7381 < Tag
7482 color = {
You can’t perform that action at this time.
0 commit comments