Add warning class to delete (#6852)

* Add error class to delete

* Apply suggestions from code review

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Add missing haStyle

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
Joakim Sørensen 2020-09-08 13:56:51 +02:00 committed by GitHub
parent 67b4688168
commit 82e9178320
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 17 deletions

View File

@ -173,7 +173,7 @@ export default class HaAutomationActionRow extends LitElement {
"ui.panel.config.automation.editor.actions.duplicate" "ui.panel.config.automation.editor.actions.duplicate"
)} )}
</mwc-list-item> </mwc-list-item>
<mwc-list-item> <mwc-list-item class="warning">
${this.hass.localize( ${this.hass.localize(
"ui.panel.config.automation.editor.actions.delete" "ui.panel.config.automation.editor.actions.delete"
)} )}

View File

@ -19,6 +19,7 @@ import { Condition } from "../../../../data/automation";
import { showConfirmationDialog } from "../../../../dialogs/generic/show-dialog-box"; import { showConfirmationDialog } from "../../../../dialogs/generic/show-dialog-box";
import { HomeAssistant } from "../../../../types"; import { HomeAssistant } from "../../../../types";
import "./ha-automation-condition-editor"; import "./ha-automation-condition-editor";
import { haStyle } from "../../../../resources/styles";
export interface ConditionElement extends LitElement { export interface ConditionElement extends LitElement {
condition: Condition; condition: Condition;
@ -86,7 +87,7 @@ export default class HaAutomationConditionRow extends LitElement {
"ui.panel.config.automation.editor.actions.duplicate" "ui.panel.config.automation.editor.actions.duplicate"
)} )}
</mwc-list-item> </mwc-list-item>
<mwc-list-item> <mwc-list-item class="warning">
${this.hass.localize( ${this.hass.localize(
"ui.panel.config.automation.editor.actions.delete" "ui.panel.config.automation.editor.actions.delete"
)} )}
@ -134,20 +135,23 @@ export default class HaAutomationConditionRow extends LitElement {
this._yamlMode = !this._yamlMode; this._yamlMode = !this._yamlMode;
} }
static get styles(): CSSResult { static get styles(): CSSResult[] {
return css` return [
.card-menu { haStyle,
float: right; css`
z-index: 3; .card-menu {
--mdc-theme-text-primary-on-background: var(--primary-text-color); float: right;
} z-index: 3;
.rtl .card-menu { --mdc-theme-text-primary-on-background: var(--primary-text-color);
float: left; }
} .rtl .card-menu {
mwc-list-item[disabled] { float: left;
--mdc-theme-text-primary-on-background: var(--disabled-text-color); }
} mwc-list-item[disabled] {
`; --mdc-theme-text-primary-on-background: var(--disabled-text-color);
}
`,
];
} }
} }

View File

@ -118,7 +118,7 @@ export default class HaAutomationTriggerRow extends LitElement {
"ui.panel.config.automation.editor.actions.duplicate" "ui.panel.config.automation.editor.actions.duplicate"
)} )}
</mwc-list-item> </mwc-list-item>
<mwc-list-item> <mwc-list-item class="warning">
${this.hass.localize( ${this.hass.localize(
"ui.panel.config.automation.editor.actions.delete" "ui.panel.config.automation.editor.actions.delete"
)} )}