Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #134

Merged
merged 21 commits into from
Oct 31, 2023
Merged

Dev #134

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
33a6ccf
feat: add additional language support on code editor input
nathan-vm Oct 24, 2023
f76c052
fix: icons styles and result styles
nathan-vm Oct 24, 2023
1c2d2c3
feat: export workflow
nathan-vm Oct 24, 2023
1c08f46
Merge pull request #124 from Tauffer-Consulting/feature/new-lenguages…
nathan-vm Oct 26, 2023
d8b5d8e
feat: import workflow
nathan-vm Oct 26, 2023
017f8bd
fix: clear state to trigger onChange if import same file
nathan-vm Oct 27, 2023
be887dc
Merge branch 'main' into dev
luiztauffer Oct 28, 2023
3116618
Merge branch 'dev' into feature/sharable-workflows
luiztauffer Oct 28, 2023
031b35e
Merge pull request #125 from Tauffer-Consulting/feature/sharable-work…
luiztauffer Oct 28, 2023
5242a40
fix(workflow settings): settings onLoad
vinicvaz Oct 30, 2023
931142d
using forward ref in sidebar settings to use onClear
vinicvaz Oct 30, 2023
7fa3610
error message on export empty workflow
vinicvaz Oct 30, 2023
3b3c6d6
update warning msg for missing pieces repos
vinicvaz Oct 30, 2023
27b2f49
improve missing secrets message
vinicvaz Oct 30, 2023
e03597a
update schedule_interval to schedule and force all datetime objects t…
vinicvaz Oct 30, 2023
5d6931f
update default piece repo version
vinicvaz Oct 30, 2023
082f90a
shutil to copy and pathlib to chmod fix #132
vinicvaz Oct 30, 2023
007ab31
Merge pull request #136 from Tauffer-Consulting/fix/sharable-workflows
vinicvaz Oct 31, 2023
ce69055
fix import error
vinicvaz Oct 31, 2023
0445a2a
Fix workflow settings loadData
vinicvaz Oct 31, 2023
48fd524
update version
vinicvaz Oct 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker-compose-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ services:
- DOMINO_DB_HOST=domino_postgres
- DOMINO_DB_PORT=5432
- DOMINO_DB_NAME=postgres
- DOMINO_DEFAULT_PIECES_REPOSITORY_VERSION=0.4.2
- DOMINO_DEFAULT_PIECES_REPOSITORY_VERSION=0.4.3
- DOMINO_DEFAULT_PIECES_REPOSITORY_TOKEN=${DOMINO_DEFAULT_PIECES_REPOSITORY_TOKEN}
- DOMINO_GITHUB_ACCESS_TOKEN_WORKFLOWS=${DOMINO_GITHUB_ACCESS_TOKEN_WORKFLOWS}
- DOMINO_GITHUB_WORKFLOWS_REPOSITORY=${DOMINO_GITHUB_WORKFLOWS_REPOSITORY}
Expand Down
31 changes: 24 additions & 7 deletions frontend/src/components/CodeEditorInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@ import {
useFormContext,
} from "react-hook-form";

const CodeEditorItem = React.forwardRef<HTMLTextAreaElement>(
({ ...register }, ref) => (
interface Props {
language?: string;
placeholder?: string;
}

const CodeEditorItem = React.forwardRef<HTMLTextAreaElement, Props>(
({ language = "python", placeholder, ...register }, ref) => (
<CodeEditor
language="python"
placeholder="Enter Python code."
language={language}
placeholder={placeholder ?? ""}
padding={15}
style={{
fontSize: 12,
Expand All @@ -33,18 +38,30 @@ const CodeEditorItem = React.forwardRef<HTMLTextAreaElement>(

CodeEditorItem.displayName = "CodeEditorItem";

interface Props<T> {
interface CodeEditorInputProps<T> {
name: Path<T>;
language?: string;
placeholder?: string;
}

function CodeEditorInput<T extends FieldValues>({ name }: Props<T>) {
function CodeEditorInput<T extends FieldValues>({
name,
language,
placeholder,
}: CodeEditorInputProps<T>) {
const { control } = useFormContext();

return (
<Controller
name={name}
control={control}
render={({ field }) => <CodeEditorItem {...field} />}
render={({ field }) => (
<CodeEditorItem
language={language}
placeholder={placeholder}
{...field}
/>
)}
/>
);
}
Expand Down
81 changes: 81 additions & 0 deletions frontend/src/components/Modal/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import {
Button,
Dialog,
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
Grid,
} from "@mui/material";
import React, { useCallback, useImperativeHandle, useState } from "react";

interface Props {
title: string;
content?: string | React.ReactNode;

confirmFn?: () => void;
cancelFn?: () => void;
}

export interface ModalRef {
open: () => void;
close: () => void;
}

export const Modal = React.forwardRef<ModalRef, Props>(
({ cancelFn, confirmFn, title, content }, ref) => {
const [isOpen, setIsOpen] = useState(false);

const open = () => {
setIsOpen(true);
};

const handleClose = useCallback(() => {
if (cancelFn) {
cancelFn();
}

setIsOpen(false);
}, []);

const handleConfirm = useCallback(() => {
if (confirmFn) {
confirmFn();
}

setIsOpen(false);
}, []);

useImperativeHandle(ref, () => ({
open,
close: handleClose,
}));

return (
<Dialog open={isOpen} onClose={handleClose}>
<DialogTitle>{title}</DialogTitle>
<DialogContent>
<DialogContentText>{content}</DialogContentText>
</DialogContent>
<DialogActions>
<Grid container justifyContent="center" spacing={4}>
{cancelFn && (
<Grid item>
<Button onClick={handleClose} variant="contained">
Cancel
</Button>
</Grid>
)}
<Grid item>
<Button onClick={handleConfirm} variant="contained">
OK
</Button>
</Grid>
</Grid>
</DialogActions>
</Dialog>
);
},
);

Modal.displayName = "Modal";
43 changes: 0 additions & 43 deletions frontend/src/components/NewFeatureDialog/index.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions frontend/src/components/WorkflowPanel/DefaultNode/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const CustomNode = memo<DefaultNodeProps>(({ id, data, selected }) => {
...data.style.nodeStyle,
display: "flex",
flexDirection: "row",
justifyContent: "center",
justifyContent: "space-evenly",
alignItems: "center",

position: "relative",
Expand All @@ -88,7 +88,7 @@ export const CustomNode = memo<DefaultNodeProps>(({ id, data, selected }) => {
backgroundColor: theme.palette.error.light,
color: theme.palette.error.contrastText,
}),
};
} satisfies CSSProperties;
}, [data, selected]);

const { sourcePosition, targetPosition } = useMemo(
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/WorkflowPanel/RunNode/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const RunNode = memo<RunNodeProps>(({ id, data, selected }) => {
...data.style.nodeStyle,
display: "flex",
flexDirection: "row",
justifyContent: "center",
justifyContent: "space-evenly",
alignItems: "center",
textAlign: "center",
position: "relative",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,40 @@ const PieceFormItem: React.FC<PieceFormItemProps> = ({
"type" in schema &&
"widget" in schema &&
schema.type === "string" &&
schema.widget === "codeeditor"
(schema.widget === "codeeditor" || schema.widget === "codeeditor-python")
) {
inputElement = (
<CodeEditorInput<IWorkflowPieceData> name={`inputs.${itemKey}.value`} />
<CodeEditorInput<IWorkflowPieceData>
name={`inputs.${itemKey}.value`}
language="python"
placeholder="Enter Python code."
/>
);
} else if (
"type" in schema &&
"widget" in schema &&
schema.type === "string" &&
schema.widget === "codeeditor-json"
) {
inputElement = (
<CodeEditorInput<IWorkflowPieceData>
name={`inputs.${itemKey}.value`}
language="json"
placeholder="Enter JSON code."
/>
);
} else if (
"type" in schema &&
"widget" in schema &&
schema.type === "string" &&
schema.widget === "codeeditor-sql"
) {
inputElement = (
<CodeEditorInput<IWorkflowPieceData>
name={`inputs.${itemKey}.value`}
language="sql"
placeholder="Enter SQL code."
/>
);
} else if (
"type" in schema &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const SidebarPieceForm: React.FC<ISidebarPieceFormProps> = (props) => {
const { schema, formId, open, onClose, title } = props;

const {
setForageWorkflowPiecesData,
setForageWorkflowPiecesDataById,
fetchForageWorkflowPiecesDataById,
setForageWorkflowPiecesOutputSchema,
clearDownstreamDataById,
Expand Down Expand Up @@ -141,10 +141,10 @@ const SidebarPieceForm: React.FC<ISidebarPieceFormProps> = (props) => {

const saveData = useCallback(async () => {
if (formId && open) {
await setForageWorkflowPiecesData(formId, data as IWorkflowPieceData);
await setForageWorkflowPiecesDataById(formId, data as IWorkflowPieceData);
await updateOutputSchema();
}
}, [formId, open, setForageWorkflowPiecesData, data, updateOutputSchema]);
}, [formId, open, setForageWorkflowPiecesDataById, data, updateOutputSchema]);

// load forage
useEffect(() => {
Expand Down
Loading
Loading