Skip to content

Commit 3978c2b

Browse files
committed
feat: selected element indicator
1 parent 5e547ce commit 3978c2b

File tree

5 files changed

+45
-24
lines changed

5 files changed

+45
-24
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@import '_variables';
2+
3+
.element-selected {
4+
border-radius: 0.1px;
5+
border-width: 1px;
6+
border-color: #171717;
7+
border-style: solid;
8+
animation: blinker 1s linear infinite;
9+
10+
@keyframes blinker {
11+
30% {
12+
opacity: 0.8;
13+
background-color: rgb(13, 13, 13);
14+
}
15+
}
16+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ input {
4242
@import 'tooltips';
4343
@import 'users';
4444
@import 'utils';
45+
@import 'elementSelected';
4546

4647
@import 'countdown/overlay';
4748
@import 'countdown/presenter';

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,14 +1075,12 @@ export class SegmentTimelineClass extends React.Component<Translated<WithTiming<
10751075
>
10761076
<h2
10771077
id={`segment-name-${this.props.segment._id}`}
1078-
className={
1079-
'segment-timeline__title__label' +
1080-
(this.props.segment.identifier ? ' identifier' : '') +
1081-
(selectElementContext.isSelected(this.props.segment._id) ? ' selected' : '')
1082-
}
1078+
className={ClassNames(
1079+
'segment-timeline__title__label' + (this.props.segment.identifier ? ' identifier' : ''),
1080+
selectElementContext.isSelected(this.props.segment._id) ? 'element-selected' : ''
1081+
)}
10831082
data-identifier={this.props.segment.identifier}
10841083
>
1085-
{/* for debugging: */ selectElementContext.isSelected(this.props.segment._id) && <span>!!</span>}
10861084
{this.props.segment.name}
10871085
</h2>
10881086
{(criticalNotes > 0 || warningNotes > 0) && (

packages/webui/src/client/ui/SegmentTimeline/SourceLayerItem.tsx

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { UIStudio } from '@sofie-automation/meteor-lib/dist/api/studios'
2424
import { ReadonlyDeep } from 'type-fest'
2525
import { PieceContentStatusObj } from '@sofie-automation/meteor-lib/dist/api/pieceContentStatus'
2626
import { SelectedElementsContext } from '../RundownView/SelectedElementsContext'
27+
import classNames from 'classnames'
2728
const LEFT_RIGHT_ANCHOR_SPACER = 15
2829
const MARGINAL_ANCHORED_WIDTH = 5
2930

@@ -671,15 +672,18 @@ export const SourceLayerItem = withTranslation()(
671672
<SelectedElementsContext.Consumer>
672673
{(selectElementContext) => (
673674
<div
674-
className={pieceUiClassNames(
675-
piece,
676-
this.props.contentStatus,
677-
'segment-timeline__piece',
678-
this.props.layer.type,
679-
this.props.part.partId,
680-
this.state.highlight,
681-
elementWidth,
682-
this.state
675+
className={classNames(
676+
pieceUiClassNames(
677+
piece,
678+
this.props.contentStatus,
679+
'segment-timeline__piece',
680+
this.props.layer.type,
681+
this.props.part.partId,
682+
this.state.highlight,
683+
elementWidth,
684+
this.state
685+
),
686+
selectElementContext.isSelected(this.props.part.instance.part._id) ? 'element-selected' : ''
683687
)}
684688
data-obj-id={piece.instance._id}
685689
ref={this.setRef}

packages/webui/src/client/ui/UserEditOperations/PropertiesPanel.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -474,16 +474,18 @@ function EditingTypeChangeSourceLayerSource(props: {
474474
})}
475475
</div>
476476
{selectedGroupSchema && (
477-
<div onChange={handleSourceChange}>
477+
<>
478478
<a className="propertiespanel-pop-up__label">{t('Source')}:</a>
479-
<SchemaFormInPlace
480-
schema={selectedGroupSchema}
481-
object={selectedValues}
482-
translationNamespaces={props.userEditOperation.translationNamespaces}
483-
/>
484-
<br />
485-
<hr />
486-
</div>
479+
<div onChange={handleSourceChange}>
480+
<SchemaFormInPlace
481+
schema={selectedGroupSchema}
482+
object={selectedValues}
483+
translationNamespaces={props.userEditOperation.translationNamespaces}
484+
/>
485+
<br />
486+
<hr />
487+
</div>
488+
</>
487489
)}
488490
</>
489491
)

0 commit comments

Comments
 (0)