-
Notifications
You must be signed in to change notification settings - Fork 90
Alternate Label Placement for TrendsCard & TrendsChart #594
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
I believe there needs to be more spacing between the chart and details for the right label position but was having a little trouble manipulating the spacing with CSS. Any suggestions? |
@amarie401 Look at the updates being done for #591 , this will effect your changes. |
@amarie401 do you have the rawgit link for this so we can review the interaction!? |
f20a02d
to
02c487f
Compare
@beanh66 whoops! here it is :) |
Thanks @amarie401! Looks great to me. Just wondering two things: |
@beanh66 in #580 @dtaylor113 suggested adding it to the compact layout because it was very close to what @serenamarie125 had provided in her issue. If it should also be in the "inline" option then I can add it there as well if you want & yes in #591 it is being addressed! :) |
@jeff-phillips-18 @beanh66 It seems that the spacing issue that @dtaylor113 is working on will only affect the spacing for the default "left" placement. I will have to implement something similar for the "right" alternate placement. |
@amarie401 That works for me! I'll leave it up to @serenamarie125 to decide if we need this in the "inline" option too! |
src/charts/trends/trends-chart.html
Outdated
@@ -19,7 +19,7 @@ | |||
</div> | |||
<div ng-switch-when="compact" class="trend-card-compact-pf"> | |||
<div class="row trend-row"> | |||
<div class="col-sm-4 col-md-4"> | |||
<div class="col-sm-4 col-md-4" ng-class="{'col-sm-push-8 col-md-push-8': $ctrl.config.compactLabelPosition === 'right'}"> |
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.
@amarie401 just a callout... as discovered this is going to conflict with @dtaylor113 PR...
src/charts/trends/trends-chart.html
Outdated
@@ -32,7 +32,7 @@ | |||
<span class="trend-header-compact-pf" ng-if="$ctrl.config.title">{{$ctrl.config.title}}</span> | |||
</div> | |||
</div> | |||
<div class="col-sm-8 col-md-8"> | |||
<div class="col-sm-8 col-md-8" ng-class="{'col-sm-pull-4 col-md-pull-4': $ctrl.config.compactLabelPosition === 'right'}"> |
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.
same callout on the conflict...
src/card/examples/card-trend.js
Outdated
@@ -81,9 +84,19 @@ | |||
'layout' : 'compact', | |||
'valueType' : 'actual', | |||
'units' : 'TB', | |||
'tooltipType' : 'percentage' | |||
'tooltipType' : 'percentage', |
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.
oh the trailing comma... though in newer ECMA this is acceptable oddly
@@ -101,7 +102,7 @@ | |||
</div> | |||
</div> | |||
<div class="row"> | |||
<div class="col-md-6"> | |||
<div class="col-md-4"> | |||
<form role="form""> |
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.
oh the double quote quote... was already there, could fix if you want, happened to me too... might want to do a search on the page for any remaining ones
@@ -110,6 +111,19 @@ | |||
</div> | |||
</form> | |||
</div> | |||
<div class="col-md-4" ng-if="config.layout === 'compact'"> | |||
<form role="form""> |
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.
double quote quote
expect(trendCard.hasClass('.col-sm-push-8 .col-md-push-8')); | ||
trendCard = element.find('.col-sm-8 .col-md-8'); | ||
expect(trendCard.hasClass('.col-sm-pull-4 .col-md-pull-4')); | ||
}); |
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.
with @dtaylor113 changes to the classes, combined with yours you'll probably have to fix these
trendCard = element.find('.col-sm-4 .col-md-4'); | ||
expect(trendCard.hasClass('.col-sm-push-8 .col-md-push-8')); | ||
trendCard = element.find('.col-sm-8 .col-md-8'); | ||
expect(trendCard.hasClass('.col-sm-pull-4 .col-md-pull-4')); |
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.
as discussed unit test missing methods...
expect(SOMETHING).toEqual(SOMETHING)
d9dfa02
to
fcd8e6c
Compare
@amarie401 oops I think I looked at the wrong thing or didn't look closely. The value IS already on the right side for the "inline" case :) Sorry! |
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.
LGTM!
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.
LGTM @amarie401 !
Is the rawgit link updated? |
@jeff-phillips-18 it should be. I will update the photos in the PR as well |
@@ -67,7 +67,7 @@ pf-c3-chart { | |||
.col-sm-2 { | |||
padding-right: 0; | |||
} | |||
.col-sm-10 { | |||
.col-sm-10:not(.col-sm-pull-2) { | |||
padding-left: 0; | |||
} |
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 would have expected this check to be on both columns and to do the reverse padding on them. That is, whichever column ends up on the left has a right-padding 0, and whichever ends up on the right has a left-padding of 0.
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.
@jeff-phillips-18 If I change the styling to this then the details is too close to the chart for the right label position as shown below unless I remove the .col-sm-2.col-sm-push-10 { padding-left: 0; }
then the spacing is fine. Should I leave that specific style out?
.trend-card-compact-pf {
.col-sm-2:not(.col-sm-push-10) {
padding-right: 0;
}
.col-sm-2.col-sm-push-10 {
padding-left: 0;
}
.col-sm-10:not(.col-sm-pull-2) {
padding-left: 0;
}
.col-sm-10.col-sm-pull-2 {
padding-right: 0;
}
}
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.
@jeff-phillips-18 what are your thoughts?
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 guess I was assuming the text would be right justified in this layout. If not, then I guess we should leave the spacing as it was.
Looking at the design from http://www.patternfly.org/pattern-library/cards/trend-card/ it doesn't appear that it should be right justified, so my mistake. Sorry for the confusion. |
No worries! @jeff-phillips-18 |
fcd8e6c
to
e30bba8
Compare
@jeff-phillips-18 @cdcabrera please review |
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.
Minor fix, then should be good for my aspect
</label> | ||
</div> | ||
</form> | ||
</div> |
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.
Indentation so it matches the other examples...
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.
Hi, cloned this branch. Trend chart and card LGTM. -thanks
e30bba8
to
afe1aa4
Compare
Description
Support for new layout for trend card & trend chart with label position on the left (default) or right for compact layout. Added new config option for label position. This would close #580
TrendsChart:
https://rawgit.com/amarie401/angular-patternfly/feat-trend-card-dist/dist/docs/index.html#/api/patternfly.charts.directive:pfTrendsChart
TrendsCard:
https://rawgit.com/amarie401/angular-patternfly/feat-trend-card-dist/dist/docs/index.html#/api/patternfly.card.component:pfCard%20-%20Trends
PR Checklist
@serenamarie125 @cshinn @jeff-phillips-18 @dtaylor113 @beanh66