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

Properties Panel (RFC #1289) #1342

Open
wants to merge 1 commit into
base: release52
Choose a base branch
from

Conversation

mint-dewit
Copy link
Contributor

About the Contributor

This pull request is posted on behalf of the BBC.

Type of Contribution

This is a: Feature

New Behavior

An optional property has been added for blueprints to configure: userEditProperties. This property can be added to Segments, Parts and Pieces. 3 parts of the properties can be configured: pieceTypeProperties, these are properties that depend on the user choosing a piece type i.e. a camera number depends on the user configuring the piece/part as a camera. The piece types are styled based on a Source Layer type. globalProperties, these are properties that are always available regardless of the piece type that the user chooses. Operations, these are UserEditOperations that are exposed as buttons on the Properties Panel. The properties are described by JSON Schemas.

The user can interact with the Properties Panel in a couple of ways:

  • Double clicking a Segment Title selects that segment
  • Right clicking on a Segment Headers, the user can choose to "Edit Segment Properties"
  • Double clicking a Piece selects that piece
  • Right clicking on a Piece, the user can choose to "Edit Segment Properties" or Edit Part Properties"

When an element is selected, it will display with a glowing border around it.

To close the Panel the user can double click the selected element in the UI, click on the X on the right top of the panel or click Cancel.

In the Properties Panel the user can change any properties that are made available by the blueprints. When the users clicks the "Save" button, a UserEdit Operation of type DefaultUserOperationsTypes.UPDATE_PROPS will be issued with the updated properties as a payload. The blueprints must then process this operation accordingly. A "restore from NRCS" button is available, when clicked this will send a UserEdit Operation to Blueprints instructing it to revert changes to either the Segment or the Part.

The Properties Panel can be disabled entirely from an option in the Studio Configuration.

image

Testing

Unit tests for the properties panel have been added.

Affected areas

  • The Blueprints API has a new optional property, which should not affect existing operations.
  • The UI has been updated with the Properties Panel component, which has also modified the RundownView component.

Time Frame

No specific requests, just leaving this as an early christmas present 🎁

Other Information

This PR adds tests for the Properties Panel, it is a bit messy in the test file because of the many mocks but this seemed to be the easiest way to keep this mocks limited to this specific test suite. If we are to add unit tests for other components it would probably be wise to move these to a more central place but I am hardly the expert to do that.

Status

  • PR is ready to be reviewed.
  • The functionality has been tested by the author.
  • Relevant unit tests has been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

Additional info about this should probably made available under the "For Developers" section but I think a second PR could be made for that too

* wip: initial draft implementation of userEditPanel

* wip: userEditPanel grouping

* wip: userEditPanel cleanup remove schema as it's replaces by schemas

* wip: userEditPanel styling and use <select> for list

* wip: userEditPanel - make groupType optional to allow empty slots

* wip: userEditPanel - convert to FC

* wip: userEditPanel - uncomment context menu

* wip: UserEditPanel - Add DefaultUserOperationsTypes for revert buttons in panel

* wip: UserEditPanel - Default revert button on panel

* wip: UserEditPanel - tracker on part and segment

* wip: UserEditPanel - only render Segment or Part in panel

* wip: UserEditPanel - initial header for part and segment

* wip: UserEditPanel - comment for the usage of getTimePosition

* wip: UserEditPanel - add Icons in header

* wip: UserEditPanel - add button type in UserEditingDefinitions

* wip: UserEditPanel - rename revert button to "Revert Changes"

* wip: UserEditPanel - add support for SVG icons in grouping (e.g for split or DVE backgrounds)

* wip: UserEditPanel - center revert button

* wip: Renaming UserEditPanel to PropertiesPanel

* wip: UI selection - Context for SelectedElements

* wip: UI selection - refactor from useState() to useReducer()

* wip: UI selection - use type for SelectedElement

* wip: UI selection -Segment not updating upon selection

* feat: unit tests for SelectedElementsContext

* wip: UI selection - add isSelected to withSegmentTiming

* wip: fix props withSelection

* wip: fix props withSelection

* wip: remove componentDidUpdate - leftover from previous debugging

* fix: added listSelectedElements() instead of exposing the selectedElements

* fix: add assertNever() to selectionReducer

* fix: remove id and use ElementId as reference in context provider

* fix: clean up isSelected should parse boolean not function as props

* chore: update package with @testing-library/react

* fix: tests for SelecedElementsContext updated and type fixed

* fix: listSelectedElements is af function not an array

* wip: implement useSelection in PropertiesPanel

* wip: useSelection on Parts

* fix: missing rundown id in propertiespanel actions

* feat: add enabling of userediting in settings

* feat: doubleclick on part selection for properties panel

* fix: properties panel crash when no selection was made

* feat: segment selection

* feat: dbl click anywhere in segment header to select properties

* feat: select part by double clicking a piece

* feat: properties panel commit button for pending changes

* feat: select/deselect an element - fix flickering upen commit changes

* fix: render all userEditOperations when part is selected

* feat: move Properties panel out of notification center logic

* feat: use context.consumer instead of wrapping

* feat: refactor userEditing structure

* feat: properties panel with refactored data structure.

* feat: Schema selection implemented in commit button logic

* feat: implement Layer colors in group selectors

* feat: only parse the selected source on useraction commit

* feat: simplify structure for userEditing source

* fix: rerender group selection when selecting new part

* fix: read the SourceLayerType into UserEditingDefinition

* feat: selected element indicator

* feat: properties panel styling - is edited indication

* wip: add close propterties icon (sketch)

* wip: properties panel css dim commit+revert when not active

* wip: properties panel clean up first iteration selector

* wip: properties panel add close upper right

* fix: crash UI - remove transiongroup

* feat: properties panel animate in and shrink rundown view

* fix: cleanup using notificationpanel for properties panel

* wip: properties panel, rightbar icon color

* fix: re-run only if part.segmentId has changed

* wip: tests for properties panel

* wip: properties panel tests - useFaketimers and implement mock useTracker()

* wip: properties panel - element selection styling

* wip: properties panel styling edit pencil icon

* wip: properties panel close when notification is open

* wip: properties panel selection glow on segment header

* feat: StyledSchemaFormInPlace schema component

* fix: Properties panel - StyledSchemaFormInPlace schema for normal form

* feat: Properties panel is edited pencil styling

* feat: Properties header styling

* wip: Properties tests - more mocking to get correct rendering in test to work

* chore: fix unit tests

* feat: refactor form action to properties field

* chore: update styles

* chore: add actions back into property panel

* chore: support translations for properties panel

* chore: fix some build issues

* feat: allow editing piece properties

* chore: various review comments

* chore: fix tests

* chore: remove unused parameter

* chore: removed commented styles

---------

Co-authored-by: Olzzon <[email protected]>
Co-authored-by: Mint de Wit <[email protected]>
@mint-dewit mint-dewit added ✨ enhancement New feature or request Contribution from BBC Contributions sponsored by BBC (bbc.co.uk) labels Dec 13, 2024
@mint-dewit mint-dewit requested a review from a team as a code owner December 13, 2024 11:02
Copy link

codecov bot commented Dec 13, 2024

Codecov Report

Attention: Patch coverage is 68.22430% with 34 lines in your changes missing coverage. Please review.

Project coverage is 56.49%. Comparing base (83c11bf) to head (1848f9e).
Report is 41 commits behind head on release52.

Files with missing lines Patch % Lines
packages/job-worker/src/blueprints/context/lib.ts 53.03% 29 Missing and 2 partials ⚠️
meteor/server/api/rest/v1/typeConversion.ts 0.00% 2 Missing ⚠️
meteor/server/lib/rest/v1/studios.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           release52    #1342      +/-   ##
=============================================
+ Coverage      56.25%   56.49%   +0.23%     
=============================================
  Files            399      401       +2     
  Lines          71164    72019     +855     
  Branches        4495     4550      +55     
=============================================
+ Hits           40035    40687     +652     
- Misses         31028    31195     +167     
- Partials         101      137      +36     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@RannveigNC
Copy link

Hello!
Thanks for this Contribution! It'll for sure be a very good addition to Sofie!
The developers have approved the implementation, the only thing that's holding this up now is that we want to confirm with our users that the functionality of double-clicking pieces (to edit instead of playing when having activated the feature-flag) is acceptable.

We expect to get back to you on January the 17th.
/Rannveig (NRK Sofie team)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contribution from BBC Contributions sponsored by BBC (bbc.co.uk) ✨ enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants