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

[WIP] Use a single view for rendering all the topology screens #942

Closed
wants to merge 6 commits into from

Conversation

skateman
Copy link
Member

@skateman skateman commented Apr 6, 2017

I found out that the topology screens only differ in the entities in their legend and the angular controller name. I created a simple DSL to declare these values in the ruby controller and I moved the universal show screen into layouts/topology.html.haml.

Depends on: #955

Pivotal story: https://www.pivotaltracker.com/n/projects/1613907

@miq-bot miq-bot added the wip label Apr 6, 2017
@skateman
Copy link
Member Author

skateman commented Apr 6, 2017

Accessing the values declared using the DSL is realised by delegate and attr_accessor. This technique requires an extra instance variable that has a name that differs from the method which sets it.

For example, in the controller:

angular_controller 'cloudTopologyController' # gets stored in @ng_controller

Accessing it in the view:

controller.ng_controller

I'm not sure if this is The Right Way™ as it uses a pair of method-instvar with a different name, so I'd like to ask @martinpovolny and @himdel to review this.

@himdel
Copy link
Contributor

himdel commented Apr 6, 2017

Yup, I think this looks like a step in the right direction :) (assuming we do it for all of them :))

@skateman skateman force-pushed the cloud-topology-refactor branch from 4103769 to 3b11fcf Compare April 6, 2017 14:43
@martinpovolny
Copy link
Member

Yes, for all or don't do it! The last thing we want is having 2 ways of doing things.

I was also thinking about not having the (ruby) controllers for topology -- having just one for all. Although that might complicate menus, toolbars and other things that

@skateman
Copy link
Member Author

skateman commented Apr 6, 2017

I want this for all the screens, of course! But we already have 2 ways of doing things 😞 the container topology is using some ✨ magic ✨ with the toolbars to build their toolbar and the others have a common partial for the same. So that needs to be addressed first...

I was thinking about creating a PR for each screen and then delete the super calls. But sure, I can add the other screens into this PR, but without the toolbar unification I can't deal with the container topology 😞 so I need to leave it out for now.

@skateman skateman force-pushed the cloud-topology-refactor branch from 3b11fcf to e70f460 Compare April 7, 2017 07:09
@skateman skateman changed the title [WIP] New DSL for declaring entities on the cloud topology screen [WIP] New DSL for declaring entities on the topology screens Apr 7, 2017
@skateman skateman force-pushed the cloud-topology-refactor branch from e70f460 to 7698719 Compare April 7, 2017 11:37
@skateman skateman force-pushed the cloud-topology-refactor branch from 7698719 to 9197222 Compare April 7, 2017 11:42
@skateman skateman changed the title [WIP] New DSL for declaring entities on the topology screens Use a single view for rendering all the topology screens Apr 7, 2017
@miq-bot
Copy link
Member

miq-bot commented Apr 7, 2017

Checked commits skateman/manageiq-ui-classic@b040b6c~...9197222 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
15 files checked, 0 offenses detected
Everything looks good. 🏆

@miq-bot miq-bot removed the wip label Apr 7, 2017
@himdel
Copy link
Contributor

himdel commented Apr 7, 2017

Missed Middleware topology ;) aand also ContainerProjectTopology which is apparently new and magic reuses a lot of ContainerTopology, but not all :) #120

@miq-bot
Copy link
Member

miq-bot commented Apr 7, 2017

This pull request is not mergeable. Please rebase and repush.

@skateman skateman changed the title Use a single view for rendering all the topology screens [WIP] Use a single view for rendering all the topology screens Apr 10, 2017
@miq-bot miq-bot added the wip label Apr 10, 2017
@skateman skateman closed this Apr 25, 2017
@skateman skateman deleted the cloud-topology-refactor branch April 25, 2017 08:49
@abonas
Copy link
Member

abonas commented May 14, 2017

@miq-bot add_label topology

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants