Skip to content

Commit

Permalink
Merge branch 'dev' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
ludchieng committed May 21, 2023
2 parents 02bedd9 + 3a52915 commit e576250
Show file tree
Hide file tree
Showing 20 changed files with 311 additions and 181 deletions.
2 changes: 2 additions & 0 deletions public/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { CacheFirst } from 'workbox-strategies'

precacheAndRoute(self.__WB_MANIFEST || [])

self.addEventListener('install', () => self.skipWaiting())

registerRoute(
({ url }) => url.pathname.startsWith('/img/lines-icons/'),
new CacheFirst({
Expand Down
2 changes: 1 addition & 1 deletion src/components/AppHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default Vue.extend({
},
data: () => ({
clockInterval: 0,
time: {} as Time,
time: Object as Time,
}),
created () {
this.clockInterval = setInterval(() => {
Expand Down
14 changes: 3 additions & 11 deletions src/components/AppNav.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<nav>
<hr>
<UiHr />
<div class="nav-content">
<div
v-if="showTabsList"
Expand Down Expand Up @@ -108,10 +108,11 @@
import Vue from 'vue'
import { getStop } from '@/utils/localstore/stops'
import LineIcon from '@/components/LineIcon.vue'
import UiHr from '@/components/ui/UiHr.vue'
export default Vue.extend({
name: 'AppNav',
components: { LineIcon },
components: { UiHr, LineIcon },
data: () => ({
showTabsList: false,
}),
Expand Down Expand Up @@ -150,15 +151,6 @@ nav {
color: #ffffff;
}
hr {
position: relative;
top: 0;
margin: 0 0 0 0;
height: 0.3rem;
background-color: #ffffff;
border: 0;
}
.nav-tabs-list {
padding-top: 0.2rem;
max-height: 70vh;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Stop/StopHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default Vue.extend({
DesignPageTitle,
},
props: {
stop: {} as PropType<StopType>,
stop: Object as PropType<StopType>,
},
})
</script>
Expand Down
67 changes: 54 additions & 13 deletions src/components/Stop/StopPrevNextStops.vue
Original file line number Diff line number Diff line change
@@ -1,29 +1,47 @@
<template>
<DesignPrevNext
:prev-items="stop.prevStops.slice().reverse().map(prevStop => ({
label: getStop($route.params.line, prevStop).displayName,
link: `/timetables/${$route.params.tab}/${$route.params.line}/${prevStop}`,
}))"
:next-items="stop.nextStops.slice().reverse().map(nextStop => ({
label: getStop($route.params.line, nextStop).displayName,
link: `/timetables/${$route.params.tab}/${$route.params.line}/${nextStop}`,
}))"
/>
<div class="stop-prev-next">
<UiHr />
<div class="content">
<button
class="hint"
type="button"
@click="() => isOpen = !isOpen"
>
{{ `— ${isOpen ? 'Cacher' : 'Afficher'} les arrêts adjacents —` }}
</button>
<UiPrevNext
v-if="isOpen"
:prev-items="stop.prevStops.slice().reverse().map(prevStop => ({
label: getStop($route.params.line, prevStop).displayName,
link: `/timetables/${$route.params.tab}/${$route.params.line}/${prevStop}`,
}))"
:next-items="stop.nextStops.slice().reverse().map(nextStop => ({
label: getStop($route.params.line, nextStop).displayName,
link: `/timetables/${$route.params.tab}/${$route.params.line}/${nextStop}`,
}))"
/>
</div>
</div>
</template>

<script lang="ts">
import Vue, { PropType } from 'vue'
import { StopType } from '@/utils/parser'
import { getStop } from '@/utils/localstore/stops'
import DesignPrevNext from '@/components/ui/UiPrevNext.vue'
import UiPrevNext from '@/components/ui/UiPrevNext.vue'
import UiHr from '@/components/ui/UiHr.vue'
export default Vue.extend({
name: 'StopPrevNextStops',
components: {
DesignPrevNext,
UiHr,
UiPrevNext,
},
data: () => ({
isOpen: false,
}),
props: {
stop: {} as PropType<StopType>,
stop: Object as PropType<StopType>,
},
methods: {
getStop,
Expand All @@ -32,4 +50,27 @@ export default Vue.extend({
</script>

<style scoped>
.stop-prev-next {
position: fixed;
bottom: 3.5rem;
left: 0;
right: 0;
}
.content {
padding: 0.25rem 1rem;
background: #F4F4F4;
}
.hint {
display: block;
padding: 0.3rem 0 0.5rem 0;
margin: 0 auto;
color: #4B4B4B;
font-size: 0.75rem;
font-family: unset;
font-weight: unset;
border: 0;
background: unset;
}
</style>
4 changes: 2 additions & 2 deletions src/components/Stop/StopSchedules.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ export default Vue.extend({
StopSchedulesVisits,
},
props: {
stop: {} as PropType<StopType>,
stop: Object as PropType<StopType>,
},
data: () => ({
fetchAbortController: new AbortController(),
visitsByDirections: [] as [string, VisitType[]][],
debugData: new Set(),
updatedAt: {} as Date,
updatedAt: Object as Date,
updateCounter: 0,
updateInterval: 0,
}),
Expand Down
22 changes: 19 additions & 3 deletions src/components/Stop/StopSchedulesDetailsTimes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@
:sublabel="visit.arrivalStatus !== 'onTime' ? visit.arrivalStatus : null"
/>
<div>
<div v-if="visit.platform">
<div
v-if="visit.platform"
class="way-label"
>
Voie
</div>
<div>{{ visit.platform }}</div>
<div class="way-value">
{{ visit.platform }}
</div>
</div>
<UiSchedulesDetailsTimeWrapped
v-if="visit.departureTime"
Expand Down Expand Up @@ -53,7 +58,7 @@ export default Vue.extend({
UiSchedulesDetailsTimeInline,
},
props: {
visit: {} as PropType<VisitType>,
visit: Object as PropType<VisitType>,
isInline: {
type: Boolean,
default: false,
Expand All @@ -71,5 +76,16 @@ export default Vue.extend({
max-width: 20rem;
margin-right: 1rem;
justify-content: space-between;
font-size: 1.0625rem;
}
.way-label {
font-size: 0.875rem;
}
.way-value {
text-align: center;
font-weight: 600;
color: #222;
}
</style>
20 changes: 17 additions & 3 deletions src/components/Stop/StopSchedulesDetailsTimesNonStopPassage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@
/>
</div>
<div>
<div v-if="visit.platform">
<div
v-if="visit.platform"
class="way-label"
>
Voie
</div>
<div>{{ visit.platform }}</div>
<div class="way-value">
{{ visit.platform }}
</div>
</div>
</div>
</template>
Expand All @@ -30,7 +35,7 @@ export default Vue.extend({
UiSchedulesDetailsTimeWrapped,
},
props: {
visit: {} as PropType<VisitType>,
visit: Object as PropType<VisitType>,
},
methods: {
toTime,
Expand All @@ -44,5 +49,14 @@ export default Vue.extend({
max-width: 20rem;
margin: 0 1rem 0.5rem 0;
justify-content: space-between;
font-size: 1.0625rem;
}
.way-label {
font-size: 0.875rem;
}
.way-value {
text-align: center;
}
</style>
Loading

0 comments on commit e576250

Please sign in to comment.