Skip to content

Commit

Permalink
Fix translation loading and manifest fetching for integration page (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten authored Jul 30, 2024
1 parent 4ade395 commit a5786b4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/layouts/hass-tabs-subpage-data-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ export class HaTabsSubpageDataTable extends LitElement {
<ha-assist-chip
.label=${localize("ui.components.subpage-data-table.sort_by", {
sortColumn: this._sortColumn
? ` ${this.columns[this._sortColumn].title || this.columns[this._sortColumn].label}`
? ` ${this.columns[this._sortColumn]?.title || this.columns[this._sortColumn]?.label}` ||
""
: "",
})}
id="sort-by-anchor"
Expand Down
4 changes: 3 additions & 1 deletion src/panels/config/integrations/ha-config-integration-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,9 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
</h1>
${normalEntries.length === 0
? html`<div class="card-content no-entries">
${this.hass.config.components.find(
${this._manifest &&
!this._manifest.config_flow &&
this.hass.config.components.find(
(comp) => comp.split(".")[0] === this.domain
)
? this.hass.localize(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ class HaConfigIntegrationsDashboard extends SubscribeMixin(LitElement) {
if (
!entryDomains.has(componentDomain) &&
manifests[componentDomain] &&
!manifests[componentDomain].config_flow &&
(!manifests[componentDomain].integration_type ||
["device", "hub", "service", "integration"].includes(
manifests[componentDomain].integration_type!
Expand Down Expand Up @@ -314,6 +315,11 @@ class HaConfigIntegrationsDashboard extends SubscribeMixin(LitElement) {
this.configEntriesInProgress.map((flow) => flow.handler)
);
}
if (changed.has("configEntries") && this.configEntries) {
this._fetchIntegrationManifests(
this.configEntries.map((entry) => entry.domain)
);
}
}

protected render() {
Expand Down
5 changes: 4 additions & 1 deletion src/panels/config/integrations/ha-config-integrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ class HaConfigIntegrations extends SubscribeMixin(HassRouterPage) {
if (this.hasUpdated) {
return;
}
this._loadTranslationsPromise = this.hass.loadBackendTranslation("title");
this._loadTranslationsPromise = this.hass.loadBackendTranslation(
"title",
this.hass.config.components.map((comp) => comp.split(".")[0])
);
}

protected updatePageEl(pageEl) {
Expand Down
2 changes: 1 addition & 1 deletion src/panels/config/integrations/ha-integration-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export class HaIntegrationCard extends LitElement {
>
</div>`
: nothing}
${!this.manifest?.config_flow
${this.manifest && !this.manifest?.config_flow
? html`<div class="icon yaml">
<ha-svg-icon .path=${mdiCodeBraces}></ha-svg-icon>
<simple-tooltip
Expand Down

0 comments on commit a5786b4

Please sign in to comment.