-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Entities Card: Entity Row Editor #7134
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 all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
e3f74c0
First commit
zsarnett f76efcd
Merge branch 'dev' of https://github.com/home-assistant/frontend into…
zsarnett 35b409b
Edit entities extra properties
zsarnett 5aac38b
Move detail editor to entities card editor +
zsarnett 433e129
update style
zsarnett ed9f848
create detail editor base
zsarnett 7b5fc31
Generalize Card editor into element editor
zsarnett e6d4274
move X clear icon to the smae spot for all rows
zsarnett 73d72c4
Make it all work
zsarnett ddcb737
Use the same editor for all generic types
zsarnett ec7d16e
Merge branch 'dev' of https://github.com/home-assistant/frontend into…
zsarnett 9b364a1
updates
zsarnett 69c5013
update type
zsarnett 6c312ea
Restore ha-more-info-logbook.ts
zsarnett 05a5bca
dont export
zsarnett 355ebc0
Restore hui-toggle-entity-row.ts
zsarnett e6c4828
Update types and a bit of ordering
zsarnett cbd2e9f
Merge branch 'entity-editor' of https://github.com/home-assistant/fro…
zsarnett 868fd3d
limit secondary info by domain
zsarnett 2895491
make simpler listbox
zsarnett 5c3f22a
lint
zsarnett 45ff398
remove unneeded code
zsarnett 66ba2d7
add const for generic type
zsarnett d4b7fd9
comments
zsarnett 5a28dfb
Update src/components/entity/ha-entity-picker.ts
zsarnett e6b19ce
UPDATE LOGIC IN PICKER
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
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
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
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,42 +1,42 @@ | ||
| import { mdiHelpCircle } from "@mdi/js"; | ||
| import deepFreeze from "deep-freeze"; | ||
| import { | ||
| css, | ||
| CSSResultArray, | ||
| customElement, | ||
| html, | ||
| internalProperty, | ||
| LitElement, | ||
| property, | ||
| internalProperty, | ||
| PropertyValues, | ||
| query, | ||
| TemplateResult, | ||
| PropertyValues, | ||
| } from "lit-element"; | ||
| import { mdiHelpCircle } from "@mdi/js"; | ||
|
|
||
| import type { HASSDomEvent } from "../../../../common/dom/fire_event"; | ||
| import { fireEvent } from "../../../../common/dom/fire_event"; | ||
| import { haStyleDialog } from "../../../../resources/styles"; | ||
| import { showSaveSuccessToast } from "../../../../util/toast-saved-success"; | ||
| import { addCard, replaceCard } from "../config-util"; | ||
| import { getCardDocumentationURL } from "../get-card-documentation-url"; | ||
| import { computeRTLDirection } from "../../../../common/util/compute_rtl"; | ||
| import { showConfirmationDialog } from "../../../../dialogs/generic/show-dialog-box"; | ||
|
|
||
| import type { HomeAssistant } from "../../../../types"; | ||
| import type { GUIModeChangedEvent } from "../types"; | ||
| import type { ConfigChangedEvent, HuiCardEditor } from "./hui-card-editor"; | ||
| import type { EditCardDialogParams } from "./show-edit-card-dialog"; | ||
| import type { HassDialog } from "../../../../dialogs/make-dialog-manager"; | ||
| import type { HASSDomEvent } from "../../../../common/dom/fire_event"; | ||
| import "../../../../components/ha-circular-progress"; | ||
| import "../../../../components/ha-dialog"; | ||
| import "../../../../components/ha-header-bar"; | ||
| import type { | ||
| LovelaceCardConfig, | ||
| LovelaceViewConfig, | ||
| } from "../../../../data/lovelace"; | ||
|
|
||
| import "./hui-card-editor"; | ||
| import { showConfirmationDialog } from "../../../../dialogs/generic/show-dialog-box"; | ||
| import type { HassDialog } from "../../../../dialogs/make-dialog-manager"; | ||
| import { haStyleDialog } from "../../../../resources/styles"; | ||
| import type { HomeAssistant } from "../../../../types"; | ||
| import { showSaveSuccessToast } from "../../../../util/toast-saved-success"; | ||
| import { addCard, replaceCard } from "../config-util"; | ||
| import { getCardDocumentationURL } from "../get-card-documentation-url"; | ||
| import "../hui-element-editor"; | ||
| import type { | ||
| ConfigChangedEvent, | ||
| HuiElementEditor, | ||
| } from "../hui-element-editor"; | ||
| import type { GUIModeChangedEvent } from "../types"; | ||
| import "./hui-card-preview"; | ||
| import "../../../../components/ha-dialog"; | ||
| import "../../../../components/ha-header-bar"; | ||
| import "../../../../components/ha-circular-progress"; | ||
| import type { EditCardDialogParams } from "./show-edit-card-dialog"; | ||
|
|
||
| declare global { | ||
| // for fire event | ||
|
|
@@ -65,7 +65,7 @@ export class HuiDialogEditCard extends LitElement implements HassDialog { | |
|
|
||
| @internalProperty() private _guiModeAvailable? = true; | ||
|
|
||
| @query("hui-card-editor") private _cardEditorEl?: HuiCardEditor; | ||
| @query("hui-element-editor") private _cardEditorEl?: HuiElementEditor; | ||
|
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. We have |
||
|
|
||
| @internalProperty() private _GUImode = true; | ||
|
|
||
|
|
@@ -183,14 +183,14 @@ export class HuiDialogEditCard extends LitElement implements HassDialog { | |
| </div> | ||
| <div class="content"> | ||
| <div class="element-editor"> | ||
| <hui-card-editor | ||
| <hui-element-editor | ||
| .hass=${this.hass} | ||
| .lovelace=${this._params.lovelaceConfig} | ||
| .value=${this._cardConfig} | ||
| @config-changed=${this._handleConfigChanged} | ||
| @GUImode-changed=${this._handleGUIModeChanged} | ||
| @editor-save=${this._save} | ||
| ></hui-card-editor> | ||
| ></hui-element-editor> | ||
| </div> | ||
| <div class="element-preview"> | ||
| <hui-card-preview | ||
|
|
@@ -364,6 +364,8 @@ export class HuiDialogEditCard extends LitElement implements HassDialog { | |
| @media all and (min-width: 850px) { | ||
| ha-dialog { | ||
| --mdc-dialog-min-width: 845px; | ||
| --dialog-surface-top: 40px; | ||
| --mdc-dialog-max-height: calc(100% - 72px); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -402,6 +404,9 @@ export class HuiDialogEditCard extends LitElement implements HassDialog { | |
| ha-dialog { | ||
| --mdc-dialog-max-width: calc(100% - 32px); | ||
| --mdc-dialog-min-width: 1000px; | ||
| --dialog-surface-position: fixed; | ||
| --dialog-surface-top: 40px; | ||
| --mdc-dialog-max-height: calc(100% - 72px); | ||
zsarnett marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| .content { | ||
|
|
||
32 changes: 15 additions & 17 deletions
32
src/panels/lovelace/editor/config-elements/config-elements-style.ts
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,19 +1,17 @@ | ||
| import { html } from "lit-element"; | ||
| import { css } from "lit-element"; | ||
|
|
||
| export const configElementStyle = html` | ||
| <style> | ||
| ha-switch { | ||
| padding: 16px 0; | ||
| } | ||
| .side-by-side { | ||
| display: flex; | ||
| } | ||
| .side-by-side > * { | ||
| flex: 1; | ||
| padding-right: 4px; | ||
| } | ||
| .suffix { | ||
| margin: 0 8px; | ||
| } | ||
| </style> | ||
| export const configElementStyle = css` | ||
| ha-switch { | ||
| padding: 16px 0; | ||
| } | ||
| .side-by-side { | ||
| display: flex; | ||
| } | ||
| .side-by-side > * { | ||
| flex: 1; | ||
| padding-right: 4px; | ||
| } | ||
| .suffix { | ||
| margin: 0 8px; | ||
| } | ||
| `; |
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.
I am not exactly sure what the best way to do this is. With the cast, it compains that entity doesn't exist in Type T.
Even if I add
"entity" in configto the if statement.