Poprawiono listę uwag eksploatacyjnych

This commit is contained in:
2022-05-21 17:43:29 +02:00
parent ad3e0bbd84
commit 05fc1860a3
3 changed files with 12 additions and 9 deletions
@@ -59,7 +59,7 @@
</div>
<div class="timetable_comments" v-if="getSceneriesWithComments(train.timetableData).length > 0 && isInfoShown">
{{ $t('trains.comment') }} <b>{{ getSceneriesWithComments(train.timetableData).join(',') }}</b>
{{ $t('trains.comment') }} <b>{{ getSceneriesWithComments(train.timetableData) }}</b>
</div>
</div>
</section>
@@ -29,7 +29,7 @@
v-if="getSceneriesWithComments(train.timetableData).length > 0"
class="image-warning"
:src="icons.warning"
:title="`${$t('trains.timetable-comments')} (${getSceneriesWithComments(train.timetableData).join(',')})`"
:title="`${$t('trains.timetable-comments')} (${getSceneriesWithComments(train.timetableData)})`"
/>
</div>
+10 -7
View File
@@ -42,7 +42,7 @@ export default defineComponent({
],
},
}),
methods: {
displayStopList(stops: TrainStop[]): string | undefined {
if (!stops) return '';
@@ -91,13 +91,16 @@ export default defineComponent({
},
getSceneriesWithComments(timetableData: Train['timetableData']) {
return (
timetableData?.followingStops.reduce((acc, stop) => {
if (stop.comments) acc.push(stop.stopNameRAW);
const commentList = timetableData?.followingStops.reduce((acc, stop, i) => {
if (stop.comments) acc.push(stop.stopNameRAW);
return acc;
}, [] as string[]) || []
);
return acc;
}, [] as string[]) || []
const moreCount = commentList.length - 10;
return commentList.slice(0,10).join(", ") + (moreCount > 0 ? `... (+${moreCount})` : '');
},
displayDistance(distance: number) {