mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 16:26:43 +00:00
Revert "20240626.1" (#21180)
Revert "20240626.1 (#21179)" This reverts commit a16cae0671c744b4ea87ec90a04ecbff918a7ca6.
This commit is contained in:
parent
a16cae0671
commit
530745d20d
@ -2,7 +2,6 @@ import type { IFuseOptions } from "fuse.js";
|
|||||||
import Fuse from "fuse.js";
|
import Fuse from "fuse.js";
|
||||||
import { stripDiacritics } from "../../../src/common/string/strip-diacritics";
|
import { stripDiacritics } from "../../../src/common/string/strip-diacritics";
|
||||||
import { StoreAddon } from "../../../src/data/supervisor/store";
|
import { StoreAddon } from "../../../src/data/supervisor/store";
|
||||||
import { getStripDiacriticsFn } from "../../../src/util/fuse";
|
|
||||||
|
|
||||||
export function filterAndSort(addons: StoreAddon[], filter: string) {
|
export function filterAndSort(addons: StoreAddon[], filter: string) {
|
||||||
const options: IFuseOptions<StoreAddon> = {
|
const options: IFuseOptions<StoreAddon> = {
|
||||||
@ -10,7 +9,7 @@ export function filterAndSort(addons: StoreAddon[], filter: string) {
|
|||||||
isCaseSensitive: false,
|
isCaseSensitive: false,
|
||||||
minMatchCharLength: Math.min(filter.length, 2),
|
minMatchCharLength: Math.min(filter.length, 2),
|
||||||
threshold: 0.2,
|
threshold: 0.2,
|
||||||
getFn: getStripDiacriticsFn,
|
getFn: (obj, path) => stripDiacritics(Fuse.config.getFn(obj, path)),
|
||||||
};
|
};
|
||||||
const fuse = new Fuse(addons, options);
|
const fuse = new Fuse(addons, options);
|
||||||
return fuse.search(stripDiacritics(filter)).map((result) => result.item);
|
return fuse.search(stripDiacritics(filter)).map((result) => result.item);
|
||||||
|
@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "home-assistant-frontend"
|
name = "home-assistant-frontend"
|
||||||
version = "20240626.1"
|
version = "20240626.0"
|
||||||
license = {text = "Apache-2.0"}
|
license = {text = "Apache-2.0"}
|
||||||
description = "The Home Assistant frontend"
|
description = "The Home Assistant frontend"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
export const stripDiacritics = (str: string) =>
|
export const stripDiacritics = (str) =>
|
||||||
str.normalize("NFD").replace(/[\u0300-\u036F]/g, "");
|
str.normalize("NFD").replace(/[\u0300-\u036F]/g, "");
|
||||||
|
@ -18,7 +18,6 @@ import memoizeOne from "memoize-one";
|
|||||||
import { fireEvent } from "../../../common/dom/fire_event";
|
import { fireEvent } from "../../../common/dom/fire_event";
|
||||||
import { computeDomain } from "../../../common/entity/compute_domain";
|
import { computeDomain } from "../../../common/entity/compute_domain";
|
||||||
import { stringCompare } from "../../../common/string/compare";
|
import { stringCompare } from "../../../common/string/compare";
|
||||||
import { stripDiacritics } from "../../../common/string/strip-diacritics";
|
|
||||||
import { LocalizeFunc } from "../../../common/translations/localize";
|
import { LocalizeFunc } from "../../../common/translations/localize";
|
||||||
import { deepEqual } from "../../../common/util/deep-equal";
|
import { deepEqual } from "../../../common/util/deep-equal";
|
||||||
import "../../../components/ha-dialog";
|
import "../../../components/ha-dialog";
|
||||||
@ -51,11 +50,11 @@ import { TRIGGER_GROUPS, TRIGGER_ICONS } from "../../../data/trigger";
|
|||||||
import { HassDialog } from "../../../dialogs/make-dialog-manager";
|
import { HassDialog } from "../../../dialogs/make-dialog-manager";
|
||||||
import { haStyle, haStyleDialog } from "../../../resources/styles";
|
import { haStyle, haStyleDialog } from "../../../resources/styles";
|
||||||
import { HomeAssistant } from "../../../types";
|
import { HomeAssistant } from "../../../types";
|
||||||
import { getStripDiacriticsFn } from "../../../util/fuse";
|
|
||||||
import {
|
import {
|
||||||
AddAutomationElementDialogParams,
|
AddAutomationElementDialogParams,
|
||||||
PASTE_VALUE,
|
PASTE_VALUE,
|
||||||
} from "./show-add-automation-element-dialog";
|
} from "./show-add-automation-element-dialog";
|
||||||
|
import { stripDiacritics } from "../../../common/string/strip-diacritics";
|
||||||
|
|
||||||
const TYPES = {
|
const TYPES = {
|
||||||
trigger: { groups: TRIGGER_GROUPS, icons: TRIGGER_ICONS },
|
trigger: { groups: TRIGGER_GROUPS, icons: TRIGGER_ICONS },
|
||||||
@ -210,7 +209,7 @@ class DialogAddAutomationElement extends LitElement implements HassDialog {
|
|||||||
isCaseSensitive: false,
|
isCaseSensitive: false,
|
||||||
minMatchCharLength: Math.min(filter.length, 2),
|
minMatchCharLength: Math.min(filter.length, 2),
|
||||||
threshold: 0.2,
|
threshold: 0.2,
|
||||||
getFn: getStripDiacriticsFn,
|
getFn: (obj, path) => stripDiacritics(Fuse.config.getFn(obj, path)),
|
||||||
};
|
};
|
||||||
const fuse = new Fuse(items, options);
|
const fuse = new Fuse(items, options);
|
||||||
return fuse.search(stripDiacritics(filter)).map((result) => result.item);
|
return fuse.search(stripDiacritics(filter)).map((result) => result.item);
|
||||||
|
@ -56,7 +56,6 @@ import {
|
|||||||
} from "./show-add-integration-dialog";
|
} from "./show-add-integration-dialog";
|
||||||
import { getConfigEntries } from "../../../data/config_entries";
|
import { getConfigEntries } from "../../../data/config_entries";
|
||||||
import { stripDiacritics } from "../../../common/string/strip-diacritics";
|
import { stripDiacritics } from "../../../common/string/strip-diacritics";
|
||||||
import { getStripDiacriticsFn } from "../../../util/fuse";
|
|
||||||
|
|
||||||
export interface IntegrationListItem {
|
export interface IntegrationListItem {
|
||||||
name: string;
|
name: string;
|
||||||
@ -257,7 +256,7 @@ class AddIntegrationDialog extends LitElement {
|
|||||||
isCaseSensitive: false,
|
isCaseSensitive: false,
|
||||||
minMatchCharLength: Math.min(filter.length, 2),
|
minMatchCharLength: Math.min(filter.length, 2),
|
||||||
threshold: 0.2,
|
threshold: 0.2,
|
||||||
getFn: getStripDiacriticsFn,
|
getFn: (obj, path) => stripDiacritics(Fuse.config.getFn(obj, path)),
|
||||||
};
|
};
|
||||||
const helpers = Object.entries(h).map(([domain, integration]) => ({
|
const helpers = Object.entries(h).map(([domain, integration]) => ({
|
||||||
domain,
|
domain,
|
||||||
|
@ -1,27 +1,25 @@
|
|||||||
import { ActionDetail } from "@material/mwc-list";
|
import { ActionDetail } from "@material/mwc-list";
|
||||||
import { mdiFilterVariant, mdiPlus } from "@mdi/js";
|
import { mdiFilterVariant, mdiPlus } from "@mdi/js";
|
||||||
import type { IFuseOptions } from "fuse.js";
|
|
||||||
import Fuse from "fuse.js";
|
import Fuse from "fuse.js";
|
||||||
|
import type { IFuseOptions } from "fuse.js";
|
||||||
import type { UnsubscribeFunc } from "home-assistant-js-websocket";
|
import type { UnsubscribeFunc } from "home-assistant-js-websocket";
|
||||||
import {
|
import {
|
||||||
CSSResultGroup,
|
|
||||||
LitElement,
|
|
||||||
PropertyValues,
|
|
||||||
css,
|
css,
|
||||||
|
CSSResultGroup,
|
||||||
html,
|
html,
|
||||||
|
LitElement,
|
||||||
nothing,
|
nothing,
|
||||||
|
PropertyValues,
|
||||||
} from "lit";
|
} from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import { ifDefined } from "lit/directives/if-defined";
|
import { ifDefined } from "lit/directives/if-defined";
|
||||||
import memoizeOne from "memoize-one";
|
import memoizeOne from "memoize-one";
|
||||||
import { isComponentLoaded } from "../../../common/config/is_component_loaded";
|
import { isComponentLoaded } from "../../../common/config/is_component_loaded";
|
||||||
import {
|
import {
|
||||||
PROTOCOL_INTEGRATIONS,
|
|
||||||
protocolIntegrationPicked,
|
protocolIntegrationPicked,
|
||||||
|
PROTOCOL_INTEGRATIONS,
|
||||||
} from "../../../common/integrations/protocolIntegrationPicked";
|
} from "../../../common/integrations/protocolIntegrationPicked";
|
||||||
import { navigate } from "../../../common/navigate";
|
import { navigate } from "../../../common/navigate";
|
||||||
import { caseInsensitiveStringCompare } from "../../../common/string/compare";
|
|
||||||
import { stripDiacritics } from "../../../common/string/strip-diacritics";
|
|
||||||
import { extractSearchParam } from "../../../common/url/search-params";
|
import { extractSearchParam } from "../../../common/url/search-params";
|
||||||
import { nextRender } from "../../../common/util/render-status";
|
import { nextRender } from "../../../common/util/render-status";
|
||||||
import "../../../components/ha-button-menu";
|
import "../../../components/ha-button-menu";
|
||||||
@ -31,7 +29,6 @@ import "../../../components/ha-fab";
|
|||||||
import "../../../components/ha-icon-button";
|
import "../../../components/ha-icon-button";
|
||||||
import "../../../components/ha-svg-icon";
|
import "../../../components/ha-svg-icon";
|
||||||
import "../../../components/search-input";
|
import "../../../components/search-input";
|
||||||
import "../../../components/search-input-outlined";
|
|
||||||
import { ConfigEntry, getConfigEntries } from "../../../data/config_entries";
|
import { ConfigEntry, getConfigEntries } from "../../../data/config_entries";
|
||||||
import { getConfigFlowInProgressCollection } from "../../../data/config_flow";
|
import { getConfigFlowInProgressCollection } from "../../../data/config_flow";
|
||||||
import { fetchDiagnosticHandlers } from "../../../data/diagnostics";
|
import { fetchDiagnosticHandlers } from "../../../data/diagnostics";
|
||||||
@ -40,11 +37,11 @@ import {
|
|||||||
subscribeEntityRegistry,
|
subscribeEntityRegistry,
|
||||||
} from "../../../data/entity_registry";
|
} from "../../../data/entity_registry";
|
||||||
import {
|
import {
|
||||||
IntegrationLogInfo,
|
|
||||||
IntegrationManifest,
|
|
||||||
domainToName,
|
domainToName,
|
||||||
fetchIntegrationManifest,
|
fetchIntegrationManifest,
|
||||||
fetchIntegrationManifests,
|
fetchIntegrationManifests,
|
||||||
|
IntegrationLogInfo,
|
||||||
|
IntegrationManifest,
|
||||||
subscribeLogInfo,
|
subscribeLogInfo,
|
||||||
} from "../../../data/integration";
|
} from "../../../data/integration";
|
||||||
import {
|
import {
|
||||||
@ -62,17 +59,19 @@ import "../../../layouts/hass-tabs-subpage";
|
|||||||
import { SubscribeMixin } from "../../../mixins/subscribe-mixin";
|
import { SubscribeMixin } from "../../../mixins/subscribe-mixin";
|
||||||
import { haStyle } from "../../../resources/styles";
|
import { haStyle } from "../../../resources/styles";
|
||||||
import type { HomeAssistant, Route } from "../../../types";
|
import type { HomeAssistant, Route } from "../../../types";
|
||||||
import { getStripDiacriticsFn } from "../../../util/fuse";
|
|
||||||
import { configSections } from "../ha-panel-config";
|
import { configSections } from "../ha-panel-config";
|
||||||
import { isHelperDomain } from "../helpers/const";
|
import { isHelperDomain } from "../helpers/const";
|
||||||
import "./ha-config-flow-card";
|
import "./ha-config-flow-card";
|
||||||
import { DataEntryFlowProgressExtended } from "./ha-config-integrations";
|
import { DataEntryFlowProgressExtended } from "./ha-config-integrations";
|
||||||
import "./ha-disabled-config-entry-card";
|
|
||||||
import "./ha-ignored-config-entry-card";
|
import "./ha-ignored-config-entry-card";
|
||||||
import "./ha-integration-card";
|
import "./ha-integration-card";
|
||||||
import type { HaIntegrationCard } from "./ha-integration-card";
|
import type { HaIntegrationCard } from "./ha-integration-card";
|
||||||
import "./ha-integration-overflow-menu";
|
import "./ha-integration-overflow-menu";
|
||||||
import { showAddIntegrationDialog } from "./show-add-integration-dialog";
|
import { showAddIntegrationDialog } from "./show-add-integration-dialog";
|
||||||
|
import "./ha-disabled-config-entry-card";
|
||||||
|
import { caseInsensitiveStringCompare } from "../../../common/string/compare";
|
||||||
|
import "../../../components/search-input-outlined";
|
||||||
|
import { stripDiacritics } from "../../../common/string/strip-diacritics";
|
||||||
|
|
||||||
export interface ConfigEntryExtended extends ConfigEntry {
|
export interface ConfigEntryExtended extends ConfigEntry {
|
||||||
localized_domain_name?: string;
|
localized_domain_name?: string;
|
||||||
@ -210,7 +209,7 @@ class HaConfigIntegrationsDashboard extends SubscribeMixin(LitElement) {
|
|||||||
isCaseSensitive: false,
|
isCaseSensitive: false,
|
||||||
minMatchCharLength: Math.min(filter.length, 2),
|
minMatchCharLength: Math.min(filter.length, 2),
|
||||||
threshold: 0.2,
|
threshold: 0.2,
|
||||||
getFn: getStripDiacriticsFn,
|
getFn: (obj, path) => stripDiacritics(Fuse.config.getFn(obj, path)),
|
||||||
};
|
};
|
||||||
const fuse = new Fuse(configEntriesInProgress, options);
|
const fuse = new Fuse(configEntriesInProgress, options);
|
||||||
filteredEntries = fuse
|
filteredEntries = fuse
|
||||||
|
@ -105,8 +105,6 @@ export class HuiCard extends ReactiveElement {
|
|||||||
"ll-upgrade",
|
"ll-upgrade",
|
||||||
(ev: Event) => {
|
(ev: Event) => {
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
element.hass = this.hass;
|
|
||||||
element.preview = this.preview;
|
|
||||||
fireEvent(this, "card-updated");
|
fireEvent(this, "card-updated");
|
||||||
},
|
},
|
||||||
{ once: true }
|
{ once: true }
|
||||||
|
@ -29,7 +29,6 @@ import {
|
|||||||
getCustomCardEntry,
|
getCustomCardEntry,
|
||||||
} from "../../../../data/lovelace_custom_cards";
|
} from "../../../../data/lovelace_custom_cards";
|
||||||
import type { HomeAssistant } from "../../../../types";
|
import type { HomeAssistant } from "../../../../types";
|
||||||
import { getStripDiacriticsFn } from "../../../../util/fuse";
|
|
||||||
import {
|
import {
|
||||||
calcUnusedEntities,
|
calcUnusedEntities,
|
||||||
computeUsedEntities,
|
computeUsedEntities,
|
||||||
@ -88,7 +87,7 @@ export class HuiCardPicker extends LitElement {
|
|||||||
isCaseSensitive: false,
|
isCaseSensitive: false,
|
||||||
minMatchCharLength: Math.min(filter.length, 2),
|
minMatchCharLength: Math.min(filter.length, 2),
|
||||||
threshold: 0.2,
|
threshold: 0.2,
|
||||||
getFn: getStripDiacriticsFn,
|
getFn: (obj, path) => stripDiacritics(Fuse.config.getFn(obj, path)),
|
||||||
};
|
};
|
||||||
const fuse = new Fuse(cards, options);
|
const fuse = new Fuse(cards, options);
|
||||||
cards = fuse.search(stripDiacritics(filter)).map((result) => result.item);
|
cards = fuse.search(stripDiacritics(filter)).map((result) => result.item);
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
import Fuse from "fuse.js";
|
|
||||||
import { stripDiacritics } from "../common/string/strip-diacritics";
|
|
||||||
|
|
||||||
type GetFn = typeof Fuse.config.getFn;
|
|
||||||
|
|
||||||
export const getStripDiacriticsFn: GetFn = (obj, path) => {
|
|
||||||
const value = Fuse.config.getFn(obj, path);
|
|
||||||
if (Array.isArray(value)) {
|
|
||||||
return value.map((v) => stripDiacritics(v ?? ""));
|
|
||||||
}
|
|
||||||
return stripDiacritics((value as string | undefined) ?? "");
|
|
||||||
};
|
|
Loading…
x
Reference in New Issue
Block a user