diff --git a/webapp/package.json b/webapp/package.json index 2019f14..84a62d7 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -6,6 +6,7 @@ "dependencies": { "@emotion/react": "^11.9.0", "@emotion/styled": "^11.8.1", + "@mui/icons-material": "^5.8.3", "@mui/material": "^5.8.0", "@mui/styles": "^5.8.0", "@types/jest": "^27.5.1", diff --git a/webapp/src/components/AutomationEditor/index.css b/webapp/src/components/AutomationEditor/index.css index abd6764..068539d 100644 --- a/webapp/src/components/AutomationEditor/index.css +++ b/webapp/src/components/AutomationEditor/index.css @@ -28,13 +28,9 @@ .automation-editor--flow-wrapper--toolbar { display: flex; flex-direction: row; + gap: 0.25em; justify-content: flex-end; -} - -.automation-editor--flow-wrapper.unchanged>.automation-editor--flow-wrapper--toolbar { - height: 0; - opacity: 0; - overflow: hidden; + margin-top: 0.25em; } .automation-editor--flow-wrapper.changed>.automation-editor--flow-wrapper--toolbar * { diff --git a/webapp/src/components/AutomationEditor/index.tsx b/webapp/src/components/AutomationEditor/index.tsx index f30562a..954837b 100644 --- a/webapp/src/components/AutomationEditor/index.tsx +++ b/webapp/src/components/AutomationEditor/index.tsx @@ -1,6 +1,7 @@ import "./index.css"; +import Icon from '@mui/material/Icon'; import { ArrowIcon, CheckMarkIcon } from "components/Icons"; -import { FC, useState } from "react"; +import { FC, useEffect, useState } from "react"; import { AutomationData } from "types/automations"; import { AutoInfoBox } from "./AutoInfoBox"; import { ButtonIcon } from "components/Icons/ButtonIcons"; @@ -37,8 +38,15 @@ export const AutomationEditor: FC = ({ save, saveAndUpdate, } = useAutomatioEditorState(propsAutos, propsOnUpdate); - const [closeInfo, setCloseInfo] = useState(false); + const [flipped, setFlipped] = useState(dims.flipped); + + // effect + useEffect(() => { + if (dims.flipped !== flipped) { + setFlipped(dims.flipped) + } + }, [dims.flipped]) // render if (state.status === 'loading') { @@ -75,6 +83,13 @@ export const AutomationEditor: FC = ({
+ {!dims.flipped && }
diff --git a/webapp/src/components/AutomationList/index.mobile.css b/webapp/src/components/AutomationList/index.mobile.css index 51d09a0..ba5b3e7 100644 --- a/webapp/src/components/AutomationList/index.mobile.css +++ b/webapp/src/components/AutomationList/index.mobile.css @@ -67,4 +67,12 @@ top: 0.75em; background-color: var(--green-opaque); z-index: 30; +} + + + +.automation-list--root.mobile .automation-editor--flow-wrapper.unchanged>.automation-editor--flow-wrapper--toolbar { + height: 0; + opacity: 0; + overflow: hidden; } \ No newline at end of file diff --git a/webapp/src/components/DAGFlow/index.tsx b/webapp/src/components/DAGFlow/index.tsx index ab5b0a8..6a9a015 100644 --- a/webapp/src/components/DAGFlow/index.tsx +++ b/webapp/src/components/DAGFlow/index.tsx @@ -140,6 +140,16 @@ export const DAGAutomationFlow: FC = ({ namer, makeSequenceUpdater(sequence, onSequenceUpdate, setModalState), ); + // this fixes some strange edge drawing issue + flowData.edges = flowData.edges.map(e => ({ + ...e, + "source": `${e.source}-${dims.flipped}`, + "target": `${e.target}-${dims.flipped}`, + })) + flowData.nodes = flowData.nodes.map(n => ({ + ...n, + id: `${n.id}-${dims.flipped}` + })) // render return <> diff --git a/webapp/yarn.lock b/webapp/yarn.lock index fe41f6b..883c78c 100644 --- a/webapp/yarn.lock +++ b/webapp/yarn.lock @@ -2028,6 +2028,13 @@ prop-types "^15.8.1" react-is "^17.0.2" +"@mui/icons-material@^5.8.3": + version "5.8.3" + resolved "https://registry.yarnpkg.com/@mui/icons-material/-/icons-material-5.8.3.tgz#75c8bde42e6ba71e3871439a2b751be987343493" + integrity sha512-dAdhimSLKOV0Q8FR7AYGEaCrTUh9OV7zU4Ueo5REoUt4cC3Vy+UBKDjZk66x5ezaYb63AFgQIFwtnZj3B/QDbQ== + dependencies: + "@babel/runtime" "^7.17.2" + "@mui/material@^5.8.0": version "5.8.2" resolved "https://registry.yarnpkg.com/@mui/material/-/material-5.8.2.tgz#13547df6bb6991e064f42ee71ce17c30629e263a"