Skip to content

Commit eb61c5c

Browse files
committed
build: use env file to manage piveau hub URLs
1 parent 63cc47d commit eb61c5c

File tree

6 files changed

+16
-10
lines changed

6 files changed

+16
-10
lines changed

opendata.swiss/ui/.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Only used in development
2+
# See https://nuxt.com/docs/4.x/guide/directory-structure/env
3+
PIVEAU_HUB_SEARCH_URL=https://piveau-hub-search-ln.zazukoians.org/
4+
PIVEAU_HUB_REPO_URL=https://piveau-hub-repo-ln.zazukoians.org/

opendata.swiss/ui/.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,3 @@ logs
1818
.DS_Store
1919
.fleet
2020
.idea
21-
22-
# Local env files
23-
.env
24-
.env.*
25-
!.env.example

opendata.swiss/ui/app/components/dataset-detail/OdsMetadataDownloadList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
import { useI18n } from 'vue-i18n';
2323
import SvgIcon from '../SvgIcon.vue';
2424
import type { DcatApChV2DatasetAdapter } from './model/dcat-ap-ch-v2-dataset-adapter';
25-
import { PIVEAU_HUB_REPO_URL } from '~/constants/piveau-endpoints';
2625
26+
const { PIVEAU_HUB_REPO_URL } = useRuntimeConfig().public
2727
const { t } = useI18n();
2828
2929
const props = defineProps({

opendata.swiss/ui/app/constants/piveau-endpoints.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

opendata.swiss/ui/app/piveau/search.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { getKeywords } from './get-keywords'
44
import { getOdsFormats } from './get-ods-formats'
55
import { getOdsCatalogInfo } from './get-ods-catalog-info'
66
import { getOdsAccrualPeriodicity } from './get-ods-accrual-periodicity'
7-
import { PIVEAU_HUB_SEARCH_URL } from '~/constants/piveau-endpoints'
87

98
// export const ACTIVE_FACETS = ['categories', 'publisher', 'catalog', 'format', 'license', 'keywords']
109
export const ACTIVE_FACETS = ['catalog', 'categories', 'publisher', 'format', 'license', 'keywords']
@@ -13,8 +12,10 @@ export const ACTIVE_FACETS = ['catalog', 'categories', 'publisher', 'format', 'l
1312
* Returns a piveau hub-search query definition for DCAT-AP datasets
1413
*/
1514
export function useDatasetsSearch() {
15+
const baseUrl = useRuntimeConfig().public.PIVEAU_HUB_SEARCH_URL as string
16+
1617
return defineHubSearch({
17-
baseUrl: PIVEAU_HUB_SEARCH_URL,
18+
baseUrl,
1819
index: 'dataset',
1920
indexDetails: 'datasets',
2021
facets: ACTIVE_FACETS,

opendata.swiss/ui/nuxt.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@ import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
22

33
import { resolve } from 'node:path'
44

5+
const { PIVEAU_HUB_REPO_URL, PIVEAU_HUB_SEARCH_URL} = process.env
6+
57
// https://nuxt.com/docs/api/configuration/nuxt-config
68
export default defineNuxtConfig({
9+
runtimeConfig: {
10+
public: {
11+
PIVEAU_HUB_REPO_URL,
12+
PIVEAU_HUB_SEARCH_URL
13+
}
14+
},
715
compatibilityDate: '2025-07-15',
816
devtools: { enabled: true },
917
modules: [

0 commit comments

Comments
 (0)