Skip to content

Commit

Permalink
fix: Quick fixes for current state of Plugin Action Editor (#36574)
Browse files Browse the repository at this point in the history
## Description

Fixes null values crashes in Plugin Action Editor


## Automation

/ok-to-test tags="@tag.Datasource"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!CAUTION]  
> If you modify the content in this section, you are likely to disrupt
the CI result for your PR.

<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No
  • Loading branch information
hetunandu committed Sep 27, 2024
1 parent fc9a594 commit 6368215
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ import React from "react";
import APIEditorForm from "./components/APIEditorForm";
import { Flex } from "@appsmith/ads";
import { useChangeActionCall } from "./hooks/useChangeActionCall";
import { usePluginActionContext } from "../../PluginActionContext";
import { UIComponentTypes } from "api/PluginApi";

const PluginActionForm = () => {
useChangeActionCall();
const { plugin } = usePluginActionContext();

return (
<Flex p="spaces-2" w="100%">
<APIEditorForm />
{plugin.uiComponent === UIComponentTypes.ApiEditorForm ? (
<APIEditorForm />
) : null}
</Flex>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function useGetFormActionValues() {

// In an unlikely scenario where form is not initialised,
// return empty values to avoid form ui issues
if (!isAPIAction(formValues)) {
if (!formValues || !isAPIAction(formValues)) {
return {
actionHeaders: [],
actionParams: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function PluginActionResponse() {
expandedHeight={`${ActionExecutionResizerHeight}px`}
isCollapsed={!open}
onSelect={updateSelectedResponseTab}
selectedTabKey={selectedTab || tabs[0].key}
selectedTabKey={selectedTab || tabs[0]?.key}
tabs={tabs}
/>
</IDEBottomView>
Expand Down

0 comments on commit 6368215

Please sign in to comment.