Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
19 changes: 19 additions & 0 deletions src/panels/config/integrations/ha-config-entry-row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
mdiAlertCircle,
mdiChevronDown,
mdiCogOutline,
mdiContentCopy,
mdiDelete,
mdiDevices,
mdiDotsVertical,
Expand Down Expand Up @@ -71,6 +72,8 @@ import {
import "./ha-config-entry-device-row";
import { renderConfigEntryError } from "./ha-config-integration-page";
import "./ha-config-sub-entry-row";
import { copyToClipboard } from "../../../common/util/copy-clipboard";
import { showToast } from "../../../util/toast";

@customElement("ha-config-entry-row")
class HaConfigEntryRow extends LitElement {
Expand Down Expand Up @@ -315,6 +318,13 @@ class HaConfigEntryRow extends LitElement {
)}
</ha-md-menu-item>

<ha-md-menu-item @click=${this._handleCopy} graphic="icon">
<ha-svg-icon slot="start" .path=${mdiContentCopy}></ha-svg-icon>
${this.hass.localize(
"ui.panel.config.integrations.config_entry.copy"
)}
</ha-md-menu-item>

${Object.keys(item.supported_subentry_types).map(
(flowType) =>
html`<ha-md-menu-item
Expand Down Expand Up @@ -623,6 +633,15 @@ class HaConfigEntryRow extends LitElement {
});
}

private async _handleCopy() {
await copyToClipboard(this.entry.entry_id);
showToast(this, {
message:
this.hass?.localize("ui.common.copied_clipboard") ||
"Copied to clipboard",
});
}

private async _handleRename() {
const newName = await showPromptDialog(this, {
title: this.hass.localize("ui.panel.config.integrations.rename_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 @@ -5514,6 +5514,7 @@
"entries": "{count} {count, plural,\n one {entry}\n other {entries}\n}",
"no_devices_or_entities": "No devices or entities",
"devices_without_subentry": "Devices that don't belong to a sub-entry",
"copy": "Copy entry ID",
"rename": "Rename",
"configure": "Configure",
"system_options": "System options",
Expand Down
Loading