Skip to content

Commit d5a691b

Browse files
committed
Update route row UI
1 parent 589ff26 commit d5a691b

2 files changed

Lines changed: 209 additions & 182 deletions

File tree

ui/src/components/routes-and-lines/line-details/RouteRow.tsx

Lines changed: 47 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ export const RouteRow: FC<PropsWithChildren<RouteRowProps>> = ({
9393
)}
9494
data-testid={testIds.container(label, route.direction)}
9595
>
96+
<div className="flex justify-center">
97+
<AlertPopover
98+
title={alertStatus.title}
99+
description={alertStatus.description}
100+
alertIcon={alertStyle.icon}
101+
/>
102+
</div>
96103
<div
97104
id={directionAndLabelId}
98105
className="col-span-2 ml-2 flex h-full items-center justify-evenly"
@@ -103,60 +110,41 @@ export const RouteRow: FC<PropsWithChildren<RouteRowProps>> = ({
103110
<RouteLabel label={label} variant={route.variant} />
104111
</span>
105112
</div>
106-
<span className="col-span-8 text-xl" data-testid={testIds.name}>
113+
<span className="text-l col-span-8" data-testid={testIds.name}>
107114
{getLocalizedTextFromDbBlob(route.name_i18n)}
108115
</span>
109-
<EditButton
110-
href={routeDetails[Path.editRoute].getLink(route.route_id, {
111-
observationDate: observationDate.toISODate(),
112-
})}
113-
testId={testIds.editRouteButton}
114-
tooltip={t(($) => $.accessibility.routes.editRouteDirection, {
115-
label,
116-
directionNumber,
117-
})}
118-
className="ml-0"
119-
/>
120116
<Link
121-
to={routeDetails[Path.routeVersions].getLink(
122-
`${label}/${route.direction}`,
123-
)}
124-
state={makeBackNavigationIsSafeState()}
125-
data-testid={testIds.versionsButton}
126-
title={t(($) => $.accessibility.routes.viewVersions, {
127-
label,
128-
directionNumber,
129-
})}
117+
to={routeDetails[Path.lineChangeHistory].getLink(label)}
118+
className="col-span-3 text-center text-sm text-brand hover:underline"
119+
data-testid={testIds.lastEdited}
130120
>
131-
<i
121+
!{mapToShortDateTime(DateTime.now())}
122+
<MdHistory
132123
aria-hidden
133-
className="icon-lista text-xl text-tweaked-brand hover:text-black"
124+
className="ml-1 inline text-xl text-tweaked-brand"
134125
/>
135126
</Link>
136127
<span
137128
data-testid={testIds.validityPeriod}
138-
className="col-span-4 text-center md:text-sm lg:text-base"
129+
className="col-span-5 text-center text-sm"
139130
>
140131
{t(($) => $.validity.validDuring, {
141132
startDate: mapToShortDate(route.validity_start ?? MIN_DATE),
142133
endDate: mapToShortDate(route.validity_end ?? MAX_DATE),
143134
})}
144135
</span>
145-
<div className="flex justify-center">
146-
<AlertPopover
147-
title={alertStatus.title}
148-
description={alertStatus.description}
149-
alertIcon={alertStyle.icon}
150-
/>
151-
</div>
152-
<span className="col-span-4 text-center" data-testid={testIds.lastEdited}>
153-
!{mapToShortDateTime(DateTime.now())}
154-
<MdHistory
155-
aria-hidden
156-
className="ml-1 inline text-xl text-tweaked-brand"
136+
<div className="col-span-4 flex h-full items-center justify-center gap-2 border-l-4 border-white">
137+
<EditButton
138+
href={routeDetails[Path.editRoute].getLink(route.route_id, {
139+
observationDate: observationDate.toISODate(),
140+
})}
141+
testId={testIds.editRouteButton}
142+
tooltip={t(($) => $.accessibility.routes.editRouteDirection, {
143+
label,
144+
directionNumber,
145+
})}
146+
className="ml-0 rounded-none border-none bg-transparent hover:text-black"
157147
/>
158-
</span>
159-
<div className="col-span-2 flex h-full items-center justify-center border-l-4 border-white">
160148
<LocatorButton
161149
onClick={onClickShowRouteOnMap}
162150
disabled={
@@ -167,6 +155,27 @@ export const RouteRow: FC<PropsWithChildren<RouteRowProps>> = ({
167155
label,
168156
directionNumber,
169157
})}
158+
className="ml-0 rounded-none border-none bg-transparent hover:text-black"
159+
/>
160+
<Link
161+
to={routeDetails[Path.routeVersions].getLink(
162+
`${label}/${route.direction}`,
163+
)}
164+
state={makeBackNavigationIsSafeState()}
165+
data-testid={testIds.versionsButton}
166+
title={t(($) => $.accessibility.routes.viewVersions, {
167+
label,
168+
directionNumber,
169+
})}
170+
>
171+
<i
172+
aria-hidden
173+
className="icon-lista ml-2 text-xl text-tweaked-brand hover:text-black"
174+
/>
175+
</Link>
176+
<i
177+
aria-hidden
178+
className="icon-download disabled ml-2 text-3xl text-grey"
170179
/>
171180
</div>
172181
<AccordionButton

0 commit comments

Comments
 (0)