-
Notifications
You must be signed in to change notification settings - Fork 25
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
Internal update to fit ember-frost-object-browser #69
Conversation
Changes Unknown when pulling 0c8a24d on quincyle:lts-rework-ob into * on ciena-frost:master*. |
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 need some context on a few of the decisions (defaultHeight, sortItems action behaviour)
@@ -39,7 +36,6 @@ const FrostList = Component.extend(PropTypeMixin, { | |||
}, | |||
|
|||
alwaysUseDefaultHeight: false, | |||
defaultHeight: 45, |
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.
Is this no longer necessary (and why)? Also, if it's still a useful mechanism, can it be set from the component interface?
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 put it here original to fix a s&m regression, and now it looks ok without it after I update the s&m from 0.4.x to 0.5.x, instead it produces a wired css issue. There's still a chain in template that user can set defaultHeight
via component interface.
@@ -44,12 +44,12 @@ export default Mixin.create(FrostListSelectionMixin, FrostListExpansionMixin, Fr | |||
) | |||
}), | |||
|
|||
listMixinConfig: Ember.computed('activeSorting', 'sortableProperties', 'sortedItems.[]', function () { | |||
listMixinConfig: Ember.computed('activeSorting', 'sortableProperties', 'statefulListItems.[]', function () { | |||
let activeSorting = this.get('activeSorting') |
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.
These let
s aren't necessary, the get can be put directly into the return object
this.set('activeSorting', activeSorting) | ||
let normalizedSortProperties = normalizeSort(filteredSortProperties) | ||
const dataKey = this.get('listConfig.items') | ||
this.set(dataKey, listDefaultSort(this.get(dataKey), normalizedSortProperties)) |
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.
Shouldn't this be conditional on someone providing their own sort function? I.E. can you override the default or not sort on the client at all?
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.
Currently, I'm assuming consumer will replace the sortItems
function entirely if they don't want the default sort or client sort. I can make an interface that takes normalizeSort out and let user only overwrites what's left over.
{{/if}} | ||
{{component item | ||
model=record | ||
hook=(concat hook '-item-' index) |
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.
If you have a hookQualifier below with the index, why concat the index on the hook?
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.
When I was working on the like, the hoookQualifier is already a thing but not working properly yet.
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.
Now you have both :) Maybe remove the concat at this stage?
return [] | ||
} | ||
return sort.map(function (item) { | ||
let key = item.value |
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.
const or just move it into the string literal
}) | ||
} | ||
|
||
export function listDefaultSort (items, sortProperties) { |
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.
No need to prefix this with list and you should add a jsdoc here or in the README explaining that you're using Ember.compare and link to the documentation http://emberjs.com/api/classes/Ember.Comparable.html#method_compare
return resultArray | ||
}) | ||
|
||
return Ember.A(items.slice().sort((itemA, itemB) => { |
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.
Add a comment here explaining that slice is used to create a copy of the array so that the sort isn't applied to the original
"ember-browserify": "1.1.12", | ||
"ember-cli": "^2.7.0", | ||
"ember-browserify": "1.1.13", | ||
"ember-cli": "^2.8.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.
~2.8.0
please. No ^
"ember-concurrency": "0.7.8", | ||
"ember-data": "^2.4.0", | ||
"ember-concurrency": "0.7.15", | ||
"ember-data": "^2.8.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.
no ^
please
"ember-frost-sort": "^3.0.0", | ||
"ember-get-config": "0.1.7", | ||
"ember-frost-core": "0.29.1", | ||
"ember-frost-sort": "5.0.1", |
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 ^
please
"ember-hash-helper-polyfill": "0.1.1", | ||
"ember-hook": "1.3.2", | ||
"ember-hook": "1.3.5", |
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 ^
please
"ember-prop-types": "^2.1.0", | ||
"ember-redux": "1.5.3", | ||
"ember-one-way-controls": "1.1.1", | ||
"ember-prop-types": "3.0.2", |
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 ^
@@ -26,41 +26,43 @@ | |||
"devDependencies": { |
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 cant directly comment on it but please change line 18 node version to >= 6.0.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.
With the upgrade to 2.8 we also need a small change in .travis.yml. Remove lines 1-5 and replace with this block -
sudo: required
dist: trusty
language: node_js
node_js:
- '6.9'
- 'stable'
This would come before the branches
statement.
Thanks.
|
Changes Unknown when pulling 33d920f on quincyle:lts-rework-ob into * on ciena-frost:master*. |
1 similar comment
Changes Unknown when pulling 33d920f on quincyle:lts-rework-ob into * on ciena-frost:master*. |
Changes Unknown when pulling b80e693 on quincyle:lts-rework-ob into * on ciena-frost:master*. |
1 similar comment
Changes Unknown when pulling b80e693 on quincyle:lts-rework-ob into * on ciena-frost:master*. |
Changes Unknown when pulling 2b1249d on quincyle:lts-rework-ob into * on ciena-frost:master*. |
1 similar comment
Changes Unknown when pulling 2b1249d on quincyle:lts-rework-ob into * on ciena-frost:master*. |
@@ -56,7 +56,7 @@ $frost-list-content-border-bottom: 1px; | |||
margin-right: 15px; | |||
background-color: $frost-color-lgrey-1; | |||
} | |||
.container { | |||
.-container { |
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.
is this supposed to be &-container?
Changes Unknown when pulling 6de98ca on quincyle:lts-rework-ob into * on ciena-frost:master*. |
1 similar comment
Changes Unknown when pulling 6de98ca on quincyle:lts-rework-ob into * on ciena-frost:master*. |
Changes Unknown when pulling c9202eb on quincyle:lts-rework-ob into * on ciena-frost:master*. |
1 similar comment
Changes Unknown when pulling c9202eb on quincyle:lts-rework-ob into * on ciena-frost:master*. |
Changes Unknown when pulling 62722b2 on quincyle:lts-rework-ob into * on ciena-frost:master*. |
1 similar comment
Changes Unknown when pulling 62722b2 on quincyle:lts-rework-ob into * on ciena-frost:master*. |
Changes Unknown when pulling 62722b2 on quincyle:lts-rework-ob into * on ciena-frost:master*. |
Changes Unknown when pulling e4a4618 on quincyle:lts-rework-ob into * on ciena-frost:master*. |
1 similar comment
Changes Unknown when pulling e4a4618 on quincyle:lts-rework-ob into * on ciena-frost:master*. |
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 stuff on my end, this looks good overall
} = Ember | ||
import computed from 'ember-computed-decorators' | ||
import {normalizeSort, defaultSort} from 'ember-frost-list/utils/utils' |
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.
Can we re-export these utils from the index.js and avoid the path? If they aren't intended to be accessed externally then you can ignore this.
I might also suggest that instead of one generic utils module you would call this utils/sort
since it contains sort utils
import FrostListCoreMixin from 'ember-frost-list/mixins/frost-list-core-mixin' | ||
|
||
export default Mixin.create(FrostListCoreMixin, { | ||
// == Event ================================================================= | ||
// TODO replace defineProperty when there's a public method available |
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.
Raise this as an issue, you can remove the TODO
sortItems (sortProperties) { | ||
const normalizedSortProperties = normalizeSort(sortProperties) | ||
const customSortMethod = get(this, 'listConfig.sorting.client') | ||
const sortMethod = typeof customSortMethod === 'function' ? customSortMethod : defaultSort |
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.
Are we using prop-types for the sorting.client
type? If so, we don't need this check (if not, we probably should use prop-types)
Basically I'm looking for an assertion instead of a silent fallback
{{/if}} | ||
{{component item | ||
model=record | ||
hook=(concat hook '-item-' index) |
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.
Now you have both :) Maybe remove the concat at this stage?
|
||
// slice is used to create a copy of the array so that the sort isn't applied to the original data in store | ||
return Ember.A(items.slice().sort((itemA, itemB) => { | ||
for (let i = 0; i < normalizedSortProperties.length; i++) { |
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.
Any reason to avoid a forEach?
Changes Unknown when pulling a9b15a8 on quincyle:lts-rework-ob into * on ciena-frost:master*. |
1 similar comment
Changes Unknown when pulling a9b15a8 on quincyle:lts-rework-ob into * on ciena-frost:master*. |
This project uses semver, please check the scope of this pr:
CHANGELOG