diff --git a/src/panels/config/application_credentials/ha-config-application-credentials.ts b/src/panels/config/application_credentials/ha-config-application-credentials.ts index b69ed369cc..644759e148 100644 --- a/src/panels/config/application_credentials/ha-config-application-credentials.ts +++ b/src/panels/config/application_credentials/ha-config-application-credentials.ts @@ -11,6 +11,7 @@ import { import "../../../components/ha-fab"; import "../../../components/ha-help-tooltip"; import "../../../components/ha-svg-icon"; +import "../../../components/ha-icon-overflow-menu"; import { ApplicationCredential, deleteApplicationCredential, @@ -70,6 +71,26 @@ export class HaConfigApplicationCredentials extends LitElement { width: "30%", direction: "asc", }, + actions: { + title: "", + width: "64px", + type: "overflow-menu", + template: (credential) => html` + this._removeCredential(credential), + }, + ]} + > + + `, + }, }; return columns; @@ -153,6 +174,24 @@ export class HaConfigApplicationCredentials extends LitElement { this._selected = ev.detail.value; } + private _removeCredential = async (credential) => { + const confirm = await showConfirmationDialog(this, { + title: this.hass.localize( + `ui.panel.config.application_credentials.picker.remove.confirm_title` + ), + text: this.hass.localize( + "ui.panel.config.application_credentials.picker.remove_selected.confirm_text" + ), + confirmText: this.hass.localize("ui.common.delete"), + dismissText: this.hass.localize("ui.common.cancel"), + destructive: true, + }); + if (!confirm) { + return; + } + await deleteApplicationCredential(this.hass, credential.id); + }; + private _removeSelected() { showConfirmationDialog(this, { title: this.hass.localize( @@ -162,8 +201,9 @@ export class HaConfigApplicationCredentials extends LitElement { text: this.hass.localize( "ui.panel.config.application_credentials.picker.remove_selected.confirm_text" ), - confirmText: this.hass.localize("ui.common.remove"), + confirmText: this.hass.localize("ui.common.delete"), dismissText: this.hass.localize("ui.common.cancel"), + destructive: true, confirm: async () => { try { await Promise.all( diff --git a/src/translations/en.json b/src/translations/en.json index 85882f0488..2ca1b89250 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -4253,9 +4253,9 @@ "config_entry": { "application_credentials": { "delete_title": "Application credentials", - "delete_prompt": "Would you like to also remove Application Credentials for this integration?", - "delete_detail": "If you remove them, you will need to enter credentials when setting up the integration again. If you keep them, they will be used automatically when setting up the integration again or may be acccessed from the Application Credentials menu.", - "delete_error_title": "Removing application credentials failed", + "delete_prompt": "Would you like to also delete Application Credentials for this integration?", + "delete_detail": "If you delete them, you will need to enter credentials when setting up the integration again. If you keep them, they will be used automatically when setting up the integration again or may be acccessed from the Application Credentials menu.", + "delete_error_title": "Deleting application credentials failed", "dismiss": "Keep", "learn_more": "Learn more about application credentials" }, @@ -4454,11 +4454,15 @@ "client_id": "OAuth client ID", "application": "Integration" }, + "remove": { + "button": "Delete application credential", + "confirm_title": "Delete application credential?" + }, "remove_selected": { - "button": "Remove selected", - "confirm_title": "Do you want to remove {number} {number, plural,\n one {credential}\n other {credentials}\n}?", - "confirm_text": "Application credentials in use by an integration may not be removed.", - "error_title": "Removing application credentials failed" + "button": "Delete selected", + "confirm_title": "Do you want to delete {number} {number, plural,\n one {credential}\n other {credentials}\n}?", + "confirm_text": "Application credentials in use by an integration may not be deleted.", + "error_title": "Deleting application credentials failed" }, "selected": "{number} selected" }