diff --git a/meteor/client/ui/Shelf/AdLibPanel.tsx b/meteor/client/ui/Shelf/AdLibPanel.tsx index 4f8445c5fb..429417b2fa 100644 --- a/meteor/client/ui/Shelf/AdLibPanel.tsx +++ b/meteor/client/ui/Shelf/AdLibPanel.tsx @@ -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 @@ -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 diff --git a/packages/blueprints-integration/src/action.ts b/packages/blueprints-integration/src/action.ts index f3e4183bac..be134514be 100644 --- a/packages/blueprints-integration/src/action.ts +++ b/packages/blueprints-integration/src/action.ts @@ -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 { diff --git a/packages/blueprints-integration/src/documents/adlibPiece.ts b/packages/blueprints-integration/src/documents/adlibPiece.ts index 7e515480d9..a01d53f18a 100644 --- a/packages/blueprints-integration/src/documents/adlibPiece.ts +++ b/packages/blueprints-integration/src/documents/adlibPiece.ts @@ -22,6 +22,8 @@ export interface IBlueprintAdLibPiece diff --git a/packages/job-worker/src/blueprints/context/lib.ts b/packages/job-worker/src/blueprints/context/lib.ts index 19811519d1..7b6203cfca 100644 --- a/packages/job-worker/src/blueprints/context/lib.ts +++ b/packages/job-worker/src/blueprints/context/lib.ts @@ -284,6 +284,7 @@ export function convertAdLibPieceToBlueprints(adLib: ReadonlyDeep): nextPieceTags: clone(adLib.nextPieceTags), uniquenessId: adLib.uniquenessId, invertOnAirState: adLib.invertOnAirState, + hidden: adLib.hidden, } return obj