-
Notifications
You must be signed in to change notification settings - Fork 703
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
Add Layout Editor #2356
Add Layout Editor #2356
Conversation
Code Climate has analyzed commit 3ee33c1 and detected 1 issue on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
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.
There's a lot of complexity here that I'm still trying to wrap my head around, but want to give you some initial feedback. Overall this is a really tough thing to build, and it looks like you came up with something that works pretty well.
import TsxComponent from 'components/tsx-component'; | ||
|
||
@Component({}) | ||
export default class MiniFeed extends TsxComponent { |
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.
Class name seems like a copy past error here.
@Component({ props: createProps(LayoutProps) }) | ||
export default class Classic extends BaseLayout { | ||
mounted() { | ||
super.mountResize(); |
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 not this.mountResize
? Seems incorrect to use super in this case, since you should allow mountResize
to potentially be overridden. (This comment applies to all layout implementations)
this.$emit('totalWidth', ['1', ['2', '3', '4']]); | ||
} | ||
destroyed() { | ||
super.destroyResize(); |
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.
Same comment.
[ELayoutElement.Mixer]: { x: 230, y: 150 }, | ||
[ELayoutElement.Minifeed]: { x: 330, y: 150 }, | ||
[ELayoutElement.Sources]: { x: 220, y: 150 }, | ||
[ELayoutElement.Scenes]: { x: 200, y: 150 }, |
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.
I think a lot of this stuff should really be pushed into the element classes themselves. If they all subclass a common abstract class or implement a common interface, you can require all elements to define these values in their implementation. This is cleaner and is better OO design, because you are clearly defining the requirements/shape of what a element implementation looks like. It's much easier for a developer down the road to add a new element. I think this comment also applies to layouts. Things like the name of the layout should be an attribute on the layout itself rather than in a map object.
No description provided.