Skip to content

Commit

Permalink
front: fix review comment
Browse files Browse the repository at this point in the history
Signed-off-by: nncluzu <[email protected]>
  • Loading branch information
kmer2016 committed Nov 21, 2024
1 parent fa93850 commit 63bad33
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
5 changes: 3 additions & 2 deletions front/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@
}
},
"units": {
"day": "j",
"day": "d",
"hour": "h",
"minute": "min"
"minute": "min",
"km": "km"
}
},
"Editor": {
Expand Down
5 changes: 3 additions & 2 deletions front/public/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@
}
},
"units": {
"day": "d",
"day": "j",
"hour": "h",
"minute": "min"
"minute": "min",
"km": "km"
}
},
"Editor": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ const StdcmSimulationNavigator = ({
let formatedTotalLength = '';
let formatedTripDuration = '';

if (hasResults(outputs) && outputs.results.simulation.final_output.times.length > 0) {
if (hasResults(outputs)) {
const { results } = outputs;
const lastPointTime = results.simulation.final_output.times.at(-1)!;
const departureTimeInTs = new Date(results.departure_time).getTime();
const departureTimeInMs = new Date(results.departure_time).getTime();

formatedTotalLength = `${Math.round(mmToKm(results.path.length))} km `;
formatedTotalLength = `${Math.round(mmToKm(results.path.length))} ${t('common.units.km', { ns: 'translation' })} `;
formatedTripDuration = formatTimeDifference(
departureTimeInTs,
lastPointTime + departureTimeInTs
departureTimeInMs,
lastPointTime + departureTimeInMs
);
}

Expand Down
1 change: 1 addition & 0 deletions front/src/styles/scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ $colors: (
'primary90': #180f47,
'selection20': #fff2b3,
'success30': #3cca80,
'success60': #0b723c,
'warning5': #fdf5e1,
'warning30': #eaa72b,
'warning60': #7d521e,
Expand Down
7 changes: 4 additions & 3 deletions front/src/styles/scss/applications/stdcm/_results.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@
overflow-x: hidden;

.simulation-item {
width: 160px;
display: inline-block;
margin: 9px 39px 0 0;
margin-right: 32px;
cursor: pointer;

.simulation-metadata {
Expand Down Expand Up @@ -93,7 +94,7 @@

&.selected {
.simulation-metadata {
color: rgb(121, 118, 113);
color: var(--grey50);
}

.simulation-name {
Expand All @@ -110,7 +111,7 @@
&.retained {
.simulation-name,
.simulation-metadata {
color: rgb(11, 114, 60);
color: var(--success60);
}
}

Expand Down

0 comments on commit 63bad33

Please sign in to comment.