= ({
+ title = '',
+ type = 'primary',
+ block = false,
+}) => {
const {
connectors: { connect },
+ actions: { setProp },
} = useNode();
+ const [textEditing, setTextEditing] = useState(false);
+ const [hovered, setHovered] = useState(false);
+
+ return (
+
+
+
+ );
+};
+
+export const SubmitButtonSettings = () => {
+ const {
+ actions: { setProp },
+ type,
+ block,
+ } = useNode((node) => ({
+ type: node.data.props.type,
+ block: node.data.props.block,
+ }));
+ const { editingEnabled } = useEditor((state) => ({ editingEnabled: state.options.enabled }));
+
return (
-
+ <>
+
+ setProp((props: SubmitButtonProps) => {
+ props.type = val;
+ })
+ }
+ />
+ }
+ />
+ {
+ setProp((props: SubmitButtonProps) => {
+ props.block = e.target.checked;
+ });
+ }}
+ />
+ }
+ />
+ >
);
};
SubmitButton.craft = {
+ props: {
+ title: 'Submit',
+ type: 'primary',
+ block: false,
+ },
+ related: {
+ settings: SubmitButtonSettings,
+ },
rules: {
canDrag: () => false,
},
diff --git a/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/_user-task-builder/elements/index.ts b/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/_user-task-builder/elements/index.ts
index bdc428fff..33d599bc0 100644
--- a/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/_user-task-builder/elements/index.ts
+++ b/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/_user-task-builder/elements/index.ts
@@ -1,11 +1,22 @@
import CheckBoxOrRadioGroup from './CheckboxOrRadioGroup';
import Column from './Column';
import Container from './Container';
-import Image from './Image';
+import { EditImage, ExportImage } from './Image';
import Input from './Input';
import Row from './Row';
import SubmitButton from './SubmitButton';
import Table from './Table';
import Text from './Text';
-export { CheckBoxOrRadioGroup, Column, Container, Image, Input, Row, SubmitButton, Table, Text };
+export {
+ CheckBoxOrRadioGroup,
+ Column,
+ Container,
+ EditImage,
+ ExportImage,
+ Input,
+ Row,
+ SubmitButton,
+ Table,
+ Text,
+};
diff --git a/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/_user-task-builder/index.tsx b/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/_user-task-builder/index.tsx
index a116b82e0..7bce49fef 100644
--- a/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/_user-task-builder/index.tsx
+++ b/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/_user-task-builder/index.tsx
@@ -29,7 +29,6 @@ import { DiffResult, deepEquals } from '@/lib/helpers/javascriptHelpers';
import { updateFileDeletableStatus as updateImageRefCounter } from '@/lib/data/file-manager-facade';
import { is as bpmnIs } from 'bpmn-js/lib/util/ModelUtil';
-import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
type BuilderProps = {
processId: string;
@@ -55,8 +54,6 @@ const EditorModal: React.FC = ({
return { editingEnabled: state.options.enabled };
});
- const queryClient = new QueryClient();
-
const environment = useEnvironment();
const [iframeMounted, setIframeMounted] = useState(false);
@@ -227,6 +224,7 @@ const UserTaskBuilder: React.FC = ({ processId, open, onClose }) =
diff --git a/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/_user-task-builder/utils.tsx b/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/_user-task-builder/utils.tsx
index 1b330e224..57e4d4afa 100644
--- a/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/_user-task-builder/utils.tsx
+++ b/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/_user-task-builder/utils.tsx
@@ -3,7 +3,6 @@ import React from 'react';
import ReactDOMServer from 'react-dom/server';
import * as Elements from './elements';
-import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
const styles = `
body {
@@ -107,6 +106,21 @@ body {
margin: 3px 3px 6px 0;
}
+.user-task-form-button {
+ background-color: #eee;
+ box-shadow: rgba(0,0,0, 0.02) 0 2px 0 0;
+ padding: 4px 15px;
+ border-radius: 6px;
+ border: 1px solid lightgrey;
+}
+
+.user-task-form-button.primary-button {
+ box-shadow: rgba(5, 145, 255, 0.1) 0 2px 0 0;
+ background-color: rgb(22, 119, 255);
+ color: white;
+ border-color: rgb(22, 119, 255);
+}
+
.user-task-form-image {
width: 100%;
display: flex;
@@ -148,17 +162,15 @@ p, h1, h2, h3, h4, h5, th, td {
`;
export function toHtml(json: string) {
- const queryClient = new QueryClient();
const markup = ReactDOMServer.renderToStaticMarkup(
-
-
-
+
,
);
@@ -169,9 +181,14 @@ export function toHtml(json: string) {
+
- ${markup}
+