-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Improved automation & script menus + show errors in toast #7371
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 3 commits
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 |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ import "../../../components/ha-card"; | |
| import "../../../components/ha-icon-button"; | ||
| import "../../../components/ha-svg-icon"; | ||
| import "../../../components/ha-yaml-editor"; | ||
| import { showToast } from "../../../util/toast"; | ||
| import type { HaYamlEditor } from "../../../components/ha-yaml-editor"; | ||
| import { | ||
| AutomationConfig, | ||
|
|
@@ -132,6 +133,7 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) { | |
| ${this.hass.localize("ui.panel.config.automation.editor.edit_ui")} | ||
| ${this._mode === "gui" | ||
| ? html`<ha-svg-icon | ||
| class="selected_menu_item" | ||
| slot="graphic" | ||
| .path=${mdiCheck} | ||
| ></ha-svg-icon>` | ||
|
|
@@ -147,6 +149,7 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) { | |
| ${this.hass.localize("ui.panel.config.automation.editor.edit_yaml")} | ||
| ${this._mode === "yaml" | ||
| ? html`<ha-svg-icon | ||
| class="selected_menu_item" | ||
| slot="graphic" | ||
| .path=${mdiCheck} | ||
| ></ha-svg-icon>` | ||
|
|
@@ -168,6 +171,7 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) { | |
| <ha-svg-icon | ||
| slot="graphic" | ||
| .path=${mdiContentDuplicate} | ||
| class=${classMap({ enabled_icon: this.automationId })} | ||
| ></ha-svg-icon> | ||
| </mwc-list-item> | ||
|
|
||
|
|
@@ -182,7 +186,12 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) { | |
| ${this.hass.localize( | ||
| "ui.panel.config.automation.picker.delete_automation" | ||
| )} | ||
| <ha-svg-icon slot="graphic" .path=${mdiDelete}></ha-svg-icon> | ||
| <ha-svg-icon | ||
| class=${classMap({ warning: this.automationId })} | ||
| slot="graphic" | ||
| .path=${mdiDelete} | ||
| > | ||
| </ha-svg-icon> | ||
| </mwc-list-item> | ||
| </ha-button-menu> | ||
| ${this._config | ||
|
|
@@ -725,6 +734,15 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) { | |
| }, | ||
| (errors) => { | ||
| this._errors = errors.body.message; | ||
| showToast(this, { | ||
| message: errors.body.message, | ||
| dismissable: false, | ||
| duration: 0, | ||
| action: { | ||
| action: () => {}, | ||
| text: this.hass.localize("ui.dialogs.generic.ok"), | ||
| }, | ||
| }); | ||
| throw errors; | ||
| } | ||
| ); | ||
|
|
@@ -766,6 +784,15 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) { | |
| mwc-fab.dirty { | ||
| bottom: 0; | ||
| } | ||
| .enabled_icon { | ||
| color: var(--primary-text-color); | ||
| } | ||
| .selected_menu_item { | ||
| color: var(--primary-color); | ||
| } | ||
|
Comment on lines
+781
to
+786
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. This is not needed, I actually fixed this here https://github.com/home-assistant/frontend/pull/7359/files#diff-57b9cba3e06172c4224cb56bc0ef55cebf53277a016de17e350271a75f22d5f3R77
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. Is that the correct link you wanted to paste? If yes, I must be missing the point how the quickbar is related to this PR.
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. The
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. Ah, I thought the link pointed 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. I made a test by copying the mentioned style line from your PR. Does not work for me. All icons are black except the last one which I colored red. |
||
| li[role="separator"] { | ||
| border-bottom-color: var(--divider-color); | ||
| } | ||
| `, | ||
| ]; | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.