mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 18:56:39 +00:00
Remove sort now that data-table does it (#5508)
This commit is contained in:
parent
cd1bfe1b20
commit
0c06517dcc
@ -108,18 +108,7 @@ class HaConfigAutomation extends PolymerElement {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return automations.sort(function entitySortBy(entityA, entityB) {
|
return automations;
|
||||||
var nameA = (entityA.attributes.alias || entityA.entity_id).toLowerCase();
|
|
||||||
var nameB = (entityB.attributes.alias || entityB.entity_id).toLowerCase();
|
|
||||||
|
|
||||||
if (nameA < nameB) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (nameA > nameB) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
computeShowEditor(_edittingAutomation, _creatingNew) {
|
computeShowEditor(_edittingAutomation, _creatingNew) {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
import "@polymer/app-route/app-route";
|
|
||||||
|
|
||||||
import "./ha-scene-editor";
|
import "./ha-scene-editor";
|
||||||
import "./ha-scene-dashboard";
|
import "./ha-scene-dashboard";
|
||||||
|
|
||||||
@ -10,8 +8,6 @@ import {
|
|||||||
import { property, customElement, PropertyValues } from "lit-element";
|
import { property, customElement, PropertyValues } from "lit-element";
|
||||||
import { HomeAssistant } from "../../../types";
|
import { HomeAssistant } from "../../../types";
|
||||||
import { computeStateDomain } from "../../../common/entity/compute_state_domain";
|
import { computeStateDomain } from "../../../common/entity/compute_state_domain";
|
||||||
import { computeStateName } from "../../../common/entity/compute_state_name";
|
|
||||||
import { compare } from "../../../common/string/compare";
|
|
||||||
import { SceneEntity } from "../../../data/scene";
|
import { SceneEntity } from "../../../data/scene";
|
||||||
import memoizeOne from "memoize-one";
|
import memoizeOne from "memoize-one";
|
||||||
import { HassEntities } from "home-assistant-js-websocket";
|
import { HassEntities } from "home-assistant-js-websocket";
|
||||||
@ -45,14 +41,8 @@ class HaConfigScene extends HassRouterPage {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return scenes.sort((a, b) => {
|
return scenes;
|
||||||
return compare(computeStateName(a), computeStateName(b));
|
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
public disconnectedCallback() {
|
|
||||||
super.disconnectedCallback();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected updatePageEl(pageEl, changedProps: PropertyValues) {
|
protected updatePageEl(pageEl, changedProps: PropertyValues) {
|
||||||
pageEl.hass = this.hass;
|
pageEl.hass = this.hass;
|
||||||
|
@ -5,7 +5,6 @@ import { PolymerElement } from "@polymer/polymer/polymer-element";
|
|||||||
import "./ha-script-editor";
|
import "./ha-script-editor";
|
||||||
import "./ha-script-picker";
|
import "./ha-script-picker";
|
||||||
|
|
||||||
import { computeStateName } from "../../../common/entity/compute_state_name";
|
|
||||||
import { computeStateDomain } from "../../../common/entity/compute_state_domain";
|
import { computeStateDomain } from "../../../common/entity/compute_state_domain";
|
||||||
|
|
||||||
class HaConfigScript extends PolymerElement {
|
class HaConfigScript extends PolymerElement {
|
||||||
@ -103,18 +102,7 @@ class HaConfigScript extends PolymerElement {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return scripts.sort(function entitySortBy(entityA, entityB) {
|
return scripts;
|
||||||
var nameA = computeStateName(entityA);
|
|
||||||
var nameB = computeStateName(entityB);
|
|
||||||
|
|
||||||
if (nameA < nameB) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (nameA > nameB) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
computeShowEditor(_edittingScript, _creatingNew) {
|
computeShowEditor(_edittingScript, _creatingNew) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user