From 3b7b17021fa9c30cd2dafe15d669341bf9b8e0ac Mon Sep 17 00:00:00 2001 From: Ari Date: Tue, 24 May 2022 21:28:14 -0400 Subject: [PATCH] replaced yaml editor --- Dockerfile | 16 +++++++++------- docker-compose.build.yaml | 3 ++- .../components/ConditionEditor/editorRender.tsx | 10 +++++----- .../OptionManager/TriggerNumericState.tsx | 14 +++++++++----- 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index 069ac81..d7d5531 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,17 @@ -# <--- Build Args --> +# <--- Pre-Build Args --> ARG BUILD_ARCH -ARG BUILD_VERSION # <--- Image Setup --> FROM homeassistant/${BUILD_ARCH}-base-python:3.9-alpine3.14 WORKDIR /app +# <--- Post-Build Args --> +ARG BUILD_VERSION + +# <--- Environment Variables --> +ENV HASSIO_TOKEN "" +ENV BUILD_VERSION $BUILD_VERSION + # <--- System Wide Dependencies --> ENV LANG C.UTF-8 RUN apk add --no-cache \ @@ -23,7 +29,7 @@ RUN pip install . /app # <--- Webapp Build --> COPY webapp/ /app/web-builder RUN cd /app/web-builder && \ - echo "REACT_APP_BUILD_VERSION=${BUILD_VERSION} >> /app/web-builder/.env.production" \ + echo "REACT_APP_BUILD_VERSION=${BUILD_VERSION}" > /app/web-builder/.env.production && \ yarn && \ yarn build && \ cp -r /app/web-builder/build /app/web && \ @@ -34,10 +40,6 @@ COPY api/src /app/src COPY run.sh /app/run.sh RUN chmod +x /app/run.sh -# <--- Environment Variables --> -ENV HASSIO_TOKEN "" -ENV BUILD_VERSION $BUILD_VERSION - # <--- Ports --> EXPOSE 8000 diff --git a/docker-compose.build.yaml b/docker-compose.build.yaml index 3e08337..b32355d 100644 --- a/docker-compose.build.yaml +++ b/docker-compose.build.yaml @@ -6,4 +6,5 @@ services: context: "./" dockerfile: "./Dockerfile" args: - - BUILD_ARCH=${ARCH:-amd64} + BUILD_ARCH: ${ARCH:-amd64} + BUILD_VERSION: ${BUILD_TAG:-latest} diff --git a/webapp/src/components/ConditionEditor/editorRender.tsx b/webapp/src/components/ConditionEditor/editorRender.tsx index 4413081..31ac544 100644 --- a/webapp/src/components/ConditionEditor/editorRender.tsx +++ b/webapp/src/components/ConditionEditor/editorRender.tsx @@ -3,11 +3,11 @@ import { AutomationCondition, LogicCondition, NumericCondition, StateCondition, import { getDescriptionFromAutomationNode } from "utils/formatting"; import InputNumber from "components/Inputs/InputNumber"; import InputText from "components/Inputs/InputText"; -import InputTextArea from "components/Inputs/InputTextArea"; import { InputEntity } from "components/Inputs/InputTextBubble"; import { ConditionNode } from "./ConditionNode"; import { genUpdateMethods } from "./nestedUpdater"; import InputTime from "components/Inputs/InputTime"; +import InputYaml from "components/Inputs/InputYaml"; interface Editor extends FC<{ @@ -50,10 +50,10 @@ export const TemplateEditor: Editor = ({ ...condition, alias })} /> - onChange({ + onChange({ ...condition, value_template - })} resizable /> + })} /> } @@ -94,10 +94,10 @@ export const NumericStateEditor: Editor = ({ below: below ? String(below) : undefined, })} /> - onChange({ + onChange({ ...condition, value_template - })} resizable /> + })} /> } diff --git a/webapp/src/components/NodeEditor/OptionManager/TriggerNumericState.tsx b/webapp/src/components/NodeEditor/OptionManager/TriggerNumericState.tsx index 5b57691..58d80ab 100644 --- a/webapp/src/components/NodeEditor/OptionManager/TriggerNumericState.tsx +++ b/webapp/src/components/NodeEditor/OptionManager/TriggerNumericState.tsx @@ -3,8 +3,8 @@ import { AutomationTriggerNumericState } from 'types/automations/triggers'; import InputText from 'components/Inputs/InputText'; import { InputEntity } from 'components/Inputs/InputTextBubble'; import InputNumber from 'components/Inputs/InputNumber'; -import InputTextArea from 'components/Inputs/InputTextArea'; import InputTime from 'components/Inputs/InputTime'; +import InputYaml from 'components/Inputs/InputYaml'; export const TriggerNumericState: OptionManager = { @@ -45,10 +45,14 @@ export const TriggerNumericState: OptionManager = below: below ? String(below) : undefined, })} /> - setState({ - ...state, - value_template - })} resizable /> + setState({ + ...state, + value_template + })} + />