Skip to content

Commit bd1ba42

Browse files
committed
Update nadd-settings.ts
1 parent 7190072 commit bd1ba42

1 file changed

Lines changed: 70 additions & 74 deletions

File tree

src/app/config/nadd/nadd-settings.ts

Lines changed: 70 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,22 @@ naddSettings.predicateVisibility.alwaysHide = [
2727
'http://iiif.io/api/presentation/3#manifest', // Note that IIIF vieing is supported through Mirador, but not shown in this demo (see RAZU implementation at https://viewer.razu.nl/ for a IIIF demo, including OCR overlay)
2828
];
2929

30+
// Replace default header with NADD header (logo without text)
31+
naddSettings.ui = {
32+
...defaultSettings.ui,
33+
header: {
34+
...defaultSettings.ui.header,
35+
showTitle: false,
36+
logoPath: '/assets/img/nadd/logo.svg',
37+
},
38+
};
39+
40+
// Set NADD texts
41+
naddSettings.content = {
42+
...defaultSettings.content,
43+
translations: { basePath: './assets/i18n/nadd/', fileExtension: '.json' },
44+
};
45+
3046
// Add endpoints
3147
naddSettings.endpoints = {
3248
...defaultSettings.endpoints,
@@ -70,43 +86,29 @@ naddSettings.endpoints = {
7086
},
7187
};
7288

73-
// Replace default header with NADD header (logo without text)
74-
naddSettings.ui = {
75-
...defaultSettings.ui,
76-
header: {
77-
...defaultSettings.ui.header,
78-
showTitle: false,
79-
logoPath: '/assets/img/nadd/logo.svg',
80-
},
81-
};
82-
8389
// Hide many details on search hits page
84-
naddSettings.predicateVisibility = {
85-
byViewMode: {
86-
[ViewMode.List]: {
87-
[PredicateVisibility.SearchHits]: [
88-
{
89-
predicates: [
90-
'https://schema.org/description',
91-
'https://schema.org/material',
92-
// '*',
93-
],
94-
},
95-
],
96-
[PredicateVisibility.Details]: [{ predicates: ['*'] }],
97-
[PredicateVisibility.Hide]: [{ predicates: [] }],
98-
},
99-
[ViewMode.Grid]: {
100-
[PredicateVisibility.SearchHits]: [],
101-
[PredicateVisibility.Details]: [{ predicates: ['*'] }],
102-
[PredicateVisibility.Hide]: [],
103-
},
90+
naddSettings.predicateVisibility.byViewMode = {
91+
[ViewMode.List]: {
92+
[PredicateVisibility.SearchHits]: [
93+
{
94+
predicates: [
95+
'https://schema.org/description',
96+
'https://schema.org/material',
97+
// '*',
98+
],
99+
},
100+
],
101+
[PredicateVisibility.Details]: [{ predicates: ['*'] }],
102+
[PredicateVisibility.Hide]: [{ predicates: [] }],
103+
},
104+
[ViewMode.Grid]: {
105+
[PredicateVisibility.SearchHits]: [],
106+
[PredicateVisibility.Details]: [{ predicates: ['*'] }],
107+
[PredicateVisibility.Hide]: [],
104108
},
105-
alwaysHide: naddSettings.predicateVisibility.alwaysHide,
106-
hideTypeBadges: [],
107109
};
108110

109-
// Add Schema and DC Terms endpoints (to automatically retrieve labels for predicates)
111+
// Add some endpoints (to automatically retrieve labels for predicates)
110112
naddSettings.endpoints.data = {
111113
...naddSettings.endpoints.data,
112114
schema: {
@@ -123,32 +125,38 @@ naddSettings.endpoints.data = {
123125
],
124126
hideInFilter: true,
125127
},
126-
};
127-
128-
// Show images for nodes
129-
naddSettings.predicates = {
130-
...defaultSettings.predicates,
131-
files: [
132-
'https://schema.org/associatedMedia',
133-
'https://schema.org/contentUrl',
134-
'http://xmlns.com/foaf/0.1/depiction',
135-
],
136-
hopFiles: [
137-
['https://schema.org/associatedMedia', 'https://schema.org/contentUrl'],
138-
],
128+
rdf: {
129+
label: 'RDF',
130+
endpointUrls: [
131+
{ sparql: 'https://triplydb.com/_api/datasets/w3c/rdf/sparql' },
132+
{ sparql: 'https://triplydb.com/_api/datasets/w3c/rdfs/sparql' },
133+
],
134+
hideInFilter: true,
135+
},
136+
foaf: {
137+
label: 'FOAF',
138+
endpointUrls: [
139+
{ sparql: 'https://triplydb.com/_api/datasets/none/foaf/sparql' },
140+
],
141+
hideInFilter: true,
142+
},
143+
owl: {
144+
label: 'OWL',
145+
endpointUrls: [
146+
{ sparql: 'https://triplydb.com/_api/datasets/w3c/owl/sparql' },
147+
],
148+
hideInFilter: true,
149+
},
139150
};
140151

141152
// Show organization for nodes
142153
naddSettings.viewModes[ViewMode.List][ViewModeSetting.ShowOrganization] = true;
143-
naddSettings.viewModes[ViewMode.Grid][ViewModeSetting.ShowOrganization] = true;
144154

145155
// Hide type for nodes
146156
naddSettings.viewModes[ViewMode.List][ViewModeSetting.ShowTypes] = false;
147-
naddSettings.viewModes[ViewMode.Grid][ViewModeSetting.ShowTypes] = false;
148157

149158
// Hide parents for nodes
150159
naddSettings.viewModes[ViewMode.List][ViewModeSetting.ShowParents] = false;
151-
naddSettings.viewModes[ViewMode.Grid][ViewModeSetting.ShowParents] = false;
152160

153161
// Show (placeholder) type filter, note that this does not work yet without Elasticsearch
154162
naddSettings.filtering = {
@@ -162,31 +170,6 @@ naddSettings.filtering = {
162170
},
163171
};
164172

165-
// Add RDF and FOAF endpoints
166-
naddSettings.endpoints.data['rdf'] = {
167-
label: 'RDF',
168-
endpointUrls: [
169-
{ sparql: 'https://triplydb.com/_api/datasets/w3c/rdf/sparql' },
170-
{ sparql: 'https://triplydb.com/_api/datasets/w3c/rdfs/sparql' },
171-
],
172-
hideInFilter: true,
173-
};
174-
naddSettings.endpoints.data['foaf'] = {
175-
label: 'FOAF',
176-
endpointUrls: [
177-
{ sparql: 'https://triplydb.com/_api/datasets/none/foaf/sparql' },
178-
],
179-
hideInFilter: true,
180-
};
181-
182-
naddSettings.endpoints.data['owl'] = {
183-
label: 'OWL',
184-
endpointUrls: [
185-
{ sparql: 'https://triplydb.com/_api/datasets/w3c/owl/sparql' },
186-
],
187-
hideInFilter: true,
188-
};
189-
190173
// Show download button for associated media file
191174
const associatedMediaFileRenderer = {
192175
component: FileRendererComponent,
@@ -204,6 +187,19 @@ naddSettings.renderComponents[RenderMode.ByPredicate].push(
204187
// Stop showing hops for associated media file
205188
associatedMediaFileRenderer.hopLinkSettings!.showHops = false;
206189

190+
// Show images for nodes
191+
naddSettings.predicates = {
192+
...defaultSettings.predicates,
193+
files: [
194+
'https://schema.org/associatedMedia',
195+
'https://schema.org/contentUrl',
196+
'http://xmlns.com/foaf/0.1/depiction',
197+
],
198+
hopFiles: [
199+
['https://schema.org/associatedMedia', 'https://schema.org/contentUrl'],
200+
],
201+
};
202+
207203
// Use human readable format for ISO 8601 dates
208204
naddSettings.renderComponents[RenderMode.ByPredicate].push({
209205
component: Iso8601DateComponent,

0 commit comments

Comments
 (0)