Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ You can also check the

## Unreleased

- Maintenance
- Update available data sources after LINDAS PROD cut over
- Fixes
- Fix XSS vulnerability caused by unescaped map layer attributions
- Allow GraphQL endpoint to return larger responses by increasing the response
Expand Down
4 changes: 2 additions & 2 deletions app/.env.development
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
DATABASE_URL=postgres://postgres:password@localhost:5432/visualization_tool
ENDPOINT=sparql+https://lindas-cached.cluster.ldbar.ch/query
ENDPOINT=sparql+https://cached.lindas.admin.ch/query
SPARQL_GEO_ENDPOINT=https://geo.ld.admin.ch/query
GRAPHQL_ENDPOINT=/api/graphql
WHITELISTED_DATA_SOURCES=["Prod", "Prod-uncached", "Int", "Int-uncached", "Test", "Test-uncached", "LINDASnext-Prod", "LINDASnext-Prod-uncached", "LINDASnext-Int", "LINDASnext-Int-uncached", "LINDASold-Test", "LINDASold-Test-uncached"]
WHITELISTED_DATA_SOURCES=["Prod", "Prod-uncached", "Int", "Int-uncached", "Test", "Test-uncached", "LINDASold-Prod", "LINDASold-Prod-uncached", "LINDASold-Int", "LINDASold-Int-uncached", "LINDASold-Test", "LINDASold-Test-uncached"]
NEXT_PUBLIC_VECTOR_TILE_URL=https://world.vectortiles.geo.admin.ch
NEXT_PUBLIC_MAPTILER_STYLE_KEY=123
ADFS_PROFILE_URL=https://www.myaccount-r.eiam.admin.ch/
Expand Down
2 changes: 1 addition & 1 deletion app/components/graphql-termsets.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const Termsets = () => {
variables: {
locale: "en",
sourceType: "sparql",
sourceUrl: "https://lindas-cached.cluster.ldbar.ch/query",
sourceUrl: "https://cached.lindas.admin.ch/query",
cubeFilter: {
iri: cube,
},
Expand Down
2 changes: 1 addition & 1 deletion app/docs/catalog/chart-preview-via-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ An example configurator state is shown below.
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/7",
dataSource: {
type: "sparql",
url: "https://lindas-cached.cluster.ldbar.ch/query",
url: "https://cached.lindas.admin.ch/query",
},
meta: {
title: {
Expand Down
44 changes: 20 additions & 24 deletions app/domain/data-source/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ import keyBy from "lodash/keyBy";

import { WHITELISTED_DATA_SOURCES } from "../env";

export const LEGACY_PROD_DATA_SOURCE_URL = "https://lindas.admin.ch/query";
export const UNCACHED_PROD_DATA_SOURCE_URL = "https://lindas.admin.ch/query";

export const PROD_DATA_SOURCE_URL =
"https://lindas-cached.cluster.ldbar.ch/query";
export const PROD_DATA_SOURCE_URL = "https://cached.lindas.admin.ch/query";

interface SourceOption {
value: string;
Expand All @@ -26,32 +25,13 @@ export const SOURCE_OPTIONS: SourceOption[] = [
supportsCachingPerCubeIri: true,
},
{
value: "sparql+https://lindas.admin.ch/query",
value: `sparql+${UNCACHED_PROD_DATA_SOURCE_URL}`,
key: "Prod-uncached",
label: "LINDAS PROD (uncached)",
url: "https://lindas.admin.ch/query",
url: UNCACHED_PROD_DATA_SOURCE_URL,
isTrusted: true,
supportsCachingPerCubeIri: true,
},

// For LINDASnext
{
value: "sparql+https://cached.lindas.admin.ch/query",
key: "LINDASnext-Prod",
label: "LINDASnext PROD",
url: "https://cached.lindas.admin.ch/query",
isTrusted: true,
supportsCachingPerCubeIri: true,
},
{
value: "sparql+https://lindas.cz-aws.net/query",
key: "LINDASnext-Prod-uncached",
label: "LINDASnext PROD (uncached)",
url: "https://lindas.cz-aws.net/query",
isTrusted: false,
supportsCachingPerCubeIri: true,
},
// Migration done for the following data sources
{
value: "sparql+https://int.cached.lindas.admin.ch/query",
key: "Int",
Expand Down Expand Up @@ -86,6 +66,22 @@ export const SOURCE_OPTIONS: SourceOption[] = [
},

// For LINDASold
{
value: "sparql+https://lindas-cached.cluster.ldbar.ch/query",
key: "LINDASold-Prod",
label: "LINDASold PROD",
url: "https://lindas-cached.cluster.ldbar.ch/query",
isTrusted: false,
supportsCachingPerCubeIri: true,
},
{
value: "sparql+https://old.ld.ldbar.ch/query",
key: "LINDASold-Prod-uncached",
label: "LINDASold PROD (uncached)",
url: "https://old.ld.ldbar.ch/query",
isTrusted: false,
supportsCachingPerCubeIri: true,
},
{
value: "sparql+https://lindas-cached.int.cluster.ldbar.ch/query",
key: "LINDASold-Int",
Expand Down
6 changes: 3 additions & 3 deletions app/domain/data-source/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const createRouter = ({ query }: { query: Record<string, string> }) => {

vi.mock("../env", () => ({
WHITELISTED_DATA_SOURCES: ["Test", "Prod", "Int"],
ENDPOINT: "sparql+https://lindas-cached.cluster.ldbar.ch/query", // Default is Prod in tests
ENDPOINT: "sparql+https://cached.lindas.admin.ch/query", // Default is Prod in tests
}));

describe("datasource state hook", () => {
Expand Down Expand Up @@ -88,7 +88,7 @@ describe("datasource state hook", () => {

expect(getState()).toEqual({
type: "sparql",
url: "https://lindas-cached.cluster.ldbar.ch/query",
url: "https://cached.lindas.admin.ch/query",
});
});

Expand Down Expand Up @@ -125,7 +125,7 @@ describe("datasource state hook", () => {
act(() => {
setState({
type: "sparql",
url: "https://lindas-cached.cluster.ldbar.ch/query",
url: "https://cached.lindas.admin.ch/query",
});
});

Expand Down
2 changes: 1 addition & 1 deletion app/domain/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const PUBLIC_URL = (
export const ENDPOINT =
clientEnv?.ENDPOINT ??
process.env.ENDPOINT ??
"sparql+https://lindas-cached.cluster.ldbar.ch/query";
"sparql+https://cached.lindas.admin.ch/query";

export const WHITELISTED_DATA_SOURCES = clientEnv?.WHITELISTED_DATA_SOURCES ??
(process.env.WHITELISTED_DATA_SOURCES !== undefined
Expand Down
2 changes: 1 addition & 1 deletion app/pages/_preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const CONFIGURATOR_STATE_COLUMN = {
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/2",
dataSource: {
type: "sparql",
url: "https://lindas-cached.cluster.ldbar.ch/query",
url: "https://cached.lindas.admin.ch/query",
},
meta: {
title: { de: "", fr: "", it: "", en: "" },
Expand Down
4 changes: 2 additions & 2 deletions app/pages/_preview_post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const photovoltaikanlagenState = {
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/7",
dataSource: {
type: "sparql",
url: "https://lindas-cached.cluster.ldbar.ch/query",
url: "https://cached.lindas.admin.ch/query",
},
meta: {
title: {
Expand Down Expand Up @@ -111,7 +111,7 @@ const nfiState = {
dataSet: "https://environment.ld.admin.ch/foen/nfi/nfi_C-1266/cube/2023-1",
dataSource: {
type: "sparql",
url: "https://lindas-cached.cluster.ldbar.ch/query",
url: "https://cached.lindas.admin.ch/query",
},
meta: {
title: {
Expand Down
16 changes: 13 additions & 3 deletions app/test/__fixtures/config/prod/column-1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@
"key": "g_Dcz7A82MNj",
"data": {
"meta": {
"title": { "de": "", "en": "", "fr": "", "it": "" },
"description": { "de": "", "en": "", "fr": "", "it": "" }
"title": {
"de": "",
"en": "",
"fr": "",
"it": ""
},
"description": {
"de": "",
"en": "",
"fr": "",
"it": ""
}
},
"dataSet": "http://environment.ld.admin.ch/foen/px/0703010000_105/dataset",
"dataSource": {
"type": "sparql",
"url": "https://lindas-cached.cluster.ldbar.ch/query"
"url": "https://cached.lindas.admin.ch/query"
},
"chartConfig": {
"version": "1.2.1",
Expand Down
20 changes: 16 additions & 4 deletions app/test/__fixtures/config/prod/column-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@
"key": "jV7rbOyAYouu",
"data": {
"meta": {
"title": { "de": "", "en": "", "fr": "", "it": "" },
"description": { "de": "", "en": "", "fr": "", "it": "" }
"title": {
"de": "",
"en": "",
"fr": "",
"it": ""
},
"description": {
"de": "",
"en": "",
"fr": "",
"it": ""
}
},
"dataSet": "http://ld.zazuko.com/foag/dataset",
"dataSource": {
"type": "sparql",
"url": "https://lindas-cached.cluster.ldbar.ch/query"
"url": "https://cached.lindas.admin.ch/query"
},
"chartConfig": {
"version": "1.2.1",
Expand All @@ -20,7 +30,9 @@
},
"componentIri": "http://ld.zazuko.com/foag/week-date"
},
"y": { "componentIri": "http://ld.zazuko.com/foag/price" }
"y": {
"componentIri": "http://ld.zazuko.com/foag/price"
}
},
"filters": {
"http://ld.zazuko.com/foag/unit": {
Expand Down
21 changes: 17 additions & 4 deletions app/test/__fixtures/config/prod/column-3.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,32 @@
"key": "KXMuXhfWuN5d",
"data": {
"meta": {
"title": { "de": "", "en": "", "fr": "", "it": "" },
"description": { "de": "", "en": "", "fr": "", "it": "" }
"title": {
"de": "",
"en": "",
"fr": "",
"it": ""
},
"description": {
"de": "",
"en": "",
"fr": "",
"it": ""
}
},
"dataSet": "http://environment.ld.admin.ch/foen/px/0703030000_135/dataset",
"dataSource": {
"type": "sparql",
"url": "https://lindas-cached.cluster.ldbar.ch/query"
"url": "https://cached.lindas.admin.ch/query"
},
"chartConfig": {
"version": "1.2.1",
"fields": {
"x": {
"sorting": { "sortingType": "byMeasure", "sortingOrder": "asc" },
"sorting": {
"sortingType": "byMeasure",
"sortingOrder": "asc"
},
"componentIri": "http://environment.ld.admin.ch/foen/px/0703030000_135/dimension/1"
},
"y": {
Expand Down
16 changes: 13 additions & 3 deletions app/test/__fixtures/config/prod/column-4.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@
"key": "l8F-tvfGFrwU",
"data": {
"meta": {
"title": { "de": "", "en": "", "fr": "", "it": "" },
"description": { "de": "", "en": "", "fr": "", "it": "" }
"title": {
"de": "",
"en": "",
"fr": "",
"it": ""
},
"description": {
"de": "",
"en": "",
"fr": "",
"it": ""
}
},
"dataSet": "http://environment.ld.admin.ch/foen/px/0703010000_102/dataset",
"dataSource": {
"type": "sparql",
"url": "https://lindas-cached.cluster.ldbar.ch/query"
"url": "https://cached.lindas.admin.ch/query"
},
"chartConfig": {
"version": "1.2.1",
Expand Down
16 changes: 13 additions & 3 deletions app/test/__fixtures/config/prod/column-5.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@
"key": "Qq3UMO9ysHZi",
"data": {
"meta": {
"title": { "de": "", "en": "", "fr": "", "it": "" },
"description": { "de": "", "en": "", "fr": "", "it": "" }
"title": {
"de": "",
"en": "",
"fr": "",
"it": ""
},
"description": {
"de": "",
"en": "",
"fr": "",
"it": ""
}
},
"dataSet": "http://environment.ld.admin.ch/foen/px/0703030000_112/dataset",
"dataSource": {
"type": "sparql",
"url": "https://lindas-cached.cluster.ldbar.ch/query"
"url": "https://cached.lindas.admin.ch/query"
},
"chartConfig": {
"version": "1.2.1",
Expand Down
9 changes: 7 additions & 2 deletions app/test/__fixtures/config/prod/column-6.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
"key": "v71kJ5n-qKGw",
"data": {
"meta": {
"title": { "de": "Holz", "en": "", "fr": "", "it": "" },
"title": {
"de": "Holz",
"en": "",
"fr": "",
"it": ""
},
"description": {
"de": "aslkslkjfsadlfkj asékfàsaék",
"en": "",
Expand All @@ -13,7 +18,7 @@
"dataSet": "http://environment.ld.admin.ch/foen/px/0703010000_106/dataset",
"dataSource": {
"type": "sparql",
"url": "https://lindas-cached.cluster.ldbar.ch/query"
"url": "https://cached.lindas.admin.ch/query"
},
"chartConfig": {
"version": "1.2.1",
Expand Down
16 changes: 13 additions & 3 deletions app/test/__fixtures/config/prod/column-7.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@
"key": "wfFzUGgvZVbp",
"data": {
"meta": {
"title": { "de": "", "en": "", "fr": "", "it": "" },
"description": { "de": "", "en": "", "fr": "", "it": "" }
"title": {
"de": "",
"en": "",
"fr": "",
"it": ""
},
"description": {
"de": "",
"en": "",
"fr": "",
"it": ""
}
},
"dataSet": "http://environment.ld.admin.ch/foen/px/0703030000_112/dataset",
"dataSource": {
"type": "sparql",
"url": "https://lindas-cached.cluster.ldbar.ch/query"
"url": "https://cached.lindas.admin.ch/query"
},
"chartConfig": {
"version": "1.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"dataSet": "https://environment.ld.admin.ch/foen/ubd003701/1",
"dataSource": {
"type": "sparql",
"url": "https://lindas-cached.cluster.ldbar.ch/query"
"url": "https://cached.lindas.admin.ch/query"
},
"chartConfig": {
"version": "1.2.1",
Expand Down
2 changes: 1 addition & 1 deletion app/test/__fixtures/config/prod/combo-line-dual.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"version": "4.2.0",
"dataSource": {
"url": "https://lindas-cached.cluster.ldbar.ch/query",
"url": "https://cached.lindas.admin.ch/query",
"type": "sparql"
},
"chartConfigs": [
Expand Down
Loading
Loading