Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: routeset controlled ab player assignment #7

Merged
Merged
Show file tree
Hide file tree
Changes from 153 commits
Commits
Show all changes
171 commits
Select commit Hold shift + click to select a range
e9a248f
wip: feat/set route active from ad.lib - sketch implementation
olzzon Mar 26, 2024
4599edc
wip: feat/set route active form ad.lib - add switchRouteSet to Action…
olzzon Apr 3, 2024
44d92fc
wip: feat/set route active from ad.lib - added switchRouseSet in bp-i…
olzzon Apr 4, 2024
f2701b8
wip: feat/set route active from ad.lib - expose switchRouseSet in Blu…
olzzon Apr 4, 2024
6eb745d
wip: feat/set route active from adlib - add access to studioPlayout s…
olzzon Apr 5, 2024
725b560
wip: support for defining routeSets in BluePrints
olzzon Apr 5, 2024
f223ecf
wip: feat/set route active from adlib - move updateRouteSetActive() t…
olzzon Apr 5, 2024
8115db3
wip: feat/set route active from adlib - move routsets modifier check …
olzzon Apr 8, 2024
5eeb777
wip: feat/set route active from adlib - add comment in saveAlltoDatab…
olzzon Apr 8, 2024
b8e01d6
wip: fix/set route active from adlib - updateRouteSetActive() was ren…
olzzon Apr 8, 2024
e5bad72
wip: feat/set route active from adlib - remove async, move routeSetAc…
olzzon Apr 9, 2024
f584bbc
wip: feat/set route active from adlib - fix exclusivitygroup is for d…
olzzon Apr 9, 2024
a708e79
wip: feat/set route active from adlib - cleanup/remove sketch of acti…
olzzon Apr 9, 2024
bd1bae1
wip: feat/routeset in BP - add StudioRouteSet types in upgrade. ToDo …
olzzon Apr 9, 2024
2cf09c0
wip: feat/routeset in BP - move StudioRouteSet types to shared-lib - …
olzzon Apr 9, 2024
983bde9
wip: feat/routeset in BP - import types from shared-lib
olzzon Apr 9, 2024
fab7c34
wip: feat/routeset in BP - rename Studio.ts to StudiorouteSet.ts
olzzon Apr 9, 2024
1fbb7c5
wip: feat/routeset in BP - force type on each dev[1] - better solution?
olzzon Apr 9, 2024
59d922f
wip: feat/routeset in BP - use ObjectWithOverrides on routeSets
olzzon Apr 9, 2024
0cb6250
wip: feat/set route active from adlib - add PlayoutAction in blueprin…
olzzon Apr 10, 2024
c70204d
wip: feat/set route active from adlib - add ISwitchRouseSet to SomeAc…
olzzon Apr 10, 2024
2fc81b0
wip: feat/set route active from adlib - add switchRouteSet to adlibAc…
olzzon Apr 10, 2024
e70b1ad
wip: feat/routeset in BP - make routeSet optional in BlueprintResultA…
olzzon Apr 10, 2024
62fb268
wip: feat/routeset i BP - add migrations to routeSet as ObjectWithOve…
olzzon Apr 11, 2024
427ef3f
wip: feat/routeset i BP - routeSet as ObjectWithOverrides
olzzon Apr 11, 2024
3507326
wip: feat/routeset i BP - Studios convert routeSets to handle overrides
olzzon Apr 12, 2024
bbb2233
wip: feat/routeset i BP - convert Routing.tsx to functional component
olzzon Apr 12, 2024
4170c7a
wip: feat/routeset i BP - Routing.tsx functional component, remove props
olzzon Apr 12, 2024
cc39c86
wip: feat/routeset i BP - Routing.tsx functional component, use props…
olzzon Apr 12, 2024
480f381
wip: feat/routeset i BP - Routing.tsx implement toggleExpandHelper
olzzon Apr 12, 2024
7630b0c
wip: feat/routeset i BP - Routing.tsx revert edit items to old version
olzzon Apr 12, 2024
b132123
wip: feat/routeset i BP - Routing.tsx fix save overrides
olzzon Apr 12, 2024
ab1569d
wip: feat/routeset i BP - Routing.tsx refactor renders into seperate …
olzzon Apr 12, 2024
9fbe0f0
wip: feat/routeset i BP - Routing.tsx implement sketch for 'deleted' …
olzzon Apr 13, 2024
f7fbdf0
wip: feat/routeset i BP - Routing.tsx implement add new rout in set
olzzon Apr 13, 2024
164d217
wip: feat/routeset i BP - fix: Routing.tsx RenderRouteSet was called …
olzzon Apr 13, 2024
d8bbdd7
wip: feat/routeset i BP - fix: Routing.tsx convert dropdown to Dropdo…
olzzon Apr 13, 2024
74c4157
wip: feat/routeset i BP - fix: Routing.tsx convert rouseSet exclusive…
olzzon Apr 13, 2024
78c02ab
wip: feat/routeset i BP - fix: Routing.tsx rouseSet undelete implemented
olzzon Apr 13, 2024
dec1ee7
wip: feat/routeset i BP - add migrations to routeSetExclusivityGroups…
olzzon Apr 13, 2024
5b6c090
wip: feat/routeset i BP - Routing.tsx exclusivitygroups save delete r…
olzzon Apr 13, 2024
6483ecd
wip: feat/routeset i BP - Routing.tsx exclusivitygroups fix dropdown …
olzzon Apr 14, 2024
348fea2
wip: feat/routeset i BP - switchboard implement routeSets as Object w…
olzzon Apr 14, 2024
1ffef1e
wip: feat/routeset i BP - switchboard implement routeSets as Object i…
olzzon Apr 14, 2024
40c9276
wip: feat/routeset i BP - move OverrideOpHelper to ./lib/collections …
olzzon Apr 14, 2024
fc025d8
Merge branch 'feat/route-as-adlib-actions' into feat/routeset-config-…
olzzon Apr 15, 2024
18e09aa
wip: feat/routeset i BP - Routings.tsx remove wip debug message in do…
olzzon Apr 15, 2024
88d5b98
wip: feat/routeset i BP - routeSets override implement in StudioBaseL…
olzzon Apr 15, 2024
78b42d9
wip: feat/routeset i BP - StudioBaseLineHelper workaround save dB dir…
olzzon Apr 15, 2024
af8dc82
wip: feat/routeset i BP - getActiveRoutes, implement overrides
olzzon Apr 15, 2024
d2a1dd0
wip: feat/routeset i BP - getActiveRoutes, implement routeSet switchb…
olzzon Apr 15, 2024
69c12e0
wip: feat/routeset i BP - move OverriddeOpHelper.tsx to client/ui and…
olzzon Apr 16, 2024
fb07e58
wip: feat/routeset i BP - move OverriddeOpHelper.tsx uses functions f…
olzzon Apr 16, 2024
e9b3136
wip: feat/routeset i BP - useGetAllCurrentItemsFromOverrides instead …
olzzon Apr 16, 2024
945ef4e
wip: feat/routeset i BP - Routings.tsx add NONE to exclusivity group …
olzzon Apr 16, 2024
6900b2a
wip: feat/routeset i BP - fix -Routings.tsx filter out deleted items
olzzon Apr 16, 2024
39d73fd
wip: feat/routeset i BP - OverrideOpHelper.tsx import and re-export c…
olzzon Apr 16, 2024
527c944
wip: feat/routeset i BP - StudioBaselineHelper implement saveAllToDat…
olzzon Apr 16, 2024
79ab818
wip: feat/routeset i BP - Switchboard sort rousetSets so they always …
olzzon Apr 16, 2024
44942bb
wip: feat/routeset i BP - routings.tsx add exclusivityGroup: undefine…
olzzon Apr 16, 2024
aade225
wip: feat/routeset i BP - fix routings.tsx update callBack when chang…
olzzon Apr 16, 2024
dc4a6d1
wip: feat/routeset i BP - routings.tsx implement updateExclusivityGro…
olzzon Apr 16, 2024
7a4e1c7
wip: feat/routeset i BP - rename overrideOpHelperBackend.ts to overri…
olzzon Apr 17, 2024
3a4a8ce
wip: feat/routeset i BP - convert ObjectsWithOverride to Record<srrin…
olzzon Apr 18, 2024
451a2de
wip: feat/routeset i BP - revert switchBoard and RunddownRightHandCon…
olzzon Apr 18, 2024
d6d2c18
wip: feat/routeset i BP - change getActiveRoutes() to use ObjectWithO…
olzzon Apr 18, 2024
0741816
wip: feat/routeset i BP - bad naming rename routeSetsFromOverrides an…
olzzon Apr 18, 2024
970cf05
wip: feat/routeset i BP - remove wrapping of addNewExclusivityGroup
olzzon Apr 18, 2024
4a2b381
wip: feat/routeset i BP - remove all _.map and filter in RouteSet.tsx
olzzon Apr 18, 2024
92e01df
wip: feat/routeset i BP - remove unnecessary <any> types in RouteSet.tsx
olzzon Apr 18, 2024
377a875
wip: feat/routeset i BP - sketch RenderRoutes as ObjectWithOverrides …
olzzon Apr 18, 2024
ff485f5
wip: feat/routeset i BP - revert RenderRoutes to original and add fun…
olzzon Apr 20, 2024
0488e0e
wip: feat/routeset i BP - OverrideOpHelperImpl, has been doubled, as …
olzzon Apr 22, 2024
d6d9105
wip: feat/routeset i BP - fix: StudioBaselineHelper - reset overrides…
olzzon Apr 22, 2024
6ddbb9b
wip: feat/routeset i BP - Routings.tsx fix optional if routes[] missing
olzzon Apr 22, 2024
d5b21cb
wip: feat/routeset i BP - migration- fix: check if defaults exsisted …
olzzon Apr 22, 2024
1711050
wip: feat/routeset i BP - Routings.tsx fix remove routeInSet
olzzon Apr 22, 2024
aa790e7
wip: feat/routeset i BP - Routings.tsx fix handle remapping sub objec…
olzzon Apr 22, 2024
10f3aef
wip: feat/routeset i BP - StudioBaselineHelper.ts remove unneccesary …
olzzon Apr 22, 2024
c23bedf
wip: feat/routeset i BP - Routings.tsx fix check if remapping is crea…
olzzon Apr 22, 2024
7e4ac36
wip: replace a use of EditAttribute
Julusian Apr 22, 2024
0a5aa4e
wip: remapping.options.mappingType
Julusian Apr 22, 2024
68d7ba8
wip: add reset routes table button
Julusian Apr 22, 2024
1e2712d
wip: fix DeviceMappingSettings
Julusian Apr 22, 2024
553df0c
wip: replace remaining EditAttribute
Julusian Apr 22, 2024
e90b8a3
wip: avoid nested useMemo
Julusian Apr 22, 2024
4a782b9
wip: feat/routeset i BP - rename routeSets (and exclusivity) to route…
olzzon Apr 23, 2024
d4ea29f
wip: feat/routeset i BP - Db migration from routeSets (and exclusivit…
olzzon Apr 23, 2024
0db2580
wip: feat/routeset i BP - remove routeSets in old Blueprint migration…
olzzon Apr 23, 2024
64b5b88
wip: feat/routeset i BP - Routings.tsx new routeSet has number in name
olzzon Apr 23, 2024
d49809a
wip: feat/routeset i BP - Routings.tsx fix - missed renaming to outeS…
olzzon Apr 23, 2024
1882a8d
wip: feat/routeset i BP - fix migration from routeSets to routeSetsWi…
olzzon Apr 23, 2024
6a090a8
wip: feat/routeset i BP - fix renaming routeSets to routeSetsWithover…
olzzon Apr 26, 2024
407e66a
wip: feat/routeset i BP - tests renaming routeSets to routeSetsWithov…
olzzon Apr 26, 2024
22ccdf5
wip: feat/routeset i BP - tests renaming routeSets to routeSetsWithov…
olzzon Apr 26, 2024
3b7fec0
wip: feat/routeset i BP - add switchrouteSet to ActionSelector
olzzon Apr 26, 2024
5b7d54b
WIP: dynamic AB playback - add filter for offline devices
olzzon Apr 30, 2024
9ac3da9
WIP: dynamic AB playback - move abFilter into existing loop
olzzon Apr 30, 2024
4747848
WIP: dynamic AB playback - switchboard inital pool handling
olzzon May 1, 2024
452c419
WIP: dynamic AB playback - add option inactive?: boolean in ABPlayerd…
olzzon May 1, 2024
4b4ad67
WIP: dynamic AB playback - rename inactive in ABPlayerdefiniton to di…
olzzon May 1, 2024
c1f148d
WIP: dynamic AB playback - skect structure with abResolver list in db…
olzzon May 2, 2024
78a68cc
WIP: dynamic AB playback - sketch structure abPoolsDisabling in DB & UI
olzzon May 3, 2024
99ec5a7
WIP: dynamic AB playback - abPoolsDisabling filtering in abPlayout
olzzon May 3, 2024
8116e36
WIP: dynamic AB playback - abPlayout logger filtering info
olzzon May 3, 2024
597c470
WIP: dynamic AB playback - StudioAbPoolDisabling and StudioAbPlayerDi…
olzzon May 3, 2024
f08ed53
WIP: dynamic AB playback - fix renaming and logger formatting
olzzon May 3, 2024
ab4f302
WIP: dynamic AB playback -StudioAbPoolDisabling - remove name:string …
olzzon May 3, 2024
bd44565
WIP: dynamic AB playback -StudioAbPoolDisabling - remove name:string …
olzzon May 3, 2024
5e7782e
WIP: dynamic AB playback - db migration to include "abPoolDisabling" …
olzzon May 3, 2024
6b9d3a6
WIP: dynamic AB playback - Blueprints-integration implementation
olzzon May 3, 2024
16146cd
WIP: dynamic AB playback - Recalc AB previous assignments if playout …
olzzon May 7, 2024
a9336f8
WIP: dynamic AB playback - Recalc AB if more than one clip is assigne…
olzzon May 7, 2024
faa0b40
fix: combine OverrideOpHelper implementations
Julusian May 7, 2024
f538d4f
chore: refactor `getAllCurrentAndDeletedItemsFromOverrides` to call `…
Julusian May 7, 2024
a6bba4d
Update meteor/server/publications/pieceContentStatusUI/__tests__/chec…
olzzon May 8, 2024
b8d5f54
Update meteor/client/ui/Settings/Studio/Routings.tsx
olzzon May 8, 2024
5c38022
Update meteor/client/ui/Settings/Studio/Routings.tsx
olzzon May 8, 2024
fff9169
Update meteor/client/ui/Settings/Studio/Routings.tsx
olzzon May 8, 2024
4f3a379
Update meteor/client/ui/Settings/Studio/Routings.tsx
olzzon May 8, 2024
ba36694
Update meteor/client/ui/Settings/Studio/Routings.tsx
olzzon May 8, 2024
36daca9
wip: feat/routeset i BP -
olzzon May 13, 2024
41523d5
wip: feat/routeset i BP - move apply overrides to higher scope
olzzon May 13, 2024
234a882
Merge branch 'feat/routeset-config-defined-in-blueprints' into feat/a…
olzzon May 13, 2024
1c132b4
wip: fix type errors
Julusian May 13, 2024
426122a
WIP: dynamic AB playback - move ABplayer disabling into RouteSets
olzzon May 14, 2024
6ea156e
WIP: dynamic AB playback -migration ABplayer disabling into RouteSets
olzzon May 14, 2024
7d3252c
WIP: dynamic AB playback - filter out AB Players that are part of an …
olzzon May 14, 2024
7fecaf3
WIP: dynamic AB playback - convert abPlayers to array to keep same st…
olzzon May 14, 2024
aa236b6
WIP: dynamic AB playback -migration move add ABplayer as a part of co…
olzzon May 14, 2024
26b4f44
WIP: dynamic AB playback - ABPlayers added in routings Settings
olzzon May 14, 2024
b7a77fc
WIP: dynamic AB playback - renamed label in ABplayers Settings to Poo…
olzzon May 15, 2024
f0579bb
wip: restore clear buttons in ui
Julusian May 15, 2024
4eb75cf
Merge branch 'feat/routeset-config-defined-in-blueprints' into feat/a…
olzzon May 16, 2024
d3c1392
WIP: dynamic AB playback - sort RouteSet by Id in settings
olzzon May 16, 2024
a9b3103
WIP: dynamic AB playback - sort RouteSet by Id use build in feature
olzzon May 17, 2024
477a6b3
WIP: dynamic AB playback - sort RouteSet by Id remove unsortedRouteSe…
olzzon May 17, 2024
f4c541b
Prepare merge of release51 into feat/routeset-config-defined-in-bluep…
olzzon Aug 19, 2024
7b73ab8
Merge remote-tracking branch 'upstream/release51' into feat/routeset-…
olzzon Aug 19, 2024
24ebc18
Merge branch 'release51' into feat/ab-dynamic-pool-assignment
Julusian Aug 21, 2024
76225b6
wip: fix types
Julusian Aug 21, 2024
e34093f
fix: blueprint rousets name was not converted with routeSetsWithOverr…
olzzon Aug 22, 2024
f2e3865
fix: check if there are any previousAbSessionAssignments before itera…
olzzon Sep 3, 2024
685966a
fix: AB session - ensure that previous assignment is kept unless a ne…
olzzon Sep 9, 2024
f4fae91
fix: AB session error on new system if previousAbSessionAssignments u…
olzzon Sep 11, 2024
5827435
fix: rework recalculation when adding/removing players
Julusian Sep 17, 2024
c5adee8
fix: routings ui override helper types
Julusian Sep 19, 2024
d3e2d95
fix: missing commit calls
Julusian Sep 19, 2024
d5a2a1c
fix: reverted upstream overrideophelper changes
Julusian Sep 19, 2024
38e0e91
chore: split ui into files
Julusian Sep 19, 2024
d4de3a4
Merge branch 'feat/routeset-config-defined-in-blueprints' into feat/a…
Julusian Sep 19, 2024
9c5df14
Merge upstream-release51 into feat/routeset-config-defined-in-blueprints
Julusian Sep 19, 2024
1110d99
Merge branch 'feat/routeset-config-defined-in-blueprints' into feat/a…
Julusian Sep 19, 2024
9bcbc67
wip: cleanup
Julusian Sep 19, 2024
3d2b0a8
outdated: remove Notification.ts as an RFC has been made instead and …
olzzon Sep 20, 2024
f6ac5f1
move checking for ab player obj in rousets to separate migration
olzzon Sep 20, 2024
45821a1
remove commented out AbPoolsDisabling from prior to moving ab into st…
olzzon Sep 20, 2024
248674f
revert parsing studio object into Switchboard popup
olzzon Sep 20, 2024
b2c242d
fix: no need for applyAbPlaybackForTimeline to be async
olzzon Sep 20, 2024
4157769
fix: UX settings rousetSet toggleExpanded should be on it's own line.
olzzon Sep 20, 2024
fc0999b
Update meteor/server/migration/X_X_X.ts
olzzon Sep 20, 2024
9ca7bcb
Update meteor/server/migration/X_X_X.ts
olzzon Sep 20, 2024
bb10ef0
only parse playlist instead of full PlayoutModel
olzzon Sep 23, 2024
3398699
fix: previousAssignmentMap can be undefined
olzzon Sep 23, 2024
09e38b2
chore: fix test
Julusian Sep 23, 2024
aa2cc06
fix: ui crash
Julusian Sep 23, 2024
289dd16
chore: refactor
Julusian Sep 27, 2024
3dc5100
fix: respect poolName
Julusian Sep 27, 2024
017fa8a
fix: handle multiple routesets defining player
Julusian Sep 27, 2024
098905c
chore: add docs
Julusian Sep 27, 2024
37c1dfb
chore: change log level
Julusian Sep 27, 2024
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
4 changes: 2 additions & 2 deletions meteor/__mocks__/defaultCollectionObjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ export function defaultStudio(_id: StudioId): DBStudio {
minimumTakeSpan: DEFAULT_MINIMUM_TAKE_SPAN,
},
_rundownVersionHash: '',
routeSets: {},
routeSetExclusivityGroups: {},
routeSetsWithOverrides: wrapDefaultObject({}),
routeSetExclusivityGroupsWithOverrides: wrapDefaultObject({}),
packageContainers: {},
previewContainerIds: [],
thumbnailContainerIds: [],
Expand Down
15 changes: 12 additions & 3 deletions meteor/client/lib/Components/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import ClassNames from 'classnames'
interface ICheckboxControlProps {
classNames?: string
disabled?: boolean
title?: string

value: boolean
handleUpdate: (value: boolean) => void
Expand All @@ -15,6 +16,7 @@ export function CheckboxControl({
value,
disabled,
handleUpdate,
title,
}: Readonly<ICheckboxControlProps>): JSX.Element {
const handleChange = useCallback(
(e: React.ChangeEvent<HTMLInputElement>) => {
Expand All @@ -25,11 +27,18 @@ export function CheckboxControl({

return (
<span className={ClassNames('checkbox', classNames)}>
<input type="checkbox" className="form-control" checked={value} onChange={handleChange} disabled={disabled} />
<span className="checkbox-checked">
<input
type="checkbox"
className="form-control"
checked={value}
onChange={handleChange}
disabled={disabled}
title={title}
/>
<span className="checkbox-checked" title={title}>
<FontAwesomeIcon icon={faCheckSquare} />
</span>
<span className="checkbox-unchecked">
<span className="checkbox-unchecked" title={title}>
<FontAwesomeIcon icon={faSquare} />
</span>
</span>
Expand Down
15 changes: 13 additions & 2 deletions meteor/client/lib/Components/LabelAndOverrides.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface LabelAndOverridesProps<T extends object, TValue> {
opPrefix: string
overrideHelper: OverrideOpHelperForItemContents

showClearButton?: boolean
formatDefaultValue?: (value: any) => JSX.Element | string | null

children: (value: TValue, setValue: (value: TValue) => void) => React.ReactNode
Expand All @@ -33,6 +34,7 @@ export function LabelAndOverrides<T extends object, TValue = any>({
itemKey,
opPrefix,
overrideHelper,
showClearButton,
formatDefaultValue,
}: Readonly<LabelAndOverridesProps<T, TValue>>): JSX.Element {
const { t } = useTranslation()
Expand All @@ -51,7 +53,7 @@ export function LabelAndOverrides<T extends object, TValue = any>({

let displayValue: JSX.Element | string | null = '""'
if (item.defaults) {
const defaultValue: any = item.defaults[itemKey]
const defaultValue: any = objectPathGet(item.defaults, String(itemKey))
// Special cases for formatting of the default
if (formatDefaultValue) {
displayValue = formatDefaultValue(defaultValue)
Expand All @@ -75,7 +77,16 @@ export function LabelAndOverrides<T extends object, TValue = any>({
<label className="field">
<LabelActual label={label} />

{children(value, setValue)}
<div className="field-content">
{showClearButton && (
<button className="btn btn-primary field-clear" onClick={() => setValue(undefined)} title={t('Clear value')}>
&nbsp;
<FontAwesomeIcon icon={faSync} />
</button>
)}

{children(value, setValue)}
</div>

{item.defaults && (
<>
Expand Down
18 changes: 16 additions & 2 deletions meteor/client/lib/forms/SchemaFormWithOverrides.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@ interface FormComponentProps {
overrideHelper: OverrideOpHelperForItemContents
itemKey: string
opPrefix: string

/** Whether a clear button should be showed for fields not marked as "required" */
showClearButton: boolean
}

/** Whether this field has been marked as "required" */
isRequired: boolean
}

function useChildPropsForFormComponent(props: Readonly<SchemaFormWithOverridesProps>) {
function useChildPropsForFormComponent(props: Readonly<SchemaFormWithOverridesProps>): FormComponentProps {
return useMemo(() => {
const title = getSchemaUIField(props.schema, SchemaFormUIField.Title) || props.attr
const description = getSchemaUIField(props.schema, SchemaFormUIField.Description)
Expand All @@ -67,10 +70,20 @@ function useChildPropsForFormComponent(props: Readonly<SchemaFormWithOverridesPr
itemKey: props.attr,
opPrefix: props.item.id,
overrideHelper: props.overrideHelper,

showClearButton: !!props.showClearButtonForNonRequiredFields && !props.isRequired,
},
isRequired: props.isRequired,
}
}, [props.schema, props.translationNamespaces, props.attr, props.item, props.overrideHelper, props.isRequired])
}, [
props.schema,
props.translationNamespaces,
props.attr,
props.item,
props.overrideHelper,
props.isRequired,
props.showClearButtonForNonRequiredFields,
])
}

export function SchemaFormWithOverrides(props: Readonly<SchemaFormWithOverridesProps>): JSX.Element {
Expand Down Expand Up @@ -179,6 +192,7 @@ const ObjectFormWithOverrides = (props: Readonly<SchemaFormWithOverridesProps>)
sofieEnumDefinitons={props.sofieEnumDefinitons}
allowTables={props.allowTables}
isRequired={props.schema.required?.includes(index) ?? false}
showClearButtonForNonRequiredFields={props.showClearButtonForNonRequiredFields}
/>
)
})}
Expand Down
5 changes: 5 additions & 0 deletions meteor/client/lib/forms/schemaFormUtil.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ export interface SchemaFormCommonProps {
* For example, a table inside a table will not display properly so this gets set automatically
*/
allowTables?: boolean

/**
* Whether a clear button should be shown for any fields not marked as "required"
*/
showClearButtonForNonRequiredFields?: boolean
}

export function translateStringIfHasNamespaces(str: string, translationNamespaces: string[] | undefined): string {
Expand Down
4 changes: 4 additions & 0 deletions meteor/client/lib/triggers/TriggersHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
RundownId,
RundownPlaylistId,
ShowStyleBaseId,
StudioId,
TriggeredActionId,
} from '@sofie-automation/corelib/dist/dataModel/Ids'
import {
Expand All @@ -48,6 +49,7 @@ import { CorelibPubSub } from '@sofie-automation/corelib/dist/pubsub'
type HotkeyTriggerListener = (e: KeyboardEvent) => void

interface IProps {
studioId: StudioId
rundownPlaylistId: RundownPlaylistId
currentRundownId: RundownId | null
showStyleBaseId: ShowStyleBaseId
Expand Down Expand Up @@ -317,6 +319,7 @@ export const TriggersHandler: React.FC<IProps> = function TriggersHandler(
let context = rundownPlaylistContext.get()
if (context === null) {
context = {
studioId: new ReactiveVar(props.studioId),
rundownPlaylistId: new ReactiveVar(playlist._id),
rundownPlaylist: new ReactiveVar(playlist),
currentRundownId: new ReactiveVar(props.currentRundownId),
Expand All @@ -339,6 +342,7 @@ export const TriggersHandler: React.FC<IProps> = function TriggersHandler(
}
})
}, [
props.studioId,
props.rundownPlaylistId,
props.currentRundownId,
props.currentPartId,
Expand Down
4 changes: 2 additions & 2 deletions meteor/client/ui/RundownView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2992,8 +2992,7 @@ const RundownViewContent = translateWithTracker<IPropsWithReady, IState, ITracke
onToggleSupportPanel={this.onToggleSupportPanel}
isStudioMode={this.state.studioMode}
onTake={this.onTake}
studioRouteSets={studio.routeSets}
studioRouteSetExclusivityGroups={studio.routeSetExclusivityGroups}
studio={studio}
onStudioRouteSetSwitch={this.onStudioRouteSetSwitch}
onSegmentViewMode={this.onSegmentViewModeChange}
/>
Expand Down Expand Up @@ -3204,6 +3203,7 @@ const RundownViewContent = translateWithTracker<IPropsWithReady, IState, ITracke
this.props.studio &&
this.props.showStyleBase && (
<TriggersHandler
studioId={this.props.studio._id}
rundownPlaylistId={this.props.rundownPlaylistId}
showStyleBaseId={this.props.showStyleBase._id}
currentRundownId={this.props.currentRundown?._id || null}
Expand Down
28 changes: 12 additions & 16 deletions meteor/client/ui/RundownView/RundownRightHandControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ import React, { useEffect, useState } from 'react'
// @ts-expect-error No types available
import * as VelocityReact from 'velocity-react'

import {
StudioRouteSet,
StudioRouteBehavior,
StudioRouteSetExclusivityGroup,
} from '@sofie-automation/corelib/dist/dataModel/Studio'
import { StudioRouteSet, StudioRouteBehavior } from '@sofie-automation/corelib/dist/dataModel/Studio'
import { RewindAllSegmentsIcon } from '../../lib/ui/icons/rewindAllSegmentsIcon'

import { Lottie } from '@crello/react-lottie'
Expand All @@ -26,15 +22,11 @@ import { SegmentViewMode } from '../../lib/ui/icons/listView'
import { RundownPlaylistId } from '@sofie-automation/corelib/dist/dataModel/Ids'
import { MediaStatusPopUp } from './MediaStatusPopUp'
import { MediaStatusIcon } from '../../lib/ui/icons/mediaStatus'
import { UIStudio } from '../../../lib/api/studios'

interface IProps {
playlistId: RundownPlaylistId
studioRouteSets: {
[id: string]: StudioRouteSet
}
studioRouteSetExclusivityGroups: {
[id: string]: StudioRouteSetExclusivityGroup
}
studio: UIStudio
isFollowingOnAir: boolean
onFollowOnAir?: () => void
onRewindSegments?: () => void
Expand Down Expand Up @@ -108,9 +100,13 @@ export function RundownRightHandControls(props: Readonly<IProps>): JSX.Element {
setSwitchboardOpen(false)
}

const availableRouteSets = Object.entries<StudioRouteSet>(props.studioRouteSets).filter(
([_id, routeSet]) => routeSet.behavior !== StudioRouteBehavior.HIDDEN
)
const availableRouteSets = Object.entries<StudioRouteSet>(props.studio.routeSets)
.filter(([_id, routeSet]) => routeSet.behavior !== StudioRouteBehavior.HIDDEN)
.sort((a, b) => {
if (a[1].name < b[1].name) return -1
if (a[1].name > b[1].name) return 1
return 0
})
const nonDefaultRoutes = availableRouteSets.filter(
([_id, routeSet]) => routeSet.defaultActive !== undefined && routeSet.active !== routeSet.defaultActive
).length
Expand Down Expand Up @@ -238,7 +234,7 @@ export function RundownRightHandControls(props: Readonly<IProps>): JSX.Element {
<SegmentViewMode />
</button>
{props.isStudioMode &&
props.studioRouteSets &&
props.studio.routeSets &&
props.onStudioRouteSetSwitch &&
availableRouteSets.length > 0 && (
<>
Expand Down Expand Up @@ -282,7 +278,7 @@ export function RundownRightHandControls(props: Readonly<IProps>): JSX.Element {
{switchboardOpen && (
<SwitchboardPopUp
availableRouteSets={availableRouteSets}
studioRouteSetExclusivityGroups={props.studioRouteSetExclusivityGroups}
studio={props.studio}
onStudioRouteSetSwitch={props.onStudioRouteSetSwitch}
/>
)}
Expand Down
74 changes: 64 additions & 10 deletions meteor/client/ui/RundownView/SwitchboardPopUp.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import {
StudioRouteSet,
StudioRouteSetExclusivityGroup,
StudioRouteBehavior,
} from '@sofie-automation/corelib/dist/dataModel/Studio'
import { StudioRouteSet, StudioRouteBehavior } from '@sofie-automation/corelib/dist/dataModel/Studio'
import classNames from 'classnames'
import { RouteSetOverrideIcon } from '../../lib/ui/icons/switchboard'
import Tooltip from 'rc-tooltip'
import { TOOLTIP_DEFAULT_DELAY } from '../../lib/lib'
import { UIStudio } from '../../../lib/api/studios'

interface IProps {
onStudioRouteSetSwitch?: (
Expand All @@ -18,9 +15,7 @@ interface IProps {
state: boolean
) => void
availableRouteSets: [string, StudioRouteSet][]
studioRouteSetExclusivityGroups: {
[id: string]: StudioRouteSetExclusivityGroup
}
studio: UIStudio
olzzon marked this conversation as resolved.
Show resolved Hide resolved
}

/**
Expand All @@ -43,8 +38,8 @@ export function SwitchboardPopUp(props: Readonly<IProps>): JSX.Element {
<h2 className="mhn mvn">{t('Switchboard')}</h2>
{Object.entries<[string, StudioRouteSet][]>(exclusivityGroups).map(([key, routeSets]) => (
<div className="switchboard-pop-up-panel__group" key={key}>
{props.studioRouteSetExclusivityGroups[key]?.name && (
<p className="mhs mbs mtn">{props.studioRouteSetExclusivityGroups[key]?.name}</p>
{props.studio.routeSetExclusivityGroups[key]?.name && (
<p className="mhs mbs mtn">{props.studio.routeSetExclusivityGroups[key]?.name}</p>
)}
{routeSets.length === 2 &&
routeSets[0][1].behavior === StudioRouteBehavior.ACTIVATE_ONLY &&
Expand Down Expand Up @@ -164,7 +159,66 @@ export function SwitchboardPopUp(props: Readonly<IProps>): JSX.Element {
)}
</div>
))}
{/* <AbPoolsDisabling studio={props.studio} onStudioAbPoolDisablingSwitch={props.onStudioAbPoolDisablingSwitch} /> */}
</div>
</div>
)
}

// function AbPoolsDisabling(props: {
olzzon marked this conversation as resolved.
Show resolved Hide resolved
// onStudioAbPoolDisablingSwitch?: IProps['onStudioAbPoolDisablingSwitch']
// studio: UIStudio
// }) {
// const { t } = useTranslation()
// if (!abPools) return <div />

// return (
// <div className="switchboard-pop-up-panel__group">
// {Object.keys(abPools).map((poolKey: string) => {
// const abPool = abPools[poolKey]
// return (
// <div key={poolKey} className="switchboard-pop-up-panel__group__controls">
// AB Pool - {poolKey}:
// <div className="switchboard-pop-up-panel__group">
// {Object.keys(abPool.players).map((playerKey: string) => {
// const player = abPool.players[playerKey]
// return (
// <div key={playerKey} className="switchboard-pop-up-panel__group__controls mhm mbs">
// <span className="switchboard-pop-up-panel__group__controls__active">{t('Off')}</span>
// <a
// className={classNames('switch-button', 'sb-nocolor', {
// 'sb-on': !player.disabled,
// })}
// role="button"
// onClick={(e) => {
// props.onStudioAbPoolDisablingSwitch &&
// props.onStudioAbPoolDisablingSwitch(e, poolKey, playerKey, !player.disabled)
// }}
// tabIndex={0}
// >
// <div className="sb-content">
// <div className="sb-label">
// <span className="mls">&nbsp;</span>
// <span className="mrs right">&nbsp;</span>
// </div>
// <div className="sb-switch"></div>
// </div>
// </a>
// <span
// className={classNames({
// 'switchboard-pop-up-panel__group__controls__active': !player.disabled,
// 'switchboard-pop-up-panel__group__controls__inactive': player.disabled,
// })}
// >
// {playerKey}
// </span>
// </div>
// )
// })}
// </div>
// </div>
// )
// })}
// </div>
// )
// }
10 changes: 9 additions & 1 deletion meteor/client/ui/Settings/Forms.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.properties-grid {
display: grid;
grid-auto-columns: fit-content(350px) minmax(350px, 1fr) fit-content(350px) minmax(max-content, 100px);
grid-auto-columns: fit-content(350px) auto minmax(350px, 1fr) fit-content(350px) minmax(max-content, 100px);
gap: 0 10px;
margin-left: 10px;

Expand Down Expand Up @@ -28,6 +28,14 @@
grid-column: 1 / 5;
}

.properties-grid > .field > .field-content {
text-wrap: nowrap;

.field-clear {
margin-bottom: -6px !important;
}
}

.properties-grid > .field > .field-hint {
grid-column: 1 / 5;
}
Expand Down
Loading