From 136b7337af46210ff3cb64bb9c756536ce206058 Mon Sep 17 00:00:00 2001 From: frikky Date: Fri, 11 Feb 2022 00:35:06 +0100 Subject: [PATCH] Made ALL popups (modals) in the workflow UI movable by dragging the title --- frontend/src/components/PaperComponent.jsx | 19 ++++++++++ frontend/src/views/AngularWorkflow.jsx | 44 +++++++++++++++++++--- 2 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 frontend/src/components/PaperComponent.jsx diff --git a/frontend/src/components/PaperComponent.jsx b/frontend/src/components/PaperComponent.jsx new file mode 100644 index 00000000..76fb56ef --- /dev/null +++ b/frontend/src/components/PaperComponent.jsx @@ -0,0 +1,19 @@ +import React, {useState, useEffect, useLayoutEffect} from 'react'; + +import Draggable from "react-draggable"; +import { + Paper +} from "@material-ui/core"; + +const PaperComponent = (props) => { + return ( + + + + ) +} + +export default PaperComponent; diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index 20831e03..f3ed0bef 100644 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -107,6 +107,7 @@ import { GetParsedPaths } from "./Apps.jsx"; import ConfigureWorkflow from "../components/ConfigureWorkflow.jsx"; import AuthenticationOauth2 from "../components/Oauth2Auth.jsx"; import ParsedAction from "../components/ParsedAction.jsx"; +import PaperComponent from "../components/PaperComponent.jsx" const surfaceColor = "#27292D"; const inputColor = "#383B40"; @@ -6370,10 +6371,14 @@ const AngularWorkflow = (defaultprops) => { const conditionsModal = ( { - + Condition @@ -11248,6 +11253,14 @@ const parsedExecutionArgument = () => { open={executionModalOpen} onClose={() => setExecutionModalOpen(false)} style={{ resize: "both", overflow: "auto", zIndex: 10005 }} + hideBackdrop={true} + variant="temporary" + onEscapeKeyDown={() => { + setExecutionModalOpen(false) + }} + onBackdropClick={() => { + setExecutionModalOpen(false) + }} PaperProps={{ style: { resize: "both", @@ -11258,6 +11271,7 @@ const parsedExecutionArgument = () => { color: "white", fontSize: 18, zIndex: 10005, + borderLeft: theme.palette.defaultBorder, }, }} > @@ -12134,6 +12148,8 @@ const parsedExecutionArgument = () => { position={dragPosition} > { return ( { setNewVariableName(""); setExecutionVariablesModalOpen(false); }} PaperProps={{ style: { + pointerEvents: "auto", backgroundColor: surfaceColor, color: "white", + border: theme.palette.defaultBorder, }, }} > - + Execution Variable @@ -12646,6 +12670,12 @@ const parsedExecutionArgument = () => { return ( { setNewVariableName(""); @@ -12655,13 +12685,15 @@ const parsedExecutionArgument = () => { }} PaperProps={{ style: { + pointerEvents: "auto", backgroundColor: surfaceColor, color: "white", + border: theme.palette.defaultBorder, }, }} > - + Workflow Variable @@ -12817,7 +12849,7 @@ const parsedExecutionArgument = () => { ) { return ( - + {selectedApp.name} does not require authentication @@ -12923,7 +12955,7 @@ const parsedExecutionArgument = () => { return (
- +
Authentication for {selectedApp.name}
@@ -13135,6 +13167,8 @@ const parsedExecutionArgument = () => { // This whole part is redundant. Made it part of Arguments instead. const authenticationModal = authenticationModalOpen ? (