From 7f758ffafe44c69c2d6da357464cb33998803e2e Mon Sep 17 00:00:00 2001 From: ludchieng Date: Tue, 24 Jan 2023 23:17:14 +0100 Subject: [PATCH 01/24] fix: remove fetch on app start --- src/App.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/App.vue b/src/App.vue index 237ee24..a2cee06 100644 --- a/src/App.vue +++ b/src/App.vue @@ -26,8 +26,6 @@ export default Vue.extend({ window.location.href = '/' }) } - // Ping server to wake it up - fetch(process.env.VUE_APP_API_URL) }, watch: { '$route.params.tab': { From f34b25bd95812ff08c00375b182323f8ac81a485 Mon Sep 17 00:00:00 2001 From: ludchieng Date: Tue, 24 Jan 2023 23:17:15 +0100 Subject: [PATCH 02/24] fix: store won't initialize correctly --- src/utils/localstore/synchronizer.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/utils/localstore/synchronizer.ts b/src/utils/localstore/synchronizer.ts index 6128bc9..4746d80 100644 --- a/src/utils/localstore/synchronizer.ts +++ b/src/utils/localstore/synchronizer.ts @@ -8,11 +8,11 @@ export const lastUpdatedAt = () => { export const synchronize = async () => { const lines = await synchronizeFile('/schemas/lines.json', 'lines') - - for (const line of Object.values(lines) as any[]) { - synchronizeLine(line.slugName) - } - localStorage.setItem('lines.updatedAt', new Date().toISOString()) + return Promise.all( + Object.values(lines).map((line: any) => synchronizeLine(line.slugName)), + ).then(() => { + localStorage.setItem('lines.updatedAt', new Date().toISOString()) + }) } export const synchronizeLine = async (line: string) => { From fb18ed41f32e42d4bd86b509f51dc190ec0677e1 Mon Sep 17 00:00:00 2001 From: ludchieng Date: Tue, 24 Jan 2023 23:17:15 +0100 Subject: [PATCH 03/24] fix: remove cache first on line schemas --- public/sw.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/public/sw.js b/public/sw.js index c252376..583c670 100644 --- a/public/sw.js +++ b/public/sw.js @@ -17,10 +17,3 @@ registerRoute( cacheName: 'img-mui', }), ) - -registerRoute( - ({ url }) => url.pathname.startsWith('/schemas/'), - new CacheFirst({ - cacheName: 'schemas', - }), -) From 1b13d89ed2f381587829e04b971bb283bffac17c Mon Sep 17 00:00:00 2001 From: ludchieng Date: Tue, 24 Jan 2023 23:17:16 +0100 Subject: [PATCH 04/24] fix: update uri paths --- src/App.vue | 8 ++++---- src/components/AppHeader.vue | 4 ++-- src/components/AppNav.vue | 10 +++++----- src/components/AppPageView.vue | 8 ++------ src/components/Line/RouteMap/Table.vue | 2 +- src/components/Stop/Header.vue | 2 +- src/components/Stop/PrevNextStops.vue | 4 ++-- src/main.ts | 13 ++++++++----- src/pages/TabPage/New.vue | 2 +- 9 files changed, 26 insertions(+), 27 deletions(-) diff --git a/src/App.vue b/src/App.vue index a2cee06..3fea1da 100644 --- a/src/App.vue +++ b/src/App.vue @@ -30,13 +30,13 @@ export default Vue.extend({ watch: { '$route.params.tab': { handler () { - if (this.$route.params.tab === 'settings') { + if (this.$route.path === '/settings') { return } const tabNumber = Number(this.$route.params.tab) const isValidTabNumber = tabNumber >= 1 && tabNumber <= this.$store.state.tabs.length if (!isValidTabNumber) { - this.$router.push(`/1/${this.$store.state.tabs[0].path}`) + this.$router.push(`/timetables/1/${this.$store.state.tabs[0].path}`) } }, deep: true, @@ -59,7 +59,7 @@ export default Vue.extend({ }, '$store.state.tabs': { handler () { - if (this.$route.params.tab === 'settings') { + if (this.$route.path === '/settings') { return } const tabNumber = Number(this.$route.params.tab) @@ -67,7 +67,7 @@ export default Vue.extend({ if (!isValidTabNumber) { const newTabNumber = Math.min(this.$store.state.tabs.length, Math.max(1, Number(this.$route.params.tab))) const { line, stop } = this.$store.state.tabs[newTabNumber - 1] - this.$router.push(`/${newTabNumber}${line ? `/${line}` : ''}${stop ? `/${stop}` : ''}`) + this.$router.push(`/timetables/${newTabNumber}${line ? `/${line}` : ''}${stop ? `/${stop}` : ''}`) } }, deep: true, diff --git a/src/components/AppHeader.vue b/src/components/AppHeader.vue index 86b4e33..30ea657 100644 --- a/src/components/AppHeader.vue +++ b/src/components/AppHeader.vue @@ -3,13 +3,13 @@
-
diff --git a/src/components/AppNav.vue b/src/components/AppNav.vue index 572732b..326d99c 100644 --- a/src/components/AppNav.vue +++ b/src/components/AppNav.vue @@ -8,7 +8,7 @@ class="tab" :class="{ 'tab-active': tabIndex() === i }" > - + @@ -36,7 +36,7 @@ class="tab" :class="{ 'tab-active': tabIndex() === i }" > - + @@ -76,18 +76,18 @@ export default Vue.extend({ }, addTab () { this.$store.commit('addTab') - this.$router.push(`/${this.$store.state.tabs.length}`) + this.$router.push(`/timetables/${this.$store.state.tabs.length}`) }, closeTab (tabIndex: number) { const currentTabIndex = Number(this.$route.params.tab) - 1 if (currentTabIndex > tabIndex) { const { line, stop } = this.$store.state.tabs[currentTabIndex] this.$store.commit('closeTab', { tabIndex }) - this.$router.push(`/${currentTabIndex}${line ? `/${line}` : ''}${stop ? `/${stop}` : ''}`) + this.$router.push(`/timetables/${currentTabIndex}${line ? `/${line}` : ''}${stop ? `/${stop}` : ''}`) } else { this.$store.commit('closeTab', { tabIndex }) const { line, stop } = this.$store.state.tabs[currentTabIndex] - this.$router.push(`/${currentTabIndex + 1}${line ? `/${line}` : ''}${stop ? `/${stop}` : ''}`) + this.$router.push(`/timetables/${currentTabIndex + 1}${line ? `/${line}` : ''}${stop ? `/${stop}` : ''}`) } }, }, diff --git a/src/components/AppPageView.vue b/src/components/AppPageView.vue index 3712c1a..a7a596f 100644 --- a/src/components/AppPageView.vue +++ b/src/components/AppPageView.vue @@ -1,8 +1,8 @@ diff --git a/src/components/LineMap/LineMapLabelCell.vue b/src/components/LineMap/LineMapLabelCell.vue index c1031ae..2c0ce5c 100644 --- a/src/components/LineMap/LineMapLabelCell.vue +++ b/src/components/LineMap/LineMapLabelCell.vue @@ -5,8 +5,13 @@ > {{ stopName }}
-
@@ -51,6 +56,5 @@ export default Vue.extend({ .line-connections > img { margin-top: 0.2rem; margin-right: 0.2rem; - width: 1.35rem; } diff --git a/src/components/Stop/StopHeader.vue b/src/components/Stop/StopHeader.vue index 168b740..3ea9bed 100644 --- a/src/components/Stop/StopHeader.vue +++ b/src/components/Stop/StopHeader.vue @@ -8,7 +8,11 @@ :key="`${conn.line}/${conn.slugName}`" :to="`/timetables/${$route.params.tab}/${conn.line}/${conn.slugName}`" > - +
diff --git a/src/components/Timetables/TimetablesHome.vue b/src/components/Timetables/TimetablesHome.vue index e9b6b7c..4076c57 100644 --- a/src/components/Timetables/TimetablesHome.vue +++ b/src/components/Timetables/TimetablesHome.vue @@ -6,7 +6,12 @@ - + @@ -50,9 +55,4 @@ hr { display: inline-block; margin: 1rem 1rem 0 0; } - -.icon-line img { - width: 3.5rem; - height: 3.5rem; -} diff --git a/src/components/design/DesignIcon.vue b/src/components/design/DesignIcon.vue index cb9e7cd..8ee5a48 100644 --- a/src/components/design/DesignIcon.vue +++ b/src/components/design/DesignIcon.vue @@ -1,19 +1,27 @@ From 7d1001d193d0051333b66ad8ecb4e3d0357faa9b Mon Sep 17 00:00:00 2001 From: ludchieng Date: Tue, 24 Jan 2023 23:17:20 +0100 Subject: [PATCH 12/24] fix: icon fade in --- src/components/LineIcon.vue | 1 + src/components/design/DesignIcon.vue | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/components/LineIcon.vue b/src/components/LineIcon.vue index 8bcc826..f0cd17d 100644 --- a/src/components/LineIcon.vue +++ b/src/components/LineIcon.vue @@ -4,6 +4,7 @@ :src="`/img/lines-icons/${color}/${lineSlugName}.svg`" :alt="`${lineSlugName}`" :size="size" + :fadeIn="fadeIn" /> diff --git a/src/components/design/DesignIcon.vue b/src/components/design/DesignIcon.vue index 8ee5a48..62f69ee 100644 --- a/src/components/design/DesignIcon.vue +++ b/src/components/design/DesignIcon.vue @@ -31,6 +31,11 @@ export default Vue.extend({ diff --git a/src/pages/TimetablesPage.vue b/src/pages/TimetablesPage.vue deleted file mode 100644 index 6e59828..0000000 --- a/src/pages/TimetablesPage.vue +++ /dev/null @@ -1,26 +0,0 @@ - - - - - diff --git a/src/components/Timetables/TimetablesStop.vue b/src/pages/TimetablesStopPage.vue similarity index 93% rename from src/components/Timetables/TimetablesStop.vue rename to src/pages/TimetablesStopPage.vue index e14f3a5..0cfca3a 100644 --- a/src/components/Timetables/TimetablesStop.vue +++ b/src/pages/TimetablesStopPage.vue @@ -1,5 +1,5 @@