Hide system generated integration options (#8764)

This commit is contained in:
Joakim Sørensen 2021-03-30 23:09:08 +02:00 committed by GitHub
parent 828523f281
commit 7d63e3e088
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 11 deletions

View File

@ -55,6 +55,10 @@ declare global {
}
const integrationsWithPanel = {
hassio: {
buttonLocalizeKey: "ui.panel.config.hassio.button",
path: "/hassio/dashboard",
},
mqtt: {
buttonLocalizeKey: "ui.panel.config.mqtt.button",
path: "/config/mqtt",
@ -344,7 +348,8 @@ export class HaIntegrationCard extends LitElement {
`}
${!item.disabled_by &&
item.state === "loaded" &&
item.supports_unload
item.supports_unload &&
item.source !== "system"
? html`<mwc-list-item @request-selected="${this._handleReload}">
${this.hass.localize(
"ui.panel.config.integrations.config_entry.reload"
@ -355,20 +360,24 @@ export class HaIntegrationCard extends LitElement {
? html`<mwc-list-item @request-selected="${this._handleEnable}">
${this.hass.localize("ui.common.enable")}
</mwc-list-item>`
: html`<mwc-list-item
: item.source !== "system"
? html`<mwc-list-item
class="warning"
@request-selected="${this._handleDisable}"
>
${this.hass.localize("ui.common.disable")}
</mwc-list-item>`}
<mwc-list-item
class="warning"
@request-selected="${this._handleDelete}"
>
${this.hass.localize(
"ui.panel.config.integrations.config_entry.delete"
)}
</mwc-list-item>
</mwc-list-item>`
: ""}
${item.source !== "system"
? html`<mwc-list-item
class="warning"
@request-selected="${this._handleDelete}"
>
${this.hass.localize(
"ui.panel.config.integrations.config_entry.delete"
)}
</mwc-list-item>`
: ""}
</ha-button-menu>
</div>
</ha-card>

View File

@ -2232,6 +2232,9 @@
"create": "Create"
}
},
"hassio": {
"button": "Configure"
},
"mqtt": {
"button": "Configure",
"title": "MQTT",