diff --git a/frontend/src/AppBuilder/_stores/slices/queryPanelSlice.js b/frontend/src/AppBuilder/_stores/slices/queryPanelSlice.js index 12a538400e..27a59740db 100644 --- a/frontend/src/AppBuilder/_stores/slices/queryPanelSlice.js +++ b/frontend/src/AppBuilder/_stores/slices/queryPanelSlice.js @@ -205,7 +205,6 @@ export const createQueryPanelSlice = (set, get) => ({ setPreviewPanelExpanded, executeRunPycode, runTransformation, - executeWorkflow, executeMultilineJS, } = queryPanel; const { onEvent } = eventsSlice; @@ -297,14 +296,6 @@ export const createQueryPanelSlice = (set, get) => ({ queryExecutionPromise = executeMultilineJS(query.options.code, query?.id, false, mode, parameters); } else if (query.kind === 'runpy') { queryExecutionPromise = executeRunPycode(query.options.code, query, false, mode, queryState); - } else if (query.kind === 'workflows') { - queryExecutionPromise = executeWorkflow( - moduleId, - query.options.workflowId, - query.options.blocking, - query.options?.params, - (currentAppEnvironmentId ?? environmentId) || selectedEnvironment?.id //TODO: currentAppEnvironmentId may no longer required. Need to check - ); } else { queryExecutionPromise = dataqueryService.run( queryId, @@ -465,7 +456,6 @@ export const createQueryPanelSlice = (set, get) => ({ setPreviewPanelExpanded, executeRunPycode, runTransformation, - executeWorkflow, executeMultilineJS, setIsPreviewQueryLoading, } = queryPanel; @@ -514,14 +504,6 @@ export const createQueryPanelSlice = (set, get) => ({ queryExecutionPromise = executeMultilineJS(query.options.code, query?.id, true, '', parameters); } else if (query.kind === 'runpy') { queryExecutionPromise = executeRunPycode(query.options.code, query, true, 'edit', queryState); - } else if (query.kind === 'workflows') { - queryExecutionPromise = executeWorkflow( - moduleId, - query.options.workflowId, - query.options.blocking, - query.options?.params, - (currentAppEnvironmentId ?? environmentId) || selectedEnvironment?.id //TODO: currentAppEnvironmentId may no longer required. Need to check - ); } else { queryExecutionPromise = dataqueryService.preview(query, options, currentVersionId, currentAppEnvironmentId); } diff --git a/frontend/src/_components/AccordionForm.jsx b/frontend/src/_components/AccordionForm.jsx new file mode 100644 index 0000000000..6afe396bb0 --- /dev/null +++ b/frontend/src/_components/AccordionForm.jsx @@ -0,0 +1,22 @@ +import React from 'react'; +import isEmpty from 'lodash/isEmpty'; +import Accordion from '@/_ui/Accordion'; + +const AccordionForm = ({ formComponent, getLayout }) => { + const sections = Object.keys(formComponent) + .map((key) => ({ + title: formComponent[key].title, + inputs: formComponent[key].inputs, + })) + .filter(({ inputs }) => inputs && !isEmpty(inputs)); + + const items = sections.map(({ title, inputs }) => ({ + title: title, + isOpen: true, + children: getLayout(inputs), + })); + + return ; +}; + +export default AccordionForm; diff --git a/frontend/src/_components/DynamicForm.jsx b/frontend/src/_components/DynamicForm.jsx index 37fd3104af..13734d54b9 100644 --- a/frontend/src/_components/DynamicForm.jsx +++ b/frontend/src/_components/DynamicForm.jsx @@ -8,13 +8,13 @@ import OAuth from '@/_ui/OAuth'; import Toggle from '@/_ui/Toggle'; import OpenApi from '@/_ui/OpenAPI'; import { Checkbox, CheckboxGroup } from '@/_ui/CheckBox'; -import CodeHinter from '@/Editor/CodeEditor'; +import CodeHinter from '@/AppBuilder/CodeEditor'; import GoogleSheets from '@/_components/Googlesheets'; import Slack from '@/_components/Slack'; import Zendesk from '@/_components/Zendesk'; import { ConditionFilter, CondtionSort, MultiColumn } from '@/_components/MultiConditions'; import Salesforce from '@/_components/Salesforce'; -import ToolJetDbOperations from '@/Editor/QueryManager/QueryEditors/TooljetDatabase/ToolJetDbOperations'; +import ToolJetDbOperations from '@/AppBuilder/QueryManager/QueryEditors/TooljetDatabase/ToolJetDbOperations'; import { orgEnvironmentVariableService, orgEnvironmentConstantService } from '../_services'; import { find, isEmpty } from 'lodash'; import { ButtonSolid } from './AppButton'; diff --git a/frontend/src/_ui/Accordion/AccordionItem.js b/frontend/src/_ui/Accordion/AccordionItem.js index 275bed5e6c..22fe54512d 100644 --- a/frontend/src/_ui/Accordion/AccordionItem.js +++ b/frontend/src/_ui/Accordion/AccordionItem.js @@ -31,17 +31,18 @@ const AccordionItem = ({ open = true, index, title, children }) => { } return (
-

setShow(!show)} className="accordion-header" id={`heading-${index}`}> - + +

{ + const darkMode = localStorage.getItem('darkMode') === 'true'; + const sortOptions = [ + { value: 'asc', label: 'Ascending' }, + { value: 'desc', label: 'Descending' }, + ]; + return ( +
+ {options.length === 0 && ( +
+ + There are no key value pairs added +
+ )} + {options.map((option, index) => { + return ( +
+
+
+ keyValuePairValueChanged(e.target.value, 0, index)} + /> +
+
+ keyValuePairValueChanged(e.target.value, 0, index)} + /> +