-
Couldn't load subscription status.
- Fork 1.8k
Ember Table set up & Manage events table #3169
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
Conversation
| @@ -0,0 +1,16 @@ | |||
| {{#ember-table class="ui table" as |t|}} | |||
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 pass in the class ui table here
package.json
Outdated
| "@bower_components/tinyColorPicker": "PitPik/tinyColorPicker#^1.1.1", | ||
| "@bower_components/wysihtml": "Voog/wysihtml#^0.5.5" | ||
| "@bower_components/wysihtml": "Voog/wysihtml#^0.5.5", | ||
| "ember-table": "addepar/ember-table#0aa5637" |
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.
Move this to devDependencies
|
@niranjan94 Actions which are defined inside the controller but are triggered from buttons inside individual cell components. We were using closure actions, so they were passed from the route template to the table. Components directly made use of them. However, they didn't need to be explicitly passed to the cell component, passing them, to the table was enough. It's not true in this case. Passing all the actions to each commponent cell seems like overkill. |
| @@ -0,0 +1,16 @@ | |||
| {{#ember-table class="ui table" as |t|}} | |||
| {{t.head columns=columns}} | |||
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 don't want to put all of this boilerplate code for every table we want to render. So move this out to a component. And then call that component here with the rows, columns.
|
For the actions ... Let me try something out locally and get back to you. |
|
Yeah, exactly I had this here for the moment as I was experimenting with
actions. This would be moved to a base component
…On Sat, 22 Jun 2019 at 4:39 PM, Niranjan Rajendran ***@***.***> wrote:
***@***.**** requested changes on this pull request.
------------------------------
In app/templates/components/tables/events/list.hbs
<#3169 (comment)>
:
> @@ -0,0 +1,16 @@
+{{#ember-table class="ui table" as |t|}}
+ {{t.head columns=columns}}
We don't want to put all of this boilerplate code for every table we want
to render. So move this out to a component. And then call that component
here with the rows, columns.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3169?email_source=notifications&email_token=AEDUDRJKTTYLXCMOBBFD6KTP3YCAFA5CNFSM4H2WFA3KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB4K6AJQ#pullrequestreview-253091878>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEDUDRIEZACHBDC33CCM6ELP3YCAFANCNFSM4H2WFA3A>
.
|
|
Going ahead with it at the moment, load speeds are much better than ember-model tables. |
34dc81d to
2dfe7f0
Compare
|
@niranjan94 I have completed the pagination functionality, both logic and template, please review that portion. I will work on sorting, search next. |
| import Component from '@ember/component'; | ||
| import { A } from '@ember/array'; | ||
|
|
||
| export default Component.extend({ |
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.
Lets start using ES6 classes + decorators for all new resources. That's the way ember is moving towards.
| import { A } from '@ember/array'; | ||
|
|
||
| export default class extends Component { | ||
| pageSizes = A([10, 25, 50, 100, 250, '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.
A not needed. Stick to native arrays whenever possible.
| @@ -0,0 +1,4 @@ | |||
| import Component from '@ember/component'; | |||
|
|
|||
| export default Component.extend({ | |||
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.
ES6 class
app/controllers/events/list.js
Outdated
| } | ||
|
|
||
| @action | ||
| doAction(eventName) { |
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 remove
|
@niranjan94 From what I gather, if we don't want to use custom css classes, we want this:Semantic-Org/Semantic-UI#2901 |
I got that, Even the columns are disappearing and collapsing for mobile view, Let's find some new way |
|
@CosmicCoder96 Isn't there some attribute like |
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'm okay with merging this in at this state. This is big change and has already improved the tables experience many times more than ember-model-tables.
We'll merge this in right now so that we can start using it on other pages asap.
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.
Let's use Ember Tables then.
@niranjan94 I am in the midst of implementing this, I need feedback on certain conventions.
1 > Is this the right way to reopen and initialize the table?
2> If not, is there any reference for it other than API docs.
3> Actions. What would be a good way to pass them, while keeping the layout general still.
4> Please ignore pagination boiler-plate for now.
5 > Pagination | Should it be inside tfoot? Or outside the table
6 > Search bar | Should it be in thead ? Or outside the table tag
Preview
so far: