Skip to content

Commit a24d833

Browse files
committed
Switch perspective 2 to 1
1 parent b6b147d commit a24d833

File tree

12 files changed

+1305
-1301
lines changed

12 files changed

+1305
-1301
lines changed

src/client/containers/SemanticPortal.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ import {
5151
processPortalConfig,
5252
createPerspectiveConfig,
5353
createPerspectiveConfigOnlyInfoPages
54-
}
55-
from '../helpers/helpers'
54+
} from '../helpers/helpers'
55+
import * as apexChartsConfig from '../library_configs/ApexCharts/ApexChartsConfig'
56+
import * as leafletConfig from '../library_configs/Leaflet/LeafletConfig'
57+
import * as networkConfig from '../library_configs/Cytoscape.js/NetworkConfig'
5658

5759
// ** Generate portal configuration based on JSON configs **
5860
import portalConfig from '../../configs/portalConfig.json'
@@ -71,9 +73,7 @@ const perspectiveConfigOnlyInfoPages = await createPerspectiveConfigOnlyInfoPage
7173
portalID,
7274
onlyInstancePagePerspectives: perspectives.onlyInstancePages
7375
})
74-
const apexChartsConfig = await import(`../library_configs/${portalID}/ApexCharts/ApexChartsConfig`)
75-
const leafletConfig = await import(`../library_configs/${portalID}/Leaflet/LeafletConfig`)
76-
const networkConfig = await import(`../library_configs/${portalID}/Cytoscape.js/NetworkConfig`)
76+
7777
// ** portal configuration end **
7878

7979
// ** Import general components **

src/client/library_configs/sampo/ApexCharts/ApexChartsConfig.js renamed to src/client/library_configs/ApexCharts/ApexChartsConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import intl from 'react-intl-universal'
3-
import { generateLabelForMissingValue } from '../../../helpers/helpers'
3+
import { generateLabelForMissingValue } from '../../helpers/helpers'
44

55
export const createSingleLineChartData = ({
66
rawData,

src/client/library_configs/sampo/Leaflet/LeafletConfig.js renamed to src/client/library_configs/Leaflet/LeafletConfig.js

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { has, orderBy } from 'lodash'
2-
import history from '../../../History'
2+
import history from '../../History'
33
import intl from 'react-intl-universal'
44

55
export const createPopUpContentDefault = ({ data, resultClass }) => {
@@ -95,7 +95,7 @@ export const createPopUpContentNameSampo = ({ data }) => {
9595
return popUpTemplate
9696
}
9797

98-
export const createPopUpContentFindSampo = data => {
98+
export const createPopUpContentFindSampo = ({ data }) => {
9999
const container = document.createElement('div')
100100

101101
if (has(data, 'image')) {
@@ -104,8 +104,8 @@ export const createPopUpContentFindSampo = data => {
104104
image = image[0]
105105
}
106106
const imageElement = document.createElement('img')
107+
imageElement.className = 'leaflet-popup-content-image'
107108
imageElement.setAttribute('src', image.url)
108-
imageElement.style.cssText = 'width: 100%'
109109
container.appendChild(imageElement)
110110
}
111111
const heading = document.createElement('h3')
@@ -116,13 +116,13 @@ export const createPopUpContentFindSampo = data => {
116116
heading.appendChild(headingLink)
117117
container.appendChild(heading)
118118
if (has(data, 'objectType')) {
119-
container.appendChild(this.createPopUpElement({
119+
container.appendChild(createPopUpElement({
120120
label: intl.get('perspectives.finds.properties.objectType.label'),
121121
value: data.objectType.prefLabel
122122
}))
123123
}
124124
if (has(data, 'material')) {
125-
container.appendChild(this.createPopUpElement({
125+
container.appendChild(createPopUpElement({
126126
label: intl.get('perspectives.finds.properties.material.label'),
127127
value: data.material.prefLabel
128128
}))
@@ -228,21 +228,24 @@ const bufferStyle = feature => {
228228
}
229229

230230
const createArchealogicalSiteColor = feature => {
231-
let color = '#dd2c00'
232-
if (feature.properties.laji.includes('poistettu kiinteä muinaisjäännös')) {
233-
color = '#000000'
234-
}
235-
return color
231+
const entry = fhaLegend.find(el => el.key === feature.properties.laji.trim())
232+
return entry.color
236233
}
237234

238-
/*
239-
FHA spatial data general documentation:
240-
https://www.museovirasto.fi/en/services-and-guidelines/data-systems/kulttuuriympaeristoen-tietojaerjestelmae/kulttuuriympaeristoen-paikkatietoaineistot
235+
export const fhaLegend = [
236+
{ key: 'kiinteä muinaisjäännös', color: '#f00501' },
237+
{ key: 'luonnonmuodostuma', color: '#00cafb' },
238+
{ key: 'löytöpaikka', color: '#ffb202' },
239+
{ key: 'mahdollinen muinaisjäännös', color: '#fc01e2' },
240+
{ key: 'muu kohde', color: '#ffffff' },
241+
{ key: 'muu kulttuuriperintökohde', color: '#b57b3b' },
242+
{ key: 'poistettu kiinteä muinaisjäännös (ei rauhoitettu)', color: '#8b928b' }
243+
]
241244

245+
/*
242246
FHA WFS services:
243247
https://kartta.nba.fi/arcgis/rest/services/WFS/MV_KulttuuriymparistoSuojellut/MapServer
244248
https://kartta.nba.fi/arcgis/rest/services/WFS/MV_Kulttuuriymparisto/MapServer/
245-
246249
MV_Kulttuuriymparisto service documentation:
247250
https://www.paikkatietohakemisto.fi/geonetwork/srv/fin/catalog.search#/metadata/83787bc0-5a11-4429-a79d-22b37360a408
248251
https://www.museovirasto.fi/uploads/Tietotuotemaarittely_kulttuuriymparisto_kaikki.pdf
@@ -290,16 +293,16 @@ export const layerConfigs = [
290293
},
291294
createPopup: createArchealogicalSitePopUp
292295
},
293-
// {
294-
// id: 'fhaLidar',
295-
// type: 'WMS',
296-
// url: `${process.env.API_URL}/fha-wms`,
297-
// layers: 'NBA:lidar',
298-
// version: '1.3.0',
299-
// attribution: 'Museovirasto',
300-
// minZoom: 13,
301-
// maxZoom: 18
302-
// },
296+
{
297+
id: 'fhaLidar',
298+
type: 'WMS',
299+
url: `${process.env.API_URL}/fha-wms`,
300+
layers: 'NBA:lidar',
301+
version: '1.3.0',
302+
attribution: 'Museovirasto',
303+
minZoom: 13,
304+
maxZoom: 18
305+
},
303306
{
304307
id: 'karelianMaps',
305308
type: 'WMTS',

src/client/translations/sampo/localeEN.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@
190190
}
191191
}
192192
},
193-
"perspective1": {
194-
"label": "Perspective 1",
193+
"perspective2": {
194+
"label": "Perspective 2",
195195
"facetResultsType": "manuscripts",
196196
"shortDescription": "Perspective1 description",
197197
"longDescription": "<p class=\"MuiTypography-root MuiTypography-body1 MuiTypography-paragraph\"> Use this perspective to access data related to physical manuscript objects. If two or more source datasets include the same manuscript and this has been verified, the information from the source datasets has been merged into one manuscript. See <a href=\"/instructions\">instructions</a> for using the filters. The result view can be selected using the tabs: </p> <ul class=\"MuiTypography-root MuiTypography-body1\"> <li> <strong>TABLE</STRONG> view includes all manuscripts in the MMM data. One table row is equivalent to one manuscript. </li> <li> <strong>PRODUCTION PLACES</STRONG> view visualizes the connection between manuscripts and the places where they were produced. </li> <li> <strong>MIGRATIONS</strong> view visualizes the migration of a manuscript from place of production to its most recently observed location. </li> <li> <strong>EXPORT</strong> the SPARQL query used to generate the result table view into YASGUI query editor. </li> </ul>",
@@ -303,8 +303,8 @@
303303
}
304304
}
305305
},
306-
"perspective2": {
307-
"label": "Perspective 2",
306+
"perspective1": {
307+
"label": "Perspective 1",
308308
"facetResultsType": "works",
309309
"shortDescription": "Perspective 2 description",
310310
"longDescription": "<p class=\"MuiTypography-root MuiTypography-body1 MuiTypography-paragraph\"> Use this perspective to access data related to Works. The MMM data model follows the <a href='https://www.ifla.org/publications/node/11240' target='_blank' rel='noopener noreferrer'>FRBRoo</a> definition of a work, which refers to “distinct concepts or combinations of concepts identified in artistic and intellectual expressions.” Works contain title and author information. If two or more source datasets include the same Work and this has been verified, the information from the source datasets has been merged into one Work. See <a href=\"/instructions\">instructions</a> for using the filters. The result view can be selected using the tabs: </p> <ul class=\"MuiTypography-root MuiTypography-body1\"> <li> <strong>TABLE</STRONG> view gives you a list of specific works, and the manuscripts and manuscript collections in which they can be found. </li> <li> <strong>EXPORT</strong> the SPARQL query used to generate the result table view into YASGUI query editor. </li> </ul>",

src/configs/portalConfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"yasguiParams": {
9191
"contentTypeConstruct": "text/turtle",
9292
"contentTypeSelect": "application/sparql-results+json",
93-
"endpoint": "http://ldf.fi/mmm/sparql",
93+
"endpoint": "https://ldf.fi/mmm/sparql",
9494
"requestMethod": "POST",
9595
"tabTitle": "Exported query"
9696
}

src/configs/sampo/only_instance_pages/manuscripts.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"useAuth": false,
66
"prefixesFile": "SparqlQueriesPrefixes.js"
77
},
8-
"sparqlQueriesFile": "SparqlQueriesPerspective1.js",
8+
"sparqlQueriesFile": "SparqlQueriesPerspective2.js",
99
"baseURI": "http://ldf.fi/mmm",
1010
"URITemplate": "<BASE_URI>/manifestation_singleton/<LOCAL_ID>",
1111
"resultClasses": {

src/configs/sampo/only_instance_pages/works.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"useAuth": false,
66
"prefixesFile": "SparqlQueriesPrefixes.js"
77
},
8-
"sparqlQueriesFile": "SparqlQueriesPerspective2.js",
8+
"sparqlQueriesFile": "SparqlQueriesPerspective1.js",
99
"baseURI": "http://ldf.fi/mmm",
1010
"URITemplate": "<BASE_URI>/work/<LOCAL_ID>",
1111
"resultClasses": {

0 commit comments

Comments
 (0)