Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/blueprints-integration/src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export interface IBlueprintActionManifestDisplay {
uniquenessId?: string
/** When not playing, display in the UI as playing, and vice versa. Useful for Adlibs that toggle something off when taken */
invertOnAirState?: boolean
/** Hide this adLib from the shelf - it is accessible only through the API */
hidden?: boolean
}

export interface IBlueprintActionManifestDisplayContent extends IBlueprintActionManifestDisplay {
Expand Down Expand Up @@ -99,8 +101,8 @@ export interface IBlueprintActionManifest<TPrivateData = unknown, TPublicData =
allVariants?: boolean

userDataManifest: {
/** List of editable fields in userData, to allow for customising */
editableFields?: JSONBlob<JSONSchema>
/** Schema for the executeAdLib adLibOptions property to allow for customising */
optionsSchema?: JSONBlob<JSONSchema>
// Potential future properties:
// /** Execute the action after userData is changed. If not present ActionExecuteAfterChanged.none is assumed. */
// executeOnUserDataChanged?: ActionExecuteAfterChanged
Expand Down
2 changes: 2 additions & 0 deletions packages/blueprints-integration/src/documents/adlibPiece.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export interface IBlueprintAdLibPiece<TPrivateData = unknown, TPublicData = unkn
uniquenessId?: string
/** When not playing, display in the UI as playing, and vice versa. Useful for Adlibs that toggle something off when taken */
invertOnAirState?: boolean
/** Hide this adLib from the shelf - it is accessible only through the API */
hidden?: boolean
}
/** The AdLib piece sent from Core */
export interface IBlueprintAdLibPieceDB<TPrivateData = unknown, TPublicData = unknown>
Expand Down
1 change: 1 addition & 0 deletions packages/job-worker/src/blueprints/context/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ export function convertAdLibPieceToBlueprints(adLib: ReadonlyDeep<AdLibPiece>):
nextPieceTags: clone<string[] | undefined>(adLib.nextPieceTags),
uniquenessId: adLib.uniquenessId,
invertOnAirState: adLib.invertOnAirState,
hidden: adLib.hidden,
}

return obj
Expand Down
4 changes: 4 additions & 0 deletions packages/live-status-gateway/api/schemas/adLibs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ $defs:
type: string
publicData:
description: Optional arbitrary data
optionsSchema:
description: JSON schema definition of the adLib properties that can be modified using the adLibOptions property in executeAdLib
type: string
required: [id, name, sourceLayer, actionType]
examples:
- id: 'C6K_yIMuGFUk8X_L9A9_jRT6aq4_'
Expand All @@ -103,3 +106,4 @@ $defs:
tags: ['music_video']
publicData:
fileName: MV000123.mxf
optionsSchema: '{"$schema":"https://json-schema.org/draft/2020-12/schema","title":"Play Video Clip","type":"object","properties":{"type":"adlib_action_video_clip","label":{"type":"string"},"clipId":{"type":"string"},"vo":{"type":"boolean"},"target":{"$schema":"https://json-schema.org/draft/2020-12/schema","title":"Object Id","description":"Id of an object sent to Sofie","type":"string"},"duration":{"type":"number","exclusiveMinimum":0},"takeType":{"$schema":"https://json-schema.org/draft/2020-12/schema","title":"AdLib Action Take Type","type":"string","enum":["take_immediate","queue"]},"transition":{"$schema":"https://json-schema.org/draft/2020-12/schema","title":"AdLib Action Transition Type","oneOf":[{"type":"object","properties":{"type":"cut"},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":"mix","duration":{"type":"number","exclusiveMinimum":0,"description":"Duration in ms"}},"required":["type","duration"],"additionalProperties":false},{"type":"object","properties":{"type":"wipe","duration":{"type":"number","exclusiveMinimum":0,"description":"Duration in ms"},"patternId":{"type":"string","description":"Type of wipe to use"}},"required":["type","duration","patternId"],"additionalProperties":false},{"type":"object","properties":{"type":"macro","macroId":{"type":"string","description":"Macro template to recall"}},"required":["type","macroId"],"additionalProperties":false}]}},"required":["type","clipId","vo","target"],"additionalProperties":false}"'
3 changes: 3 additions & 0 deletions packages/live-status-gateway/src/topics/adLibsTopic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ interface AdLibStatusBase {
actionType: AdLibActionType[]
tags?: string[]
publicData: unknown
optionsSchema?: any
}

export class AdLibsTopic
Expand Down Expand Up @@ -125,6 +126,7 @@ export class AdLibsTopic
actionType: triggerModes,
tags: action.display.tags,
publicData: action.publicData,
optionsSchema: action.userDataManifest.optionsSchema,
},
id: unprotectString(action._id),
label: name,
Expand Down Expand Up @@ -193,6 +195,7 @@ export class AdLibsTopic
actionType: triggerModes,
tags: action.display.tags,
publicData: action.publicData,
optionsSchema: action.userDataManifest.optionsSchema,
},
id: unprotectString(action._id),
label: name,
Expand Down
29 changes: 20 additions & 9 deletions packages/webui/src/client/ui/Shelf/AdLibPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -369,15 +369,25 @@ export function fetchAndFilter(props: IFetchAndFilterProps): AdLibFetchAndFilter
// @ts-expect-error deep-property
sort: { 'display._rank': 1 },
}
).map<{
partId: PartId
piece: AdLibPieceUi
}>((action) => {
return {
partId: action.partId,
piece: actionToAdLibPieceUi(action, sourceLayerLookup, outputLayerLookup),
}
}),
)
.map<{
partId: PartId
piece: AdLibPieceUi
hidden: boolean
}>((action) => {
return {
partId: action.partId,
piece: actionToAdLibPieceUi(action, sourceLayerLookup, outputLayerLookup),
hidden: !!action.display.hidden,
}
})
.filter((adLibPiece) => {
if (!adLibPiece.hidden)
return {
partId: adLibPiece.partId,
piece: adLibPiece.piece,
}
}),
'adLibActions',
unorderedRundownIds,
partIds
Expand Down Expand Up @@ -485,6 +495,7 @@ export function fetchAndFilter(props: IFetchAndFilterProps): AdLibFetchAndFilter
}
)
.fetch()
.filter((action) => !action.display.hidden)
.map((action) => actionToAdLibPieceUi(action, sourceLayerLookup, outputLayerLookup)),
'globalAdLibActions',
currentRundownId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ export default translateWithTracker<IProps, {}, ITrackedProps>((props: IProps) =
/>
<div className="shelf-inspector__action-editor">
<div className="shelf-inspector__action-editor__panel">
{action.userDataManifest && action.userDataManifest.editableFields && !targetAction ? (
{action.userDataManifest && action.userDataManifest.optionsSchema && !targetAction ? (
<Spinner />
) : action.userDataManifest && action.userDataManifest.editableFields && targetAction ? (
) : action.userDataManifest && action.userDataManifest.optionsSchema && targetAction ? (
<span>Editable Fields are not currently supported.</span>
) : null}
</div>
Expand Down