Skip to content

Commit

Permalink
Merge pull request #158 from Geoportail-Luxembourg/GSLUX-760-fix-meta…
Browse files Browse the repository at this point in the history
…data-url

GSLUX-760: Fix use relative urls for metadata
  • Loading branch information
AlitaBernachot authored Oct 14, 2024
2 parents 9341d8c + ae41f35 commit 79d8a0f
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 24 deletions.
13 changes: 9 additions & 4 deletions .env
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# Proxy urls
VITE_USE_PROXYURL=true
VITE_PROXYURL_WMS="https://map.geoportail.lu/ogcproxywms"
VITE_PROXYURL_REMOTE="https://map.geoportail.lu/httpsproxy"
VITE_PROXYURL_WMS="/ogcproxywms"
VITE_PROXYURL_REMOTE="/httpsproxy"

# Urls for metadata, metadata links and legends
VITE_GEONETWORK_URL="https://geocatalogue.geoportail.lu/geonetwork/srv"
VITE_GET_LEGENDS_URL="/legends/get_html"
VITE_GET_METADATA_URL="/getMetadata"

# Paths for symbols
VITE_SYMBOL_ICONS_URL="https://map.geoportail.lu/mymaps"
VITE_SYMBOLS_URL="https://map.geoportail.lu/mymaps/symbols"
VITE_SYMBOL_ICONS_URL="/mymaps"
VITE_SYMBOLS_URL="/mymaps/symbols"

# Urls for vectortiles
VITE_VECTORTILES_URL="https://vectortiles.geoportail.lu"
Expand Down
13 changes: 9 additions & 4 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# Proxy urls
VITE_USE_PROXYURL=true
VITE_PROXYURL_WMS="https://map.geoportail.lu/ogcproxywms"
VITE_PROXYURL_REMOTE="https://map.geoportail.lu/httpsproxy"
VITE_PROXYURL_WMS="https://migration.geoportail.lu/ogcproxywms"
VITE_PROXYURL_REMOTE="https://migration.geoportail.lu/httpsproxy"

# Urls for metadata, metadata links and legends
VITE_GEONETWORK_URL="https://geocatalogue.geoportail.lu/geonetwork/srv"
VITE_GET_LEGENDS_URL="https://migration.geoportail.lu/legends/get_html"
VITE_GET_METADATA_URL="https://migration.geoportail.lu/getMetadata"

# Paths for symbols
VITE_SYMBOL_ICONS_URL="https://map.geoportail.lu/mymaps"
VITE_SYMBOLS_URL="https://map.geoportail.lu/mymaps/symbols"
VITE_SYMBOL_ICONS_URL="https://map.geoportail.lu/mymaps" # !!! use prod because of CORS
VITE_SYMBOLS_URL="https://map.geoportail.lu/mymaps/symbols" # !!! use prod because of CORS

# Urls for vectortiles
VITE_VECTORTILES_URL="https://vectortiles.geoportail.lu"
Expand Down
9 changes: 7 additions & 2 deletions .env.e2e
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ VITE_USE_PROXYURL=true
VITE_PROXYURL_WMS="https://map.geoportail.lu/ogcproxywms"
VITE_PROXYURL_REMOTE="https://map.geoportail.lu/httpsproxy"

# Urls for metadata, metadata links and legends
VITE_GEONETWORK_URL="https://geocatalogue.geoportail.lu/geonetwork/srv"
VITE_GET_LEGENDS_URL="https://migration.geoportail.lu/legends/get_html"
VITE_GET_METADATA_URL="https://migration.geoportail.lu/getMetadata"

# Paths for symbols
VITE_SYMBOL_ICONS_URL="https://map.geoportail.lu/mymaps"
VITE_SYMBOLS_URL="https://map.geoportail.lu/mymaps/symbols"
VITE_SYMBOL_ICONS_URL="https://map.geoportail.lu/mymaps" # !!! use prod because of CORS
VITE_SYMBOLS_URL="https://map.geoportail.lu/mymaps/symbols" # !!! use prod because of CORS

# Urls for vectortiles
VITE_VECTORTILES_URL="https://vectortiles.geoportail.lu"
Expand Down
13 changes: 9 additions & 4 deletions .env.staging
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# Proxy urls
VITE_USE_PROXYURL=true
VITE_PROXYURL_WMS="https://map.geoportail.lu/ogcproxywms"
VITE_PROXYURL_REMOTE="https://map.geoportail.lu/httpsproxy"
VITE_PROXYURL_WMS="https://migration.geoportail.lu/ogcproxywms"
VITE_PROXYURL_REMOTE="https://migration.geoportail.lu/httpsproxy"

# Urls for metadata, metadata links and legends
VITE_GEONETWORK_URL="https://geocatalogue.geoportail.lu/geonetwork/srv"
VITE_GET_LEGENDS_URL="https://migration.geoportail.lu/legends/get_html"
VITE_GET_METADATA_URL="https://migration.geoportail.lu/getMetadata"

# Paths for symbols
VITE_SYMBOL_ICONS_URL="https://map.geoportail.lu/mymaps"
VITE_SYMBOLS_URL="https://map.geoportail.lu/mymaps/symbols"
VITE_SYMBOL_ICONS_URL="https://migration.geoportail.lu/mymaps"
VITE_SYMBOLS_URL="https://migration.geoportail.lu/mymaps/symbols"

# Urls for vectortiles
VITE_VECTORTILES_URL="https://vectortiles-staging.geoportail.lu"
Expand Down
17 changes: 7 additions & 10 deletions src/services/layer-metadata/layer-metadata.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@ import { LayerId } from '@/stores/map.store.model'
import { remoteMetadataHelper } from './remote-metadata.helper'
import { REMOTE_SERVICE_TYPE } from '../remote-layers/remote-layers.model'

export class LayerMetadataService {
// TODO: get urls from a config
private geonetworkBaseUrl =
'https://geocatalogue.geoportail.lu/geonetwork/srv'
private legendBaseUrl = 'https://map.geoportail.lu/legends/get_html'
// TODO: get from config or relative
private localMetadataBaseUrl = 'https://map.geoportail.lu/getMetadata'
const GEONETWORK_URL = import.meta.env.VITE_GEONETWORK_URL
const GET_LEGENDS_URL = import.meta.env.VITE_GET_LEGENDS_URL
const GET_METADATA_URL = import.meta.env.VITE_GET_METADATA_URL

export class LayerMetadataService {
async getLayerMetadata(id: LayerId, currentLanguage: string) {
const themesService = useThemes()
const layer: ThemeNodeModel | undefined =
Expand All @@ -34,7 +31,7 @@ export class LayerMetadataService {
const metadata =
metadataId &&
(await this.getLocalMetadata(
this.localMetadataBaseUrl,
GET_METADATA_URL,
metadataId,
currentLanguage
))
Expand All @@ -45,7 +42,7 @@ export class LayerMetadataService {
const legendHtml =
legendName &&
(await this.getLegendHtml(
this.legendBaseUrl,
GET_LEGENDS_URL,
legendName,
layerId,
currentLanguage
Expand Down Expand Up @@ -90,7 +87,7 @@ export class LayerMetadataService {
responsibleParty: metadata.responsibleParty
? getResponsibleParty(metadata.responsibleParty)
: undefined,
metadataLink: `${this.geonetworkBaseUrl}/${isoLang2To3(
metadataLink: `${GEONETWORK_URL}/${isoLang2To3(
language
)}/catalog.search#/metadata/${metadataUid}`,
isError: false,
Expand Down

0 comments on commit 79d8a0f

Please sign in to comment.