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

Add Layout Editor #2356

Merged
merged 40 commits into from
Dec 20, 2019
Merged

Add Layout Editor #2356

merged 40 commits into from
Dec 20, 2019

Conversation

gettinToasty
Copy link
Contributor

No description provided.

@codeclimate
Copy link

codeclimate bot commented Dec 18, 2019

Code Climate has analyzed commit 3ee33c1 and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

View more on Code Climate.

Copy link
Member

@avacreeth avacreeth left a 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 {
Copy link
Member

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();
Copy link
Member

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();
Copy link
Member

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 },
Copy link
Member

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.

@gettinToasty gettinToasty merged commit f202fa5 into staging Dec 20, 2019
@gettinToasty gettinToasty deleted the sb_modular_editor_2 branch February 28, 2020 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants