-
Notifications
You must be signed in to change notification settings - Fork 286
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
Modernize UI Components #1022
Modernize UI Components #1022
Conversation
@@ -28,11 +28,12 @@ | |||
<div class="split__panel"> | |||
<div class="split__panel__hd"> | |||
{{outlet "toolbar"}} | |||
{{ui/sidebar-toggle |
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.
Used only once so I removed it.
|
||
<div class="toolbar__checkbox js-with-stack"> | ||
<label for="instrument-with-stack"> | ||
{{ui/action-checkbox |
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.
Used only once so I removed it. (also, the way ActionCheckbox was implemented feels like an old pattern anyway)
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.
🔥
@@ -3,12 +3,5 @@ import layout from '../templates/components/error-page'; | |||
|
|||
export default Component.extend({ | |||
layout, | |||
|
|||
didInsertElement() { |
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.
Just use CSS for this, duh.
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 you explain more about 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 just use CSS to animate Tomster in place of manual DOM stuff.
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.
Gotcha, sounds good 👍
</div> | ||
<img class="tomster" src="assets/images/fishy_tomster.png" alt="Fishy Tomster"> | ||
</div> | ||
|
||
<div class="error-page__body"> | ||
<div class="error-page__body-title"> | ||
{{#if bodyTitle}} |
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.
bodyTitle
is never used by the app.
import Component from '@ember/component'; | ||
import layout from '../templates/components/toolbar-search-field'; | ||
|
||
let uuid = 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.
Robert Jackson Suggested ™️
8182018
to
74f8ec7
Compare
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 is looking awesome! Just some general questions about potential simplification, but nothing too bad. Thanks for these PRs!
@@ -0,0 +1,7 @@ | |||
import Component from '@ember/component'; |
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.
Could we make this a template-only-glimmer-component and remove this JS file?
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 not sure we can do that until 3.14. 🤷♀
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, it has been a feature of https://github.com/emberjs/ember-optional-features for awhile. I think we need to run ember feature:enable template-only-glimmer-components
then delete the JS file.
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 plan in my head was to made a pass at components like I did in this PR, then go over again and Glimmerize in another PR. Happy to give it a try now if you prefer.
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 would just handle this one instance now, so we can get rid of the JS file, which we are only keeping around for tagName: ''
. We can go through and find other things later.
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.
Done and done.
@@ -1,11 +1,19 @@ | |||
{{input value=value type="text" placeholder="Search"}} | |||
<div class={{concat "toolbar__search " @wrapperClass}}> |
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.
Instead of @wrapperClass
I think we can use normal class
. Then I think if you pass class="foo"
instead of @wrapperClass="foo"
you should get both classes added to the element.
<div class={{concat "toolbar__search " @wrapperClass}}> | |
<div class="toolbar__search"> |
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 was torn on this. If you were the end-user of <ToolbarSearchField />
would you think class
would be applied to the <input>
?
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 I would look at the template before assuming, so I think it should be fine to use class
directly, rather than introducing a new variable.
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.
Change made.
title="clear" | ||
{{on "click" this.clear}} | ||
> | ||
{{svg-jar "clear" width="14px" height="14px"}} |
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 svg-jar
angle bracket compatible? If so, could we use <SvgJar
?
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.
svg-jar
is a helper.
@@ -3,12 +3,5 @@ import layout from '../templates/components/error-page'; | |||
|
|||
export default Component.extend({ | |||
layout, | |||
|
|||
didInsertElement() { |
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 you explain more about this?
|
||
<div class="toolbar__checkbox js-with-stack"> | ||
<label for="instrument-with-stack"> | ||
{{ui/action-checkbox |
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.
🔥
@nummi looks like we have failures. Are they due to the component tree not being able to show template only / glimmer components? |
e1cdd61
to
c12f8ae
Compare
c12f8ae
to
487c982
Compare
Use @, this,
on
in place ofaction
, angle brackets,tagName=''
, etc. for Inspectors UI add-on.