value === input.value) || {
- value: "",
- label: "",
- }
- }
- placeholder={placeholder}
- inputId={input.name}
- onChange={({ value }: any) => {
- input.onChange(nullable && !value ? null : value);
- }}
- className={generateClassNames(meta)}
- isDisabled={disabled}
- options={selectDataWithDefault}
- isOptionDisabled={(option: unknown) => {
- if (!disabledOptions) {
- return false;
+
+ value === input.value) || {
+ value: "",
+ label: "",
+ }
}
- return disabledOptions.includes(
- (option as ISelectData).value as string
- );
- }}
- />,
+ placeholder={placeholder}
+ inputId={input.name}
+ onChange={({ value }: any) => {
+ input.onChange(nullable && !value ? null : value);
+ }}
+ className={generateClassNames(meta)}
+ isDisabled={disabled}
+ options={selectDataWithDefault}
+ isOptionDisabled={(option: unknown) => {
+ if (!disabledOptions) {
+ return false;
+ }
+ return disabledOptions.includes(
+ (option as ISelectData).value as string
+ );
+ }}
+ />
+
,
props
);
};
diff --git a/src/frontend/design-system/components/Form/Styles.ts b/src/frontend/design-system/components/Form/Styles.ts
index 818d71fe2..540826c33 100644
--- a/src/frontend/design-system/components/Form/Styles.ts
+++ b/src/frontend/design-system/components/Form/Styles.ts
@@ -77,11 +77,6 @@ export const Input = styled.input`
${InputStyles}
`;
-export const FormGroup = styled.div`
- margin-bottom: 0px;
- margin-top: 0px;
-`;
-
export const FormLabel = styled.label<{ sm?: true }>`
padding-bottom: 1px;
margin-bottom: 0;
diff --git a/src/frontend/design-system/components/Form/_wrapForm.tsx b/src/frontend/design-system/components/Form/_wrapForm.tsx
index cd1eb74b4..476ad1e13 100644
--- a/src/frontend/design-system/components/Form/_wrapForm.tsx
+++ b/src/frontend/design-system/components/Form/_wrapForm.tsx
@@ -5,7 +5,7 @@ import { Stack } from "frontend/design-system/primitives/Stack";
import { SystemIcon } from "frontend/design-system/Icons/System";
import { ISharedFormInput } from "./_types";
import { Tooltip } from "../Tooltip";
-import { FormGroup, FormLabel, FormFeedback, RequiredAsterick } from "./Styles";
+import { FormLabel, FormFeedback, RequiredAsterick } from "./Styles";
import { SoftButton } from "../Button/SoftButton";
export const isFormMetaWithError = (meta: FieldMetaState) =>
@@ -26,24 +26,24 @@ export const wrapLabelAndError = (
rightActions = [],
}: ISharedFormInput
) => (
-
- <>
-
-
- {label && (
- <>
-
- {label}
-
- {required ? * : null}
- >
- )}
- {description ? (
-
-
-
- ) : null}
-
+ <>
+
+
+ {label && (
+ <>
+
+ {label}
+
+ {required ? * : null}
+ >
+ )}
+ {description ? (
+
+
+
+ ) : null}
+
+ {rightActions.length > 0 && (
{rightActions.map((rightAction) => (
))}
-
- {formComponent}
-
- {isFormMetaWithError(meta)}
-
-
- >
-
+ )}
+
+ {formComponent}
+
+ {isFormMetaWithError(meta)}
+
+
+ >
);
export const generateClassNames = (meta: FieldMetaState): string =>
diff --git a/src/frontend/design-system/components/OffCanvas/OffCanvas.spec.tsx b/src/frontend/design-system/components/OffCanvas/OffCanvas.spec.tsx
deleted file mode 100644
index 9c9dee719..000000000
--- a/src/frontend/design-system/components/OffCanvas/OffCanvas.spec.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import React, { useState } from "react";
-import { render, screen } from "@testing-library/react";
-import userEvent from "@testing-library/user-event";
-import { OffCanvas } from ".";
-
-function Template() {
- const [open, setOpen] = useState(false);
- return (
- <>
-
- setOpen(false)}
- >
- Some awesome content
-
- >
- );
-}
-
-describe.skip("OffCanvas", () => {
- it("should open and close modal", async () => {
- render();
-
- expect(screen.queryByRole("dialog")).not.toBeInTheDocument();
- expect(screen.queryByText("Some awesome content")).not.toBeInTheDocument();
-
- await userEvent.click(screen.getByRole("button", { name: "Open Canvas" }));
-
- expect(
- screen.getByRole("dialog", { name: "Some Awesome Canvas Title" })
- ).toBeInTheDocument();
-
- expect(screen.getByText("Some awesome content")).toBeInTheDocument();
- });
-});
diff --git a/src/frontend/views/entity/Actions/Base.tsx b/src/frontend/views/entity/Actions/Base.tsx
index b3441ddef..9d96beb56 100644
--- a/src/frontend/views/entity/Actions/Base.tsx
+++ b/src/frontend/views/entity/Actions/Base.tsx
@@ -120,6 +120,10 @@ export function FormActions({ entity }: { entity: string }) {
},
];
+ const createNew = () => {
+ setCurrentFormActionId(NEW_ACTION_ITEM);
+ };
+
return (
<>
setCurrentFormActionId(NEW_ACTION_ITEM)}
+ action={createNew}
systemIcon="Plus"
label={FORM_ACTION_CRUD_CONFIG.TEXT_LANG.CREATE}
/>
@@ -143,7 +147,7 @@ export function FormActions({ entity }: { entity: string }) {
text: FORM_ACTION_CRUD_CONFIG.TEXT_LANG.EMPTY_LIST,
createNew: {
label: FORM_ACTION_CRUD_CONFIG.TEXT_LANG.CREATE,
- action: () => setCurrentFormActionId(NEW_ACTION_ITEM),
+ action: createNew,
},
}}
/>
diff --git a/src/frontend/views/entity/Actions/Form.tsx b/src/frontend/views/entity/Actions/Form.tsx
index 786e4fa5f..4a5c34271 100644
--- a/src/frontend/views/entity/Actions/Form.tsx
+++ b/src/frontend/views/entity/Actions/Form.tsx
@@ -1,6 +1,6 @@
/* eslint-disable no-param-reassign */
import { SchemaForm } from "frontend/components/SchemaForm";
-import { useState } from "react";
+import { useEffect, useState } from "react";
import { IAppliedSchemaFormConfig } from "shared/form-schemas/types";
import {
ActionIntegrations,
@@ -45,7 +45,6 @@ export function ActionForm({
const implementations = useIntegrationImplementationsList(integration);
const currentActionTitle = integrationsListMap[integration]?.title;
-
const selectedImplementation = Object.fromEntries(
Object.entries(
implementations.data.find(({ key }) => key === action)
@@ -56,6 +55,15 @@ export function ActionForm({
])
);
+ useEffect(() => {
+ if (initialValues.integration) {
+ setIntegration(initialValues.integration || "");
+ }
+ if (initialValues.action) {
+ setAction(initialValues.action || "");
+ }
+ }, [initialValues]);
+
const fields: IAppliedSchemaFormConfig = {
trigger: {
label: "Trigger",