Skip to content

Commit

Permalink
Merge branch 'feat/option-to-disable-evaluation-form' into bbc-release52
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon committed Dec 17, 2024
2 parents deae44f + e9f21fb commit 10240cb
Show file tree
Hide file tree
Showing 15 changed files with 81 additions and 1 deletion.
1 change: 1 addition & 0 deletions meteor/__mocks__/defaultCollectionObjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export function defaultStudio(_id: StudioId): DBStudio {
allowHold: false,
allowPieceDirectPlay: false,
enableBuckets: false,
enableEvaluationForm: true,
}),
_rundownVersionHash: '',
routeSetsWithOverrides: wrapDefaultObject({}),
Expand Down
2 changes: 2 additions & 0 deletions meteor/server/api/rest/v1/typeConversion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ export function studioSettingsFrom(apiStudioSettings: APIStudioSettings): Comple
allowHold: apiStudioSettings.allowHold ?? true, // Backwards compatible
allowPieceDirectPlay: apiStudioSettings.allowPieceDirectPlay ?? true, // Backwards compatible
enableBuckets: apiStudioSettings.enableBuckets ?? true, // Backwards compatible
enableEvaluationForm: apiStudioSettings.enableEvaluationForm ?? true, // Backwards compatible
}
}

Expand All @@ -396,6 +397,7 @@ export function APIStudioSettingsFrom(settings: IStudioSettings): Complete<APISt
allowHold: settings.allowHold,
allowPieceDirectPlay: settings.allowPieceDirectPlay,
enableBuckets: settings.enableBuckets,
enableEvaluationForm: settings.enableEvaluationForm,
}
}

Expand Down
1 change: 1 addition & 0 deletions meteor/server/api/studio/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export async function insertStudioInner(organizationId: OrganizationId | null, n
allowHold: false,
allowPieceDirectPlay: false,
enableBuckets: true,
enableEvaluationForm: true,
}),
_rundownVersionHash: '',
routeSetsWithOverrides: wrapDefaultObject({}),
Expand Down
1 change: 1 addition & 0 deletions meteor/server/lib/rest/v1/studios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,5 @@ export interface APIStudioSettings {
allowHold?: boolean
allowPieceDirectPlay?: boolean
enableBuckets?: boolean
enableEvaluationForm: true
}
1 change: 1 addition & 0 deletions meteor/server/migration/0_1_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const addSteps = addMigrationSteps('0.1.0', [
allowHold: false,
allowPieceDirectPlay: false,
enableBuckets: true,
enableEvaluationForm: true,
}),
mappingsWithOverrides: wrapDefaultObject({}),
blueprintConfigWithOverrides: wrapDefaultObject({}),
Expand Down
50 changes: 50 additions & 0 deletions meteor/server/migration/X_X_X.ts
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,56 @@ export const addSteps = addMigrationSteps(CURRENT_SYSTEM_VERSION, [
}
},
},
{
id: `studios settings create default enableBuckets=true`,
canBeRunAutomatically: true,
validate: async () => {
const studios = await Studios.findFetchAsync({
'settingsWithOverrides.defaults.enableBuckets': { $exists: false },
})
if (studios.length > 0) {
return 'studio is missing enableBuckets setting'
}
return false
},
migrate: async () => {
const studios = await Studios.findFetchAsync({
'settingsWithOverrides.defaults.enableBuckets': { $exists: false },
})
for (const studio of studios) {
await Studios.updateAsync(studio._id, {
$set: {
'settingsWithOverrides.defaults.enableBuckets': true,
},
})
}
},
},
{
id: `studios settings create default enableEvaluationForm=true`,
canBeRunAutomatically: true,
validate: async () => {
const studios = await Studios.findFetchAsync({
'settingsWithOverrides.defaults.enableEvaluationForm': { $exists: false },
})
if (studios.length > 0) {
return 'studio is missing enableEvaluationForm setting'
}
return false
},
migrate: async () => {
const studios = await Studios.findFetchAsync({
'settingsWithOverrides.defaults.enableEvaluationForm': { $exists: false },
})
for (const studio of studios) {
await Studios.updateAsync(studio._id, {
$set: {
'settingsWithOverrides.defaults.enableEvaluationForm': true,
},
})
}
},
},
])

interface PartialOldICoreSystem {
Expand Down
3 changes: 3 additions & 0 deletions meteor/server/migration/__tests__/migrations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ describe('Migrations', () => {
allowHold: true,
allowPieceDirectPlay: true,
enableBuckets: true,
enableEvaluationForm: true,
}),
mappingsWithOverrides: wrapDefaultObject({}),
blueprintConfigWithOverrides: wrapDefaultObject({}),
Expand Down Expand Up @@ -160,6 +161,7 @@ describe('Migrations', () => {
allowHold: true,
allowPieceDirectPlay: true,
enableBuckets: true,
enableEvaluationForm: true,
}),
mappingsWithOverrides: wrapDefaultObject({}),
blueprintConfigWithOverrides: wrapDefaultObject({}),
Expand Down Expand Up @@ -202,6 +204,7 @@ describe('Migrations', () => {
allowHold: true,
allowPieceDirectPlay: true,
enableBuckets: true,
enableEvaluationForm: true,
}),
mappingsWithOverrides: wrapDefaultObject({}),
blueprintConfigWithOverrides: wrapDefaultObject({}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ describe('lib/mediaObjects', () => {
allowHold: false,
allowPieceDirectPlay: false,
enableBuckets: false,
enableEvaluationForm: false,
}

const mockDefaultStudio = defaultStudio(protectString('studio0'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export function defaultStudio(_id: StudioId): DBStudio {
allowHold: true,
allowPieceDirectPlay: true,
enableBuckets: true,
enableEvaluationForm: true,
}),
routeSetsWithOverrides: wrapDefaultObject({}),
routeSetExclusivityGroupsWithOverrides: wrapDefaultObject({}),
Expand Down
2 changes: 2 additions & 0 deletions packages/job-worker/src/blueprints/__tests__/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ describe('Test blueprint config', () => {
allowHold: true,
allowPieceDirectPlay: true,
enableBuckets: true,
enableEvaluationForm: true,
}),
blueprintConfigWithOverrides: wrapDefaultObject({ sdfsdf: 'one', another: 5 }),
})
Expand All @@ -44,6 +45,7 @@ describe('Test blueprint config', () => {
allowHold: true,
allowPieceDirectPlay: true,
enableBuckets: true,
enableEvaluationForm: true,
}),
blueprintConfigWithOverrides: wrapDefaultObject({ sdfsdf: 'one', another: 5 }),
})
Expand Down
1 change: 1 addition & 0 deletions packages/job-worker/src/playout/upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export async function handleBlueprintUpgradeForStudio(context: JobContext, _data
allowHold: true,
allowPieceDirectPlay: true,
enableBuckets: true,
enableEvaluationForm: true,
}

await context.directCollections.Studios.update(context.studioId, {
Expand Down
4 changes: 4 additions & 0 deletions packages/shared-lib/src/core/model/StudioSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,8 @@ export interface IStudioSettings {
* Doubleclick changes behaviour as selector for userediting
*/
enableUserEdits?: boolean
/**
* Enable evaluation form - the default behavior is to have evaluation forms.
*/
enableEvaluationForm: boolean
}
1 change: 1 addition & 0 deletions packages/webui/src/__mocks__/defaultCollectionObjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export function defaultStudio(_id: StudioId): DBStudio {
allowHold: true,
allowPieceDirectPlay: true,
enableBuckets: true,
enableEvaluationForm: true,
}),
_rundownVersionHash: '',
routeSetsWithOverrides: wrapDefaultObject({}),
Expand Down
3 changes: 2 additions & 1 deletion packages/webui/src/client/ui/RundownView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3036,7 +3036,8 @@ const RundownViewContent = translateWithTracker<IPropsWithReady, IState, ITracke
<ErrorBoundary>
{this.props.matchedSegments &&
this.props.matchedSegments.length > 0 &&
this.props.userPermissions.studio && <AfterBroadcastForm playlist={playlist} />}
this.props.userPermissions.studio &&
studio.settings.enableEvaluationForm && <AfterBroadcastForm playlist={playlist} />}
</ErrorBoundary>
<ErrorBoundary>
<RundownHeader
Expand Down
10 changes: 10 additions & 0 deletions packages/webui/src/client/ui/Settings/Studio/Generic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,16 @@ function StudioSettings({ studio }: { studio: DBStudio }): JSX.Element {
{(value, handleUpdate) => <CheckboxControl value={!!value} handleUpdate={handleUpdate} />}
</LabelAndOverridesForCheckbox>

<LabelAndOverridesForCheckbox
label={t('Enable Evaluation Form')}
item={wrappedItem}
itemKey={'enableEvaluationForm'}
overrideHelper={overrideHelper}
hint={t('This enables or disables the evaluationform in the UI - enabled is the default behavior')}
>
{(value, handleUpdate) => <CheckboxControl value={!!value} handleUpdate={handleUpdate} />}
</LabelAndOverridesForCheckbox>

<LabelAndOverridesForCheckbox
label={t('Double click selection for properties panel')}
item={wrappedItem}
Expand Down

0 comments on commit 10240cb

Please sign in to comment.