mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +00:00
Use const everywhere for "group.default_view" (#8918)
This commit is contained in:
parent
9d29b55bee
commit
f6e223c18d
@ -3,6 +3,8 @@ import {
|
|||||||
HassEntity,
|
HassEntity,
|
||||||
STATE_NOT_RUNNING,
|
STATE_NOT_RUNNING,
|
||||||
} from "home-assistant-js-websocket";
|
} from "home-assistant-js-websocket";
|
||||||
|
import { isComponentLoaded } from "../../../common/config/is_component_loaded";
|
||||||
|
import { DEFAULT_VIEW_ENTITY_ID } from "../../../common/const";
|
||||||
import { computeDomain } from "../../../common/entity/compute_domain";
|
import { computeDomain } from "../../../common/entity/compute_domain";
|
||||||
import { computeObjectId } from "../../../common/entity/compute_object_id";
|
import { computeObjectId } from "../../../common/entity/compute_object_id";
|
||||||
import { computeStateDomain } from "../../../common/entity/compute_state_domain";
|
import { computeStateDomain } from "../../../common/entity/compute_state_domain";
|
||||||
@ -13,7 +15,6 @@ import { splitByGroups } from "../../../common/entity/split_by_groups";
|
|||||||
import { compare } from "../../../common/string/compare";
|
import { compare } from "../../../common/string/compare";
|
||||||
import { LocalizeFunc } from "../../../common/translations/localize";
|
import { LocalizeFunc } from "../../../common/translations/localize";
|
||||||
import { subscribeOne } from "../../../common/util/subscribe-one";
|
import { subscribeOne } from "../../../common/util/subscribe-one";
|
||||||
import { isComponentLoaded } from "../../../common/config/is_component_loaded";
|
|
||||||
import {
|
import {
|
||||||
AreaRegistryEntry,
|
AreaRegistryEntry,
|
||||||
subscribeAreaRegistry,
|
subscribeAreaRegistry,
|
||||||
@ -45,7 +46,6 @@ import {
|
|||||||
} from "../cards/types";
|
} from "../cards/types";
|
||||||
import { LovelaceRowConfig } from "../entity-rows/types";
|
import { LovelaceRowConfig } from "../entity-rows/types";
|
||||||
|
|
||||||
const DEFAULT_VIEW_ENTITY_ID = "group.default_view";
|
|
||||||
const HIDE_DOMAIN = new Set([
|
const HIDE_DOMAIN = new Set([
|
||||||
"automation",
|
"automation",
|
||||||
"configurator",
|
"configurator",
|
||||||
@ -181,7 +181,8 @@ export const computeCards = (
|
|||||||
titlePrefix &&
|
titlePrefix &&
|
||||||
stateObj &&
|
stateObj &&
|
||||||
// eslint-disable-next-line no-cond-assign
|
// eslint-disable-next-line no-cond-assign
|
||||||
(name = computeStateName(stateObj)) !== titlePrefix && name.startsWith(titlePrefix)
|
(name = computeStateName(stateObj)) !== titlePrefix &&
|
||||||
|
name.startsWith(titlePrefix)
|
||||||
? {
|
? {
|
||||||
entity: entityId,
|
entity: entityId,
|
||||||
name: adjustName(name.substr(titlePrefix.length)),
|
name: adjustName(name.substr(titlePrefix.length)),
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import * as assert from "assert";
|
import * as assert from "assert";
|
||||||
|
import { DEFAULT_VIEW_ENTITY_ID } from "../../../src/common/const";
|
||||||
import { extractViews } from "../../../src/common/entity/extract_views";
|
import { extractViews } from "../../../src/common/entity/extract_views";
|
||||||
|
|
||||||
import { createEntities, createView } from "./test_util";
|
import { createEntities, createView } from "./test_util";
|
||||||
|
|
||||||
describe("extractViews", () => {
|
describe("extractViews", () => {
|
||||||
@ -14,7 +13,7 @@ describe("extractViews", () => {
|
|||||||
entities[view2.entity_id] = view2;
|
entities[view2.entity_id] = view2;
|
||||||
|
|
||||||
const view3 = createView({
|
const view3 = createView({
|
||||||
entity_id: "group.default_view",
|
entity_id: DEFAULT_VIEW_ENTITY_ID,
|
||||||
attributes: { order: 8 },
|
attributes: { order: 8 },
|
||||||
});
|
});
|
||||||
entities[view3.entity_id] = view3;
|
entities[view3.entity_id] = view3;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user