-
Notifications
You must be signed in to change notification settings - Fork 9
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
Allow row selection in fixed tables #23
Conversation
Realized that I left changes in the demo I didn't want to, will remove those |
@@ -20,12 +21,29 @@ export default Component.extend({ | |||
// == PropTypes ============================================================= | |||
|
|||
propTypes: { | |||
// required: | |||
// options: |
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 rename this? Consistency with other existing components?
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.
Yes, consistency with frost-table
@@ -76,6 +99,17 @@ export default Component.extend({ | |||
@readOnly | |||
@computed('css') | |||
/** | |||
* The selector for the left header DOM element | |||
* @param {String} css - the base css class name for the component | |||
* @returns {String} a sutiable jQuery selector for the left section of the table header |
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.
typo suitable
?
|
||
@readOnly | ||
@computed('css') | ||
/** | ||
* The selector for the middle header DOM element (specifically the scroll wrapper) | ||
* @param {String} css - the base css class name for the component | ||
* @returns {String} a sutiable jQuery selector for the middle section of the table header |
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.
typo suitable
?
/** | ||
* The selector for the right header DOM element | ||
* @param {String} css - the base css class name for the component | ||
* @returns {String} a sutiable jQuery selector for the right section of the table header |
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.
typo suitable
?
* @param {String} css - the base css class name for the component | ||
* @returns {String} a sutiable jQuery selector for the left section of the table header | ||
*/ | ||
headerLeftSelector (css) { |
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 exposing
this CP to the consumer? I'm simply wondering because there is an inconsistency in naming CP _
vs no _
for internal CPs. No big deal I'm simply wondering.
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 a valid comment for all other CPs
/** | ||
* Set up synced scrolling as well as calculating padding for middle sections | ||
*/ | ||
didRender () { | ||
this._super(...arguments) | ||
this.setupBodyHeights() | ||
this.setupHoverProxy() | ||
this.setupLeftAndRightWidths() // Needs to happen before setting up middle section |
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.
Why do we need this now?
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 related to the selection?
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.
Adding in the checkboxes column misaligns the columns BAD
const clonedSelectedItems = A(this.get('selectedItems').slice()) | ||
const _rangeState = this.get('_rangeState') | ||
|
||
// Selects are proccessed in order of precedence: specific, range, basic |
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 think this should be isolated in a util since it can be common.
addon/components/frost-table-row.js
Outdated
@@ -65,6 +65,11 @@ export default Component.extend({ | |||
|
|||
// == DOM Events ============================================================ | |||
|
|||
click (event) { | |||
event.stopPropagation() | |||
this.$().find('.frost-table-row-selection').trigger('click') |
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 simply trigger consumer action? (not sure here I'm simply wondering)
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.
So frost-table-row when you enable selection adds an frost-table-row-selection to the row. It is within the click event handler of frost-table-row-selection that the onSelect callback is call, thought it would be simplist to just trigger this event
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 doing an action on click for the table on when we click on a button or something like that (similar to list)? If we are using a button to do an action based on selection then we should use a similar implementation to the list and I'm not seeing anything like this in the list.
@@ -31,8 +31,10 @@ | |||
hook=(concat hookPrefix '-header-left') | |||
hookQualifiers=hookQualifiers | |||
tagName='div' | |||
isSelectable=_isSelectable |
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.
We can select the header? For sorting I'm expecting?
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.
This was done in frost-table, for sorting was my guess as well but will look a little deeper to confirm
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.
Not for sorting, this is how the header knows to add in a column in header that corresponds to the checkbox column
|
||
// sass-lint:disable nesting-depth | ||
.frost-table-row { | ||
&.is-selected { |
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 is-selected
in the list for selection? It will be nice to use the same class name.
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.
Yep
.travis.yml
Outdated
@@ -17,7 +17,6 @@ addons: | |||
|
|||
cache: | |||
directories: | |||
- node_modules |
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.
@AdamWard1995 why? This does not follow the practice of any of our other repos /cc @juwara0
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.
@notmessenger - is correct. Please do not remove the caching.
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.
He's trying to figure out why something isn't working, and needed to clear the cache. It should be temporary.
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.
Going to add it back, just clearing it as locally everything is installing fine :)
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.
That setting tells travis that it can cache the node_modules directories during builds. https://docs.travis-ci.com/user/caching/#Caching-directories-(Bundler%2C-dependencies). If you need to clear the cache during CI there is an option to do so on the build page under the drop-down in the upper right corner.
ember-cli-build.js
Outdated
@@ -24,8 +24,6 @@ module.exports = function (defaults) { | |||
|
|||
if (app.env === 'test') { |
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.
The rest of this code
if (app.env === 'test') {
;[
].forEach((path) => {
app.import(path, {type: 'test'})
})
}
needs to be removed as well
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.
OK
Changes Unknown when pulling 28901f7 on AdamWard1995:fixedTableSelection into ** on ciena-frost:master**. |
Changes Unknown when pulling 49b0844 on AdamWard1995:fixedTableSelection into ** on ciena-frost:master**. |
Changes Unknown when pulling a75f7ea on AdamWard1995:fixedTableSelection into ** on ciena-frost:master**. |
Changes Unknown when pulling 461689f on AdamWard1995:fixedTableSelection into ** on ciena-frost:master**. |
Looks good :) 👍 |
This project uses semver, please check the scope of this pr:
Add functionality for selecting table rows to frost-fixed-table. Needed for an internal story.
CHANGELOG