Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/panels/lovelace/editor/view-editor/hui-edit-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,9 @@ export class HuiEditView extends LitElement {
<div class="paper-dialog-buttons">
${this.viewIndex !== undefined
? html`
<paper-icon-button
class="delete"
title="Delete"
icon="hass:delete"
@click="${this._delete}"
></paper-icon-button>
<mwc-button class="warning left-align" @click="${this._delete}">
${this.hass!.localize("ui.common.delete_view")}
</mwc-button>
`
: ""}
<mwc-button @click="${this._closeDialog}"
Expand Down
4 changes: 4 additions & 0 deletions src/resources/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ export const haStyleDialog = css`
--mdc-theme-primary: var(--google-red-500);
}

.paper-dialog-buttons .warning.left-align {
margin-right: auto;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to hui-edit-views static get styles(), there is a .delete class there that was used for the button, should clean that up and replace with the new styles.


@media all and (max-width: 450px), all and (max-height: 500px) {
paper-dialog,
ha-paper-dialog {
Expand Down
1 change: 1 addition & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@
"common": {
"loading": "Loading",
"cancel": "Cancel",
"delete_view": "Delete View",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be in common but in the section of lovelace and the views, there actually already is a key for delete there.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bramkragten I didn't realize those existed in en.json.

"save": "Save",
"successfully_saved": "Successfully saved"
},
Expand Down