-
Notifications
You must be signed in to change notification settings - Fork 15
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
Themes for yeti-table #16
Conversation
Do you have any idea what the build error is? Everything works fine on my pc. yarn upgrade does not change my package.json. |
Seems like some dependency expected node 6 but we defined node 8 on dependencies? |
As far as I can tell its still allowing node 6 from the package.json, https://github.com/bgantzler/ember-yeti-table/blob/master/package.json#L85, its not anything that I can tell I changed |
I did update the dependancies for ember-decorators to 3.1.5 |
OK rereading it I think its the reverse. More than likely ember-decorators 3.1.5 does NOT support 6, and 6 is in the package.json. Is it acceptable to remove node 6 from the engine list? I am not sure how to get this kind of warning locally so I can fix it before pushing |
I dont know what the problem is. The only think I thought it could be was I upgraded ember-decorators to 3.1.5. which has node 6* in the engines list. So I rolled that back, still the same error. Error says that ip-regex 3.0.0 requires node =>8 that is true. I pulled the master branch and yarn says its installing ip-regex 3.0.0 so master branch should not compile for the same reason. Not sure where to go from here except remove 6.* from the engines list. Which I am going to try now just out of curiosity of the build will even pass. |
Removing node 6 from the package.json resulted in the build erroring out because it seems to run on node 6 and ember-yeti-table itself doesnt match. reverting |
It appears this is affecting other people and I think it is coming in from ember-cli-addon-docs. If you look for jan 12 messages in discord dev-ember-cli you will see talk about it. They are saying build with --ignore-engines or use yarn resolutions to mitigate for the time being. Ill see about getting a resolution and try again. |
reference ember-cli/ember-cli#8360 |
Tried to add |
Seems like adding
I think this happens because |
I looked back in the build history and noticed that this error started sometime back on your master branch before I even started contributing. So figured it was something to do with some dependency that you may have updated. |
Where go from here? Need some documentation updated? Tests? |
@cah-briangantzler I updated ember-decorators and a bunch of other things on master. Could you please rebase this PR? |
They removed @required? I found that useful when I was coding. Being that you are now based on a beta, that changes may be a breaking change, if this is used in any application also using decorators, they could end up with a version that would be missing required and have the wrong path for types I have rebased the code and re-uploaded |
Any
This shouldn't happen because yeti-table should have ember-decorators/argument version it specifies and the host app should have the other. It's like any other npm dependency. Someone correct me if I'm wrong. Still, I will bump the minor version because this update will imply that only ember 3.4+ will be supported. @pzuraq is trying to polyfill things into 2.8 LTS, but until/if that happens, yeti-table will be 3.4+ (people can always use older versions). |
@@ -48,6 +49,9 @@ const arrayOrPromise = unionOf( | |||
class Body extends Component { | |||
layout = layout; | |||
|
|||
@argument(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.
It seems this should be @argument('object')
@@ -17,6 +17,9 @@ import layout from './template'; | |||
class Cell extends Component { | |||
layout = layout; | |||
|
|||
@argument(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.
same here
@@ -1,5 +1,5 @@ | |||
{{#if column.visible}} | |||
<td class="{{class}} {{column.columnClass}}" ...attributes> | |||
<td class="{{class}} {{column.columnClass}} {{theme.tbodyCell}} " ...attributes> |
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 add an extra space here in the end of the class attribute.
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.
fixed
@@ -49,6 +50,9 @@ import layout from './template'; | |||
class Row extends Component { | |||
layout = layout; | |||
|
|||
@argument(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.
same here
* | ||
* You may create your own theme-class and set `theme` to it's instance. Check Theme properties you may define in your own theme. | ||
*/ | ||
@argument(optional(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.
same here
@@ -25,11 +26,19 @@ import layout from './template'; | |||
class Foot extends Component { | |||
layout = layout; | |||
|
|||
@argument(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.
same here
@@ -23,6 +23,9 @@ import layout from './template'; | |||
class Cell extends Component { | |||
layout = layout; | |||
|
|||
@argument(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.
same here
@@ -26,6 +26,9 @@ import layout from './template'; | |||
class Row extends Component { | |||
layout = layout; | |||
|
|||
@argument(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.
same here
@@ -29,6 +30,9 @@ import layout from './template'; | |||
class Head extends Component { | |||
layout = layout; | |||
|
|||
@argument(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.
same here
@@ -30,6 +30,9 @@ import layout from './template'; | |||
class Cell extends Component { | |||
layout = layout; | |||
|
|||
@argument(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.
same here
@@ -47,6 +47,9 @@ import layout from './template'; | |||
class Column extends DidChangeAttrsComponent { | |||
layout = layout; | |||
|
|||
@argument(optional(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.
same here
@@ -29,6 +29,9 @@ import layout from './template'; | |||
class Row extends Component { | |||
layout = layout; | |||
|
|||
@argument(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.
same here
@@ -30,6 +31,9 @@ import layout from './template'; | |||
class Header extends Component { | |||
layout = layout; | |||
|
|||
@argument(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.
same here
``` | ||
*/ | ||
@classNames('yeti-table-pagination-controls') | ||
class Pagination extends Component { | ||
layout = layout; | ||
|
||
@argument(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.
same here
Ahh, makes sense on the required, I was looking through the docs and didnt see that. @argument(optional(Object)) had been like that the while time, tests and everything run. Figured Object was like https://github.com/bgantzler/ember-yeti-table/blob/theme/addon/components/yeti-table/component.js#L147 Function isnt in quotes. Ill change them I had to use the yarn resolve block for a while to get the correct version of another addon for a while. Thought it might fall under the same thing |
@cah-briangantzler I'm just following the docs here: https://github.com/ember-decorators/argument#primitive-types
And the list contains export const Action = Function; So I just used |
columnSortedAsc: 'yeti-table-sorted-asc', | ||
columnSortedDesc: 'yeti-table-sorted-desc', | ||
|
||
pagination: { |
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.
My last concern is the pagination
object.
With the current way this is set up, if we do something like:
<YetiTable @theme={{hash pagination=(hash info="some-class)}}>
all the other properties (pageSize, next and previous) would be overwritten be this new object.
One solution would be to always have a flat theme object structure, probably namespaced. e.g:
paginationInfo: 'yeti-table-pagination-controls-page-info',
paginationSize: 'yeti-table-pagination-controls-page-size',
paginationNext: 'yeti-table-pagination-controls-next',
paginationPrevious: 'yeti-table-pagination-controls-previous'
But I do see how having some structure could help tidying up things a bit. In that case we would have to look for a way to "Object.assign" without overwriting the entire object. There are some packages on npm that do that.
What are your thoughts on this?
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 the original reason I was attempting Theme as an actual emberObject was to use mergedProperties in ember to solve this.
I prefer the organization of the nested objects and could see users arbitrarily adding nested objects to the config version and then trying to merge them, so it would be nice if it supported this.
Was searching and thought this one looked like it would do the trick https://davidwalsh.name/javascript-deep-merge (https://github.com/TehShrike/deepmerge)
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 one looks great! deepMerge.all()
seems to be what we're looking for.
With ember-auto-import in dependências we should be able to import it.
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.
Ill see what I can do later. I thought about putting the 4 sort ones under a nest 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.
That sounds good.
…ion controls class should be themed as well. tests now refer to classes using the default theme object. add tests for deep merge.
Ok, so I made some updates:
|
Yea I noticed the pagination controls container, was going to fix it when I did the merge. Thanks for doing that. looking forward to the results. |
Thank you for your great work on this feature. 🎉 |
Adds themes for css classes to be added to YetiTable.
Implements most of #7