Skip to content

Page Elements ​

A detail page is a set of columns, and each column holds elements: a metadata window, a list of related entities, a media viewer, a map. This page lists every element type the PWA renders, and documents the smaller ones in full. The larger ones have their own page.

How columns are declared, sized and aliased is in GraphQL-Driven UI. In short:

graphql
entityView {
  column {
    size(size: sixty)
    elements {
      windowElement { ... }
      Cars: entityListElement { ... }
      WorkOrders: entityListElement { ... }
    }
  }
  column2: column {
    size(size: forty)
    elements {
      mapElement { ... }
    }
  }
}

Two elements of the same type in one column are aliased (Cars:, WorkOrders:). Elements render in the order they are selected.

All element types ​

Field in elementsRendersDocs
windowElementMetadata panels, where the entity is editedWindow Element
entityListElementA list of related entities: list, grid, media, map or pipeline viewEntity Lists
singleMediaFileElementThe page's own mediafile in a viewerMedia Elements
mediaFileElementA mediafile library, or a legacy mapMedia Elements
mapElementWKT geometries or a heat mapMaps
wysiwygElementA rich text fieldbelow
commentsElementComment threadsbelow
hierarchyListElementThe chain of ancestors of the entitybelow
graphElementA chart of statisticsbelow
markdownViewerElementA metadata value rendered as Markdownbelow
manifestViewerElementA IIIF Presentation manifest in Mirador or TIFYbelow
entityViewerElement, actionElementNothingbelow

Every label is an i18n key, see Translations. isCollapsed sets the starting state; the element header toggles it, except where noted below.

wysiwygElement ​

A rich text editor (TipTap) on one metadata key. It works as a column element, with its own header, or inside a window panel, inline with the other fields. A work order's description:

graphql
wysiwygElement {
  label(input: "metadata.labels.description")
  metadataKey(input: "description")
  extensions(input: [starterKit, bold, italic])
}

The key must also be selected in intialValues. The editor reads from and writes to intialValues[metadataKey] as HTML, and saves with the entity.

FieldEffect
labelLabel, an i18n key
metadataKeyThe metadata key read and saved
extensionsRequired. The TipTap extensions to load, see below
isMultilingualOne value per language. Only inside a panel, and only with the supportsMultilingualMetadataEditing feature on
taggingConfiguration { customQuery taggableEntityConfiguration(configuration: [...]) }What can be tagged with elodyTaggingExtension; customQuery feeds the suggestion dropdown
wysiwygElementConfigurationcustomEditorStyles (extra classes), showLineNumbers, virtualKeyboardLayouts, transliterationConfig
infoPanel(title, content)An info button that opens content (HTML)
lockedTooltipTooltip on the lock icon while the field is locked
ExtensionAdds
starterKitParagraphs, headings, lists, code block, blockquote, horizontal rule, with toolbar buttons
bold, italicTheir toolbar buttons
hardBreakEnter inserts <br> instead of a new paragraph
color, textStyleLoaded, but no toolbar button
doc, paragraph, textThe minimum document; required when starterKit is left out
elodyTaggingExtensionTagging entities in the text, see Comments & Threads

An unknown extension breaks the editor

A misspelled extension throws while the editor is created, and the editor never appears.

The virtual keyboard, transliteration toggle, language selector and infoPanel only show when the field is inside a panel. As a column element it renders only its header and the editor.

commentsElement ​

Threaded comments on the entity. What threads, tagging and notifications do is in Comments & Threads; the element is configured like this:

graphql
commentsElement {
  label(input: "element-labels.comments")
  parentEntityFilterKey(input: "pim:1|properties.ref_parent_entity.value")
  readOnly
  createFields {
    category: metaData {
      label(input: "metadata.labels.category")
      inputField(type: commentCategoryField) { ...inputfield }
    }
  }
  composer {
    label(input: "metadata.labels.comment")
    metadataKey(input: "body")
    extensions(input: [doc, paragraph, text, bold, italic, hardBreak, elodyTaggingExtension])
    taggingConfiguration {
      taggableEntityConfiguration(
        configuration: [
          {
            tag: "user"
            taggableEntityType: user
            relationType: "ref_tagged_users"
            metadataFilterForTagContent: "pim:1|properties.name.value"
            inlineTrigger: { character: "@", minCharacters: 1 }
          }
        ]
      ) {
        ...taggableEntityConfiguration
      }
    }
  }
}

commentCategoryField stands for a dropdown field type the client defines.

FieldEffect
labelHeader label
parentEntityFilterKeyRequired. The filter key that finds the comments of this entity
readOnlyTakes no input: the server sets it from the user's permission to comment. Select it anyway, or the composer always shows
composerA wysiwygElement; its metadataKey is where the comment text is stored
createFieldsExtra fields filled in when a comment is created, stored as metadata and shown on every comment

There is no isCollapsed; the element always starts open.

hierarchyListElement ​

The entity's ancestors, top-most first, as a list. It follows one relation per step: from a work order to its car, from the car to its customer.

graphql
hierarchyListElement {
  label(input: "element-labels.hierarchy")
  isCollapsed(input: false)
  hierarchyRelationList(input: [
    { key: "for_car", entityType: car }
    { key: "owned_by", entityType: customer }
  ]) {
    key
    entityType
  }
  customQuery(input: "GetEntityForHierarchy")
}
FieldEffect
hierarchyRelationListThe relations to follow, in order. Select { key entityType }
customQueryThe query document fetching each ancestor, called with id and type. It must return relationValues, so the walk can go on, and the list fragment (teaserMetadata, allowedViewModes)
canHides the element without that permission. Only the first entry is checked
entityTypeAsCenterPoint, centerCoordinatesKeyPassed to the map view mode of the list

Each step reads the first relation of that type from the previous entity.

A missing link empties the whole list

When an entity in the chain lacks the next relation, the element shows "no results", even for the ancestors it already found. A failed fetch, by contrast, keeps the partial list. An empty hierarchyRelationList keeps the element loading forever.

graphElement ​

A Chart.js chart of statistics from the collection API.

graphql
mileageGraph: graphElement {
  label(input: "element-labels.mileage")
  isCollapsed(input: true)
  type(input: line)
  datasource(input: "mileage")
  dataset(input: { labels: ["mileage (km)"] }) {
    labels
    filter { key values }
  }
  timeUnit(input: dayOfYear)
  datapoints(input: 30)
}
FieldEffect
typeChart type: bar, bubble, doughnut, line, pie, polarArea, radar, scatter
datasourceFetches GET /stats/{datasource}/{entityId} from the collection API
dataset(input: { labels, filter: { key values } })Series names, and an optional filter sent as filter_key / filter_values
timeUnitmonth, hour, dayOfYear, dayOfWeek
datapointsHow many points to request
convert_toPassed to the endpoint as convert_to

Things to know before using it

  • The base collection API has no stats endpoint. A client must implement stats/{datasource} in its collection module.
  • Graphs always start collapsed and move to the end of their column, whatever isCollapsed says. They are hidden in edit mode.
  • Select filter { key values } on dataset: the request is built from the returned dataset, so an unselected filter is never sent.
  • Only dayOfYear gets x-axis labels; the other time units leave them blank.

markdownViewerElement ​

A metadata value, in the user's preferred language, rendered as Markdown. Read-only. A car model's service notes:

graphql
markdownViewerElement {
  label(input: "element-labels.service-notes")
  isCollapsed(input: false)
  markdownContent(metadataKey: "service_notes")
}

Nothing renders while the value is empty. The collapse chevron shows but does nothing: isCollapsed is fixed by the query.

manifestViewerElement ​

A IIIF Presentation manifest whose URL is stored on the entity:

graphql
manifestViewerElement {
  label(input: "element-labels.manual")
  isCollapsed(input: false)
  manifestUrl(metadataKey: "manifest_url")
  manifestVersion(metadataKey: "manifest_version")
}
FieldEffect
manifestUrl(metadataKey)The metadata key holding the manifest URL. Empty: a "no manifest" message
manifestVersion(metadataKey)The metadata key holding the IIIF version, a number. Default 3

Version 3 opens in Mirador. Any other version opens in tabs with TIFY and Mirador. The header can add the manifest to a collection, and opens a page where Mirador shows every collected manifest. Like the Markdown viewer, its collapse chevron does nothing.

Elements that render nothing ​

entityViewerElement and actionElement are in the schema and resolve on the server, but the PWA has no component for them. Selecting them renders nothing and logs nothing. Don't use them.

The pieces ​

FileRepoRole
src/components/EntityColumn.vueelody-pwacolumns and their sizes
src/components/entityElements/EntityElement.vueelody-pwapicks the component per element, by __typename
src/components/entityElements/WYSIWYG/EntityElementWYSIWYG.vueelody-pwawysiwygElement
src/composables/useWYSIWYGEditor.tselody-pwaextension names → TipTap extensions
src/components/entityElements/comments/EntityElementComments.vueelody-pwacommentsElement
src/components/entityElements/EntityElementHierarchyListViewer.vueelody-pwahierarchyListElement
src/components/entityElements/EntityElementGraph.vueelody-pwagraphElement
src/components/entityElements/EntityElementMarkdownViewer.vueelody-pwamarkdownViewerElement
src/components/entityElements/EntityElementManifestViewer.vueelody-pwamanifestViewerElement
baseModule/baseSchema.schema.tselody-base-graphqlEntityViewElements and every element type

Powered by Elody - Open Source Semantic Data Platform