mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 11:46:42 +00:00
Fix filters for entity/device from integrations dashboard (#20953)
This commit is contained in:
parent
250f87cfd8
commit
f2b2da9877
@ -199,38 +199,28 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _setFiltersFromUrl() {
|
private _setFiltersFromUrl() {
|
||||||
if (this._searchParms.has("domain")) {
|
const domain = this._searchParms.get("domain");
|
||||||
this._filters = {
|
const configEntry = this._searchParms.get("config_entry");
|
||||||
...this._filters,
|
|
||||||
"ha-filter-states": {
|
this._filters = {
|
||||||
value: [
|
...this._filters,
|
||||||
...((this._filters["ha-filter-states"]?.value as string[]) || []),
|
"ha-filter-states": {
|
||||||
"disabled",
|
value: [
|
||||||
],
|
...((this._filters["ha-filter-states"]?.value as string[]) || []),
|
||||||
items: undefined,
|
"disabled",
|
||||||
},
|
],
|
||||||
"ha-filter-integrations": {
|
items: undefined,
|
||||||
value: [this._searchParms.get("domain")!],
|
},
|
||||||
items: undefined,
|
"ha-filter-integrations": {
|
||||||
},
|
value: domain ? [domain] : [],
|
||||||
};
|
items: undefined,
|
||||||
}
|
},
|
||||||
if (this._searchParms.has("config_entry")) {
|
config_entry: {
|
||||||
this._filters = {
|
value: configEntry ? [configEntry] : [],
|
||||||
...this._filters,
|
items: undefined,
|
||||||
"ha-filter-states": {
|
},
|
||||||
value: [
|
};
|
||||||
...((this._filters["ha-filter-states"]?.value as string[]) || []),
|
|
||||||
"disabled",
|
|
||||||
],
|
|
||||||
items: undefined,
|
|
||||||
},
|
|
||||||
config_entry: {
|
|
||||||
value: [this._searchParms.get("config_entry")!],
|
|
||||||
items: undefined,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
if (this._searchParms.has("label")) {
|
if (this._searchParms.has("label")) {
|
||||||
this._filterLabel();
|
this._filterLabel();
|
||||||
}
|
}
|
||||||
|
@ -943,6 +943,7 @@ ${
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected firstUpdated() {
|
protected firstUpdated() {
|
||||||
|
this._setFiltersFromUrl();
|
||||||
if (Object.keys(this._filters).length) {
|
if (Object.keys(this._filters).length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -952,39 +953,31 @@ ${
|
|||||||
items: undefined,
|
items: undefined,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
this._setFiltersFromUrl();
|
|
||||||
fetchEntitySourcesWithCache(this.hass).then((sources) => {
|
fetchEntitySourcesWithCache(this.hass).then((sources) => {
|
||||||
this._entitySources = sources;
|
this._entitySources = sources;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private _setFiltersFromUrl() {
|
private _setFiltersFromUrl() {
|
||||||
if (this._searchParms.has("domain")) {
|
const domain = this._searchParms.get("domain");
|
||||||
this._filters = {
|
const configEntry = this._searchParms.get("config_entry");
|
||||||
...this._filters,
|
|
||||||
"ha-filter-states": {
|
this._filters = {
|
||||||
value: [],
|
...this._filters,
|
||||||
items: undefined,
|
"ha-filter-states": {
|
||||||
},
|
value: [],
|
||||||
"ha-filter-integrations": {
|
items: undefined,
|
||||||
value: [this._searchParms.get("domain")!],
|
},
|
||||||
items: undefined,
|
"ha-filter-integrations": {
|
||||||
},
|
value: domain ? [domain] : [],
|
||||||
};
|
items: undefined,
|
||||||
}
|
},
|
||||||
if (this._searchParms.has("config_entry")) {
|
config_entry: {
|
||||||
this._filters = {
|
value: configEntry ? [configEntry] : [],
|
||||||
...this._filters,
|
items: undefined,
|
||||||
"ha-filter-states": {
|
},
|
||||||
value: [],
|
};
|
||||||
items: undefined,
|
|
||||||
},
|
|
||||||
config_entry: {
|
|
||||||
value: [this._searchParms.get("config_entry")!],
|
|
||||||
items: undefined,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
if (this._searchParms.has("label")) {
|
if (this._searchParms.has("label")) {
|
||||||
this._filterLabel();
|
this._filterLabel();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user