From 9d10302468e7c5329dddb4d8df47d3e80e85aa21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Grutle?= Date: Thu, 22 Aug 2024 12:38:31 +0200 Subject: [PATCH] fix(tilecard): remove county name from header (#1621) --- .../edit/[id]/components/TileCard/index.tsx | 15 +++++---------- tavla/src/Board/scenarios/QuayTile/index.tsx | 4 ++-- tavla/src/Board/scenarios/StopPlaceTile/index.tsx | 4 ++-- tavla/src/Shared/types/tile.ts | 1 + 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/tavla/app/(admin)/edit/[id]/components/TileCard/index.tsx b/tavla/app/(admin)/edit/[id]/components/TileCard/index.tsx index df39e8d03..320cbc716 100644 --- a/tavla/app/(admin)/edit/[id]/components/TileCard/index.tsx +++ b/tavla/app/(admin)/edit/[id]/components/TileCard/index.tsx @@ -26,7 +26,6 @@ import { Paragraph, SubParagraph, } from '@entur/typography' -import { isEmptyOrSpaces } from 'app/(admin)/edit/utils' import { ColumnModal } from 'app/(admin)/organizations/components/DefaultColumns/ColumnModal' import Goat from 'assets/illustrations/Goat.png' import { HiddenInput } from 'components/Form/HiddenInput' @@ -150,7 +149,9 @@ function TileCard({ }`} >
- {tile.name} + + {tile.displayName ?? tile.name} +
{transportModes.map((tm) => ( @@ -226,12 +227,6 @@ function TileCard({ ) as string data.delete('displayName') - if (isEmptyOrSpaces(displayName)) - return addToast({ - variant: 'info', - content: 'Navnet kan ikke være tomt.', - }) - let lines: string[] = [] for (const line of data.values()) { lines.push(line as string) @@ -251,7 +246,7 @@ function TileCard({ distance: tile.walkingDistance?.distance, }, offset: Number(offset) || undefined, - name: displayName, + displayName: displayName || undefined, } as TTile bid === 'demo' @@ -272,7 +267,7 @@ function TileCard({ label="Navn på stoppested" className="!w-2/5" name="displayName" - defaultValue={tile.name} + defaultValue={tile.displayName} />
Gåavstand diff --git a/tavla/src/Board/scenarios/QuayTile/index.tsx b/tavla/src/Board/scenarios/QuayTile/index.tsx index 4b571c743..2c3bfabbf 100644 --- a/tavla/src/Board/scenarios/QuayTile/index.tsx +++ b/tavla/src/Board/scenarios/QuayTile/index.tsx @@ -15,7 +15,7 @@ export function QuayTile({ columns, walkingDistance, offset, - name, + displayName, }: TQuayTile) { const { data } = useQuery( GetQuayQuery, @@ -49,7 +49,7 @@ export function QuayTile({ return (