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

1.0: paper-progress-linear #277

Merged
merged 8 commits into from
Feb 5, 2016
Merged

Conversation

peec
Copy link
Contributor

@peec peec commented Feb 4, 2016

Update code-style, docs and unit -> integration test.

@peec peec added the v1.0.0 label Feb 4, 2016
@peec peec added this to the 1.0 milestone Feb 4, 2016
@miguelcobain
Copy link
Collaborator

Could you please add more test cases like the ones here:
https://github.com/angular/material/blob/v1.0.4/src%2Fcomponents%2FprogressLinear%2Fprogress-linear.spec.js

Or maybe inspired by paper-progress-circular ones. I feel this component is still poorly tested.

Let's ignore accessibility for now. We'll deal with that in a separate issue.

@@ -1,5 +1,7 @@
import Ember from 'ember';
import ColorMixin from 'ember-paper/mixins/color-mixin';
const {inject, computed, Component, isPresent} = Ember;
Copy link
Collaborator

Choose a reason for hiding this comment

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

to conform with other stlyes, please add spaces around declarations.

const { inject, computed, Component, isPresent } = Ember;

Sorry for this. We need to add decent jscs support in the project.

@miguelcobain
Copy link
Collaborator

Also, we currently have a problem with component attributes. We have both dash-attr and camelAttr currently. That is inconsistent.

I'll discuss this with ember folks at slack.
I'm inclined to camelAttr. If that ends to become the decided format, we should change buffer-value to bufferValue and document this in the CHANGELOG.

Thank you so much for this, @peec.


init() {
this._super(...arguments);
this.setupTransforms();
},

mode: Ember.computed('value', function() {
mode: computed('value', function() {
var value = this.get('value');
var bufferValue = this.get('buffer-value');
Copy link
Collaborator

Choose a reason for hiding this comment

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

We're now using let instead of var, expect for constants.

assert.equal(this.$('md-progress-linear').attr('md-mode'), 'buffer');
});

test('should auto-set the md-mode to "buffer" if a value and bufferValue is specified', function(assert) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Duplicated test?

}),

bar2Style: Ember.computed('clampedValue', function() {
bar2Style: computed('clampedValue', function() {

if (this.get('mode') === 'query') {
Copy link
Collaborator

Choose a reason for hiding this comment

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

test against MODE_QUERY constant.

clampedValue: Ember.computed('value', function() {

var value = this.get('value');
clampedValue: computed('value', function() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here is a much cooler way to clamp values: https://github.com/miguelcobain/ember-paper/blob/wip/v1.0.0/addon%2Fcomponents%2Fpaper-progress-circular.js#L29-L32

I'll make this a computed macro in the future.
Can you change both cps here to clamp using similar code?

@miguelcobain
Copy link
Collaborator

Perfect. Let's just wait for some input on dash-attr vs camelAttr.
What are your thoughts on that?

@peec
Copy link
Contributor Author

peec commented Feb 4, 2016

@miguelcobain Yes I agree, best to follow the ember-way on attribute naming, if they have suggestions

@peec
Copy link
Contributor Author

peec commented Feb 5, 2016

@miguelcobain I will merge this as it holds up my wip/v1.0.0 branch (should have branched it to wip/v1.0.0/paper-progress-linear instead). And we can discuss further in issue of wip1.0.0 i guess ?

peec added a commit that referenced this pull request Feb 5, 2016
1.0: paper-progress-linear
@peec peec merged commit 6c95e0c into adopted-ember-addons:wip/v1.0.0 Feb 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants