From b0775ad11c86fe2a15e2601b702af79800f6ae8c Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 29 Jun 2022 15:45:17 +0200 Subject: [PATCH] (typo) passed -> past --- .../reservations/reservations-panel.tsx | 22 +++++++++---------- config/locales/app.logged.en.yml | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/frontend/src/javascript/components/dashboard/reservations/reservations-panel.tsx b/app/frontend/src/javascript/components/dashboard/reservations/reservations-panel.tsx index 559aecdae..7206460b1 100644 --- a/app/frontend/src/javascript/components/dashboard/reservations/reservations-panel.tsx +++ b/app/frontend/src/javascript/components/dashboard/reservations/reservations-panel.tsx @@ -36,17 +36,17 @@ const ReservationsPanel: React.FC = ({ userId, onError, /** * Return the reservations for the given period */ - const reservationsByDate = (state: 'passed' | 'futur'): Array => { + const reservationsByDate = (state: 'past' | 'futur'): Array => { return reservations.filter(r => { return !!r.slots_attributes.find(s => filterSlot(s, state)); }); }; /** - * Check if the given slot if passed of futur + * Check if the given slot if past of futur */ - const filterSlot = (slot: ReservationSlot, state: 'passed' | 'futur'): boolean => { - return (state === 'passed' && moment(slot.start_at).isBefore()) || + const filterSlot = (slot: ReservationSlot, state: 'past' | 'futur'): boolean => { + return (state === 'past' && moment(slot.start_at).isBefore()) || (state === 'futur' && moment(slot.start_at).isAfter()); }; @@ -91,7 +91,7 @@ const ReservationsPanel: React.FC = ({ userId, onError, /** * Render the reservation in a user-friendly way */ - const renderReservation = (reservation: Reservation, state: 'passed' | 'futur'): ReactNode => { + const renderReservation = (reservation: Reservation, state: 'past' | 'futur'): ReactNode => { return (
  • @@ -109,7 +109,7 @@ const ReservationsPanel: React.FC = ({ userId, onError, }; const futur = reservationsByDate('futur'); - const passed = _.orderBy(reservationsByDate('passed'), r => r.slots_attributes[0].start_at, 'desc'); + const past = _.orderBy(reservationsByDate('past'), r => r.slots_attributes[0].start_at, 'desc'); return ( @@ -118,14 +118,14 @@ const ReservationsPanel: React.FC = ({ userId, onError, {futur.length === 0 && noReservations()} {futur.map(r => renderReservation(r, 'futur'))} -

    {t('app.logged.dashboard.reservations.reservations_panel.passed')}

    +

    {t('app.logged.dashboard.reservations.reservations_panel.past')}

      - {passed.length === 0 && noReservations()} - {passed.slice(0, 10).map(r => renderReservation(r, 'passed'))} - {passed.length > 10 && !showMore &&
    • + {past.length === 0 && noReservations()} + {past.slice(0, 10).map(r => renderReservation(r, 'past'))} + {past.length > 10 && !showMore &&
    • {t('app.logged.dashboard.reservations.reservations_panel.show_more')}
    • } - {passed.length > 10 && showMore && passed.slice(10).map(r => renderReservation(r, 'passed'))} + {past.length > 10 && showMore && past.slice(10).map(r => renderReservation(r, 'past'))}
    ); diff --git a/config/locales/app.logged.en.yml b/config/locales/app.logged.en.yml index 0922ef0a4..2d07299d1 100644 --- a/config/locales/app.logged.en.yml +++ b/config/locales/app.logged.en.yml @@ -147,7 +147,7 @@ en: title_Space: "My space reservations" title_Machine: "My machines reservations" upcoming: "Upcoming" - passed: "Passed" + past: "Past" slots_details: "Slots details" no_reservations: "No reservations" show_more: "Show more"