Remove sort now that data-table does it (#5508)

This commit is contained in:
Bram Kragten 2020-04-09 15:45:18 +02:00 committed by GitHub
parent cd1bfe1b20
commit 0c06517dcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 36 deletions

View File

@ -108,18 +108,7 @@ class HaConfigAutomation extends PolymerElement {
}
});
return automations.sort(function entitySortBy(entityA, entityB) {
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;
});
return automations;
}
computeShowEditor(_edittingAutomation, _creatingNew) {

View File

@ -1,5 +1,3 @@
import "@polymer/app-route/app-route";
import "./ha-scene-editor";
import "./ha-scene-dashboard";
@ -10,8 +8,6 @@ import {
import { property, customElement, PropertyValues } from "lit-element";
import { HomeAssistant } from "../../../types";
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 memoizeOne from "memoize-one";
import { HassEntities } from "home-assistant-js-websocket";
@ -45,14 +41,8 @@ class HaConfigScene extends HassRouterPage {
}
});
return scenes.sort((a, b) => {
return compare(computeStateName(a), computeStateName(b));
return scenes;
});
});
public disconnectedCallback() {
super.disconnectedCallback();
}
protected updatePageEl(pageEl, changedProps: PropertyValues) {
pageEl.hass = this.hass;

View File

@ -5,7 +5,6 @@ import { PolymerElement } from "@polymer/polymer/polymer-element";
import "./ha-script-editor";
import "./ha-script-picker";
import { computeStateName } from "../../../common/entity/compute_state_name";
import { computeStateDomain } from "../../../common/entity/compute_state_domain";
class HaConfigScript extends PolymerElement {
@ -103,18 +102,7 @@ class HaConfigScript extends PolymerElement {
}
});
return scripts.sort(function entitySortBy(entityA, entityB) {
var nameA = computeStateName(entityA);
var nameB = computeStateName(entityB);
if (nameA < nameB) {
return -1;
}
if (nameA > nameB) {
return 1;
}
return 0;
});
return scripts;
}
computeShowEditor(_edittingScript, _creatingNew) {