-
Notifications
You must be signed in to change notification settings - Fork 911
Replace ruby generated toolbar with angular's #9753
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
Conversation
@miq-bot add_label wip ui |
@karelhala Cannot apply the following label because they are not recognized: wip ui |
@miq-bot add_label wip, ui |
@karelhala Cannot apply the following label because they are not recognized: wip ui |
The general goal here is to use observables and observers to communicate between toolbars, GTL lists and other components. One example of that communication is the enabling/disabling of buttons based on selection in the GTL lists. Another example is the changing of the layout of the GTL component in reaction on clicking the view toolbar buttons. Sure, there are more to come. The toolbars will be downloaded in JSON by the client or send as part of JSON messages throught the ExplorerPresenter and similar and processed by ManageIQ.explorer or simillar. |
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
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.
collect returns a list, no need to do push
a25ca75
to
caff549
Compare
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.
gtl
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
c681a5b
to
38fb6c2
Compare
@martinpovolny I dug deeply and found that it's not possible to have multiple ng-app elements on page, but we don't have to rely only on default angular's bootstrap mechanism as described in docs ngApp we can use angular.bootstrap. However there is warning that angular team does not test this and we should pay attention when using manual bootstrapping Things to keep in mind. But I tried it and clicked trough couple of pages in MiQ and it worked good (even with So I think it's good to go, we can test it and see if anything gets broken. I believe I have changed all toolbars to use |
@karelhala Kinda expected that |
is it safe to take the direction which is declared as untested by Angular dev team? |
@abonas Not much choice, the alternative would involve even less tested approaches, until we can get rid of RJS. (Would probably need to pass every |
63d9703
to
947817c
Compare
Okay clicked trough couple of pages (topology, dashboard, normal gtl pages, detail pages, etc.) and it seems good to go. However it would be nice if someone else tried it (I don't know MiQ that well and that deep as you guys). So removing WIP and you can review the code. |
@miq-bot remove_label wip |
when explorer got refreshed toolbar didn't reacted properly to this. We have to send JSON object instead of HTML string and update toolbar based on this object. When in compare mode, we want to see two state buttons, similiar behaving as buttons.
dashboard toolbar is secified in custom html file, so we have to use render partial and this html string insert to JSON response so we can use angular's toolbars
when switching views in explorer ajax call instead of pure redirect needs to be called. Images in toolbar lists are fetched from ruby and inserted to JSON object Remove nested toolbar-pf-actions from dashboard Add missing property to test case for toolbar builder
use different image_path to determine image_url
851b259
to
e448d6e
Compare
Updated bower.json to use newest version of ui-components. If no-one has any other complaints it's good to go from my side. |
Checked commits karelhala/manageiq@e416daa~...e448d6e with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 |
@dclarizio Tested. Looks good. |
we keep the toolbar wrapping margin fix, and remove the resulting double margin by forcing toolbar-pf-actions' bottom margin to 0 .. and remove duplicate css introduced in ManageIQ#9753
As we were talking @martinpovolny here is approach of angular's toolbar.
No need to change anything in current ui or ruby backend. Every toolbar generation in
app/views/lauouts/_content.html.haml
contains generating of toolbar via javascript.Settings is generated in render phase to JSON (this way we don't have to add any context variables when fetching toolbar object). However we should switch to AJAX later down the line so we can have dynamic toolbars (will be needed once we will move to ui-router since rendering of htmls will no longer be part of ruby).
Removed jquery click function, because it did not bound to toolbar properly every time (.click function does not check if any new elements are added), but rather used on-click in angular world and call
miqToolbarOnClick(event)
ofmiq_application.js
from angular.We had to use custom generated toolbars from hawkular-ui-components because we have need for custom html passed along side with selectboxes and buttons. So any changes to look and feel should be done in ui-components (leader of this package is @mtho11 so contact him if new version is needed).