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

Timepicker on the right #11980

Merged
merged 12 commits into from
Jun 9, 2017
Merged

Timepicker on the right #11980

merged 12 commits into from
Jun 9, 2017

Conversation

nreese
Copy link
Contributor

@nreese nreese commented May 24, 2017

Fixes #4785

timepicker

Part the PR involves moving the timepicker quick, relative, and absolute panels from the timepicker directive into separate directive's.

@nreese nreese requested review from cjcenizal and stacey-gammon May 24, 2017 05:15
@stacey-gammon
Copy link
Contributor

stacey-gammon commented May 24, 2017

Hmm, maybe just because I'm used to it, but it looks a little weird to me right aligned. Also, every other panel we have is left aligned so now this one is different. Ultimately I'll leave it up to the design team though.

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

Looks great man! I think this is a much better UX. It's much easier/faster to change the time now. I just had some requests for changing some classes to use UI Framework components.

</div>
</div>

<input type="text" required class="form-control" input-datetime="{{format}}" ng-model="absolute.from">
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we change this class to kuiTextInput fullWidth?

</div>

<span ng-show="!absolute.to"><em>Invalid Date</em></span>
<input type="text" required class="form-control" input-datetime="{{format}}" ng-model="absolute.to">
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here.

greater-than="-1"
min="0"
type="number"
class="form-control fullWidth">
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we change this class to kuiTextInput fullWidth?

</div>

<div class="kuiFieldGroup kuiVerticalRhythmSmall">
<div class="kuiFieldGroupSection kuiFieldGroupSection--wide" ng-class="{ 'has-error': checkRelative() }">
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of the ng-class here, can we put it on the input instead?

<input
  ng-class="{ 'kuiTextInput-isInvalid' : checkRelative() }"
  etc...
>

You will need to rebase master to make this class available though, since I just added it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Putting ng-class inside the input causes some problems. When you are editing the input, it is styled for having focus. As soon as the user puts in a value that causes checkRelative to flag an error than the error message appears but the input styling does not change. The input styling only shows the red border after the input looses focus.

ng-model="relative.from.unit"
ng-options="opt.value as opt.text for opt in relativeOptions"
ng-change="formatRelative({key:'from'})"
class="form-control fullWidth">
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we change this class to kuiSelect fullWidth?

class="form-control fullWidth">
</div>

<div class="kuiFieldGroupSection" ng-class="{ 'has-error': checkRelative() }">
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we move this ng-class to the select, but assign kuiSelect-isInvalid instead of has-error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Setting kuiSelect-isInvalid on the select does not visually effect the select styling.

</div>

<div class="kuiVerticalRhythmSmall">
<label>
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use the kuiCheckBox class here, with the relevant markup for making sure the label is clickable. In the UI Framework, the example looks like this:

<label class="kuiCheckBoxLabel">
  <input
    class="kuiCheckBox"
    type="checkbox"
  >
  <span class="kuiCheckBoxLabel__text">
    With clickable label
  </span>
</label>

greater-than="-1"
min="0"
type="number"
class="form-control fullWidth">
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comments as above for this input

ng-model="relative.to.unit"
ng-options="opt.value as opt.text for opt in relativeOptions"
ng-change="formatRelative({key:'to'})"
class="form-control fullWidth">
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comments as above for this select

</div>

<div class="kuiVerticalRhythmSmall">
<label>
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comments as above for this checkbox

@stacey-gammon
Copy link
Contributor

You may need to do some trimming of whitespace to get the tests to pass:

Chrome 58.0.3029 (Linux 0.0.0) timepicker directive relative mode has a preview of the "from" input FAILED
	Error: expected '\n          January 1st 2014, 05:51:06.666\n        ' to equal 'January 1st 2014, 05:51:06.666'
	    at Assertion.assert (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:437228:14)
	    at Assertion.be.Assertion.equal (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:437348:11)
	    at Assertion.(anonymous function) [as be] (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:437201:25)
	    at Context.<anonymous> (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:456778:49)
Chrome 58.0.3029 (Linux 0.0.0): Executed 146 of 829 (1 FAILED) (0 secs / 1.016 secs)
Chrome 58.0.3029 (Linux 0.0.0) timepicker directive relative mode has a disabled "to" field that contains "Now" FAILED
	Error: expected '\n          Now\n        ' to equal 'Now'

Other than that and @cjcenizal's comments, looks good! Love the refactoring & clean up!

@nreese nreese force-pushed the timepicker-on-right2 branch 2 times, most recently from b4a0a9a to c8f5de3 Compare June 2, 2017 21:07
@nreese nreese dismissed cjcenizal’s stale review June 5, 2017 14:23

Made changes but github did not reflect that all comments have been addressed

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

Just had two minor suggestions and then it LGTM!

@@ -8,7 +16,30 @@
}
.kbn-timepicker-section {
float: left;
padding: 0px 15px;
padding-right: 15px;
Copy link
Contributor

Choose a reason for hiding this comment

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

We can make each column the same width, and also remove the unnecessary padding from the last column by changing these styles:

  .kbn-timepicker-section {
    float: left;
    width: 25%;

    & + .kbn-timepicker-section {
      padding-left: 15px;
    }
  }

image

display: flex;
align-items: center;
}
.nav > li > a {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we just use a class here instead? E.g. .kbn-timerpicker-nav-button?

nreese and others added 11 commits June 9, 2017 09:11
…youts all occupy the same bounds (#1)

* Adjust markup and styles so that the Quick, Relative, and Absolute layouts all occupy the same bounds, so the content doesn't jump around as you switch modes..

* Make kbn-timepicker-content responsive so that it stacks content on narrower screens.

* Combine Relative input and select fields using kuiFieldGroup.

* Make Timepicker submit button wider.

* Align button on right.
@nreese nreese force-pushed the timepicker-on-right2 branch from a262ca3 to e7c9861 Compare June 9, 2017 15:12
@lukasolson
Copy link
Member

Thanks for taking this on, @nreese! Awesome to see this broken up into separate modules and cleaned up 😄

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