-
Notifications
You must be signed in to change notification settings - Fork 356
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
Topology for Container Projects #120
Conversation
@zeari Cannot apply the following labels because they are not recognized: topology, ui |
Overall it looks good! I don't get how the part I see it more related to capabilities and the We may use the decorators for this -- the decarators on the classes (not instances) that @himdel is just adding. I am concerned about |
@@ -43,6 +43,8 @@ def view_toolbar_filename | |||
'drift_view_tb' | |||
elsif %w(ems_container ems_infra).include?(@layout) && %w(main dashboard topology).include?(@display) | |||
'dashboard_summary_toggle_view_tb' | |||
elsif %w(container_project).include?(@layout) | |||
"#{@layout}_view_tb" |
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 don't get how the part entities have topology\dashboard views relates to role_allows??
I thought that if an entity (like ems) has a dashboard view available (maybe through supports?
) then we should add the toolbar dashboard view button instead of picking specific entities with their toolbars.
or maybe we always have entities search for their "#{@layout}_view_tb"
file.
Im just trying to prevent massive refactors later...
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 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.
sorry, I don't get it :-(
@dclarizio @serenamarie125 Can I get a general ack towards making this change? |
@zeari is this essentially adding the Topology icon in the view selector ? |
@serenamarie125 that goes to a project level topology screen, yes. |
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.
This is exactly what UX designed and recommends. Thanks @zeari
This pull request is not mergeable. Please rebase and repush. |
7015b1c
to
9c7c96d
Compare
9c7c96d
to
beba70d
Compare
@miq-bot remove_label wip |
@zeari Cannot apply the following labels because they are not recognized: topology, providers/containers |
@martinpovolny @himdel PTAL |
beba70d
to
c45c1fa
Compare
Im not sure whats the next step here. right now i just refactored that code into the mixin. |
@martinpovolny @zeari those methods are definitely ugly and must be improved, but if this PR is about just moving some code from one place to another (mixin) I don't think we should block on a technical debt / refactoring. |
:ContainerServices => { :ContainerRoutes => nil } | ||
} | ||
} | ||
} |
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.
@simon3z Do we want to show nodes\Vms in this topology?
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 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.
27279da
to
2fd75cf
Compare
} else { | ||
// search for pattern ^/<controler>/<id>$ in the pathname | ||
type = 'container_topology' |
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.
@zeari @martinpovolny this logic of this functions seems to become a little complex to maintain. Maybe we don't have to keep the old container_topology
path if it's becoming an exception (as you need an extra else
branch).
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.
Correct me if I'm wrong please, but .. isn't it always container_topology
here? We don't really reuse the controller for any other topologies now, do we?
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.
Correct me if I'm wrong please, but .. isn't it always container_topology here? We don't really reuse the controller for any other topologies now, do we?
in this case it could also be container_project_topology
. container_topology
would lead to code from ContainerTopologyService
which generates topology for ems
and not projects.
@zeari @martinpovolny this logic of this functions seems to become a little complex to maintain. Maybe we don't have to keep the old container_topology path if it's becoming an exception (as you need an extra else branch).
in that case we would need the /ems_container/
path to build topology for ems
.
right now there are 3 cases for the url:
- all ems topology (the path
/container_topology/
without an id) - single ems topology (the same but with id -
/ems_container/3 --> "/container_topology/data/3"
) - in this PR: single topology for any entity:
'/container_project/show/21' --> "/container_project_topology/data/21'
2fd75cf
to
db55c81
Compare
// search for pattern ^/<controler>/<id>$ in the pathname - /ems_container/4 | ||
var arr = pathname.match('/(.+)/([0-9]+)'); | ||
type = 'container_topology'; | ||
id = '/' + arr[2] | ||
} | ||
|
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.
db55c81
to
8f4ad1a
Compare
@zeari IIUC the special logic you have in
Is this difference in paths really necessary to keep? So much that it's worth to add special handling logic in the topology? |
@simon3z though the project is going in that direction, I think converting the containers area to 'restful urls' seem is a little big just to satisfy this bit of code 😅 |
@simon3z : we would like to get all the URLs to the "restful" style. But noone is working on that project at this moment imho. I think that unification is a great think but agree that we cannot do everything in one PR. |
@martinpovolny if the plan is to move to the "restful" style, maybe now we have the chance to update the container projects and at the same time avoid extra logic in the topology; it seems worth investigating (unless it's a dramatic change). |
@showtype = "topology" | ||
drop_breadcrumb(:name => @record.name + _(" (Topology)"), | ||
:url => "/#{controller_name}/show/#{@record.id}?display=topology") | ||
end |
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.
we have already show_topology
in EmsCommon. But never mind this can be unified in a follow up PR. But please, use the show_link
to generate the show links so that this works also for restful? == true
.
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.
please, fix the show link
Let's fix the show link, merge this and deal with the rest in follow up PRs. |
8f4ad1a
to
38c6a00
Compare
Checked commit zeari@38c6a00 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 app/helpers/application_helper/toolbar/container_project_view.rb
app/services/container_project_topology_service.rb
app/services/container_topology_service_mixin.rb
|
Fixed |
@miq-bot add_label topology |
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1426229
![screencapture-localhost-3000-container_project-show-7-1484060335913](https://cloud.githubusercontent.com/assets/11256940/21810827/0a357382-d756-11e6-8b95-4e38e4549aee.png)
From projects summary page click on the topology view toggle button:
Land here:
![screencapture-localhost-3000-container_project-show-7-1484060193857](https://cloud.githubusercontent.com/assets/11256940/21810788/dd72875e-d755-11e6-96e9-102ffc7a9d6a.png)
@martinpovolny PTAL, I remember you refactored topology recently
ContainerProjectTopologyService
isContainerTopologyService
with a differentbuild_topology
method but i can throw the shared code into a mixin. I also couldnt get around creatingContainerProjectTopologyController
which is more of the same.toolbar_chooser
to figure out which entities have topology\dashboard views and show the upper right toolbar icons accordingly. Im guessing arole_allows?(:feature => 'topologyview')
cc @simon3z
@miq-bot add_label topology, providers/containers, ui, wip