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

View File

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