minor refactor
This commit is contained in:
1 parent
eee37346ab
commit
a9b2bdb775
76 files changed
+77
-77
No files matched your search
+1
-1
@@ -1,7 +1,7 @@
|
||||
import "./App.css";
|
||||
import { Routes, Route, BrowserRouter } from "react-router-dom";
|
||||
import { AutomationRoute } from "routes/automation";
|
||||
import { useConnectedApiService } from "apiService";
|
||||
import { useConnectedApiService } from "services/apiService";
|
||||
import { ErrorBoundary } from "components/ErrorBoundary";
|
||||
import { CookiesProvider } from "react-cookie";
|
||||
import { Page } from "components/Page";
|
||||
|
||||
@@ -10,7 +10,7 @@ import { AddIcon, TrashIcon } from "components/Icons";
|
||||
import InputAutoText from "components/Inputs/InputAutoText";
|
||||
import { TagDB } from "components/AutomationManager/TagDB";
|
||||
import { ButtonIcon } from "components/Icons/ButtonIcons";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
export interface AutoInfoBoxProps {
|
||||
metadata: AutomationMetadata & Partial<AutomationShortumationMetadata>;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import "./index.css";
|
||||
|
||||
import { AutomationNode, AutomationNodeMapping } from "types/automations";
|
||||
import { useHA } from "haService";
|
||||
import { useHA } from "services/haService";
|
||||
import { CollectionNodeElement } from "components/DAGGraph/nodes/CollectionNode/CollectionNodeElement";
|
||||
import { getDescriptionFromAutomationNode } from "utils/formatting";
|
||||
import { Size } from "components/DAGGraph/elements/types";
|
||||
|
||||
@@ -31,7 +31,7 @@ import { MiniFailure } from "types/validators/helper";
|
||||
|
||||
import { AutoInfoBox } from "./AutoInfoBox";
|
||||
import { useAutomatioEditorState, EditorData } from "./state";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
import { useSnackbar } from "notistack";
|
||||
import { Alert } from "@mui/material";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { HassEntities } from "home-assistant-js-websocket";
|
||||
import { LangStore, useLang } from "lang";
|
||||
import { LangStore, useLang } from "services/lang";
|
||||
import { useEffect, useState } from "react";
|
||||
import { AutomationData, BareAutomationData } from "types/automations";
|
||||
import { defaultAutomation } from "utils/defaults";
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
} from "./state";
|
||||
import Alert from "@mui/material/Alert";
|
||||
import { useConfirm } from "material-ui-confirm";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
export type AutomationManagerLoadedProps = UseAutomationManagerStateArgs & {
|
||||
onAutomationDelete: (aid: string, eid: string) => void;
|
||||
|
||||
@@ -7,7 +7,7 @@ import { useAutomationDB } from "./automationDB";
|
||||
import { useConfirm } from "material-ui-confirm";
|
||||
import { AutomationManagerAutoUpdatable } from "../types";
|
||||
import { useSnackbar } from "notistack";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
export type UseAutomationManagerStateArgs = {
|
||||
configAutomations: AutomationData[];
|
||||
|
||||
@@ -12,7 +12,7 @@ import { Button } from "components/Inputs/Buttons/Button";
|
||||
import InputAutoText from "components/Inputs/InputAutoText";
|
||||
|
||||
import { TagDB } from "../TagDB";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
export type TagsProps = {
|
||||
automationId: string;
|
||||
|
||||
@@ -18,7 +18,7 @@ import { ButtonIcon } from "components/Icons/ButtonIcons";
|
||||
import { AutomationManagerAuto } from "../types";
|
||||
import { Tags } from "./Tags";
|
||||
import { TagDB } from "../TagDB";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
export type MetadataBoxProps = AutomationManagerAuto & {
|
||||
onDelete: () => void;
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
} from "../types";
|
||||
import { Button } from "components/Inputs/Buttons/Button";
|
||||
import { ButtonIcon } from "components/Icons/ButtonIcons";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
export type AutomationManagerSidebarProps = {
|
||||
tagsDB: TagDB;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { makeStory } from "devUtils";
|
||||
import { useMockApiService } from "apiService";
|
||||
import { useMockApiService } from "services/apiService";
|
||||
import { AutomationManager } from ".";
|
||||
import {
|
||||
MockHAEntitiesProps,
|
||||
useMockHAEntities,
|
||||
} from "haService/HAEntities.mock";
|
||||
} from "services/haService/HAEntities.mock";
|
||||
import { AutomationData } from "types/automations";
|
||||
import { createMockAuto } from "utils/mocks";
|
||||
import { useState } from "react";
|
||||
|
||||
@@ -4,8 +4,8 @@ import { FC, useEffect, useRef, useState } from "react";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import Skeleton from "@mui/material/Skeleton";
|
||||
|
||||
import { ApiService } from "apiService/core";
|
||||
import { HAEntitiesState } from "haService/HAEntities";
|
||||
import { ApiService } from "services/apiService/core";
|
||||
import { HAEntitiesState } from "services/haService/HAEntities";
|
||||
import { AutomationManagerLoaded } from "./Loaded";
|
||||
import { Alert } from "@mui/material";
|
||||
import { useSnackbar } from "notistack";
|
||||
@@ -14,8 +14,8 @@ import { getFailures } from "types/validators/helper";
|
||||
import * as av from "types/validators/autmation";
|
||||
import { useConfirm } from "material-ui-confirm";
|
||||
import InputYaml from "components/Inputs/Base/InputYaml";
|
||||
import { APIResponse } from "apiService/types";
|
||||
import { useLang } from "lang";
|
||||
import { APIResponse } from "services/apiService/types";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
export type AutomationManagerProps = {
|
||||
onAutomationStateChange: (eid: string, on: boolean) => Promise<any>;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import Alert from "@mui/material/Alert";
|
||||
import Skeleton from "@mui/material/Skeleton";
|
||||
import { ApiService } from "apiService/core";
|
||||
import { UserProfile } from "apiService/types";
|
||||
import { ApiService } from "services/apiService/core";
|
||||
import { UserProfile } from "services/apiService/types";
|
||||
import { InputList } from "components/Inputs/InputList";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
import { FC, useState } from "react";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import "./index.css";
|
||||
import { FC, useState } from "react";
|
||||
import { useHAConnection } from "haService/connection";
|
||||
import { useHAConnection } from "services/haService/connection";
|
||||
import { Button } from "components/Inputs/Buttons/Button";
|
||||
import SettingsSuggestOutlinedIcon from "@mui/icons-material/SettingsSuggestOutlined";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
import { Modal } from "components/Modal";
|
||||
import { UserProfileEditor, UserProfileProps } from "./UserProfile";
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@ import { FC, useState } from "react";
|
||||
import { AutomationCondition } from "types/automations/conditions";
|
||||
import { getSubTypeList } from "utils/automations";
|
||||
import { getConditionDefaultValues } from "utils/defaults";
|
||||
import { useHA } from "haService";
|
||||
import { useHA } from "services/haService";
|
||||
import InputYaml from "components/Inputs/Base/InputYaml";
|
||||
import { getViewer } from "./viewRender";
|
||||
import { getEditor } from "./editorRender";
|
||||
import useWindowSize from "utils/useWindowSize";
|
||||
import { ConditionNodeSettings } from "./ConditionNodeSettings";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
export type ConditionNodeBaseProps = {
|
||||
condition: AutomationCondition;
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
import { genUpdateMethods } from "./nestedUpdater";
|
||||
import { InputTime } from "components/Inputs/Base/InputTime";
|
||||
import InputYaml from "components/Inputs/Base/InputYaml";
|
||||
import { HAService } from "haService";
|
||||
import { HAService } from "services/haService";
|
||||
import { DeviceEditor } from "components/DeviceEditor";
|
||||
import { ButtonIcon } from "components/Icons/ButtonIcons";
|
||||
import AddIcon from "@mui/icons-material/Add";
|
||||
@@ -31,7 +31,7 @@ import { prettyName } from "utils/formatting";
|
||||
import { InputList } from "components/Inputs/InputList";
|
||||
import { Button } from "components/Inputs/Buttons/Button";
|
||||
import { RemoveCircle } from "@mui/icons-material";
|
||||
import { LangStore } from "lang";
|
||||
import { LangStore } from "services/lang";
|
||||
|
||||
interface Editor<C extends AutomationCondition>
|
||||
extends FC<{
|
||||
|
||||
@@ -3,7 +3,7 @@ import { ComponentMeta, ComponentStory } from "@storybook/react";
|
||||
import { Page } from "components/Page";
|
||||
import { DAGGraphBoard } from "components/DAGGraph/board";
|
||||
import { useAutomationNodes } from "./index";
|
||||
import { useHA } from "haService";
|
||||
import { useHA } from "services/haService";
|
||||
import { AutomationActionData } from "types/automations";
|
||||
import { createUpdaterFromAutomationData } from "../updater";
|
||||
import { ModalState } from "../board/types";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { FC, useState, ReactNode } from "react";
|
||||
import { AutomationSequenceNode } from "types/automations";
|
||||
import { useHA } from "haService";
|
||||
import { useHA } from "services/haService";
|
||||
import { ModalState } from "./board/types";
|
||||
import { createUpdater } from "./updater";
|
||||
import { useAutomationNodes } from "./elements";
|
||||
|
||||
@@ -13,7 +13,7 @@ import { prettyName } from "utils/formatting";
|
||||
import DeleteForeverIcon from "@mui/icons-material/DeleteForever";
|
||||
import { useConfirm } from "material-ui-confirm";
|
||||
import { useSnackbar } from "notistack";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
export const CollectionNodeElement: FC<PropsWithChildren<CollectionNodeProps>> =
|
||||
({
|
||||
|
||||
@@ -16,7 +16,7 @@ import InputBoolean from "components/Inputs/Base/InputBoolean";
|
||||
import { SpeedDial } from "components/SpeedDial";
|
||||
import { SequenceNodeElementProps } from "./types";
|
||||
import { useSequenceNodeColor } from "./util";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
export const SequenceNodeElement: FC<
|
||||
PropsWithChildren<SequenceNodeElementProps>
|
||||
|
||||
@@ -6,9 +6,9 @@ import { InputDevice } from "components/Inputs/AutoComplete/InputDevice";
|
||||
import { InputDeviceCapabilties } from "components/Inputs/AutoComplete/InputDeviceCapabilties";
|
||||
import { InputEntity } from "components/Inputs/AutoComplete/InputEntities";
|
||||
import { cleanUpUndefined } from "utils/helpers";
|
||||
import { DeviceBaseType, DeviceTypeCapability } from "haService/types";
|
||||
import { DeviceBaseType, DeviceTypeCapability } from "services/haService/types";
|
||||
import { AutomationDeviceState } from "types/automations/common";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
export type DeviceEditorProps<DBT extends DeviceBaseType> = {
|
||||
type: "action" | "condition" | "trigger";
|
||||
|
||||
@@ -2,7 +2,7 @@ import "./ButtonIcons.css";
|
||||
import Tooltip from "@mui/material/Tooltip";
|
||||
import { FC, ReactNode } from "react";
|
||||
import IconButton, { IconButtonTypeMap } from "@mui/material/IconButton";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
export type ButtonIconProps = {
|
||||
icon: ReactNode;
|
||||
|
||||
@@ -3,8 +3,8 @@ import {
|
||||
InputAutoComplete,
|
||||
InputAutoCompletePropsBase,
|
||||
} from "./InputAutoComplete";
|
||||
import { useHAAreas } from "haService/AreaRegistry";
|
||||
import { useLang } from "lang";
|
||||
import { useHAAreas } from "services/haService/AreaRegistry";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
export type InputAreaProps = InputAutoCompletePropsBase & {
|
||||
restrictToDomain?: string[];
|
||||
|
||||
@@ -7,7 +7,7 @@ import Popper from "@mui/material/Popper";
|
||||
import { SearchItem } from "./extras";
|
||||
import { ReactNode } from "react";
|
||||
import { prettyName } from "utils/formatting";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
export type BaseOption<T = {}> = {
|
||||
id: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { FC } from "react";
|
||||
import { useHADeviceRegistry } from "haService";
|
||||
import { useLang } from "lang";
|
||||
import { useHADeviceRegistry } from "services/haService";
|
||||
import { useLang } from "services/lang";
|
||||
import {
|
||||
InputAutoComplete,
|
||||
InputAutoCompletePropsBase,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import "./InputDeviceCapabilties.css";
|
||||
import { HaFormSchema } from "haService/types";
|
||||
import { HaFormSchema } from "services/haService/types";
|
||||
import { useSnackbar } from "notistack";
|
||||
import { useRef } from "react";
|
||||
import { prettyName } from "utils/formatting";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { FC } from "react";
|
||||
import { useHAEntities } from "haService/HAEntities";
|
||||
import { useHAEntities } from "services/haService/HAEntities";
|
||||
import {
|
||||
InputAutoComplete,
|
||||
InputAutoCompletePropsBase,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { FC } from "react";
|
||||
import { useHAServices } from "haService";
|
||||
import { useHAServices } from "services/haService";
|
||||
import {
|
||||
InputAutoComplete,
|
||||
InputAutoCompletePropsBase,
|
||||
} from "./InputAutoComplete";
|
||||
import { prettyName } from "utils/formatting";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
export type InputServiceProps = InputAutoCompletePropsBase & {
|
||||
multiple?: false;
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
} from "utils/time";
|
||||
import { InputEntity } from "./InputEntities";
|
||||
import { InputTime } from "components/Inputs/Base/InputTime";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
export type InputTimeEntityProps = {
|
||||
value: string;
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
} from "utils/time";
|
||||
import { prettyName } from "utils/formatting";
|
||||
import { ButtonIcon } from "components/Icons/ButtonIcons";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
// constants
|
||||
const fields: Array<keyof AutomationTimeObject> = [
|
||||
|
||||
@@ -9,7 +9,7 @@ import FormHelperText from "@mui/material/FormHelperText";
|
||||
import InputAdornment from "@mui/material/InputAdornment";
|
||||
import { Save } from "@mui/icons-material";
|
||||
import { ButtonIcon } from "components/Icons/ButtonIcons";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
export interface Props<T extends {}> {
|
||||
label: string;
|
||||
|
||||
@@ -7,7 +7,7 @@ import FormControl from "@mui/material/FormControl";
|
||||
import Select from "@mui/material/Select";
|
||||
import { prettyName } from "utils/formatting";
|
||||
import { ReactNode } from "react";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
export type Props<T extends string | Object> = {
|
||||
current?: T;
|
||||
|
||||
@@ -5,7 +5,7 @@ import Autocomplete from "@mui/material/Autocomplete";
|
||||
import TextField from "@mui/material/TextField";
|
||||
import Checkbox from "@mui/material/Checkbox";
|
||||
import { useSnackbar } from "notistack";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
export interface Props<T extends string> {
|
||||
label: string;
|
||||
|
||||
@@ -5,7 +5,7 @@ import CheckCircleOutlineOutlinedIcon from "@mui/icons-material/CheckCircleOutli
|
||||
import ModeEditOutlineOutlinedIcon from "@mui/icons-material/ModeEditOutlineOutlined";
|
||||
import TextField from "@mui/material/TextField";
|
||||
import Tooltip from "@mui/material/Tooltip";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
export type InputTextViewProps = {
|
||||
className?: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { HAService } from "haService";
|
||||
import { HAEntitiesState } from "haService/HAEntities";
|
||||
import { LangStore } from "lang";
|
||||
import { HAService } from "services/haService";
|
||||
import { HAEntitiesState } from "services/haService/HAEntities";
|
||||
import { LangStore } from "services/lang";
|
||||
import { FC } from "react";
|
||||
import { AutomationAction } from "types/automations/actions";
|
||||
import { AutomationCondition } from "types/automations/conditions";
|
||||
|
||||
@@ -15,7 +15,7 @@ import { Button } from "components/Inputs/Buttons/Button";
|
||||
import { useState } from "react";
|
||||
import AddIcon from "@mui/icons-material/Add";
|
||||
import { InputTimeEntity } from "components/Inputs/AutoComplete/InputTimeEntity";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
export const TriggerTime: OptionManager<AutomationTriggerTime> = {
|
||||
defaultState: () => ({
|
||||
|
||||
@@ -10,10 +10,10 @@ import {
|
||||
import InputYaml from "components/Inputs/Base/InputYaml";
|
||||
import InputText from "components/Inputs/Base/InputText";
|
||||
import { getDescriptionFromAutomationNode } from "utils/formatting";
|
||||
import { useHA } from "haService";
|
||||
import { useHA } from "services/haService";
|
||||
import { Generic } from "./Generic";
|
||||
import { getNodeTypeAndValidate } from "utils/automations";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
type UseState = <S>(s: S) => [S, Dispatch<SetStateAction<S>>];
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { Button } from "components/Inputs/Buttons/Button";
|
||||
import InputBoolean from "components/Inputs/Base/InputBoolean";
|
||||
import { useConfirm } from "material-ui-confirm";
|
||||
import { getNodeSubTypeDescription } from "./utils";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
export interface NodeEditorProps {
|
||||
node: AutomationNode;
|
||||
|
||||
@@ -10,12 +10,12 @@ import {
|
||||
import { BottomBar } from "components/BottomBar";
|
||||
import { SnackbarKey, SnackbarProvider, useSnackbar } from "notistack";
|
||||
import Button from "@mui/material/Button";
|
||||
import { useHAConnection } from "haService/connection";
|
||||
import { useHAConnection } from "services/haService/connection";
|
||||
import { ConfirmProvider } from "material-ui-confirm";
|
||||
import { Color } from "@mui/material";
|
||||
import useWindowSize from "utils/useWindowSize";
|
||||
import { ApiService } from "apiService/core";
|
||||
import { ApiStateProvider, useMockApiService } from "apiService";
|
||||
import { ApiService } from "services/apiService/core";
|
||||
import { ApiStateProvider, useMockApiService } from "services/apiService";
|
||||
|
||||
export type PageProps = PropsWithChildren<{
|
||||
api: ApiService;
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
} from "components/Inputs/AutoComplete/InputAutoComplete";
|
||||
import { prettyName } from "utils/formatting";
|
||||
import InputBoolean from "components/Inputs/Base/InputBoolean";
|
||||
import { SelectorNumber, SelectorText } from "haService/fieldTypes";
|
||||
import { SelectorNumber, SelectorText } from "services/haService/fieldTypes";
|
||||
import InputYaml from "components/Inputs/Base/InputYaml";
|
||||
import { useSnackbar } from "notistack";
|
||||
import { InputEntity } from "components/Inputs/AutoComplete/InputEntities";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import "./ServiceEditorTarget.css";
|
||||
import { InputDevice } from "components/Inputs/AutoComplete/InputDevice";
|
||||
import { InputEntity } from "components/Inputs/AutoComplete/InputEntities";
|
||||
import { Targets } from "haService/fieldTypes";
|
||||
import { Targets } from "services/haService/fieldTypes";
|
||||
import { FC } from "react";
|
||||
import { InputArea } from "components/Inputs/AutoComplete/InputArea";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useState } from "react";
|
||||
import { ServiceEditor } from ".";
|
||||
import { TypedHassService } from "haService/fieldTypes";
|
||||
import { TypedHassService } from "services/haService/fieldTypes";
|
||||
import InputYaml from "components/Inputs/Base/InputYaml";
|
||||
|
||||
import { makeStory } from "devUtils";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import "./index.css";
|
||||
|
||||
import { cleanUpUndefined } from "utils/helpers";
|
||||
import { TypedHassService } from "haService/fieldTypes";
|
||||
import { TypedHassService } from "services/haService/fieldTypes";
|
||||
import { FC, useState } from "react";
|
||||
import {
|
||||
ServiceEditorOption,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { BaseOption } from "components/Inputs/AutoComplete/InputAutoComplete";
|
||||
import { FieldData, TypedHassService } from "haService/fieldTypes";
|
||||
import { FieldData, TypedHassService } from "services/haService/fieldTypes";
|
||||
import { prettyName } from "utils/formatting";
|
||||
|
||||
export type ServiceEditorData = {
|
||||
|
||||
@@ -2,8 +2,8 @@ import "styles/root.css";
|
||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
||||
import { Page } from "components/Page";
|
||||
import { ComponentProps, JSXElementConstructor } from "react";
|
||||
import { ApiService } from "apiService/core";
|
||||
import { useConnectedApiService, useMockApiService } from "apiService";
|
||||
import { ApiService } from "services/apiService/core";
|
||||
import { useConnectedApiService, useMockApiService } from "services/apiService";
|
||||
|
||||
export type MakeStoryArgs<
|
||||
T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useConnectedApiService } from "apiService";
|
||||
import { useConnectedApiService } from "services/apiService";
|
||||
import { makeStory } from "devUtils";
|
||||
import { AutomationRoute } from "./automation";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ApiService } from "apiService/core";
|
||||
import { ApiService } from "services/apiService/core";
|
||||
import { FC } from "react";
|
||||
import { useHA } from "haService";
|
||||
import { useHA } from "services/haService";
|
||||
import { AutomationManager } from "components/AutomationManager";
|
||||
|
||||
export const AutomationRoute: FC<{ api: ApiService }> = ({ api }) => {
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
|
||||
import { useAutoMockAPI } from "./mock";
|
||||
import { makeAutomationAPI } from "./automations";
|
||||
import { createMockAuto } from "../utils/mocks";
|
||||
import { createMockAuto } from "utils/mocks";
|
||||
import { AutomationData } from "types/automations";
|
||||
|
||||
const fakeUseRef = (a: any) => ({ current: a });
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -2,7 +2,7 @@ import { useState } from "react";
|
||||
import { ApiState } from "./types";
|
||||
import { AutomationAPI } from "./automations";
|
||||
import { UserProfileAPI } from "./profile";
|
||||
import { UserProfile } from "apiService/types";
|
||||
import { UserProfile } from "services/apiService/types";
|
||||
|
||||
export const useDefaultApiState = () =>
|
||||
useState<ApiState>({
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -1,6 +1,6 @@
|
||||
import React, { FC, useEffect, useState } from "react";
|
||||
import { makeStory } from "devUtils";
|
||||
import { useHA } from "haService";
|
||||
import { useHA } from "services/haService";
|
||||
import InputYaml from "components/Inputs/Base/InputYaml";
|
||||
import { InputList } from "components/Inputs/InputList";
|
||||
import { Button } from "components/Inputs/Buttons/Button";
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
ERR_INVALID_HTTPS_TO_HTTP,
|
||||
createConnection as _createConnection,
|
||||
} from "home-assistant-js-websocket";
|
||||
import { wsURL } from "apiService";
|
||||
import { wsURL } from "services/apiService";
|
||||
|
||||
export type HAConnection =
|
||||
| {
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { FC } from "react";
|
||||
import { useHADeviceRegistry } from "haService";
|
||||
import { useHADeviceRegistry } from "services/haService";
|
||||
import InputYaml from "components/Inputs/Base/InputYaml";
|
||||
import { makeStory } from "devUtils";
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import React, { FC, useState } from "react";
|
||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
||||
import { MockPage } from "components/Page";
|
||||
import { useHAEntities } from "haService/HAEntities";
|
||||
import { useHAEntities } from "services/haService/HAEntities";
|
||||
|
||||
const Test: FC<{ onRender: () => void }> = ({ onRender }) => {
|
||||
const [searchTerm, setSearch] = useState("");
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { FC } from "react";
|
||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
||||
import { MockPage } from "components/Page";
|
||||
import { useHAEntityRegistry } from "haService";
|
||||
import { useHAEntityRegistry } from "services/haService";
|
||||
|
||||
const Test: FC<{ onRender: () => void }> = ({ onRender }) => {
|
||||
const conn = useHAEntityRegistry();
|
||||
File renamed without changes.
File renamed without changes.
@@ -12,7 +12,7 @@ import { TypedHassService } from "./fieldTypes";
|
||||
import { Option } from "components/Inputs/AutoComplete/InputAutoComplete";
|
||||
import { getDeviceExtraWsCalls } from "./extras";
|
||||
import { useHAEntities } from "./HAEntities";
|
||||
import { useLang } from "lang";
|
||||
import { useLang } from "services/lang";
|
||||
|
||||
export type ServiceOption = Option<{
|
||||
domain: string;
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import React, { FC, useEffect, useState } from "react";
|
||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
||||
import { MockPage } from "components/Page";
|
||||
import { useHA } from "haService";
|
||||
import { useHA } from "services/haService";
|
||||
import InputYaml from "components/Inputs/Base/InputYaml";
|
||||
import { InputList } from "components/Inputs/InputList";
|
||||
import { Button } from "components/Inputs/Buttons/Button";
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
|
||||
import { useApiState } from "apiService";
|
||||
import { useApiState } from "services/apiService";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
const MISSING_TEXT = "<<MISSING TEXT -- {{langId}}>>";
|
||||
File renamed without changes.
Reference in new issue
Block a user