Skip to content

Commit 2443eb7

Browse files
committed
wip: start on rundown view
1 parent b6f29b4 commit 2443eb7

File tree

12 files changed

+107
-73
lines changed

12 files changed

+107
-73
lines changed

packages/webui/src/client/lib/Components/ToggleSwitch.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface IToggleSwitchControlProps {
88
label?: string
99

1010
value: boolean
11-
handleUpdate: (value: boolean) => void
11+
handleUpdate: (value: boolean, e: React.MouseEvent<HTMLElement>) => void
1212
}
1313
export function ToggleSwitchControl({
1414
classNames,
@@ -21,10 +21,13 @@ export function ToggleSwitchControl({
2121
const currentValue = useRef(value)
2222
currentValue.current = value
2323

24-
const handleChange = useCallback(() => {
25-
if (disabled) return
26-
handleUpdate(!currentValue.current)
27-
}, [handleUpdate, disabled])
24+
const handleChange = useCallback(
25+
(e: React.MouseEvent<HTMLElement>) => {
26+
if (disabled) return
27+
handleUpdate(!currentValue.current, e)
28+
},
29+
[handleUpdate, disabled]
30+
)
2831

2932
return (
3033
<Form.Check

packages/webui/src/client/lib/viewPort.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ let HEADER_HEIGHT: number | undefined = undefined
103103

104104
export function getHeaderHeight(): number {
105105
if (HEADER_HEIGHT === undefined) {
106-
const root = document.querySelector('#render-target > .container-fluid-custom > .rundown-view > .header')
106+
const root = document.querySelector(
107+
'#render-target > .container-fluid-custom > .rundown-view > .rundown-header'
108+
)
107109
if (!root) {
108110
return FALLBACK_HEADER_HEIGHT
109111
}

packages/webui/src/client/styles/bootstrap-customise.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ $btn-disabled-opacity: 0.5;
1717

1818
$modal-header-padding: 0.5rem 1rem;
1919
$modal-md: 550px;
20+
21+
$body-bg-dark: #343434;

packages/webui/src/client/styles/fromOrigo.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.header-clear {
22
padding-top: 4rem;
33
padding-right: $statusbar-width;
4+
padding-left: 0;
45
}
56

67
ul {
@@ -84,6 +85,14 @@ header {
8485
flex-direction: row;
8586
}
8687

88+
.flex-col {
89+
display: flex;
90+
flex: 0 0 auto;
91+
align-content: flex-start;
92+
justify-content: flex-start;
93+
flex-direction: column;
94+
}
95+
8796
.action-btn {
8897
font-size: 0.875rem;
8998
cursor: pointer;

packages/webui/src/client/styles/main.scss

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ input {
1212

1313
@use 'defaultColors';
1414

15-
@use 'bootstrap';
15+
@import 'bootstrap';
1616

1717
@import 'itemTypeColors';
1818

@@ -41,13 +41,13 @@ input {
4141
// @import 'pieceStatusIcon';
4242
// @import 'prompter';
4343
@import 'rundownList';
44-
// @import 'rundownSystemStatus';
44+
@import 'rundownSystemStatus';
4545
@import 'settings';
4646
// @import 'splitDropdown';
4747
@import 'statusbar';
4848
// @import 'statusNotification';
49-
// @import 'studioScreenSaver';
50-
// @import 'supportAndSwitchboardPanel';
49+
@import 'studioScreenSaver';
50+
@import 'supportAndSwitchboardPanel';
5151
@import 'systemStatus';
5252
@import 'testtools';
5353
@import 'tooltips';
@@ -57,7 +57,7 @@ input {
5757
@import 'countdown/overlay';
5858
@import 'countdown/presenter';
5959

60-
// @import 'customizations/nrk/shelf/taPanel';
60+
@import 'customizations/nrk/shelf/taPanel';
6161

6262
@import 'shelf/adLibPanel';
6363
@import 'shelf/adLibRegionPanel';
@@ -115,7 +115,7 @@ input {
115115
@import '../ui/RundownView/MediaStatusPopUp/MediaStatusPopUpSegmentRule.scss';
116116
@import '../ui/SegmentAdlibTesting/SegmentAdlibTesting.scss';
117117

118-
// @import 'rundownView';
118+
@import 'rundownView';
119119

120120
// body {
121121
// overscroll-behavior: none;
@@ -229,3 +229,20 @@ input {
229229
}
230230
}
231231
}
232+
233+
.form-switch.switch-lg {
234+
// TODO
235+
.form-check-input {
236+
width: 3em;
237+
height: 1.5em;
238+
}
239+
}
240+
.form-switch.switch-nocolor {
241+
.form-check-input,
242+
.form-check-input:checked {
243+
--bs-form-switch-bg: #{escape-svg($form-switch-checked-bg-image)};
244+
245+
background-color: #737373;
246+
border-color: #737373;
247+
}
248+
}

packages/webui/src/client/styles/notifications.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@
469469
.rundown-view {
470470
&.notification-center-open {
471471
padding-right: 25vw !important;
472-
> .header .rundown-overview {
472+
> .rundown-header .rundown-overview {
473473
padding-right: calc(25vw + 1.5em) !important;
474474
}
475475
}

packages/webui/src/client/styles/rundownView.scss

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,19 @@ $break-width: 35rem;
137137
}
138138
}
139139

140-
.header.rundown .notification-pop-ups {
140+
.rundown-header .notification-pop-ups {
141141
top: 65px;
142142
}
143143

144-
> .header .rundown-overview {
144+
> .rundown-header .rundown-overview {
145145
transition: 0s padding-right 0.5s;
146146
}
147147

148148
&.notification-center-open {
149149
padding-right: $notification-center-width;
150150
transition: 0s padding-right 1s;
151151

152-
> .header .rundown-overview {
152+
> .rundown-header .rundown-overview {
153153
padding-right: calc(#{$notification-center-width} + 1.5em);
154154
transition: 0s padding-right 1s;
155155
}
@@ -159,7 +159,7 @@ $break-width: 35rem;
159159
padding-right: $properties-panel-width;
160160
transition: 0s padding-right 1s;
161161

162-
> .header .rundown-overview {
162+
> .rundown-header .rundown-overview {
163163
padding-right: calc(#{$properties-panel-width} + 1.5em);
164164
transition: 0s padding-right 1s;
165165
}
@@ -220,8 +220,10 @@ body.no-overflow {
220220
}
221221
}
222222

223-
.header.rundown {
224-
.row {
223+
.rundown-header {
224+
padding: 0;
225+
226+
.header-row {
225227
width: 100%;
226228

227229
&.margin-right {
@@ -435,17 +437,17 @@ body.no-overflow {
435437
cursor: default;
436438
}
437439

438-
.header.rundown.not-active .first-row {
440+
.rundown-header.not-active .first-row {
439441
background-color: rgb(38, 137, 186);
440442
}
441-
.header.rundown.not-active .first-row .timing-clock,
442-
.header.rundown.not-active .first-row .timing-clock-label {
443+
.rundown-header.not-active .first-row .timing-clock,
444+
.rundown-header.not-active .first-row .timing-clock-label {
443445
color: #fff !important;
444446
}
445-
// .header.rundown.active .first-row {
447+
// .rundown-header.active .first-row {
446448
// background-color: #600
447449
// }
448-
.header.rundown.active.rehearsal .first-row {
450+
.rundown-header.active.rehearsal .first-row {
449451
background-color: #660;
450452
}
451453

@@ -3172,7 +3174,7 @@ svg.icon {
31723174
> .thumbnail {
31733175
display: block;
31743176
width: 414px;
3175-
height: 233px;
3177+
height: 233px;
31763178
background: #000;
31773179
}
31783180

packages/webui/src/client/styles/supportAndSwitchboardPanel.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@
133133
color: #a4a4a4;
134134
}
135135

136+
.form-switch {
137+
display: inline-block;
138+
margin-right: 1rem;
139+
margin-left: 1.5rem;
140+
}
141+
136142
&.dual {
137143
display: flex;
138144

packages/webui/src/client/ui/RundownView.tsx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import Escape from './../lib/Escape'
2222

2323
import * as i18next from 'i18next'
2424
import Tooltip from 'rc-tooltip'
25-
import { NavLink, Route, Prompt } from 'react-router-dom'
25+
import { NavLink, Route, Prompt, Link } from 'react-router-dom'
2626
import {
2727
DBRundownPlaylist,
2828
QuickLoopMarker,
@@ -172,6 +172,10 @@ import * as RundownResolver from '../lib/RundownResolver'
172172
import { MAGIC_TIME_SCALE_FACTOR } from './SegmentTimeline/Constants'
173173
import { SelectedElementProvider, SelectedElementsContext } from './RundownView/SelectedElementsContext'
174174
import { PropertiesPanel } from './UserEditOperations/PropertiesPanel'
175+
import Container from 'react-bootstrap/esm/Container'
176+
import Navbar from 'react-bootstrap/esm/Navbar'
177+
import { LinkContainer } from 'react-router-bootstrap'
178+
import Nav from 'react-bootstrap/esm/Nav'
175179

176180
const REHEARSAL_MARGIN = 1 * 60 * 1000
177181
const HIDE_NOTIFICATIONS_AFTER_MOUNT: number | undefined = 5000
@@ -1162,8 +1166,11 @@ const RundownHeader = withTranslation()(
11621166
)}
11631167
</ContextMenu>
11641168
</Escape>
1165-
<div
1166-
className={ClassNames('header rundown', {
1169+
<Navbar
1170+
data-bs-theme="dark"
1171+
fixed="top"
1172+
expand
1173+
className={ClassNames('rundown-header', {
11671174
active: !!this.props.playlist.activationId,
11681175
'not-active': !this.props.playlist.activationId,
11691176
rehearsal: this.props.playlist.rehearsal,
@@ -1184,15 +1191,15 @@ const RundownHeader = withTranslation()(
11841191
noResetOnActivate ? this.activateRundown(e) : this.resetAndActivateRundown(e)
11851192
}
11861193
/>
1187-
<div className="row flex-row first-row super-dark">
1194+
<div className="header-row flex-row first-row super-dark">
11881195
<div className="flex-col left horizontal-align-left">
1189-
<div className="badge mod">
1196+
<div className="badge-sofie my-3 mx-4">
11901197
<Tooltip
11911198
overlay={t('Add ?studio=1 to the URL to enter studio mode')}
11921199
visible={getHelpMode() && !this.props.userPermissions.studio}
11931200
placement="bottom"
11941201
>
1195-
<div className="media-elem mrs sofie-logo" />
1202+
<div className="media-elem me-2 sofie-logo" />
11961203
</Tooltip>
11971204
<div className="bd mls">
11981205
<span className="logo-text"></span>
@@ -1236,7 +1243,8 @@ const RundownHeader = withTranslation()(
12361243
</div>
12371244
</div>
12381245
</ContextMenuTrigger>
1239-
</div>
1246+
</Navbar>
1247+
12401248
<ModalDialog
12411249
title={t('Error')}
12421250
acceptText={t('OK')}
@@ -1839,6 +1847,7 @@ const RundownViewContent = translateWithTracker<IPropsWithReady, IState, ITracke
18391847

18401848
componentDidMount(): void {
18411849
document.body.classList.add('dark', 'vertical-overflow-only')
1850+
document.body.setAttribute('data-bs-theme', 'dark')
18421851

18431852
rundownNotificationHandler.set(this.onRONotificationClick)
18441853

@@ -2104,6 +2113,7 @@ const RundownViewContent = translateWithTracker<IPropsWithReady, IState, ITracke
21042113

21052114
componentWillUnmount(): void {
21062115
document.body.classList.remove('dark', 'vertical-overflow-only')
2116+
document.body.removeAttribute('data-bs-theme')
21072117
window.removeEventListener('beforeunload', this.onBeforeUnload)
21082118

21092119
documentTitle.set(null)

packages/webui/src/client/ui/RundownView/MediaStatusPopUp/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export function MediaStatusPopUp({ playlistId }: Readonly<IProps>): JSX.Element
8787
<MediaStatusPopOutIcon />
8888
</NavLink>
8989
</div>
90-
<h2 className="mhm mvn">{t('Media Status')}</h2>
90+
<h2 className="mx-3 my-0">{t('Media Status')}</h2>
9191
<div className="media-status-panel__scrollbox">
9292
<table className="media-status-panel__table">
9393
<MediaStatusPopUpHeader

0 commit comments

Comments
 (0)