From df12d7b9bc62cab376106ec2673a19d913d3f43b Mon Sep 17 00:00:00 2001 From: cedricnjanga Date: Fri, 27 Oct 2017 14:47:19 +0200 Subject: Refs #4794 Added some UX changes on VehicleJourney collection route - truncate the id of the VJ and the JP to 10 characters - only show the 3 first timetable in the metas of the VJ - add a link to the time_table#show in the EditTimeTable modal --- app/javascript/vehicle_journeys/actions/index.js | 5 ++++- app/javascript/vehicle_journeys/components/VehicleJourney.js | 4 +++- .../components/tools/TimetablesEditVehicleJourney.js | 11 +++++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/javascript/vehicle_journeys/actions/index.js b/app/javascript/vehicle_journeys/actions/index.js index 8d7c4d7a0..95c739893 100644 --- a/app/javascript/vehicle_journeys/actions/index.js +++ b/app/javascript/vehicle_journeys/actions/index.js @@ -269,7 +269,10 @@ const actions = { type: 'RECEIVE_TOTAL_COUNT', total }), - humanOID: (oid) => oid.split(':')[2].split("-").pop(), + humanOID: (oid) => { + let shortOId = oid.split(':')[2].split("-").pop() + return shortOId.length > 10 ? `${shortOId.slice(0, 10)}...` : shortOId + }, fetchVehicleJourneys : (dispatch, currentPage, nextPage, queryString) => { if(currentPage == undefined){ currentPage = 1 diff --git a/app/javascript/vehicle_journeys/components/VehicleJourney.js b/app/javascript/vehicle_journeys/components/VehicleJourney.js index 7a49182ae..91f8a8eee 100644 --- a/app/javascript/vehicle_journeys/components/VehicleJourney.js +++ b/app/javascript/vehicle_journeys/components/VehicleJourney.js @@ -44,6 +44,7 @@ export default class VehicleJourney extends Component { render() { this.previousCity = undefined + let {time_tables} = this.props.value return (