Made ALL popups (modals) in the workflow UI movable by dragging the title

This commit is contained in:
frikky
2022-02-11 00:35:06 +01:00
parent 65418b39c4
commit 136b7337af
2 changed files with 58 additions and 5 deletions
@@ -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 (
<Draggable
handle="#draggable-dialog-title"
cancel={'[class*="MuiDialogContent-root"]'}
>
<Paper {...props} />
</Draggable>
)
}
export default PaperComponent;
+39 -5
View File
@@ -107,6 +107,7 @@ import { GetParsedPaths } from "./Apps.jsx";
import ConfigureWorkflow from "../components/ConfigureWorkflow.jsx"; import ConfigureWorkflow from "../components/ConfigureWorkflow.jsx";
import AuthenticationOauth2 from "../components/Oauth2Auth.jsx"; import AuthenticationOauth2 from "../components/Oauth2Auth.jsx";
import ParsedAction from "../components/ParsedAction.jsx"; import ParsedAction from "../components/ParsedAction.jsx";
import PaperComponent from "../components/PaperComponent.jsx"
const surfaceColor = "#27292D"; const surfaceColor = "#27292D";
const inputColor = "#383B40"; const inputColor = "#383B40";
@@ -6370,10 +6371,14 @@ const AngularWorkflow = (defaultprops) => {
const conditionsModal = ( const conditionsModal = (
<Dialog <Dialog
PaperComponent={PaperComponent}
aria-labelledby="draggable-dialog-title"
disableEnforceFocus={true} disableEnforceFocus={true}
hideBackdrop={true} hideBackdrop={true}
disableBackdropClick={true} disableBackdropClick={true}
style={{ pointerEvents: "none" }} style={{ pointerEvents: "none" }}
PaperComponent={PaperComponent}
aria-labelledby="draggable-dialog-title"
open={conditionsModalOpen} open={conditionsModalOpen}
PaperProps={{ PaperProps={{
style: { style: {
@@ -6406,7 +6411,7 @@ const AngularWorkflow = (defaultprops) => {
</a> </a>
</span> </span>
<FormControl> <FormControl>
<DialogTitle> <DialogTitle id="draggable-dialog-title" style={{cursor: "move",}}>
<span style={{ color: "white" }}>Condition</span> <span style={{ color: "white" }}>Condition</span>
</DialogTitle> </DialogTitle>
<DialogContent style={{}}> <DialogContent style={{}}>
@@ -11248,6 +11253,14 @@ const parsedExecutionArgument = () => {
open={executionModalOpen} open={executionModalOpen}
onClose={() => setExecutionModalOpen(false)} onClose={() => setExecutionModalOpen(false)}
style={{ resize: "both", overflow: "auto", zIndex: 10005 }} style={{ resize: "both", overflow: "auto", zIndex: 10005 }}
hideBackdrop={true}
variant="temporary"
onEscapeKeyDown={() => {
setExecutionModalOpen(false)
}}
onBackdropClick={() => {
setExecutionModalOpen(false)
}}
PaperProps={{ PaperProps={{
style: { style: {
resize: "both", resize: "both",
@@ -11258,6 +11271,7 @@ const parsedExecutionArgument = () => {
color: "white", color: "white",
fontSize: 18, fontSize: 18,
zIndex: 10005, zIndex: 10005,
borderLeft: theme.palette.defaultBorder,
}, },
}} }}
> >
@@ -12134,6 +12148,8 @@ const parsedExecutionArgument = () => {
position={dragPosition} position={dragPosition}
> >
<Dialog <Dialog
PaperComponent={PaperComponent}
aria-labelledby="draggable-dialog-title"
disableEnforceFocus={true} disableEnforceFocus={true}
style={{ pointerEvents: "none" }} style={{ pointerEvents: "none" }}
hideBackdrop={true} hideBackdrop={true}
@@ -12502,19 +12518,27 @@ const parsedExecutionArgument = () => {
return ( return (
<Dialog <Dialog
open={executionVariablesModalOpen} open={executionVariablesModalOpen}
PaperComponent={PaperComponent}
hideBackdrop={true}
disableEnforceFocus={true}
disableBackdropClick={true}
style={{ pointerEvents: "none" }}
aria-labelledby="draggable-dialog-title"
onClose={() => { onClose={() => {
setNewVariableName(""); setNewVariableName("");
setExecutionVariablesModalOpen(false); setExecutionVariablesModalOpen(false);
}} }}
PaperProps={{ PaperProps={{
style: { style: {
pointerEvents: "auto",
backgroundColor: surfaceColor, backgroundColor: surfaceColor,
color: "white", color: "white",
border: theme.palette.defaultBorder,
}, },
}} }}
> >
<FormControl> <FormControl>
<DialogTitle> <DialogTitle id="draggable-dialog-title" style={{cursor: "move",}}>
<span style={{ color: "white" }}>Execution Variable</span> <span style={{ color: "white" }}>Execution Variable</span>
</DialogTitle> </DialogTitle>
<DialogContent> <DialogContent>
@@ -12646,6 +12670,12 @@ const parsedExecutionArgument = () => {
return ( return (
<Dialog <Dialog
PaperComponent={PaperComponent}
aria-labelledby="draggable-dialog-title"
hideBackdrop={true}
disableEnforceFocus={true}
disableBackdropClick={true}
style={{ pointerEvents: "none" }}
open={variablesModalOpen} open={variablesModalOpen}
onClose={() => { onClose={() => {
setNewVariableName(""); setNewVariableName("");
@@ -12655,13 +12685,15 @@ const parsedExecutionArgument = () => {
}} }}
PaperProps={{ PaperProps={{
style: { style: {
pointerEvents: "auto",
backgroundColor: surfaceColor, backgroundColor: surfaceColor,
color: "white", color: "white",
border: theme.palette.defaultBorder,
}, },
}} }}
> >
<FormControl> <FormControl>
<DialogTitle> <DialogTitle id="draggable-dialog-title" style={{cursor: "move",}}>
<span style={{ color: "white" }}>Workflow Variable</span> <span style={{ color: "white" }}>Workflow Variable</span>
</DialogTitle> </DialogTitle>
<DialogContent> <DialogContent>
@@ -12817,7 +12849,7 @@ const parsedExecutionArgument = () => {
) { ) {
return ( return (
<DialogContent style={{ textAlign: "center", marginTop: 50 }}> <DialogContent style={{ textAlign: "center", marginTop: 50 }}>
<Typography variant="h4"> <Typography variant="h4" id="draggable-dialog-title" style={{cursor: "move",}}>
{selectedApp.name} does not require authentication {selectedApp.name} does not require authentication
</Typography> </Typography>
</DialogContent> </DialogContent>
@@ -12923,7 +12955,7 @@ const parsedExecutionArgument = () => {
return ( return (
<div> <div>
<DialogTitle> <DialogTitle id="draggable-dialog-title" style={{cursor: "move",}}>
<div style={{ color: "white" }}> <div style={{ color: "white" }}>
Authentication for {selectedApp.name} Authentication for {selectedApp.name}
</div> </div>
@@ -13135,6 +13167,8 @@ const parsedExecutionArgument = () => {
// This whole part is redundant. Made it part of Arguments instead. // This whole part is redundant. Made it part of Arguments instead.
const authenticationModal = authenticationModalOpen ? ( const authenticationModal = authenticationModalOpen ? (
<Dialog <Dialog
PaperComponent={PaperComponent}
aria-labelledby="draggable-dialog-title"
hideBackdrop={true} hideBackdrop={true}
disableEnforceFocus={true} disableEnforceFocus={true}
disableBackdropClick={true} disableBackdropClick={true}