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

Update dashboard widget styling #728

Merged
merged 1 commit into from
Mar 17, 2017
Merged

Update dashboard widget styling #728

merged 1 commit into from
Mar 17, 2017

Conversation

epwinchell
Copy link
Contributor

This PR updates the styling of the main dashboard widgets with the latest Patternfly Card markup, fixing a bug where the drop-downs in the right column widgets appear off the screen. It also adds PF "empty state" styling for the various widget types when no data is present.

https://bugzilla.redhat.com/show_bug.cgi?id=1426752

Old
screen shot 2017-03-17 at 10 29 32 am

New
screen shot 2017-03-17 at 10 29 03 am

@epwinchell
Copy link
Contributor Author

@miq-bot add_label bug, euwe/no, enhancement, formatting/styling

@epwinchell
Copy link
Contributor Author

@miq-bot assign @dclarizio

@miq-bot
Copy link
Member

miq-bot commented Mar 17, 2017

Checked commit https://github.com/epwinchell/manageiq-ui-classic/commit/f02468a0948fd7ef910f77bf14d3f9cd4630d4d5 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
4 files checked, 4 offenses detected

app/views/dashboard/_widget_blank.html.haml

  • ⚠️ - Line 4 - Prefer to_s over string interpolation.

app/views/dashboard/_widget_chart.html.haml

  • ⚠️ - Line 21 - Tagging a string as html safe may be a security risk, prefer safe_join or other Rails tag helpers instead.

app/views/dashboard/_widget_report.html.haml

  • ⚠️ - Line 12 - Tagging a string as html safe may be a security risk, prefer safe_join or other Rails tag helpers instead.

app/views/dashboard/_widget_rss.html.haml

  • ⚠️ - Line 12 - Tagging a string as html safe may be a security risk, prefer safe_join or other Rails tag helpers instead.

@dclarizio dclarizio merged commit 384a802 into ManageIQ:master Mar 17, 2017
@dclarizio dclarizio added this to the Sprint 57 Ending Mar 27, 2017 milestone Mar 17, 2017
@epwinchell
Copy link
Contributor Author

@miq-bot rm_label euwe/no

@epwinchell
Copy link
Contributor Author

@miq-bot add_label euwe/yes

@simaishi
Copy link
Contributor

@epwinchell Please resolve conflict and create an Euwe-specific PR (referencing this one) or suggest other PRs to backport.

$ git diff
diff --cc app/assets/stylesheets/patternfly_overrides.scss
index 3ce7ccc,de96da5..0000000
--- a/app/assets/stylesheets/patternfly_overrides.scss
+++ b/app/assets/stylesheets/patternfly_overrides.scss
@@@ -101,8 -101,12 +101,17 @@@ li.brand-white-label.whitelabeled 
  
  /* Dashboard overrides */
  
++<<<<<<< HEAD
 +body#dashboard .container-cards-pf {
 +  margin-top: 0;
++=======
+ body#dashboard .blank-slate-pf {
+   padding: 0 !important;
+ }
+ 
+ .blank-slate-pf .pficon-warning-triangle-o:before {
+   color: #9c9c9c;
++>>>>>>> 384a802... Merge pull request #728 from epwinchell/dashboard_update
  }
  
  body#dashboard table {
diff --cc app/views/dashboard/_widget_chart.html.haml
index 3e17a29,e394f91..0000000
--- a/app/views/dashboard/_widget_chart.html.haml
+++ b/app/views/dashboard/_widget_chart.html.haml
@@@ -1,26 -1,28 +1,45 @@@
  -#
    Parameters:
      widget -- MiqWidget instance
++<<<<<<< HEAD
 +- width  ||= 350
 +- height ||= 250
 +.card-pf-body.chart_widget
 +  .mc{:id => "dd_w#{widget.id}_box",
 +    :style => @sb[:dashboards][@sb[:active_db]][:minimized].include?(widget.id) ? 'display:none' : ''}
++=======
+ .mc{:id => "dd_w#{widget.id}_box",
+   :style => @sb[:dashboards][@sb[:active_db]][:minimized].include?(widget.id) ? 'display:none' : ''}
++>>>>>>> 384a802... Merge pull request #728 from epwinchell/dashboard_update
  
-     - if widget.contents_for_user(current_user).contents.blank?
-       = _('No chart data found')
-       \. . .
-     - datum = widget.contents_for_user(current_user).contents
-     - if Charting.data_ok?(datum)
-       -# we need to count all charts to be able to display multiple
-       -# charts on a dashboard screen
-       - WidgetPresenter.chart_data.push(:xml => datum)
-       - chart_index = WidgetPresenter.chart_data.length - 1
-       - chart_data = Charting.deserialized(datum)
+   - if widget.contents_for_user(current_user).contents.blank?
+     .blank-slate-pf{:style => "padding: 10px"}
+       .blank-slate-pf-icon
+         %i.fa.fa-cog
+       %h1= _('No chart data found.')
  
++<<<<<<< HEAD
 +      = chart_local(chart_data,
 +                    :id     => "miq_widgetchart_#{chart_index}".html_safe,
 +                    :width  => width,
 +                    :height => height)
 +    - else
 +      = _('Invalid chart data. Try regenerating the widgets.')
++=======
+   - datum = widget.contents_for_user(current_user).contents
+   - if Charting.data_ok?(datum)
+     -# we need to count all charts to be able to display multiple
+     -# charts on a dashboard screen
+     - WidgetPresenter.chart_data.push(:xml => datum)
+     - chart_index = WidgetPresenter.chart_data.length - 1
+     - chart_data = Charting.deserialized(datum)
+ 
+     = chart_local(chart_data,
+                   :id     => "miq_widgetchart_#{chart_index}".html_safe)
+   - else
+     .blank-slate-pf{:style => "padding: 10px"}
+       .blank-slate-pf-icon
+         %i.pficon.pficon-warning-triangle-o
+       %h1= _('Invalid chart data.')
+       %p= _('Invalid chart data. Try regenerating the widgets.')
++>>>>>>> 384a802... Merge pull request #728 from epwinchell/dashboard_update

@simaishi
Copy link
Contributor

Backported to Euwe via ManageIQ/manageiq#14417

@simaishi
Copy link
Contributor

Backported to Darga via ManageIQ/manageiq#14789

@epwinchell epwinchell deleted the dashboard_update branch October 25, 2017 18:39
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