Skip to content

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

Merged
merged 1 commit into from
Aug 28, 2017

Conversation

amarie401
Copy link
Contributor

@amarie401 amarie401 commented Aug 24, 2017

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

  • Unit tests are included
  • Screenshots are attached (if there are visual changes in the UI)
  • A Designer (@beanh66) is assigned as a reviewer (if there are visual changes in the UI)
  • A CSS rep (@cshinn) is assigned as a reviewer (if there are visual changes in the UI)

screen shot 2017-08-25 at 5 26 12 pm

screen shot 2017-08-25 at 5 29 04 pm

@serenamarie125 @cshinn @jeff-phillips-18 @dtaylor113 @beanh66

@amarie401
Copy link
Contributor Author

amarie401 commented Aug 24, 2017

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?

@jeff-phillips-18
Copy link
Member

@amarie401 Look at the updates being done for #591 , this will effect your changes.

@beanh66
Copy link
Member

beanh66 commented Aug 24, 2017

@amarie401 do you have the rawgit link for this so we can review the interaction!?

@beanh66
Copy link
Member

beanh66 commented Aug 24, 2017

Thanks @amarie401! Looks great to me. Just wondering two things:
1 - Is this spacing bug being addressed outside of this PR (I assume yes)
2 - Should the radio button option for putting the value on the right instead of left also be available when looking at the "Inline" option? I noticed it only appears with the "Compact" option as of now, but just curious!

@amarie401
Copy link
Contributor Author

amarie401 commented Aug 24, 2017

@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! :)

@amarie401
Copy link
Contributor Author

amarie401 commented Aug 25, 2017

@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.

@beanh66
Copy link
Member

beanh66 commented Aug 25, 2017

@amarie401 That works for me! I'll leave it up to @serenamarie125 to decide if we need this in the "inline" option too!

@@ -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'}">
Copy link
Member

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...

@@ -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'}">
Copy link
Member

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...

@@ -81,9 +84,19 @@
'layout' : 'compact',
'valueType' : 'actual',
'units' : 'TB',
'tooltipType' : 'percentage'
'tooltipType' : 'percentage',
Copy link
Member

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"">
Copy link
Member

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"">
Copy link
Member

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'));
});
Copy link
Member

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'));
Copy link
Member

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)

@amarie401 amarie401 force-pushed the feat-trend-card branch 4 times, most recently from d9dfa02 to fcd8e6c Compare August 25, 2017 18:42
@beanh66
Copy link
Member

beanh66 commented Aug 25, 2017

@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!

Copy link
Member

@beanh66 beanh66 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@serenamarie125 serenamarie125 left a comment

Choose a reason for hiding this comment

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

LGTM @amarie401 !

@jeff-phillips-18
Copy link
Member

Is the rawgit link updated?

@amarie401
Copy link
Contributor Author

amarie401 commented Aug 25, 2017

@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;
}
Copy link
Member

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.

Copy link
Contributor Author

@amarie401 amarie401 Aug 25, 2017

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;
  }
}

screen shot 2017-08-25 at 6 04 30 pm

Copy link
Contributor Author

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?

Copy link
Member

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.

@jeff-phillips-18
Copy link
Member

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.

@amarie401
Copy link
Contributor Author

No worries! @jeff-phillips-18

@amarie401
Copy link
Contributor Author

@jeff-phillips-18 @cdcabrera please review

Copy link
Member

@cdcabrera cdcabrera left a 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>
Copy link
Member

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...

Copy link
Member

@dtaylor113 dtaylor113 left a 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

@cdcabrera cdcabrera merged commit 4207e65 into patternfly:master Aug 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for new layout for Trend Card
6 participants