mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-29 04:06:35 +00:00
Add automation loading indicator (#25146)
This commit is contained in:
parent
b2044e88b6
commit
d58590b534
@ -1,3 +1,4 @@
|
|||||||
|
import { consume } from "@lit-labs/context";
|
||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import {
|
import {
|
||||||
mdiCog,
|
mdiCog,
|
||||||
@ -22,17 +23,19 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from "lit";
|
|||||||
import { css, html, LitElement, nothing } from "lit";
|
import { css, html, LitElement, nothing } from "lit";
|
||||||
import { property, state } from "lit/decorators";
|
import { property, state } from "lit/decorators";
|
||||||
import { classMap } from "lit/directives/class-map";
|
import { classMap } from "lit/directives/class-map";
|
||||||
import { consume } from "@lit-labs/context";
|
import { transform } from "../../../common/decorators/transform";
|
||||||
import { fireEvent } from "../../../common/dom/fire_event";
|
import { fireEvent } from "../../../common/dom/fire_event";
|
||||||
import { navigate } from "../../../common/navigate";
|
import { navigate } from "../../../common/navigate";
|
||||||
import { computeRTL } from "../../../common/util/compute_rtl";
|
import { computeRTL } from "../../../common/util/compute_rtl";
|
||||||
import { afterNextRender } from "../../../common/util/render-status";
|
|
||||||
import { promiseTimeout } from "../../../common/util/promise-timeout";
|
import { promiseTimeout } from "../../../common/util/promise-timeout";
|
||||||
|
import { afterNextRender } from "../../../common/util/render-status";
|
||||||
import "../../../components/ha-button-menu";
|
import "../../../components/ha-button-menu";
|
||||||
import "../../../components/ha-fab";
|
import "../../../components/ha-fab";
|
||||||
|
import "../../../components/ha-fade-in";
|
||||||
import "../../../components/ha-icon";
|
import "../../../components/ha-icon";
|
||||||
import "../../../components/ha-icon-button";
|
import "../../../components/ha-icon-button";
|
||||||
import "../../../components/ha-list-item";
|
import "../../../components/ha-list-item";
|
||||||
|
import "../../../components/ha-spinner";
|
||||||
import "../../../components/ha-svg-icon";
|
import "../../../components/ha-svg-icon";
|
||||||
import "../../../components/ha-yaml-editor";
|
import "../../../components/ha-yaml-editor";
|
||||||
import type {
|
import type {
|
||||||
@ -52,6 +55,7 @@ import {
|
|||||||
} from "../../../data/automation";
|
} from "../../../data/automation";
|
||||||
import { substituteBlueprint } from "../../../data/blueprint";
|
import { substituteBlueprint } from "../../../data/blueprint";
|
||||||
import { validateConfig } from "../../../data/config";
|
import { validateConfig } from "../../../data/config";
|
||||||
|
import { fullEntitiesContext } from "../../../data/context";
|
||||||
import { UNAVAILABLE } from "../../../data/entity";
|
import { UNAVAILABLE } from "../../../data/entity";
|
||||||
import {
|
import {
|
||||||
type EntityRegistryEntry,
|
type EntityRegistryEntry,
|
||||||
@ -61,11 +65,14 @@ import {
|
|||||||
showAlertDialog,
|
showAlertDialog,
|
||||||
showConfirmationDialog,
|
showConfirmationDialog,
|
||||||
} from "../../../dialogs/generic/show-dialog-box";
|
} from "../../../dialogs/generic/show-dialog-box";
|
||||||
|
import { showMoreInfoDialog } from "../../../dialogs/more-info/show-ha-more-info-dialog";
|
||||||
import "../../../layouts/hass-subpage";
|
import "../../../layouts/hass-subpage";
|
||||||
import { KeyboardShortcutMixin } from "../../../mixins/keyboard-shortcut-mixin";
|
import { KeyboardShortcutMixin } from "../../../mixins/keyboard-shortcut-mixin";
|
||||||
|
import { PreventUnsavedMixin } from "../../../mixins/prevent-unsaved-mixin";
|
||||||
import { haStyle } from "../../../resources/styles";
|
import { haStyle } from "../../../resources/styles";
|
||||||
import type { Entries, HomeAssistant, Route } from "../../../types";
|
import type { Entries, HomeAssistant, Route } from "../../../types";
|
||||||
import { showToast } from "../../../util/toast";
|
import { showToast } from "../../../util/toast";
|
||||||
|
import { showAssignCategoryDialog } from "../category/show-dialog-assign-category";
|
||||||
import "../ha-config-section";
|
import "../ha-config-section";
|
||||||
import { showAutomationModeDialog } from "./automation-mode-dialog/show-dialog-automation-mode";
|
import { showAutomationModeDialog } from "./automation-mode-dialog/show-dialog-automation-mode";
|
||||||
import {
|
import {
|
||||||
@ -74,11 +81,6 @@ import {
|
|||||||
} from "./automation-save-dialog/show-dialog-automation-save";
|
} from "./automation-save-dialog/show-dialog-automation-save";
|
||||||
import "./blueprint-automation-editor";
|
import "./blueprint-automation-editor";
|
||||||
import "./manual-automation-editor";
|
import "./manual-automation-editor";
|
||||||
import { showMoreInfoDialog } from "../../../dialogs/more-info/show-ha-more-info-dialog";
|
|
||||||
import { showAssignCategoryDialog } from "../category/show-dialog-assign-category";
|
|
||||||
import { PreventUnsavedMixin } from "../../../mixins/prevent-unsaved-mixin";
|
|
||||||
import { fullEntitiesContext } from "../../../data/context";
|
|
||||||
import { transform } from "../../../common/decorators/transform";
|
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface HTMLElementTagNameMap {
|
interface HTMLElementTagNameMap {
|
||||||
@ -184,7 +186,11 @@ export class HaAutomationEditor extends PreventUnsavedMixin(
|
|||||||
|
|
||||||
protected render(): TemplateResult | typeof nothing {
|
protected render(): TemplateResult | typeof nothing {
|
||||||
if (!this._config) {
|
if (!this._config) {
|
||||||
return nothing;
|
return html`
|
||||||
|
<ha-fade-in .delay=${500}>
|
||||||
|
<ha-spinner size="large"></ha-spinner>
|
||||||
|
</ha-fade-in>
|
||||||
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const stateObj = this._entityId
|
const stateObj = this._entityId
|
||||||
@ -1063,6 +1069,12 @@ export class HaAutomationEditor extends PreventUnsavedMixin(
|
|||||||
return [
|
return [
|
||||||
haStyle,
|
haStyle,
|
||||||
css`
|
css`
|
||||||
|
ha-fade-in {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
.content {
|
.content {
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user