-
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
Angular infra dashboards #1901
Angular infra dashboards #1901
Conversation
75a8e99
to
404a986
Compare
30a9768
to
3fef8cc
Compare
b15fbae
to
25bfb1c
Compare
@himdel please review/suggest how to convert this PR to Angular 2. |
@h-kataria Oh, this looks really close now :) 👍 One note.. you probably can't use Oh, and is As for angular2 .. We would need to make that whole screen (well, the right cell anyway) an Angular 2 app (that should come first, otherwise you can't use the components) .. then those components should be useable via angular.module( 'patternfly.card' ).component('pfAggregateStatusCard', {
bindings: {
status: '=',
showTopBorder: '@?',
altLayout: '@?',
layout: '@?'
},
templateUrl: '/static/pf_charts/aggregate-status-card.html.haml',
controller: function () {
'use strict';
var vm = this;
vm.$onInit = function () {
vm.shouldShowTopBorder = (vm.showTopBorder === 'true');
vm.isAltLayout = (vm.altLayout === 'true' || vm.layout === 'tall');
vm.isMiniLayout = (vm.layout === 'mini');
};
}
}); would become.. @Component({
selector: 'pf-aggregate-status-card',
templateUrl: '/static/pf_charts/aggregate-status-card.html.haml',
inputs: [ 'status', 'showTopBorder', 'altLayout', 'layout' ],
})
class pfAggregateStatusCard {
ngOnInit() {
this.shouldShowTopBorder = (vm.showTopBorder === 'true');
this.isAltLayout = (vm.altLayout === 'true' || vm.layout === 'tall');
this.isMiniLayout = (vm.layout === 'mini');
}
} and that's pretty much it.. :) +- unexpected stuff :) If you wanted to go full typescript right away, you'd also need...
To indicate the types and required/optional for those fields, and to mention it implements the ngOnInit function. Oh.. and templates.. Right now, we can't have an angular2 template in haml - there's a haml extension for angular2, which works with haml but not hamlit.... Alternatively we could use the JS haml-loader and use That's something I need to look into still... If you wanted to do the angular2 version right away, the only option is html, not haml. (Unless the only logic in that template is IMO it still feels like we're not quite there yet with angular2 and I'd rather merge this as an angular 1 dashboard that works, but if it can wait... (Or if you want to solve those issues yourself :).) |
@himdel can you please point out which id were you referencing to in your comment. About your comment on usage of |
1459d4e
to
ccca920
Compare
@martinpovolny @himdel i would like to get this PR merged and do any other suggested changes as a follow up PR, please review/merge. |
@h-kataria sorry for the delay..
Every time you write So.. But looks like you found them all .. only https://github.com/ManageIQ/manageiq-ui-classic/pull/1901/files#diff-1089af45db5ae37204a2abb2310cf1b0R8 remains :).
I mean, it's OK to use them :). I was just concerned we're creating new components and pretending they're from patternfly.. but not a blocker either way :). |
But! The QE would be actually happy if you created some IDs that would have a relation to the entities being displayed. Such as Ping @mfalesni |
1e3768e
to
58e6f50
Compare
@martinpovolny addressed your comment regarding adding ids for each component |
@h-kataria : just glanced over the CC issues, many are trivial to fix. |
- Changed dashboard service calls to send up individual calls to build charts - some code cleanup to remove dummy heatmap data setup https://www.pivotaltracker.com/story/show/150048620
And other components that are needed to show Global Utilization charts: c3Chart, donutChart, donutPctChart, sparklineChart components along with their counterpart controllers, templates etc.
And Line chart component and related controllers, template, views to display Recent Hosts & Recent VMs line charts.
- Removed unused old code and moved files appropriately under ems_infra_dashboard directory - Addressed some rubocop warning in ems_infra_dashboard_service https://www.pivotaltracker.com/story/show/150048620
Addressed syntax related code climate warnings that were brought over by downloading patternfly components from patternfly repo. https://www.pivotaltracker.com/story/show/147962059
Added unique id for each component that can be referenced in QE tests https://www.pivotaltracker.com/story/show/147962059
- Added .catch to all API/http request calls. https://www.pivotaltracker.com/story/show/147962059
7465f68
to
9fcd199
Compare
@h-kataria I've found the source of the bug... previously, Now, only (And yes, this could be considered a PF bug, but right now, we have to fix it :).) |
Added loadingDone checks to make sure to load charts once data is available https://www.pivotaltracker.com/story/show/147962059
@himdel thx for your help on getting |
@martinpovolny Could you have a look at what needs to be done to make the charts resize inside the cards like the main dashboard and cap & u charts? (The donut charts may be an exception) Thanks. |
I searched the history and believe that what I did is gone with the last bits of jqplot. It must have been somehow redone for C3, but that was not me (or I don't remember). Ping @PanSpagetka, Robin, can you answer this, please? |
Checked commits h-kataria/manageiq-ui-classic@e9b3ee8~...d663770 with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0 app/views/ems_infra/_aggregate-status-card.html.haml app/views/ems_infra/_heatmap.html.haml
app/views/ems_infra/_recent-hosts-line-chart.html.haml
app/views/ems_infra/_recent-vms-line-chart.html.haml
app/views/ems_infra/_utilization-trend-chart.html.haml
app/views/static/pf_charts/aggregate-status-card.html.haml
app/views/static/pf_charts/donut-pct-chart.html.haml
app/views/static/pf_charts/utilization-trend-chart.html.haml |
so..another round of ui testing..
EDIT: but it matches the PF style 👍
EDIT: black is right, the the icon being always visible makes more sense anyway 👍
EDIT: but deployment role is the same thing as cluster, except different name
EDIT: but does not break anything 👍
EDIT: this is caused by the difference in date range .. |
@himdel This is correct Patternfly. Containers, specifically styled theirs blue. https://rawgit.com/patternfly/patternfly/master-dist/dist/tests/cards.html |
So, any remaning problems are not really that important, merging.. |
$q.all([promiseProviderData]).then(function() { | ||
vm.status = { | ||
// "title": vm.provider.name, | ||
"iconImage": "/assets/svg/vendor-" + getIcon(vm.provider.type) + ".svg", |
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 does not work outside the development enrionment.
Image paths must be created using the image_path
helper, ruby-side
(noticed the same problem in #3806)
BEFORE:
![infra_dashboard_before1](https://user-images.githubusercontent.com/3450808/31345040-839a8cb4-ace2-11e7-97d0-70ad900d7228.png)
![infra_dashboard_before2](https://user-images.githubusercontent.com/3450808/31345044-85845370-ace2-11e7-8bee-30c6cf490750.png)
AFTER:
![infra_dashboard_after_styling](https://user-images.githubusercontent.com/3450808/31503008-7fb733c0-af3c-11e7-93b2-f2f4e27684fa.png)
https://www.pivotaltracker.com/story/show/147962059