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

Containers Provider Dashboard conversion to use Angular/PF components #2499

Merged
merged 17 commits into from Jul 27, 2018

Conversation

h-kataria
Copy link
Contributor

@h-kataria h-kataria commented Oct 24, 2017

@miq-bot
Copy link
Member

miq-bot commented Oct 25, 2017

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

@miq-bot
Copy link
Member

miq-bot commented Dec 4, 2017

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

@epwinchell
Copy link
Contributor

epwinchell commented Jan 22, 2018

@martinpovolny @himdel I recall we left off with this, wondering if the charts could be dynamically resized like the main dashboard. We'd like to do the same thing for all of the new angular dashboards. Is that something you could look at?

I see for Cap & U it is handled here: https://github.com/ManageIQ/manageiq-ui-classic/blob/master/app/assets/javascripts/miq_c3.js

screen shot 2018-01-22 at 5 09 37 pm

@h-kataria h-kataria force-pushed the containers_dashboard branch 2 times, most recently from 07aa2d2 to 6da4a1d Compare January 24, 2018 21:02
@h-kataria h-kataria changed the title [WIP] - Containers Provider Dashboard conversion to use Angular/PF components Containers Provider Dashboard conversion to use Angular/PF components Jan 24, 2018
@h-kataria
Copy link
Contributor Author

@epwinchell please review commit with styling changes, i hope i didn't miss any from the patch you sent me.

@epwinchell
Copy link
Contributor

@h-kataria Tested. Looks fine.

@miq-bot
Copy link
Member

miq-bot commented Jan 30, 2018

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

@h-kataria
Copy link
Contributor Author

@himdel can you please review, let me know if this is still a valid/acceptable way to move forward with dashboard componentization work.

@h-kataria
Copy link
Contributor Author

@himdel please review, would be good before more of similar ones get merged and are being worked on, another one in this area is #3427

@h-kataria h-kataria force-pushed the containers_dashboard branch 2 times, most recently from 0429c8f to 3c6a37a Compare February 27, 2018 18:51
@h-kataria
Copy link
Contributor Author

@himdel please take a look, i have fixed the aggregate status card to show total counts/link of Providers on Containers Dashboard. This PR only affects All Containers Dashboard and individual Container Provider dashboard, all charts before/after on the above mentioned 2 types of dashboards look same to me. The only difference is layouts of charts which is intentional, goal is to keep all charts to same size so when we introduce drag/drop feature in future it wont cause any issues with regards to layouts.

@h-kataria
Copy link
Contributor Author

Containers Dashboard:
before:
before

after:
screenshot from 2018-07-26 13-34-05

Container Provider Dashboard:
before:
before2

after:
screenshot from 2018-07-26 13-33-41

@himdel
Copy link
Contributor

himdel commented Jul 27, 2018

The only difference is layouts of charts which is intentional, goal is to keep all charts to same size so when we introduce drag/drop feature in future it wont cause any issues with regards to layouts.

Aah, makes sense, thanks :).

Taking another look..

@himdel
Copy link
Contributor

himdel commented Jul 27, 2018

Issue I can still see:

  • container detail - network utilization trend missing a chart - sometimes

  • container detail - provider missing name

  • container detail - node utilization has no data (looking why, your screenshot looks fine)

  • container detail - numbers in alerts have wrong font (and the number should be there twice?)

  • dashboard - network utilization trend missing a chart - sometimes

  • dashboard - numbers with providers and alert have wrong font

  • dashboard - node utilization has no data (looking why, your screenshot looks fine)

EDIT: missing node utilization was a local problem, old metrics
EDIT2: network utilization trend ... sometimes it displays the chart, sometimes it doesn't, reloading can change it, so likely a timing problem

@himdel
Copy link
Contributor

himdel commented Jul 27, 2018

Oh, but the network utilization trend issue is probably easy, I can see an error in the console:

angular.self-4d4ad11d5ffcf4b45937b602ad6794ec0402cf414a488a6e28edf2a00bb8370c.js:14801 TypeError: Cannot read property 'layout' of undefined
    at trendsChartController.vm.updateAll (trends-chart.component.self-15211e0b82fd6c4300f468726085cf159aafb86322fe040f0353edfaad30e661.js:27)
    at trendsChartController.vm.$onChanges (trends-chart.component.self-15211e0b82fd6c4300f468726085cf159aafb86322fe040f0353edfaad30e661.js:59)
    at angular.self-4d4ad11d5ffcf4b45937b602ad6794ec0402cf414a488a6e28edf2a00bb8370c.js:9960
    at forEach (angular.self-4d4ad11d5ffcf4b45937b602ad6794ec0402cf414a488a6e28edf2a00bb8370c.js:417)
    at nodeLinkFn (angular.self-4d4ad11d5ffcf4b45937b602ad6794ec0402cf414a488a6e28edf2a00bb8370c.js:9956)
    at angular.self-4d4ad11d5ffcf4b45937b602ad6794ec0402cf414a488a6e28edf2a00bb8370c.js:10348
    at processQueue (angular.self-4d4ad11d5ffcf4b45937b602ad6794ec0402cf414a488a6e28edf2a00bb8370c.js:17170)
    at angular.self-4d4ad11d5ffcf4b45937b602ad6794ec0402cf414a488a6e28edf2a00bb8370c.js:17218
    at Scope.$digest (angular.self-4d4ad11d5ffcf4b45937b602ad6794ec0402cf414a488a6e28edf2a00bb8370c.js:18353)
    at Scope.$apply (angular.self-4d4ad11d5ffcf4b45937b602ad6794ec0402cf414a488a6e28edf2a00bb8370c.js:18650)
(anonymous) @ angular.self-4d4ad11d5ffcf4b45937b602ad6794ec0402cf414a488a6e28edf2a00bb8370c.js:14801
angular.self-4d4ad11d5ffcf4b45937b602ad6794ec0402cf414a488a6e28edf2a00bb8370c.js:14801 TypeError: Cannot read property 'layout' of undefined
    at trendsChartController.vm.getChartHeight (trends-chart.component.self-15211e0b82fd6c4300f468726085cf159aafb86322fe040f0353edfaad30e661.js:52)
    at fn (eval at compile (angular.self-4d4ad11d5ffcf4b45937b602ad6794ec0402cf414a488a6e28edf2a00bb8370c.js:15652), <anonymous>:4:184)
    at initializeBinding (angular.self-4d4ad11d5ffcf4b45937b602ad6794ec0402cf414a488a6e28edf2a00bb8370c.js:10733)
    at forEach (angular.self-4d4ad11d5ffcf4b45937b602ad6794ec0402cf414a488a6e28edf2a00bb8370c.js:417)
    at initializeDirectiveBindings (angular.self-4d4ad11d5ffcf4b45937b602ad6794ec0402cf414a488a6e28edf2a00bb8370c.js:10640)
    at nodeLinkFn (angular.self-4d4ad11d5ffcf4b45937b602ad6794ec0402cf414a488a6e28edf2a00bb8370c.js:9943)
    at angular.self-4d4ad11d5ffcf4b45937b602ad6794ec0402cf414a488a6e28edf2a00bb8370c.js:10348
    at processQueue (angular.self-4d4ad11d5ffcf4b45937b602ad6794ec0402cf414a488a6e28edf2a00bb8370c.js:17170)
    at angular.self-4d4ad11d5ffcf4b45937b602ad6794ec0402cf414a488a6e28edf2a00bb8370c.js:17218
    at Scope.$digest (angular.self-4d4ad11d5ffcf4b45937b602ad6794ec0402cf414a488a6e28edf2a00bb8370c.js:18353)
(anonymous) @ angular.self-4d4ad11d5ffcf4b45937b602ad6794ec0402cf414a488a6e28edf2a00bb8370c.js:14801

.spinner.spinner-lg.loading{"ng-if" => "!vm.loadingDone"}
.row
.col-xs-12.col-sm-12.col-md-12.col-lg-6.example-heatmap-container{"ng-repeat" => "(key, data) in vm.data"}
%pf-heatmap{'ng-attr-id' => "{{data[0].id}}", "chart-title" => "key", "data" => "data", "chart-data-available" => "vm.dataAvailable", "show-legend" => "vm.showLegends", "legend-labels" => "vm.legendLabels", "max-block-size" => "20", "block-padding" => "5", "heatmap-color-pattern" => "vm.heatmapColorPattern", "thresholds" => "vm.thresholds", "click-action" => "vm.clickAction", "loading-done" => true}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"chart-data-available" => "vm.dataAvailable"

I think that's the problem - dataAvailable is true before the loading is done .. looks like you may want to use vm.dataAvailable && vm.loadingDone here?

@himdel
Copy link
Contributor

himdel commented Jul 27, 2018

As for the font problem, that looks like a bug in the existing app/views/static/pf_charts/aggregate-status-card.html.haml: The element with a fonticon class should never have text descendants, only siblings.

Soo..

diff --git a/app/views/static/pf_charts/aggregate-status-card.html.haml b/app/views/static/pf_charts/aggregate-status-card.html.haml
index ab86948cf..422cf8d21 100644
--- a/app/views/static/pf_charts/aggregate-status-card.html.haml
+++ b/app/views/static/pf_charts/aggregate-status-card.html.haml
@@ -23,12 +23,12 @@
         %a{:href => "{{notification.href}}", "ng-if" => "notification.href"}
           %image{"ng-if" => "notification.iconImage", "ng-src" => "{{notification.iconImage}}", :alt => "", :class => "card-pf-icon-image"}
           %span{:class => "{{notification.iconClass}}"}
-            {{ notification.count }}
+          {{ notification.count }}
 
         %span{"ng-if" => "!notification.href"}
           %image{"ng-if" => "notification.iconImage", "ng-src" => "{{notification.iconImage}}", :alt => "", :class => "card-pf-icon-image"}
           %span{:class => "{{notification.iconClass}}"}
-            {{ notification.count }}
+          {{ notification.count }}
 
 %div{"ng-if" => "$ctrl.isMiniLayout", :class => "card-pf card-pf-aggregate-status card-pf-aggregate-status-mini", "ng-class" => "{'card-pf-accented': $ctrl.shouldShowTopBorder}"}
   %h2{:class => "card-pf-title"}

Should be closer

@himdel
Copy link
Contributor

himdel commented Jul 27, 2018

Indeed, looks like with those 2 changes (aggregate and loadingDone):

  • alerts looks good
  • there is no console error
  • network utilization trend always shows up :)

@h-kataria
Copy link
Contributor Author

@himdel, i will implement your suggestions and push those up in a few mins.

@h-kataria
Copy link
Contributor Author

@himdel for container detail - provider missing name -It has been a long time since this PR was created but as far as i remember removing the name was intentional as the name is already available in the breadcrumbs
screenshot from 2018-07-27 09-09-32

@h-kataria
Copy link
Contributor Author

@himdel for container detail - numbers in alerts have wrong font (and the number should be there twice?) - it doesn't make sense to show same data/numbers twice on the card.

Fixed heatmap loading so it loads charts everytime properly.
@miq-bot
Copy link
Member

miq-bot commented Jul 27, 2018

Checked commits h-kataria/manageiq-ui-classic@b630035~...c369f5c with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
15 files checked, 1 offense detected

**

  • 💣 💥 🔥 🚒 - Linter/Haml - Linter::Haml STDERR:
warning: parser/current is loading parser/ruby23, which recognizes
warning: 2.3.6-compliant syntax, but you are running 2.3.3.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.

@h-kataria
Copy link
Contributor Author

@himdel pushed a commit with suggested changes, all charts seem to be loading fine for me with the data i have. jest spec test failure seems to be unrelated to my changes.

@himdel
Copy link
Contributor

himdel commented Jul 27, 2018

Agreed, seeing the same thing :)

I think we're ready, sorry it took so long :).

Confirming the jest failure is unrelated - #4371.

@himdel himdel merged commit 5763edb into ManageIQ:master Jul 27, 2018
@himdel himdel added this to the Sprint 91 Ending Jul 30, 2018 milestone Jul 27, 2018
@h-kataria
Copy link
Contributor Author

@himdel thx for the merge.

@@ -1,145 +0,0 @@
angular.module('miq.util').factory('chartsMixin', ['$document', function($document) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for keeping this empty file?

@@ -1,4 +1,4 @@
angular.module('miq.util').factory('containerChartsMixin', ['pfUtils', function(pfUtils) {
Copy link
Member

@felipedf felipedf Jul 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we are using this file over ems_common/charts-mixin, that correct? because I noticed that this file is missing few configs that were present on the older one.

Copy link
Contributor

@himdel himdel Jul 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chartsMixin should be preferred. If this PR removed chartsMixin and replaced it with an older version, that's a mistake (bad rebase I'd guess?).

(But looks like we had 2 versions already for some reason - mixins/charts-mixin and ems_common/charts-mixin. All of those should definitely be unified.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right @himdel, I've heard about plans to unify the container with the other providers, so I won't touch it 😅, will just rollback the chartsMixin

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @felipedf .. feel free to touch it enough so that you don't see any more breakages ;)

I'd love to unify these more, but.. obviously not breaking stuff is more important :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok @himdel will try to help whenever I can (:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I guess it was exactly what @h-kataria did here, container_dashboard/util/charts-mixin was merged with the older chartsMixin but some configs might me lost in the between, will just update the new chartsMixin.

can confirm that @h-kataria ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@felipedf apologies if during all the back and forth rebasing i missed/lost some piece of code, let me know i will be happy to help with recovering those.

Copy link
Member

@felipedf felipedf Jul 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@h-kataria it is fine 😄
I got it all working just fine now.. I was confused after pulling from master and ending up with 3 charts-mixin in my local.. i was like LOL 😅

@h-kataria h-kataria deleted the containers_dashboard branch October 24, 2018 22:08
Hyperkid123 pushed a commit to Hyperkid123/manageiq-ui-classic that referenced this pull request Jun 11, 2019
the file is empty, and never referenced

(emptied and last reference removed in ManageIQ#2499)
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.

None yet

6 participants