mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 17:56:46 +00:00
Improve delete device button and confirmation dialog (#13500)
This commit is contained in:
parent
2751adf440
commit
e273b6b659
@ -944,7 +944,18 @@ export class HaConfigDevicePage extends LitElement {
|
|||||||
buttons.push({
|
buttons.push({
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const confirmed = await showConfirmationDialog(this, {
|
const confirmed = await showConfirmationDialog(this, {
|
||||||
text: this.hass.localize("ui.panel.config.devices.confirm_delete"),
|
text:
|
||||||
|
this._integrations(device, this.entries).length > 1
|
||||||
|
? this.hass.localize(
|
||||||
|
`ui.panel.config.devices.confirm_delete_integration`,
|
||||||
|
{
|
||||||
|
integration: domainToName(
|
||||||
|
this.hass.localize,
|
||||||
|
entry.domain
|
||||||
|
),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
: this.hass.localize(`ui.panel.config.devices.confirm_delete`),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!confirmed) {
|
if (!confirmed) {
|
||||||
@ -960,7 +971,7 @@ export class HaConfigDevicePage extends LitElement {
|
|||||||
classes: "warning",
|
classes: "warning",
|
||||||
icon: mdiDelete,
|
icon: mdiDelete,
|
||||||
label:
|
label:
|
||||||
buttons.length > 1
|
this._integrations(device, this.entries).length > 1
|
||||||
? this.hass.localize(
|
? this.hass.localize(
|
||||||
`ui.panel.config.devices.delete_device_integration`,
|
`ui.panel.config.devices.delete_device_integration`,
|
||||||
{
|
{
|
||||||
|
@ -2576,7 +2576,7 @@
|
|||||||
"download_diagnostics": "Download diagnostics",
|
"download_diagnostics": "Download diagnostics",
|
||||||
"download_diagnostics_integration": "Download {integration} diagnostics",
|
"download_diagnostics_integration": "Download {integration} diagnostics",
|
||||||
"delete_device": "Delete",
|
"delete_device": "Delete",
|
||||||
"delete_device_integration": "Remove {integration} from device",
|
"delete_device_integration": "Remove device from {integration}",
|
||||||
"type": {
|
"type": {
|
||||||
"device_heading": "Device",
|
"device_heading": "Device",
|
||||||
"device": "device",
|
"device": "device",
|
||||||
@ -2653,6 +2653,7 @@
|
|||||||
},
|
},
|
||||||
"delete": "Delete",
|
"delete": "Delete",
|
||||||
"confirm_delete": "Are you sure you want to delete this device?",
|
"confirm_delete": "Are you sure you want to delete this device?",
|
||||||
|
"confirm_delete_integration": "Are you sure you want to remove this device from {integration}?",
|
||||||
"picker": {
|
"picker": {
|
||||||
"search": "Search devices",
|
"search": "Search devices",
|
||||||
"filter": {
|
"filter": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user