Skip to content

Commit 45659c2

Browse files
committed
Merge remote-tracking branch 'origin/release51' into release52
2 parents ea30e05 + c4e1c88 commit 45659c2

File tree

11 files changed

+204
-47
lines changed

11 files changed

+204
-47
lines changed

.github/workflows/node.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,21 @@ jobs:
700700
yarn build
701701
env:
702702
CI: true
703+
- name: Generate OpenAPI client library
704+
if: ${{ steps.do-publish.outputs.tag }}
705+
uses: hatamiarash7/[email protected]
706+
with:
707+
generator: typescript-fetch
708+
openapi-file: ./packages/openapi/api/actions.yaml
709+
output-dir: ./packages/openapi/client/ts
710+
command-args: -p supportsES6=true
711+
- name: Build OpenAPI client library
712+
if: ${{ steps.do-publish.outputs.tag }}
713+
run: |
714+
cd packages/openapi
715+
yarn build:main
716+
env:
717+
CI: true
703718
- name: Modify dependencies to use npm packages
704719
run: node scripts/prepublish.js
705720
- name: Publish to NPM

.github/workflows/prerelease-libs.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,21 @@ jobs:
131131
yarn build
132132
env:
133133
CI: true
134+
- name: Generate OpenAPI client library
135+
if: ${{ steps.do-publish.outputs.tag }}
136+
uses: hatamiarash7/[email protected]
137+
with:
138+
generator: typescript-fetch
139+
openapi-file: ./packages/openapi/api/actions.yaml
140+
output-dir: ./packages/openapi/client/ts
141+
command-args: -p supportsES6=true
142+
- name: Build OpenAPI client library
143+
if: ${{ steps.do-publish.outputs.tag }}
144+
run: |
145+
cd packages/openapi
146+
yarn build:main
147+
env:
148+
CI: true
134149
- name: Modify dependencies to use npm packages
135150
run: node scripts/prepublish.js
136151
- name: Publish to NPM

packages/.yarn/patches/@asyncapi-generator-react-sdk-npm-1.0.20-af18b2f42b.patch

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
import { protectString } from '@sofie-automation/corelib/dist/protectedString'
2+
import { DBPartInstance } from '@sofie-automation/corelib/dist/dataModel/PartInstance'
3+
import { getRandomId, literal } from '@sofie-automation/corelib/dist/lib'
4+
import { PlayoutPartInstanceModelImpl } from '../PlayoutPartInstanceModelImpl'
5+
import { PieceInstance, PieceInstancePiece } from '@sofie-automation/corelib/dist/dataModel/PieceInstance'
6+
import { IBlueprintPieceType, PieceLifespan } from '@sofie-automation/blueprints-integration'
7+
8+
describe('PlayoutPartInstanceModelImpl', () => {
9+
function createBasicDBPartInstance(): DBPartInstance {
10+
return {
11+
_id: getRandomId(),
12+
rundownId: protectString(''),
13+
segmentId: protectString(''),
14+
playlistActivationId: protectString(''),
15+
segmentPlayoutId: protectString(''),
16+
rehearsal: false,
17+
18+
takeCount: 0,
19+
20+
part: {
21+
_id: getRandomId(),
22+
_rank: 0,
23+
rundownId: protectString(''),
24+
segmentId: protectString(''),
25+
externalId: '',
26+
title: '',
27+
28+
expectedDurationWithTransition: undefined,
29+
},
30+
}
31+
}
32+
33+
function createPieceInstanceAsInfinite(id: string, fromPreviousPlayhead: boolean): PieceInstance {
34+
return literal<PieceInstance>({
35+
_id: protectString(id),
36+
rundownId: protectString(''),
37+
partInstanceId: protectString(''),
38+
playlistActivationId: protectString('active'),
39+
piece: literal<PieceInstancePiece>({
40+
_id: protectString(`${id}_p`),
41+
externalId: '',
42+
startPartId: protectString(''),
43+
enable: { start: 0 },
44+
name: '',
45+
lifespan: PieceLifespan.OutOnRundownChange,
46+
sourceLayerId: '',
47+
outputLayerId: '',
48+
invalid: false,
49+
content: {},
50+
timelineObjectsString: protectString(''),
51+
pieceType: IBlueprintPieceType.Normal,
52+
}),
53+
infinite: {
54+
infiniteInstanceId: protectString(`${id}_inf`),
55+
infiniteInstanceIndex: 0,
56+
infinitePieceId: protectString(`${id}_p`),
57+
fromPreviousPart: false,
58+
fromPreviousPlayhead,
59+
},
60+
})
61+
}
62+
63+
describe('replaceInfinitesFromPreviousPlayhead', () => {
64+
it('works for an empty part', async () => {
65+
const partInstance = createBasicDBPartInstance()
66+
const model = new PlayoutPartInstanceModelImpl(partInstance, [], false)
67+
68+
expect(() => model.replaceInfinitesFromPreviousPlayhead([])).not.toThrow()
69+
expect(model.pieceInstances).toEqual([])
70+
})
71+
72+
it('keeps pieceInstance with fromPreviousPlayhead=false', async () => {
73+
const partInstance = createBasicDBPartInstance()
74+
const model = new PlayoutPartInstanceModelImpl(
75+
partInstance,
76+
[createPieceInstanceAsInfinite('p1', false)],
77+
false
78+
)
79+
80+
expect(() => model.replaceInfinitesFromPreviousPlayhead([])).not.toThrow()
81+
expect(model.pieceInstances.map((p) => p.pieceInstance._id)).toEqual(['p1'])
82+
})
83+
84+
it('deleted pieceInstance with fromPreviousPlayhead=true if no replacement provided', async () => {
85+
const partInstance = createBasicDBPartInstance()
86+
const model = new PlayoutPartInstanceModelImpl(
87+
partInstance,
88+
[createPieceInstanceAsInfinite('p1', true)],
89+
false
90+
)
91+
92+
expect(() => model.replaceInfinitesFromPreviousPlayhead([])).not.toThrow()
93+
expect(model.pieceInstances.map((p) => p.pieceInstance._id)).toEqual([])
94+
})
95+
96+
it('replaces pieceInstance with fromPreviousPlayhead=true if replacement provided', async () => {
97+
const partInstance = createBasicDBPartInstance()
98+
const model = new PlayoutPartInstanceModelImpl(
99+
partInstance,
100+
[createPieceInstanceAsInfinite('p1', true)],
101+
false
102+
)
103+
104+
expect(() =>
105+
model.replaceInfinitesFromPreviousPlayhead([createPieceInstanceAsInfinite('p1', true)])
106+
).not.toThrow()
107+
expect(model.pieceInstances.map((p) => p.pieceInstance._id)).toEqual(['p1'])
108+
})
109+
})
110+
})

packages/openapi/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License (MIT)
2+
3+
Copyright (c) 2018 Norsk rikskringkasting AS (NRK)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/webui/src/client/ui/FloatingInspectors/L3rdFloatingInspector.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ export const L3rdFloatingInspector: React.FunctionComponent<IProps> = ({
8484

8585
const { style: floatingInspectorStyle } = useInspectorPosition(position, ref, showMiniInspector)
8686

87-
return noraContent && noraContent.previewPayload && noraContent.previewRenderer ? (
87+
const hasValidPreviewPayload =
88+
noraContent?.previewPayload && noraContent?.previewPayload && noraContent.previewPayload.toString() !== '{}'
89+
90+
return hasValidPreviewPayload && noraContent.previewRenderer ? (
8891
showMiniInspector ? (
8992
<NoraFloatingInspector ref={ref} noraContent={noraContent} style={floatingInspectorStyle} />
9093
) : null

packages/webui/src/client/ui/FloatingInspectors/NoraFloatingInspector.tsx

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { JSONBlobParse, NoraContent } from '@sofie-automation/blueprints-integration'
1+
import { JSONBlobParse, NoraContent, NoraPayload } from '@sofie-automation/blueprints-integration'
22
import React, { useEffect, useImperativeHandle } from 'react'
33
import _ from 'underscore'
44
import { getNoraContentSteps } from '../SegmentContainer/PieceMultistepChevron'
@@ -86,35 +86,39 @@ export class NoraPreviewRenderer extends React.Component<{}, IStateHeader> {
8686
}
8787

8888
private postNoraEvent(contentWindow: Window, noraContent: NoraContent) {
89-
const payload = JSONBlobParse(noraContent.previewPayload)
90-
91-
contentWindow.postMessage(
92-
{
93-
event: 'nora',
94-
contentToShow: {
95-
manifest: payload.manifest,
96-
template: {
97-
event: 'preview',
98-
name: payload.template.name,
99-
channel: 'gfx1',
100-
layer: payload.template.layer,
101-
system: 'html',
89+
try {
90+
const payload = JSONBlobParse<NoraPayload>(noraContent.previewPayload)
91+
92+
contentWindow.postMessage(
93+
{
94+
event: 'nora',
95+
contentToShow: {
96+
manifest: payload.manifest,
97+
template: {
98+
event: 'preview',
99+
name: payload.template.name,
100+
channel: 'gfx1',
101+
layer: payload.template.layer,
102+
system: 'html',
103+
},
104+
content: {
105+
...payload.content,
106+
_valid: false,
107+
},
108+
timing: {
109+
duration: '00:05',
110+
in: 'auto',
111+
out: 'auto',
112+
timeIn: '00:00',
113+
},
114+
step: payload.step,
102115
},
103-
content: {
104-
...payload.content,
105-
_valid: false,
106-
},
107-
timing: {
108-
duration: '00:05',
109-
in: 'auto',
110-
out: 'auto',
111-
timeIn: '00:00',
112-
},
113-
step: payload.step,
114116
},
115-
},
116-
'*'
117-
)
117+
'*'
118+
)
119+
} catch (e) {
120+
console.error(`Error in NoraPreviewRenderer.postNoraEvent: ${e}`, e)
121+
}
118122
}
119123

120124
private _show() {

packages/webui/src/client/ui/SegmentList/LinePartSecondaryPiece/LinePartSecondaryPiece.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const LinePartSecondaryPiece: React.FC<IProps> = React.memo(function Line
3838
const typeClass = piece?.sourceLayer?.type ? RundownUtils.getSourceLayerClassName(piece?.sourceLayer?.type) : ''
3939

4040
const pieceStyle = useMemo<CSSProperties>(() => {
41-
const width = timeInBase(piece.renderedDuration ?? partDuration, timelineBase, timelineBase)
41+
const width = timeInBase(piece.renderedDuration ?? Math.max(timelineBase, partDuration), timelineBase, timelineBase)
4242
const left = timeInBase(piece.renderedInPoint ?? 0, timelineBase, timelineBase)
4343
const overflow = Math.max(0, left + width - 100)
4444
return {

packages/webui/src/client/ui/SegmentList/LinePartTimeline.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ import { PieceUi } from '../SegmentContainer/withResolvedSegment'
1414
import StudioContext from '../RundownView/StudioContext'
1515
import { InvalidPartCover } from '../SegmentTimeline/Parts/InvalidPartCover'
1616
import { getPartInstanceTimingId } from '../../lib/rundownTiming'
17+
import { getShowHiddenSourceLayers } from '../../lib/localStorage'
1718

1819
const TIMELINE_DEFAULT_BASE = 30 * 1000
1920

21+
const showHiddenSourceLayers = getShowHiddenSourceLayers()
22+
2023
interface IProps {
2124
part: PartExtended
2225
isLive: boolean
@@ -56,7 +59,7 @@ function findTimelineGraphics(pieces: PieceExtended[]) {
5659
.filter((piece) => {
5760
if (
5861
piece.sourceLayer?.type === SourceLayerType.LOWER_THIRD &&
59-
!piece.sourceLayer?.isHidden &&
62+
(showHiddenSourceLayers || !piece.sourceLayer?.isHidden) &&
6063
((piece.instance.piece.lifespan === PieceLifespan.WithinPart && piece.instance.piece.enable.duration) ||
6164
!piece.sourceLayer?.onListViewColumn)
6265
) {

packages/webui/src/client/ui/SegmentStoryboard/StoryboardPartThumbnail/StoryboardPartThumbnail.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const supportedSourceLayerTypes = new Set(
2121

2222
function findMainPiece(pieces: PieceExtended[]) {
2323
return findPieceExtendedToShowFromOrderedResolvedInstances(
24-
pieces.filter((piece) => piece.outputLayer?.isPGM),
24+
pieces.filter((piece) => piece.outputLayer?.isPGM && piece.sourceLayer?.onPresenterScreen),
2525
supportedSourceLayerTypes
2626
)
2727
}

0 commit comments

Comments
 (0)