-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: [Plugin Action Editor] Query forms in Plugin Action Form (#36684)
## Description Implement UQI Editor Form and Query Response panes Fixes #36154 ## Automation /ok-to-test tags="@tag.IDE" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/11175240455> > Commit: 5c0a579 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11175240455&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.IDE` > Spec: > <hr>Fri, 04 Oct 2024 07:12:01 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced the `UQIEditorForm` component for enhanced form handling within the `PluginActionForm`. - Updated the `usePluginActionResponseTabs` hook to support additional plugin types and dynamic tab structures based on datasource presence. - **Bug Fixes** - Improved conditional rendering logic to ensure proper display of UI components based on plugin types. - **Documentation** - Added descriptive comments to clarify the functionality of new components and hooks. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
Showing
3 changed files
with
109 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
app/client/src/PluginActionEditor/components/PluginActionForm/components/UQIEditorForm.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React from "react"; | ||
import FormRender from "pages/Editor/QueryEditor/FormRender"; | ||
import { usePluginActionContext } from "../../../PluginActionContext"; | ||
import { QUERY_EDITOR_FORM_NAME } from "ee/constants/forms"; | ||
import { getFormValues, reduxForm } from "redux-form"; | ||
import type { QueryAction, SaaSAction } from "entities/Action"; | ||
import { useSelector } from "react-redux"; | ||
import { getFormEvaluationState } from "selectors/formSelectors"; | ||
import { Flex } from "@appsmith/ads"; | ||
|
||
const UQIEditorForm = () => { | ||
const { editorConfig, plugin } = usePluginActionContext(); | ||
|
||
const formData = useSelector(getFormValues(QUERY_EDITOR_FORM_NAME)) as | ||
| QueryAction | ||
| SaaSAction; | ||
|
||
const formEvaluation = useSelector(getFormEvaluationState); | ||
|
||
let formEvaluationState = {}; | ||
|
||
// Fetching evaluations state only once the formData is populated | ||
if (!!formData) { | ||
formEvaluationState = formEvaluation[formData.id]; | ||
} | ||
|
||
return ( | ||
<Flex flexDirection="column" overflowY="scroll" w="100%"> | ||
<FormRender | ||
editorConfig={editorConfig} | ||
formData={formData} | ||
formEvaluationState={formEvaluationState} | ||
formName={QUERY_EDITOR_FORM_NAME} | ||
uiComponent={plugin.uiComponent} | ||
/> | ||
</Flex> | ||
); | ||
}; | ||
|
||
export default reduxForm({ | ||
form: QUERY_EDITOR_FORM_NAME, | ||
enableReinitialize: true, | ||
})(UQIEditorForm); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters