-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New warning row for non-existent entities #1946
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import { html, LitElement } from "@polymer/lit-element"; | ||
| import { TemplateResult } from "lit-html"; | ||
|
|
||
| class HuiErrorEntityRow extends LitElement { | ||
| public entity?: string; | ||
|
|
||
| static get properties() { | ||
| return { | ||
| entity: {}, | ||
| }; | ||
| } | ||
|
|
||
| protected render(): TemplateResult { | ||
| if (!this.entity) { | ||
| return html``; | ||
| } | ||
|
|
||
| return html` | ||
| ${this.renderStyle()} | ||
| <div> | ||
| Entity not available: ${this.entity} | ||
| </div> | ||
| `; | ||
| } | ||
|
|
||
| private renderStyle(): TemplateResult { | ||
| return html` | ||
| <style> | ||
| div { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, one more comment. Skip the whole div. Remove it from the template and update CSS to style :host {
display: block;
background-color: yellow;
padding: 8px;
}btw do we know why we use
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe I pulled that from somewhere and just kept the copypasta without checking any of it since it just worked. (Hearing that out loud sounds like I need to put the keyboard up smh)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's not something I would ever do...
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can see that we only work with the best engineers here 👍 Switch to
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey, you brought on a C++ dev that started front-end stuff three months ago 🤣 |
||
| flex: 1; | ||
| background-color: yellow; | ||
| padding: 8px; | ||
| } | ||
| </style> | ||
| `; | ||
| } | ||
| } | ||
|
|
||
| declare global { | ||
| interface HTMLElementTagNameMap { | ||
| "hui-error-entity-row": HuiErrorEntityRow; | ||
| } | ||
| } | ||
|
|
||
| customElements.define("hui-error-entity-row", HuiErrorEntityRow); | ||
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 that we should always render this element, even if no entity set. Make it
${this.enttiy || ''}below and it's fineThere 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 also indirectly meant that we should remove this if, or else it doesn't make sense to default below.