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!: no default tabs when using Shelf Layout #684

Merged
merged 3 commits into from
Feb 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
53 changes: 16 additions & 37 deletions meteor/client/ui/RundownView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,6 @@ const TimingDisplay = withTranslation()(
)
)

interface HotkeyDefinition {
key: string
label: string
}

interface IRundownHeaderProps {
playlist: RundownPlaylist
showStyleBase: ShowStyleBase
Expand All @@ -314,7 +309,6 @@ interface IRundownHeaderProps {
rundownIds: RundownId[]
firstRundown: Rundown | undefined
onActivate?: (isRehearsal: boolean) => void
onRegisterHotkeys?: (hotkeys: Array<HotkeyDefinition>) => void
studioMode: boolean
inActiveRundownView?: boolean
layout: RundownLayoutRundownHeader | undefined
Expand Down Expand Up @@ -347,10 +341,6 @@ const RundownHeader = withTranslation()(
}
}
componentDidMount() {
if (typeof this.props.onRegisterHotkeys === 'function') {
this.props.onRegisterHotkeys(this.bindKeys)
}

RundownViewEventBus.on(RundownViewEvents.ACTIVATE_RUNDOWN_PLAYLIST, this.eventActivate)
RundownViewEventBus.on(RundownViewEvents.RESYNC_RUNDOWN_PLAYLIST, this.eventResync)
RundownViewEventBus.on(RundownViewEvents.TAKE, this.eventTake)
Expand Down Expand Up @@ -1092,7 +1082,6 @@ interface IState {
followLiveSegments: boolean
manualSetAsNext: boolean
subsReady: boolean
usedHotkeys: Array<HotkeyDefinition>
isNotificationsCenterOpen: NoticeLevel | undefined
isSupportPanelOpen: boolean
isInspectorShelfExpanded: boolean
Expand Down Expand Up @@ -1288,8 +1277,6 @@ export const RundownView = translateWithTracker<IProps, IState, ITrackedProps>((
constructor(props: Translated<IProps & ITrackedProps>) {
super(props)

const { t } = this.props

const shelfLayout = this.props.rundownLayouts?.find((layout) => layout._id === this.props.shelfLayoutId)
let isInspectorShelfExpanded = false

Expand All @@ -1305,17 +1292,6 @@ export const RundownView = translateWithTracker<IProps, IState, ITrackedProps>((
followLiveSegments: true,
manualSetAsNext: false,
subsReady: false,
usedHotkeys: [
// Register additional hotkeys or legend entries
{
key: 'Escape',
label: t('Cancel currently pressed hotkey'),
},
{
key: 'F11',
label: t('Change to fullscreen mode'),
},
],
isNotificationsCenterOpen: undefined,
isSupportPanelOpen: false,
isInspectorShelfExpanded,
Expand Down Expand Up @@ -2212,14 +2188,6 @@ export const RundownView = translateWithTracker<IProps, IState, ITrackedProps>((
})
}

onRegisterHotkeys = (hotkeys: Array<HotkeyDefinition>) => {
// @ts-ignore
this.state.usedHotkeys = this.state.usedHotkeys.concat(hotkeys) // we concat directly to the state object member, because we need to
this.setState({
usedHotkeys: this.state.usedHotkeys,
})
}

onContextMenuTop = (e: React.MouseEvent<HTMLDivElement>): boolean => {
if (!getAllowDeveloper()) {
e.preventDefault()
Expand Down Expand Up @@ -2416,6 +2384,20 @@ export const RundownView = translateWithTracker<IProps, IState, ITrackedProps>((
return true
}

defaultHotkeys(t: i18next.TFunction) {
return [
// Register additional hotkeys or legend entries
{
key: 'Escape',
label: t('Cancel currently pressed hotkey'),
},
{
key: 'F11',
label: t('Change to fullscreen mode'),
},
]
}

renderRundownView(
studio: DBStudio,
playlist: RundownPlaylist,
Expand Down Expand Up @@ -2457,7 +2439,6 @@ export const RundownView = translateWithTracker<IProps, IState, ITrackedProps>((
firstRundown={this.props.rundowns[0]}
onActivate={this.onActivate}
studioMode={this.state.studioMode}
onRegisterHotkeys={this.onRegisterHotkeys}
inActiveRundownView={this.props.inActiveRundownView}
currentRundown={this.state.currentRundown || this.props.rundowns[0]}
layout={this.state.rundownHeaderLayout}
Expand Down Expand Up @@ -2637,13 +2618,12 @@ export const RundownView = translateWithTracker<IProps, IState, ITrackedProps>((
(!this.state.wasShelfResizedByUser && this.state.shelfLayout?.openByDefault)
}
onChangeExpanded={this.onShelfChangeExpanded}
hotkeys={this.state.usedHotkeys}
hotkeys={this.defaultHotkeys(t)}
playlist={this.props.playlist}
showStyleBase={this.props.showStyleBase}
showStyleVariant={this.props.showStyleVariant}
studioMode={this.state.studioMode}
onChangeBottomMargin={this.onChangeBottomMargin}
onRegisterHotkeys={this.onRegisterHotkeys}
rundownLayout={this.state.shelfLayout}
shelfDisplayOptions={this.props.shelfDisplayOptions}
bucketDisplayFilter={this.props.bucketDisplayFilter}
Expand Down Expand Up @@ -2689,13 +2669,12 @@ export const RundownView = translateWithTracker<IProps, IState, ITrackedProps>((
buckets={this.props.buckets}
isExpanded={this.state.isInspectorShelfExpanded}
onChangeExpanded={this.onShelfChangeExpanded}
hotkeys={this.state.usedHotkeys}
hotkeys={this.defaultHotkeys(this.props.t)}
playlist={this.props.playlist}
showStyleBase={this.props.showStyleBase}
showStyleVariant={this.props.showStyleVariant}
studioMode={this.state.studioMode}
onChangeBottomMargin={this.onChangeBottomMargin}
onRegisterHotkeys={this.onRegisterHotkeys}
rundownLayout={this.state.shelfLayout}
studio={this.props.studio}
fullViewport={true}
Expand Down
30 changes: 13 additions & 17 deletions meteor/client/ui/Settings/components/FilterEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -626,24 +626,20 @@ export default withTranslation()(
/>
</label>
</div>
<div className="mod mvs mhs">
<label className="field">
{t('Display Rank')}
<EditAttribute
modifiedClassName="bghl"
attribute={`filters.${index}.rank`}
obj={item}
type="float"
collection={RundownLayouts}
className="input text-input input-l"
/>
</label>
</div>
{isDashboardLayout && this.renderDashboardLayoutSettings(item, index, true)}
{isDashboardLayout && (
<React.Fragment>
<div className="mod mvs mhs">
<label className="field">
{t('Display Rank')}
<EditAttribute
modifiedClassName="bghl"
attribute={`filters.${index}.rank`}
obj={item}
type="float"
collection={RundownLayouts}
className="input text-input input-l"
/>
</label>
</div>
</React.Fragment>
)}
</React.Fragment>
)
}
Expand Down
13 changes: 8 additions & 5 deletions meteor/client/ui/Shelf/AdLibListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ interface IListViewItemProps {
layer: ISourceLayer | undefined
selected: boolean
disabled?: boolean
onSelectAdLib: (aSLine: IAdLibListItem) => void
onToggleAdLib: (aSLine: IAdLibListItem, queue: boolean, context: any, mode?: IBlueprintActionTriggerMode) => void
onSelectAdLib?: (aSLine: IAdLibListItem) => void
onToggleAdLib?: (aSLine: IAdLibListItem, queue: boolean, context: any, mode?: IBlueprintActionTriggerMode) => void
playlist: RundownPlaylist
}

Expand All @@ -58,9 +58,12 @@ export const AdLibListItem = withMediaObjectStatus<IListViewItemProps, {}>()(
}),
//@ts-ignore React.HTMLAttributes does not list data attributes, but that's fine
'data-obj-id': this.props.piece._id,
onClick: () => this.props.onSelectAdLib(this.props.piece),
onContextMenu: () => this.props.onSelectAdLib(this.props.piece),
onDoubleClick: (e) => !this.props.disabled && this.props.onToggleAdLib(this.props.piece, e.shiftKey, e),
onClick: () => this.props.onSelectAdLib && this.props.onSelectAdLib(this.props.piece),
onContextMenu: () => this.props.onSelectAdLib && this.props.onSelectAdLib(this.props.piece),
onDoubleClick: (e) =>
!this.props.disabled &&
this.props.onToggleAdLib &&
this.props.onToggleAdLib(this.props.piece, e.shiftKey, e),
}}
collect={() =>
setShelfContextMenuContext({
Expand Down
Loading