-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Entity Settings Page to MWC 3 #11694
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bf46769
Entity Settings Page to MWC 3
zsarnett 1404af0
input select settings to mwc 3
zsarnett f407ba4
input Number to mwc
zsarnett a2f7c71
stash
zsarnett 7b1d612
helpers
zsarnett bc3955d
change alert
zsarnett 5eb273b
detail could be undefined
zsarnett File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,6 @@ | ||
| import "@material/mwc-button/mwc-button"; | ||
| import "@material/mwc-list/mwc-list-item"; | ||
| import "@material/mwc-select/mwc-select"; | ||
| import "@polymer/paper-input/paper-input"; | ||
| import { HassEntity, UnsubscribeFunc } from "home-assistant-js-websocket"; | ||
| import { | ||
| css, | ||
|
|
@@ -19,6 +18,7 @@ import "../../../components/ha-area-picker"; | |
| import "../../../components/ha-expansion-panel"; | ||
| import "../../../components/ha-icon-picker"; | ||
| import "../../../components/ha-switch"; | ||
| import "../../../components/ha-textfield"; | ||
| import type { HaSwitch } from "../../../components/ha-switch"; | ||
| import { | ||
| DeviceRegistryEntry, | ||
|
|
@@ -36,7 +36,6 @@ import { | |
| showConfirmationDialog, | ||
| } from "../../../dialogs/generic/show-dialog-box"; | ||
| import { SubscribeMixin } from "../../../mixins/subscribe-mixin"; | ||
| import type { PolymerChangedEvent } from "../../../polymer-types"; | ||
| import { haStyle } from "../../../resources/styles"; | ||
| import type { HomeAssistant } from "../../../types"; | ||
| import { showDeviceRegistryDetailDialog } from "../devices/device-registry-detail/show-dialog-device-registry-detail"; | ||
|
|
@@ -137,15 +136,16 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) { | |
| </div> | ||
| ` | ||
| : ""} | ||
| ${this._error ? html` <div class="error">${this._error}</div> ` : ""} | ||
| ${this._error ? html`<div class="error">${this._error}</div>` : ""} | ||
|
zsarnett marked this conversation as resolved.
Outdated
|
||
| <div class="form container"> | ||
| <paper-input | ||
| <ha-textfield | ||
| .value=${this._name} | ||
| @value-changed=${this._nameChanged} | ||
| .label=${this.hass.localize("ui.dialogs.entity_registry.editor.name")} | ||
| .placeholder=${this.entry.original_name} | ||
| .invalid=${invalidDomainUpdate} | ||
| .disabled=${this._submitting} | ||
| ></paper-input> | ||
| .placeholder=${this.entry.original_name} | ||
| @input=${this._nameChanged} | ||
| ></ha-textfield> | ||
| <ha-icon-picker | ||
| .value=${this._icon} | ||
| @value-changed=${this._iconChanged} | ||
|
|
@@ -176,16 +176,16 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) { | |
| )} | ||
| </mwc-select>` | ||
| : ""} | ||
| <paper-input | ||
| <ha-textfield | ||
| error-message="Domain needs to stay the same" | ||
|
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. Same
Contributor
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. |
||
| .value=${this._entityId} | ||
| @value-changed=${this._entityIdChanged} | ||
| .label=${this.hass.localize( | ||
| "ui.dialogs.entity_registry.editor.entity_id" | ||
| )} | ||
| error-message="Domain needs to stay the same" | ||
| .invalid=${invalidDomainUpdate} | ||
| .disabled=${this._submitting} | ||
| ></paper-input> | ||
| @input=${this._entityIdChanged} | ||
| ></ha-textfield> | ||
| ${!this.entry.device_id | ||
| ? html`<ha-area-picker | ||
| .hass=${this.hass} | ||
|
|
@@ -282,19 +282,19 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) { | |
| `; | ||
| } | ||
|
|
||
| private _nameChanged(ev: PolymerChangedEvent<string>): void { | ||
| private _nameChanged(ev): void { | ||
| this._error = undefined; | ||
| this._name = ev.detail.value; | ||
| this._name = ev.target.value; | ||
| } | ||
|
|
||
| private _iconChanged(ev: PolymerChangedEvent<string>): void { | ||
| private _iconChanged(ev: CustomEvent): void { | ||
| this._error = undefined; | ||
| this._icon = ev.detail.value; | ||
| } | ||
|
|
||
| private _entityIdChanged(ev: PolymerChangedEvent<string>): void { | ||
| private _entityIdChanged(ev): void { | ||
| this._error = undefined; | ||
| this._entityId = ev.detail.value; | ||
| this._entityId = ev.target.value; | ||
| } | ||
|
|
||
| private _deviceClassChanged(ev): void { | ||
|
|
@@ -423,6 +423,10 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) { | |
| ha-switch { | ||
| margin-right: 16px; | ||
| } | ||
| ha-textfield { | ||
| display: block; | ||
| margin: 8px 0; | ||
| } | ||
| .row { | ||
| margin: 8px 0; | ||
| color: var(--primary-text-color); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back 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.
This is not a property for textfield https://github.com/material-components/material-web/tree/master/packages/textfield#propertiesattributes
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 is on ha-textfield
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.
https://github.com/home-assistant/frontend/blob/dev/src/components/ha-textfield.ts#L10