-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat: switch to ember-table for all remaining tables [Admin Area] #3246
Conversation
const rows = []; | ||
this.model.data.map(row => { | ||
rows.pushObject({ | ||
name : row.get('event.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.
@niranjan94
Events which share same session names:
@niranjan94 It's ready for another review. |
} | ||
|
||
@computed('model.[]') | ||
get rows() { |
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.
Use model directly. One less computed property. One less iteration of the dataset.
} | ||
|
||
@computed('model.[]', 'model.@each.event') | ||
get rows() { |
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.
Use model directly. One less computed property. One less iteration of the dataset.
@niranjan94 How exactly will that work? where as the mapped array has the format: Ember table expects the formatted mapped array? |
The models have getters for the properties already. So, even though you cannot see the property when you do a console.log, accessing them via for example, |
ember tables uses |
@niranjan94 I tried with a single column table, get columns() {
return [
{
name : 'Email',
valuePath : 'email'
}
];
} passed It throws this exception: collapse-tree.js:514 Uncaught (in promise) TypeError: Ember.get(...).some is not a function
at Class.<anonymous> (collapse-tree.js:514)
at ComputedProperty.get (metal.js:3200)
at Object._get2 [as get] (metal.js:1614)
at Class.<anonymous> (collapse-tree.js:609)
at ComputedProperty.get (metal.js:3200)
at _get2 (metal.js:1614)
at _getPath (metal.js:1646)
at Object._get2 [as get] (metal.js:1598)
at Class.<anonymous> (collapse-tree.js:851)
at ComputedProperty.get (metal.js:3200) Collapsee tree.js:514: return !Ember.get(this, 'value.children').some(function (child) {
return Ember.isArray(Ember.get(child, 'children'));
}); What else needs to change? |
@niranjan94 This is ready for review, I have used extraValue paths for all properties. |
@@ -1,6 +1,7 @@ | |||
import Route from '@ember/routing/route'; | |||
|
|||
export default Route.extend({ | |||
import { action } from '@ember/object'; |
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.
@CosmicCoder96 actually I'm already refactoring this file in my PR #3198 where I'm also introducing few session rating columns and actions. 😅
I'll introduce any changes if missing there.
Fixes #3169
Short description of what this resolves:
Replaces all the ember-model tables inside the admin area with ember-tables.