Skip to content

Commit cbbabf4

Browse files
committed
STAC-24925: add component presentation link
1 parent d45f713 commit cbbabf4

2 files changed

Lines changed: 111 additions & 1 deletion

File tree

spec/components.api.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,11 @@ components:
237237
items:
238238
$ref: "#/components/schemas/RelatedResource"
239239
description: 'Resolved related resource definitions in display order. Backend populates from both legacy and new presentation definitions.'
240+
links:
241+
type: array
242+
items:
243+
$ref: "#/components/schemas/ComponentPresentationLink"
244+
description: 'Resolved presentation links in display order. Backend populates from matching presentation definitions.'
240245
events:
241246
$ref: "#/components/schemas/ComponentEvents"
242247
data:
@@ -260,6 +265,7 @@ components:
260265
- fields
261266
- synced
262267
- relatedResources
268+
- links
263269
- data
264270
- actions
265271
- summary
@@ -579,6 +585,63 @@ components:
579585
in the stql field, and derives the name from the referenced presentation's PresentationName.
580586
Array order in the response determines display order.
581587
588+
ComponentPresentationLink:
589+
discriminator:
590+
propertyName: _type
591+
oneOf:
592+
- $ref: '#/components/schemas/ResolvedComponentPresentationLink'
593+
- $ref: '#/components/schemas/ErrorComponentPresentationLink'
594+
description: 'A resolved link definition returned in the FullComponent response.'
595+
596+
ResolvedComponentPresentationLink:
597+
type: object
598+
properties:
599+
_type:
600+
type: string
601+
enum: [ResolvedPresentationComponentLink]
602+
linkId:
603+
type: string
604+
description: 'Identity key for this link.'
605+
title:
606+
type: string
607+
description: 'Displayed link title.'
608+
target:
609+
type: string
610+
description: 'Relative or fully-qualified link target.'
611+
openInNewTab:
612+
type: boolean
613+
description: 'Whether the link opens in a new tab.'
614+
tooltip:
615+
type: string
616+
description: 'Optional tooltip text.'
617+
required:
618+
- _type
619+
- linkId
620+
- title
621+
- target
622+
- openInNewTab
623+
624+
ErrorComponentPresentationLink:
625+
type: object
626+
properties:
627+
_type:
628+
type: string
629+
enum: [ErrorPresentationComponentLink]
630+
linkId:
631+
type: string
632+
description: 'Identity key for this link.'
633+
title:
634+
type: string
635+
description: 'Displayed link title, or the link identity when the title could not be resolved.'
636+
message:
637+
type: string
638+
description: 'Reason why the link could not be resolved.'
639+
required:
640+
- _type
641+
- linkId
642+
- title
643+
- message
644+
582645
ComponentEvents:
583646
properties:
584647
showEvents:

spec_domain/settings.yaml

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ components:
161161
type: array
162162
items:
163163
$ref: '#/components/schemas/PresentationRelatedResource'
164+
links:
165+
type: array
166+
items:
167+
$ref: '#/components/schemas/PresentationLink'
164168
events:
165169
$ref: '#/components/schemas/PresentationHighlightEvents'
166170
metrics:
@@ -171,6 +175,7 @@ components:
171175
Highlight presentation definition. The `fields` define the fields to show in the highlight page.
172176
If multiple ComponentPresentations match, fields are merged by `fieldId` according to binding rank.
173177
Related resources follow the same merge semantics using `resourceId` as the identity key.
178+
Links follow the same merge semantics using `linkId` as the identity key.
174179
required:
175180
- title
176181
- fields
@@ -232,6 +237,48 @@ components:
232237
- Different resourceId entries are appended.
233238
- Display order is determined by the order field.
234239
240+
PresentationLink:
241+
type: object
242+
properties:
243+
linkId:
244+
type: string
245+
description: 'Stable identity key for merging across presentations, analogous to fieldId and resourceId.'
246+
title:
247+
type: string
248+
description: 'CEL expression that returns the displayed link title.'
249+
target:
250+
type: string
251+
description: 'CEL expression that returns a relative or fully-qualified link target.'
252+
openInNewTab:
253+
type: boolean
254+
default: false
255+
description: 'Whether the link opens in a new tab. Defaults to false.'
256+
tooltip:
257+
type: string
258+
description: 'Optional CEL expression that returns tooltip text.'
259+
filter:
260+
type: string
261+
description: 'Optional CEL boolean expression deciding whether the link is shown. Missing filters default to true.'
262+
order:
263+
type: number
264+
format: double
265+
description: 'Display order. Higher value means it shows first in UI.'
266+
required:
267+
- linkId
268+
- title
269+
- target
270+
- order
271+
description: |
272+
Link definition for the highlight page. Each entry defines a navigation link shown for a component.
273+
Merge semantics follow related resource rules:
274+
- All presentations whose binding matches the component contribute links.
275+
- Same linkId with higher specificity wins (override).
276+
- Different linkId entries are appended.
277+
- Display order is determined by the order field.
278+
CEL expressions are evaluated against the component presentation context. The filter is evaluated first;
279+
if it evaluates to false the link is omitted. If the filter includes the link but required data cannot be
280+
evaluated, the resolved highlight response reports an error link.
281+
235282
ComponentHighlightProjection:
236283
discriminator:
237284
propertyName: _type
@@ -1462,4 +1509,4 @@ components:
14621509
connectedComponents:
14631510
type: boolean
14641511
neighboringComponents:
1465-
type: boolean
1512+
type: boolean

0 commit comments

Comments
 (0)