Skip to content

Commit

Permalink
fix: my units calendar now shows the reservation name with prefix
Browse files Browse the repository at this point in the history
fix: make translation function required in getReserveeName

wip
  • Loading branch information
vincit-matu committed May 7, 2024
1 parent 43738b2 commit a4fadf1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
} from "common/src/helpers";
import { RELATED_RESERVATION_STATES } from "common/src/const";
import { ReservationUnitWithAffectingArgs } from "common/src/queries/fragments";
import { t } from "i18next";

type Props = {
begin: string;
Expand Down Expand Up @@ -57,7 +58,7 @@ const getEventTitle = ({
const reservationUnit = reservation.reservationUnit?.[0];
const isOtherReservationUnit = reservationUnitPk !== reservationUnit?.pk;

const reserveeName = getReserveeName(reservation);
const reserveeName = getReserveeName(reservation, t);
if (isOtherReservationUnit) {
const reservationUnitName = reservationUnit?.nameFi ?? "";

Expand Down
2 changes: 1 addition & 1 deletion apps/admin-ui/src/component/my-units/UnitCalendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ function getEventTitle({
}

return event && event?.pk !== event?.reservationUnit?.[0]?.pk
? getReserveeName(event)
? getReserveeName(event, t)
: title;
}

Expand Down
2 changes: 1 addition & 1 deletion apps/admin-ui/src/component/reservations/requested/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export const getTranslationKeyForCustomerTypeChoice = (

export const getReserveeName = (
reservation: ReservationNode,
t?: TFunction,
t: TFunction,
length = 50
): string => {
let prefix = "";
Expand Down

0 comments on commit a4fadf1

Please sign in to comment.