Skip to content

Commit f34df07

Browse files
committed
Adjusted to review
1 parent 28d7b2b commit f34df07

6 files changed

Lines changed: 13 additions & 19 deletions

File tree

Mobile-Expensify

src/languages/en.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3012,22 +3012,21 @@ const translations = {
30123012
`Your flight ${airlineCode} (${origin}${destination}) on ${startDate}} has been canceled by the airline.`,
30133013
flightScheduleChangePending: ({airlineCode}: AirlineParams) => `The airline has proposed a schedule change for flight ${airlineCode}; we are awaiting confirmation.`,
30143014
flightScheduleChangeClosed: ({airlineCode, startDate}: AirlineParams) => `Schedule change confirmed: flight ${airlineCode} now departs at ${startDate}.`,
3015-
flightChanged: ({airlineCode, origin, destination, startDate}: FlightParams) => `Your flight ${airlineCode} (${origin}${destination}) on ${startDate} has been changed.`,
3015+
flightUpdated: ({airlineCode, origin, destination, startDate}: FlightParams) => `Your flight ${airlineCode} (${origin}${destination}) on ${startDate} has been updated.`,
30163016
flightCabinChanged: ({airlineCode, cabinClass}: AirlineParams) => `Your cabin class has been updated to ${cabinClass} on flight ${airlineCode}.`,
30173017
flightSeatConfirmed: ({airlineCode}: AirlineParams) => `Your seat assignment on flight ${airlineCode} has been confirmed.`,
30183018
flightSeatChanged: ({airlineCode}: AirlineParams) => `Your seat assignment on flight ${airlineCode} has been changed.`,
30193019
flightSeatCancelled: ({airlineCode}: AirlineParams) => `Your seat assignment on flight ${airlineCode} was removed.`,
30203020
paymentDeclined: 'Payment for your air booking failed. Please try again.',
30213021
bookingCancelledByTraveler: ({type, id = ''}: TravelTypeParams) => `You cancelled your ${type} reservation ${id}.`,
3022-
bookingCancelledByVendor: ({type, id = ''}: TravelTypeParams) => `The vendor cancelled your ${type} reservation ${id}.`,
3022+
bookingCancelledByVendor: ({type, id = ''}: TravelTypeParams) => `The vendor cancelled your ${type} reservation ${id}.`,
30233023
bookingRebooked: ({type, id = ''}: TravelTypeParams) => `Your ${type} reservation was re-booked. New confirmation #:${id}.`,
30243024
bookingUpdated: ({type}: TravelTypeParams) => `Your ${type} booking was updated. Review the new details in the itinerary.`,
30253025
railTicketRefund: ({origin, destination, startDate}: RailTicketParams) =>
30263026
`Your rail ticket for ${origin}${destination} on ${startDate} has been refunded. A credit will be processed.`,
30273027
railTicketExchange: ({origin, destination, startDate}: RailTicketParams) => `Your rail ticket for ${origin}${destination} on ${startDate} has been exchanged.`,
30283028
railTicketUpdate: ({origin, destination, startDate}: RailTicketParams) => `Your rail ticket for ${origin}${destination} on ${startDate} has been updated.`,
30293029
defaultUpdate: ({type}: TravelTypeParams) => `Your ${type} reservation was updated.`,
3030-
notSupported: 'Not supported travel update.',
30313030
},
30323031
},
30333032
workspace: {

src/languages/es.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3036,7 +3036,7 @@ const translations = {
30363036
`Tu vuelo ${airlineCode} (${origin}${destination}) del ${startDate} ha sido cancelado por la aerolínea.`,
30373037
flightScheduleChangePending: ({airlineCode}: AirlineParams) => `La aerolínea ha propuesto un cambio de horario para el vuelo ${airlineCode}; estamos esperando la confirmación.`,
30383038
flightScheduleChangeClosed: ({airlineCode, startDate}: AirlineParams) => `Cambio de horario confirmado: el vuelo ${airlineCode} ahora sale a las ${startDate}.`,
3039-
flightChanged: ({airlineCode, origin, destination, startDate}: FlightParams) => `Tu vuelo ${airlineCode} (${origin}${destination}) del ${startDate} ha sido modificado.`,
3039+
flightUpdated: ({airlineCode, origin, destination, startDate}: FlightParams) => `Tu vuelo ${airlineCode} (${origin}${destination}) del ${startDate} ha sido actualizado.`,
30403040
flightCabinChanged: ({airlineCode, cabinClass}: AirlineParams) => `Tu clase de cabina ha sido actualizada a ${cabinClass} en el vuelo ${airlineCode}.`,
30413041
flightSeatConfirmed: ({airlineCode}: AirlineParams) => `Tu asignación de asiento en el vuelo ${airlineCode} ha sido confirmada.`,
30423042
flightSeatChanged: ({airlineCode}: AirlineParams) => `Tu asignación de asiento en el vuelo ${airlineCode} ha sido modificada.`,
@@ -3051,7 +3051,6 @@ const translations = {
30513051
railTicketExchange: ({origin, destination, startDate}: RailTicketParams) => `Tu billete de tren de ${origin} a ${destination} para el ${startDate} ha sido cambiado.`,
30523052
railTicketUpdate: ({origin, destination, startDate}: RailTicketParams) => `Tu billete de tren de ${origin} a ${destination} para el ${startDate} ha sido actualizado.`,
30533053
defaultUpdate: ({type}: TravelTypeParams) => `Tu reserva de ${type} fue actualizada.`,
3054-
notSupported: 'Actualización de viaje no admitida.',
30553054
},
30563055
},
30573056
workspace: {

src/libs/ReportActionsUtils.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,13 +1565,9 @@ function getMessageOfOldDotReportAction(oldDotAction: PartialReportAction | OldD
15651565
}
15661566
}
15671567

1568-
function getTravelUpdateMessage(action: ReportAction, formatDate?: (datetime: string, includeTimezone: boolean, isLowercase?: boolean | undefined) => string) {
1569-
const details = isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.TRAVEL_UPDATE) ? getOriginalMessage(action) : undefined;
1570-
if (!details) {
1571-
return translateLocal('travel.updates.notSupported');
1572-
}
1573-
1574-
const formattedStartDate = formatDate?.(details.start.date, false) ?? format(details.start.date, CONST.DATE.FNS_DATE_TIME_FORMAT_STRING);
1568+
function getTravelUpdateMessage(action: ReportAction<'TRAVEL_TRIP_ROOM_UPDATE'>, formatDate?: (datetime: string, includeTimezone: boolean, isLowercase?: boolean | undefined) => string) {
1569+
const details = getOriginalMessage(action);
1570+
const formattedStartDate = formatDate?.(details?.start.date ?? '', false) ?? format(details?.start.date ?? '', CONST.DATE.FNS_DATE_TIME_FORMAT_STRING);
15751571

15761572
switch (details?.operation) {
15771573
case CONST.TRAVEL.UPDATE_OPERATION_TYPE.BOOKING_TICKETED:
@@ -1619,7 +1615,7 @@ function getTravelUpdateMessage(action: ReportAction, formatDate?: (datetime: st
16191615
});
16201616

16211617
case CONST.TRAVEL.UPDATE_OPERATION_TYPE.FLIGHT_CHANGED:
1622-
return translateLocal('travel.updates.flightChanged', {
1618+
return translateLocal('travel.updates.flightUpdated', {
16231619
airlineCode: details.route?.airlineCode ?? '',
16241620
origin: details.start.shortName ?? '',
16251621
destination: details.end?.shortName ?? '',
@@ -1686,7 +1682,7 @@ function getTravelUpdateMessage(action: ReportAction, formatDate?: (datetime: st
16861682
startDate: formattedStartDate,
16871683
});
16881684
}
1689-
return translateLocal('travel.updates.flightChanged', {
1685+
return translateLocal('travel.updates.flightUpdated', {
16901686
airlineCode: details.route?.airlineCode ?? '',
16911687
origin: details.start.shortName ?? '',
16921688
destination: details.end?.shortName ?? '',
@@ -1705,7 +1701,7 @@ function getTravelUpdateMessage(action: ReportAction, formatDate?: (datetime: st
17051701
startDate: formattedStartDate,
17061702
});
17071703
}
1708-
return translateLocal('travel.updates.flightChanged', {
1704+
return translateLocal('travel.updates.flightUpdated', {
17091705
airlineCode: details.route?.airlineCode ?? '',
17101706
origin: details.start.shortName ?? '',
17111707
destination: details.end?.shortName ?? '',
@@ -1728,7 +1724,7 @@ function getTravelUpdateMessage(action: ReportAction, formatDate?: (datetime: st
17281724

17291725
default:
17301726
return translateLocal('travel.updates.defaultUpdate', {
1731-
type: details.type,
1727+
type: details?.type ?? '',
17321728
});
17331729
}
17341730
}

src/libs/SidebarUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ function getOptionData({
701701
result.alternateText = getRetractedMessage();
702702
} else if (lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.REOPENED) {
703703
result.alternateText = getReopenedMessage();
704-
} else if (lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.TRAVEL_UPDATE) {
704+
} else if (isActionOfType(lastAction, CONST.REPORT.ACTIONS.TYPE.TRAVEL_UPDATE)) {
705705
result.alternateText = getTravelUpdateMessage(lastAction);
706706
} else {
707707
result.alternateText =

src/pages/home/report/PureReportActionItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,7 @@ function PureReportActionItem({
10671067
<RenderHTML html={`<comment><muted-text>${getMovedTransactionMessage(action)}</muted-text></comment>`} />
10681068
</ReportActionItemBasicMessage>
10691069
);
1070-
} else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.TRAVEL_UPDATE) {
1070+
} else if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.TRAVEL_UPDATE)) {
10711071
children = (
10721072
<ReportActionItemBasicMessage message="">
10731073
<RenderHTML html={`<comment><muted-text>${getTravelUpdateMessage(action, datetimeToCalendarTime)}</muted-text></comment>`} />

0 commit comments

Comments
 (0)