-
Notifications
You must be signed in to change notification settings - Fork 52
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(FEC-10785): add support to remove ui element #460
Conversation
flow-typed/types/ui-component.js
Outdated
|}; | ||
|
||
declare type KPUIRemoveComponent = {| | ||
removeComponent?: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removeComponent?: string, | |
removeComponent: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right!
flow-typed/types/ui-component.js
Outdated
}; | ||
replaceComponent?: string, | ||
presets: Array<string>, | ||
area: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move them up like before (mandatory first)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
src/common/ui-wrapper.js
Outdated
let replaceComponent: KPUIAddComponent = { | ||
label: `Remove_${component.removeComponent}`, | ||
get: Components.Remove, | ||
presets: component.presets.concat(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why concat is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To create a copy of the array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- why copy?
- i think
[...component.presets]
is clearer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.Copy because it seemed to me more correct. But not sure actually why not.
2. Because I'm old and I wrote it 1999 style
…a/kaltura-player-js into FEC-10785-removeComponent # Conflicts: # flow-typed/types/ui-component.js
Description of the Changes
Until now it was possible to add new component or to add and replace existing components.
There was no official way to remove an existing ui component.
solves FEC-10785
changes were done also in ui repo - kaltura/playkit-js-ui#613
CheckLists