Newer
Older
import { activityStreamFields, siteSettings } from './fragments'
/**
* Enum of Classes that should generate pages
* @readonly
* @enum {array}
*/
export const publicDocumentTypes = [
'HumanMadeObject',
'Actor',
'Group',
'Concept',
'ObjectType',
'Place',
{
"items": *[_type in ["Actor", "Group"]] | order(label, desc){
_id,
_type,
label,
hasType[]-> {
_id,
label
},
image,
"count": count(*[references(^._id)]),
},
${siteSettings}
}
`
*[_type == "Alert"][0] | order(_createdAt desc) {
...
}
`
"items": *[_type in ["Concept", "ObjectType"]] | order(label.no desc){
_id,
_type,
label,
"count": count(*[references(^._id)]),
},
${siteSettings}
}
`
"items": *[_type in ["Concept", "ObjectType", "Actor", "Group"]] | order(label.no){
_id,
_type,
label,
"count": count(*[references(^._id)]),
},
${siteSettings}
}
`
{
"frontpage": *[ _id == "frontpage" ][0] {
_id,
...,
navMenu-> {
...,
items[] {
...,
"route": landingPageRoute->.slug.current
}
},
content[] {
disabled != true => {
...
},
_type == 'MiradorGallery' && disabled != true => @{
...,
items[] {
"manifest": coalesce(manifestRef->.subjectOfManifest, manifestUrl),
canvasUrl,
},
},
_type == 'SingleObject' && disabled != true => @{
...,
item-> {
"manifest": coalesce(subjectOfManifest, manifestUrl),
canvasUrl,
}
},
_type == 'Grid' => @{
...,
items[] {
...,
"route": landingPageRoute->.slug.current
}
}
}
},
"latest": *[ _type == "HumanMadeObject"][0..10] {
_id,
label,
hasType[]-> {
...
},
image,
*[_type in $publicDocumentTypes] {
*[ _type == "Route" ] {
_id,
_type,
slug
}
`
{
"route": *[ _type == "Route" && slug.current == $joinID ][0] {
...,
page->{
...,
navMenu->{
...,
items[]{
...,
"route": landingPageRoute->.slug.current
}
},
_type == 'reference' => @->{
_id,
_type,
label,
shortDescription,
image,
memberOf[]->{
_id,
label,
image
}
},
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
_type == 'PageHeader' => @{
...,
"palette": illustration.image.asset->.metadata.palette{
darkMuted,
darkVibrant,
dominant,
lightMuted,
vibrantMuted,
muted,
vibrant
}
},
_type == 'MiradorGallery' => @{
...,
items[] {
_id,
label,
view,
"owner": manifestRef->.hasCurrentOwner[]->{
_id,
label
},
"manifest": coalesce(
manifestRef->.subjectOfManifest,
manifestUrl,
"/api/manifest/" + manifestRef->._id
),
canvasUrl,
},
},
_type == 'ActorCollection' => {
...,
items[] {
"label": coalesce(title, item->label.no),
"description": coalesce(description, item->referredToBy[0].body),
"image": coalesce(image, item->image),
file,
item-> {
_id,
label,
shortDescription,
referredToBy[] {
...
},
image
}
}
},
_type == 'SingleObject' => @{
...,
view,
item-> {
_id,
label,
"owner": hasCurrentOwner[]-> {
_id,
label
},
"manifest": coalesce(
subjectOfManifest,
manifestUrl,
"/api/manifest/" + _id
),
canvasUrl,
}
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
...,
content[] {
...,
_type == 'SingleObject' => {
...,
item-> {
_id,
label,
"owner": hasCurrentOwner[]-> {
_id,
label
},
"manifest": coalesce(
subjectOfManifest,
manifestUrl,
"/api/manifest/" + _id
),
canvasUrl,
}
},
_type == 'PageHeader' => {
...,
"palette": illustration.image.asset->.metadata.palette{
darkMuted,
darkVibrant,
dominant,
lightMuted,
vibrantMuted,
muted,
vibrant
}
},
_type == 'MiradorGallery' => {
...,
items[] {
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
"owner": manifestRef->.hasCurrentOwner[]->{
_id,
label
},
"manifest": coalesce(
manifestRef->.subjectOfManifest,
manifestUrl,
"/api/manifest/" + manifestRef->._id
),
canvasUrl,
},
},
_type == 'SingleObject' => {
...,
view,
item-> {
_id,
label,
"owner": hasCurrentOwner[]-> {
_id,
label
},
"manifest": coalesce(
subjectOfManifest,
manifestUrl,
"/api/manifest/" + _id
),
canvasUrl,
}
},
}
_type == 'PageHeader' => @{
...,
"palette": illustration.image.asset->.metadata.palette{
darkMuted,
darkVibrant,
dominant,
lightMuted,
vibrantMuted,
muted,
vibrant
}
},
_type == 'MiradorGallery' => @{
...,
items[] {
view,
"owner": manifestRef->.hasCurrentOwner[]->{
"manifest": coalesce(
manifestRef->.subjectOfManifest,
manifestUrl,
"/api/manifest/" + manifestRef->._id
),
canvasUrl,
},
},
_type == 'SingleObject' => @{
...,
_id,
label,
"owner": hasCurrentOwner[]-> {
_id,
label
},
"manifest": coalesce(
subjectOfManifest,
manifestUrl,
"/api/manifest/" + _id
),
},
_type == 'ActorCollection' => @{
...,
items[] {
...,
_id,
title,
"label": coalesce(title, "test"),
description,
item-> {
_id,
label,
shortDescription,
referredToBy[] {
...
},
image
}
}
},
}
}
},
${siteSettings}
}
`
"items": *[_type == "HumanMadeObject"] | order(label){
_id,
_type,
label,
preferredIdentifier,
hasType[]-> {
_id,
label
},
image,
"description": referredToBy[]{
...
},
hasCurrentOwner[0]->{
_id,
},
"creation": activityStream[]{
_type in ["Production", "BeginningOfExistence"] => @{
"creators": contributionAssignedBy[]{
"name": assignedActor->.label,
"_id": assignedActor->._id
},
timespan
}
},
"aspectRatio": image.asset->.metadata.dimensions.aspectRatio,
},
${siteSettings}
}`
"items": [
...*[_type in ["Activity", "Event"]]{
label,
hasType[]->{
_id,
label
},
timespan[]{
...,
"orderDate": coalesce(date, beginOfTheBegin)
},
tookPlaceAt[]->{
_id,
label
},
...*[defined(activityStream)].activityStream[featured == true]{
${activityStreamFields}
}
],
${siteSettings}
}`
export const contactCopyQuery = groq`{
"tags": *[_type == "media.tag"]| order(name.current desc){
name,
"images": *[references(^._id)]{
...,
"isThumbnail": defined(*[_type == "HumanMadeObject" && references(^._id)]),
"countAssetUsage": count(*[_type != "HumanMadeObject" && references(^._id)])
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
}`
export const physicalExhibitionQuery = groq`{
"item": *[_type == 'Exhibition'][0]{
...,
language[]->{
_id,
label
},
referredToBy[]{
...,
language->{
_id,
label
},
body[] {
...,
_type == 'ExhibitionElement' => @{
...,
forseesUseOf-> {
...
},
item-> {
_id,
_type,
hasType[]->{
_id,
label
},
label,
image
}
}
}
}
},
${siteSettings}