From bef4b824a0e606d321f67fcc8b3afdbcac29aeb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Kolo=C5=A1?= Date: Mon, 22 Sep 2025 22:16:47 +0200 Subject: [PATCH 01/60] Prepare for parallel --- pages/song/Song.vue | 25 +++++++++++++++++++++---- stores/list.js | 14 ++++++++++++++ 2 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 stores/list.js diff --git a/pages/song/Song.vue b/pages/song/Song.vue index ec57512..ba95cb7 100644 --- a/pages/song/Song.vue +++ b/pages/song/Song.vue @@ -18,11 +18,23 @@ { label: 'Tisk', icon: 'print', - href: 'javascript:window.print()' + href: 'javascript:window.print()', }, ]" /> +
+ +
@@ -33,7 +45,10 @@ import SongDetail from './SongDetail'; import SongLoading from './SongLoading'; import Kebab from '~/components/Kebab'; import { getFullName } from '~/components/SongName'; +import SongsList from '~/pages/search/components/SongsList'; import Bowser from 'bowser'; +import { mapStores } from 'pinia'; +import useListStore from '~/stores/list.js'; const VISIT_SONG = gql` mutation ( @@ -180,11 +195,11 @@ const FETCH_SONG_LYRIC = gql` export default { name: 'Song', - components: { SongLoading, SongDetail, Kebab }, + components: { SongLoading, SongDetail, Kebab, SongsList }, data() { return { - previous: '', + previous: [], }; }, @@ -193,7 +208,7 @@ export default { // access to component public instance via `vm` // todo: fix for navigating between songs (or authors) // probably using pinia - vm.previous = from.fullPath; + vm.previous.push(from.fullPath); }); }, @@ -248,6 +263,8 @@ export default { }, computed: { + ...mapStores(useListStore), + topBarTitle() { return this.song_lyric ? String( diff --git a/stores/list.js b/stores/list.js new file mode 100644 index 0000000..029806e --- /dev/null +++ b/stores/list.js @@ -0,0 +1,14 @@ +import { defineStore } from 'pinia' + +export default defineStore('list', { + state: () => ({ + active: false, + searchString: '', + selectedTags: {}, + selectedSongbooks: {}, + selectedLanguages: {}, + sort: 0, + descending: false, + seed: 0, + }), +}) From 4373634201a7973eb53f057b7d3582b3390fff4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Kolo=C5=A1?= Date: Tue, 23 Sep 2025 23:47:48 +0200 Subject: [PATCH 02/60] Working prototype --- app.vue | 42 ++++++++++++ components/Search/SearchHistoryManager.vue | 20 +++++- layouts/default.vue | 76 ++++------------------ pages/search/Search.vue | 4 +- pages/song/Song.vue | 16 +---- 5 files changed, 78 insertions(+), 80 deletions(-) diff --git a/app.vue b/app.vue index 8e7f33e..d67b113 100644 --- a/app.vue +++ b/app.vue @@ -5,3 +5,45 @@ + + diff --git a/components/Search/SearchHistoryManager.vue b/components/Search/SearchHistoryManager.vue index 8ab68e3..f1809ba 100644 --- a/components/Search/SearchHistoryManager.vue +++ b/components/Search/SearchHistoryManager.vue @@ -1,6 +1,8 @@ diff --git a/layouts/default.vue b/layouts/default.vue index 03bd7d6..289d351 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -1,71 +1,23 @@ diff --git a/pages/search/Search.vue b/pages/search/Search.vue index d958511..f5974d3 100644 --- a/pages/search/Search.vue +++ b/pages/search/Search.vue @@ -124,9 +124,9 @@ :selected-tags="selected_tags" :selected-songbooks="selected_songbooks" :selected-languages="selected_languages" - :sort="parseInt(sort)" + :sort="sort" :descending="descending" - :seed="parseInt(seed)" + :seed="seed" @query-loaded="queryLoaded" > -
- -
@@ -199,7 +187,7 @@ export default { data() { return { - previous: [], + previous: '', }; }, @@ -208,7 +196,7 @@ export default { // access to component public instance via `vm` // todo: fix for navigating between songs (or authors) // probably using pinia - vm.previous.push(from.fullPath); + vm.previous = from.fullPath; }); }, From 60d6ebf81951fa40eed43985f1e043e0bf1feb6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Kolo=C5=A1?= Date: Mon, 22 Sep 2025 22:23:18 +0200 Subject: [PATCH 03/60] Upgrade node --- docker/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 6149e7a..cbe924a 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,5 +1,5 @@ # Image -FROM node:22-alpine +FROM node:22.19-alpine RUN apk update # required for yarn install @@ -9,4 +9,4 @@ RUN apk add make g++ RUN yarn global add pm2 --prefix /usr/local # Set up work directory -WORKDIR /var/www/html \ No newline at end of file +WORKDIR /var/www/html From 4b7ae8ba860492589a5094d52b4e3f492d1d220e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Kolo=C5=A1?= Date: Mon, 22 Sep 2025 22:59:33 +0200 Subject: [PATCH 04/60] Set apollo in production mode --- nuxt.config.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nuxt.config.ts b/nuxt.config.ts index ebe541b..71c1b66 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -60,6 +60,11 @@ export default defineNuxtConfig({ }, vite: { plugins: [graphql()], // Allow usage of .gql/.graphql files + define: { + 'globalThis.__DEV__': JSON.stringify( + process.env.NODE_ENV === 'development' + ), // Sets apollo in correct (development/production) mode + }, }, nitro: { routeRules: { From 8e6ae9fe9dbf0278d2371f949c0f0671204df0cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Kolo=C5=A1?= Date: Tue, 23 Sep 2025 00:06:37 +0200 Subject: [PATCH 05/60] Fix bible commonjs --- package.json | 2 +- yarn.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index bb47671..ecebae7 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "@apollo/client": "^3.7.14", "@pinia/nuxt": "^0.4.9", "@vue/apollo-option": "^4.0.0-beta.4", - "bible-liturgy-utils": "https://github.com/glowspace/bible-liturgy-utils", + "bible-liturgy-utils": "https://github.com/glowspace/bible-liturgy-utils#commonjs", "bigpicture": "^2.6.2", "bowser": "^2.11.0", "destr": "^1.2.2", diff --git a/yarn.lock b/yarn.lock index f2290a4..2c69b0a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1856,9 +1856,9 @@ baseline-browser-mapping@^2.8.3: resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.8.6.tgz#c37dea4291ed8d01682f85661dbe87967028642e" integrity sha512-wrH5NNqren/QMtKUEEJf7z86YjfqW/2uw3IL3/xpqZUC95SSVIFXYQeeGjL6FT/X68IROu6RMehZQS5foy2BXw== -"bible-liturgy-utils@https://github.com/glowspace/bible-liturgy-utils": +"bible-liturgy-utils@https://github.com/glowspace/bible-liturgy-utils#commonjs": version "2.0.2" - resolved "https://github.com/glowspace/bible-liturgy-utils#2e6b8f3221dc96aeca7557b7ca2e881757124568" + resolved "https://github.com/glowspace/bible-liturgy-utils#e4823e6df31cffec67073002283496d726ec32bf" dependencies: "@romcal/calendar.czech-republic" "^3.0.0-alpha.0" romcal "3.0.0-alpha.0" From dade2687efb655423dae24898cd4a410b35b32ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Kolo=C5=A1?= Date: Tue, 23 Sep 2025 20:22:50 +0200 Subject: [PATCH 06/60] Refactor song name and number --- components/SongName.vue | 51 +++++++---------- pages/author/Author.vue | 52 ++--------------- pages/author/AuthorSongsList.vue | 35 +++++++++++- pages/search/components/SLItem.vue | 82 ++++++++++++++++++++++++--- pages/search/components/SongsList.vue | 76 +++++-------------------- pages/song/Song.vue | 31 ++-------- 6 files changed, 153 insertions(+), 174 deletions(-) diff --git a/components/SongName.vue b/components/SongName.vue index e43fd20..2d7c3bc 100644 --- a/components/SongName.vue +++ b/components/SongName.vue @@ -27,6 +27,9 @@ export default { song: { type: Object, }, + songbookId: { + default: null, + }, multiline: { type: Boolean, default: false, @@ -38,50 +41,38 @@ export default { }, computed: { songName() { - return getName(this.song, this.$config.public.variation); - }, - names() { - return getNames(this.song, this.$config.public.variation); + return getNames( + this.song, + this.songbookId ?? this.$config.public.variation.songbook + )[0]; }, secondaryNames() { - return this.names.slice(1); + return getNames( + this.song, + this.songbookId ?? this.$config.public.variation.songbook + ).slice(1); }, }, }; -function getName(song, variation) { - if (variation.songbook != null) { - const songbookName = song.songbook_records?.find( - (record) => record.pivot.songbook.id == variation.songbook +function getNames(song, songbookId) { + if (songbookId != null && song.songbook_records != null) { + const songbookName = song.songbook_records.find( + (record) => record.pivot.songbook.id == songbookId )?.pivot.song_name; if (songbookName) { - return songbookName; - } - } - - return song.name; -} - -function getNames(song, variation) { - const names = [ - getName(song, variation), - song.secondary_name_1, - song.secondary_name_2, - ]; - const result = []; - - for (const name of names) { - if (name && !result.includes(name)) { - result.push(name); + return [songbookName]; } } - return result; + return [song.name, song.secondary_name_1, song.secondary_name_2].filter( + (name) => name + ); } -export function getFullName(song, variation) { - const names = getNames(song, variation); +export function getFullName(song, songbookId) { + const names = getNames(song, songbookId); if (names.length == 1) { return names[0]; diff --git a/pages/author/Author.vue b/pages/author/Author.vue index 2317a02..3075235 100644 --- a/pages/author/Author.vue +++ b/pages/author/Author.vue @@ -93,7 +93,7 @@ + + diff --git a/pages/search/components/SLItem.vue b/pages/search/components/SLItem.vue index dc20575..de0dd4b 100644 --- a/pages/search/components/SLItem.vue +++ b/pages/search/components/SLItem.vue @@ -5,11 +5,11 @@ class="hidden lg:table-cell text-gray text-right w-16 text-sm" > - {{ number }} + {{ `${songbookPrefix}${songNumber}` }} @@ -18,16 +18,21 @@ :class="{ 'md:pl-7': isSearch }" :to="song_lyric.public_route" > - {{ specialNumber }}. + {{ songNumber }}. - + + + diff --git a/pages/song/Song.vue b/pages/song/Song.vue index cfa643c..1a56a8a 100644 --- a/pages/song/Song.vue +++ b/pages/song/Song.vue @@ -1,30 +1,32 @@ From e6b1fc284a80cad14e7d60d6f5ebf889ca345dc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Kolo=C5=A1?= Date: Thu, 6 Nov 2025 23:01:50 +0100 Subject: [PATCH 17/60] Fix sheets, add search box --- assets/css/tailwind.css | 4 ++++ components/BottomSheets.vue | 12 ++++++++---- components/SideList.vue | 16 ++++++++++++++++ pages/search/Search.vue | 2 +- pages/search/components/FilterRowItem.vue | 6 +++++- pages/search/components/Filters.vue | 14 +++++++++++--- pages/search/components/SearchBox.vue | 2 +- pages/song/components/SongBox/SongBox.vue | 4 ++-- 8 files changed, 48 insertions(+), 12 deletions(-) diff --git a/assets/css/tailwind.css b/assets/css/tailwind.css index 3860f61..73efabd 100644 --- a/assets/css/tailwind.css +++ b/assets/css/tailwind.css @@ -10,6 +10,10 @@ @apply w-full max-w-[700px] mx-auto; } +.input-box { + @apply h-14 rounded-full bg-surface-100 dark:bg-surfacedark-100 p-2 m-2 border border-gray-500; +} + .stretched-link { position: static; will-change: initial; diff --git a/components/BottomSheets.vue b/components/BottomSheets.vue index 5ab1ff2..948d594 100644 --- a/components/BottomSheets.vue +++ b/components/BottomSheets.vue @@ -7,7 +7,7 @@ class="background group-[&.show]:opacity-20 dark:group-[&.show]:opacity-20 inset-0 fixed z-40 opacity-0 -top-full bg-black" > -
+
@@ -32,7 +32,11 @@ diff --git a/pages/search/Search.vue b/pages/search/Search.vue index 3ec1716..25df0dc 100644 --- a/pages/search/Search.vue +++ b/pages/search/Search.vue @@ -21,7 +21,7 @@ + + diff --git a/pages/search/components/Filters.vue b/pages/search/components/Filters.vue index 2dff21a..25e8faf 100644 --- a/pages/search/components/Filters.vue +++ b/pages/search/components/Filters.vue @@ -1,15 +1,17 @@