Skip to content

Commit

Permalink
Updated to add hidden property to IBlueprintAdLibPiece and IBlueprint…
Browse files Browse the repository at this point in the history
…ActionManifestDisplay interfaces, and filter for that
  • Loading branch information
Simon Rogers committed Nov 6, 2024
1 parent 1b5a5ce commit 89d7eca
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
30 changes: 20 additions & 10 deletions meteor/client/ui/Shelf/AdLibPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -371,15 +371,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 @@ -487,7 +497,7 @@ export function fetchAndFilter(props: IFetchAndFilterProps): AdLibFetchAndFilter
}
)
.fetch()
.filter((action) => !(action.publicData && ((action.publicData as any).template as boolean)))
.filter((action) => !action.display.hidden)
.map((action) => actionToAdLibPieceUi(action, sourceLayerLookup, outputLayerLookup)),
'globalAdLibActions',
currentRundownId
Expand Down
2 changes: 2 additions & 0 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
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 @@ -284,6 +284,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

0 comments on commit 89d7eca

Please sign in to comment.