PromucFlow_constructor/app/client/src/PluginActionEditor/PluginActionEditor.tsx

94 lines
2.6 KiB
TypeScript
Raw Normal View History

chore: Plugin Action Editor Context (#36187) ## Description - Introduce the PluginActionEditor module structure - Add basic handling and states in the PluginActionContext - Update AppIDE to use the new Editor when the feature flag is active. This will later be updated and the component will be used from the route level itself Fixes #36152 ## Automation /ok-to-test tags="@tag.Datasource" ### :mag: 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/10805408539> > Commit: 1b8259b32c0df05137b01e25d7ff942b936e8110 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10805408539&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Datasource` > Spec: > <hr>Wed, 11 Sep 2024 05:53:02 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a `PluginActionEditor` component for managing plugin actions. - Added `PluginActionContext` for improved state management of plugin actions. - Implemented feature flag checks to conditionally render the redesigned action editor interface in both the `ApiEditorWrapper` and `QueryEditor` components. - **Documentation** - Added centralized export files for easier access to new components and context providers. - **Bug Fixes** - Enhanced error handling for missing plugin settings and configurations in the `PluginActionEditor`. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-12 04:41:54 +00:00
import React from "react";
import { useLocation } from "react-router";
import { identifyEntityFromPath } from "../navigation/FocusEntity";
import { useSelector } from "react-redux";
import {
getActionByBaseId,
chore: Init Plugin Action Response (#36485) ## Description Response Pane stuff - Move Api Response into its own component and sub components - Move Api Headers response into its own component and sub components - A lot of these are also used by queries and js so maybe we will create a common folder for that - Add a logic to render the bottom tabs in the module. Allows for extension via hook Fixes #36155 ## Automation /ok-to-test tags="@tag.Datasource" ### :mag: 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/11026260058> > Commit: c3b5b4b8f0e0668ff43adae1b22d320a5e6d347d > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11026260058&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Datasource` > Spec: > <hr>Wed, 25 Sep 2024 05:04:24 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced new components for displaying API responses, including `ApiFormatSegmentedResponse` and `ApiResponseHeaders`. - Enhanced user interaction with a segmented control for switching between different API response formats. - **Improvements** - Added utility functions for improved handling and validation of API response headers and HTML content. - **Bug Fixes** - Improved error handling for API response states to ensure accurate feedback during user interactions. - **Chores** - Added tests for new utility functions to validate their functionality and ensure reliability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-25 07:44:26 +00:00
getActionResponses,
chore: Plugin Action Editor Context (#36187) ## Description - Introduce the PluginActionEditor module structure - Add basic handling and states in the PluginActionContext - Update AppIDE to use the new Editor when the feature flag is active. This will later be updated and the component will be used from the route level itself Fixes #36152 ## Automation /ok-to-test tags="@tag.Datasource" ### :mag: 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/10805408539> > Commit: 1b8259b32c0df05137b01e25d7ff942b936e8110 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10805408539&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Datasource` > Spec: > <hr>Wed, 11 Sep 2024 05:53:02 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a `PluginActionEditor` component for managing plugin actions. - Added `PluginActionContext` for improved state management of plugin actions. - Implemented feature flag checks to conditionally render the redesigned action editor interface in both the `ApiEditorWrapper` and `QueryEditor` components. - **Documentation** - Added centralized export files for easier access to new components and context providers. - **Bug Fixes** - Enhanced error handling for missing plugin settings and configurations in the `PluginActionEditor`. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-12 04:41:54 +00:00
getDatasource,
getEditorConfig,
getPlugin,
} from "ee/selectors/entitiesSelector";
import { PluginActionContextProvider } from "./PluginActionContext";
import { get } from "lodash";
import EntityNotFoundPane from "pages/Editor/EntityNotFoundPane";
import Spinner from "components/editorComponents/Spinner";
import CenteredWrapper from "components/designSystems/appsmith/CenteredWrapper";
import { Text } from "@appsmith/ads";
chore: [Plugin Action Editor] Implement a useIsEditorIsInitialised hook (#36328) ## Description Implements a new IDE level hook that looks at the editor state and returns it. This hook gets overriden with EE logic. EE PR: https://github.com/appsmithorg/appsmith-ee/pull/5151 Related to #34324 ## Automation /ok-to-test tags="@tag.IDE" ### :mag: 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/10882119504> > Commit: 330560e22eb27555f85e8ef32b94a7edec783b00 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10882119504&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.IDE` > Spec: > <hr>Mon, 16 Sep 2024 11:06:52 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new hook, `useIsEditorInitialised`, for improved management of the editor's initialization state. - Enhanced the `PluginActionEditor` component to utilize the new hook, streamlining the initialization state access. - **Bug Fixes** - Removed reliance on Redux for the editor's initialization state in favor of the new hook, improving performance and readability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-16 11:10:37 +00:00
import { useIsEditorInitialised } from "IDE/hooks";
chore: Adding a new hook to set `settingsConfig` for an action based on IDE type (#36442) ## Description Adding a new hook to set `settingsConfig` for an action based on IDE type. This is being used in PluginActionEditor in the new modular flow. Fixes #36438 #36439 ## Automation /ok-to-test tags="@tag.All" ### :mag: 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/10955776812> > Commit: 447d926c31c6e26922bb24851c68727bec14d1ae > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10955776812&attempt=2" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Fri, 20 Sep 2024 10:12:39 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 ## Summary by CodeRabbit - **New Features** - Introduced a new hook, `useActionSettingsConfig`, for simplified access to plugin action settings. - Updated the `PluginActionEditor` to utilize the new hook, enhancing the logic for retrieving plugin settings. - Added a re-exporting mechanism for `useActionSettingsConfig` to improve organization within the Plugin Action Editor. - **Improvements** - Streamlined the process of accessing plugin configurations, improving overall code clarity and maintainability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-20 14:07:10 +00:00
import { useActionSettingsConfig } from "./hooks";
chore: Plugin Action Editor Context (#36187) ## Description - Introduce the PluginActionEditor module structure - Add basic handling and states in the PluginActionContext - Update AppIDE to use the new Editor when the feature flag is active. This will later be updated and the component will be used from the route level itself Fixes #36152 ## Automation /ok-to-test tags="@tag.Datasource" ### :mag: 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/10805408539> > Commit: 1b8259b32c0df05137b01e25d7ff942b936e8110 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10805408539&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Datasource` > Spec: > <hr>Wed, 11 Sep 2024 05:53:02 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a `PluginActionEditor` component for managing plugin actions. - Added `PluginActionContext` for improved state management of plugin actions. - Implemented feature flag checks to conditionally render the redesigned action editor interface in both the `ApiEditorWrapper` and `QueryEditor` components. - **Documentation** - Added centralized export files for easier access to new components and context providers. - **Bug Fixes** - Enhanced error handling for missing plugin settings and configurations in the `PluginActionEditor`. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-12 04:41:54 +00:00
interface ChildrenProps {
chore: [Plugin Action Editor] Convert to Module (#36305) ## Description CE PR for: https://github.com/appsmithorg/appsmith-ee/pull/5134 ## Automation /ok-to-test tags="@tag.Sanity" ### :mag: 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/10845636973> > Commit: 1f40848b28f4a3fbb3461578334ee613f608c7bd > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10845636973&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Sanity` > Spec: > <hr>Fri, 13 Sep 2024 08:48:25 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced flexibility for child components in the Plugin Action Editor, allowing single or multiple React nodes. - Introduced a new toolbar with a dropdown menu for additional actions. - Added components for converting actions into modules, including callouts and disablers for better user feedback. - **Bug Fixes** - Improved user experience by providing notifications during the action conversion process. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-13 08:59:20 +00:00
children: React.ReactNode | React.ReactNode[];
chore: Plugin Action Editor Context (#36187) ## Description - Introduce the PluginActionEditor module structure - Add basic handling and states in the PluginActionContext - Update AppIDE to use the new Editor when the feature flag is active. This will later be updated and the component will be used from the route level itself Fixes #36152 ## Automation /ok-to-test tags="@tag.Datasource" ### :mag: 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/10805408539> > Commit: 1b8259b32c0df05137b01e25d7ff942b936e8110 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10805408539&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Datasource` > Spec: > <hr>Wed, 11 Sep 2024 05:53:02 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a `PluginActionEditor` component for managing plugin actions. - Added `PluginActionContext` for improved state management of plugin actions. - Implemented feature flag checks to conditionally render the redesigned action editor interface in both the `ApiEditorWrapper` and `QueryEditor` components. - **Documentation** - Added centralized export files for easier access to new components and context providers. - **Bug Fixes** - Enhanced error handling for missing plugin settings and configurations in the `PluginActionEditor`. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-12 04:41:54 +00:00
}
const PluginActionEditor = (props: ChildrenProps) => {
const { pathname } = useLocation();
chore: [Plugin Action Editor] Implement a useIsEditorIsInitialised hook (#36328) ## Description Implements a new IDE level hook that looks at the editor state and returns it. This hook gets overriden with EE logic. EE PR: https://github.com/appsmithorg/appsmith-ee/pull/5151 Related to #34324 ## Automation /ok-to-test tags="@tag.IDE" ### :mag: 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/10882119504> > Commit: 330560e22eb27555f85e8ef32b94a7edec783b00 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10882119504&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.IDE` > Spec: > <hr>Mon, 16 Sep 2024 11:06:52 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new hook, `useIsEditorInitialised`, for improved management of the editor's initialization state. - Enhanced the `PluginActionEditor` component to utilize the new hook, streamlining the initialization state access. - **Bug Fixes** - Removed reliance on Redux for the editor's initialization state in favor of the new hook, improving performance and readability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-16 11:10:37 +00:00
const isEditorInitialized = useIsEditorInitialised();
chore: Plugin Action Editor Context (#36187) ## Description - Introduce the PluginActionEditor module structure - Add basic handling and states in the PluginActionContext - Update AppIDE to use the new Editor when the feature flag is active. This will later be updated and the component will be used from the route level itself Fixes #36152 ## Automation /ok-to-test tags="@tag.Datasource" ### :mag: 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/10805408539> > Commit: 1b8259b32c0df05137b01e25d7ff942b936e8110 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10805408539&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Datasource` > Spec: > <hr>Wed, 11 Sep 2024 05:53:02 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a `PluginActionEditor` component for managing plugin actions. - Added `PluginActionContext` for improved state management of plugin actions. - Implemented feature flag checks to conditionally render the redesigned action editor interface in both the `ApiEditorWrapper` and `QueryEditor` components. - **Documentation** - Added centralized export files for easier access to new components and context providers. - **Bug Fixes** - Enhanced error handling for missing plugin settings and configurations in the `PluginActionEditor`. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-12 04:41:54 +00:00
const entity = identifyEntityFromPath(pathname);
const action = useSelector((state) => getActionByBaseId(state, entity.id));
const pluginId = get(action, "pluginId", "");
const plugin = useSelector((state) => getPlugin(state, pluginId));
const datasourceId = get(action, "datasource.id", "");
const datasource = useSelector((state) => getDatasource(state, datasourceId));
chore: Adding a new hook to set `settingsConfig` for an action based on IDE type (#36442) ## Description Adding a new hook to set `settingsConfig` for an action based on IDE type. This is being used in PluginActionEditor in the new modular flow. Fixes #36438 #36439 ## Automation /ok-to-test tags="@tag.All" ### :mag: 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/10955776812> > Commit: 447d926c31c6e26922bb24851c68727bec14d1ae > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10955776812&attempt=2" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Fri, 20 Sep 2024 10:12:39 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 ## Summary by CodeRabbit - **New Features** - Introduced a new hook, `useActionSettingsConfig`, for simplified access to plugin action settings. - Updated the `PluginActionEditor` to utilize the new hook, enhancing the logic for retrieving plugin settings. - Added a re-exporting mechanism for `useActionSettingsConfig` to improve organization within the Plugin Action Editor. - **Improvements** - Streamlined the process of accessing plugin configurations, improving overall code clarity and maintainability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-20 14:07:10 +00:00
const settingsConfig = useActionSettingsConfig(action);
chore: Plugin Action Editor Context (#36187) ## Description - Introduce the PluginActionEditor module structure - Add basic handling and states in the PluginActionContext - Update AppIDE to use the new Editor when the feature flag is active. This will later be updated and the component will be used from the route level itself Fixes #36152 ## Automation /ok-to-test tags="@tag.Datasource" ### :mag: 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/10805408539> > Commit: 1b8259b32c0df05137b01e25d7ff942b936e8110 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10805408539&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Datasource` > Spec: > <hr>Wed, 11 Sep 2024 05:53:02 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a `PluginActionEditor` component for managing plugin actions. - Added `PluginActionContext` for improved state management of plugin actions. - Implemented feature flag checks to conditionally render the redesigned action editor interface in both the `ApiEditorWrapper` and `QueryEditor` components. - **Documentation** - Added centralized export files for easier access to new components and context providers. - **Bug Fixes** - Enhanced error handling for missing plugin settings and configurations in the `PluginActionEditor`. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-12 04:41:54 +00:00
const editorConfig = useSelector((state) => getEditorConfig(state, pluginId));
chore: Init Plugin Action Response (#36485) ## Description Response Pane stuff - Move Api Response into its own component and sub components - Move Api Headers response into its own component and sub components - A lot of these are also used by queries and js so maybe we will create a common folder for that - Add a logic to render the bottom tabs in the module. Allows for extension via hook Fixes #36155 ## Automation /ok-to-test tags="@tag.Datasource" ### :mag: 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/11026260058> > Commit: c3b5b4b8f0e0668ff43adae1b22d320a5e6d347d > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11026260058&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Datasource` > Spec: > <hr>Wed, 25 Sep 2024 05:04:24 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced new components for displaying API responses, including `ApiFormatSegmentedResponse` and `ApiResponseHeaders`. - Enhanced user interaction with a segmented control for switching between different API response formats. - **Improvements** - Added utility functions for improved handling and validation of API response headers and HTML content. - **Bug Fixes** - Improved error handling for API response states to ensure accurate feedback during user interactions. - **Chores** - Added tests for new utility functions to validate their functionality and ensure reliability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-25 07:44:26 +00:00
const actionResponses = useSelector(getActionResponses);
chore: Plugin Action Editor Context (#36187) ## Description - Introduce the PluginActionEditor module structure - Add basic handling and states in the PluginActionContext - Update AppIDE to use the new Editor when the feature flag is active. This will later be updated and the component will be used from the route level itself Fixes #36152 ## Automation /ok-to-test tags="@tag.Datasource" ### :mag: 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/10805408539> > Commit: 1b8259b32c0df05137b01e25d7ff942b936e8110 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10805408539&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Datasource` > Spec: > <hr>Wed, 11 Sep 2024 05:53:02 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a `PluginActionEditor` component for managing plugin actions. - Added `PluginActionContext` for improved state management of plugin actions. - Implemented feature flag checks to conditionally render the redesigned action editor interface in both the `ApiEditorWrapper` and `QueryEditor` components. - **Documentation** - Added centralized export files for easier access to new components and context providers. - **Bug Fixes** - Enhanced error handling for missing plugin settings and configurations in the `PluginActionEditor`. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-12 04:41:54 +00:00
if (!isEditorInitialized) {
return (
<CenteredWrapper>
<Spinner size={30} />
</CenteredWrapper>
);
}
if (!action) {
return <EntityNotFoundPane />;
}
if (!plugin) {
return (
<CenteredWrapper>
<Text color="var(--ads-v2-color-fg-error)" kind="heading-m">
Plugin not installed!
</Text>
</CenteredWrapper>
);
}
if (!settingsConfig || !editorConfig) {
return (
<CenteredWrapper>
<Text color="var(--ads-v2-color-fg-error)" kind="heading-m">
Editor config not found!
</Text>
</CenteredWrapper>
);
}
chore: Init Plugin Action Response (#36485) ## Description Response Pane stuff - Move Api Response into its own component and sub components - Move Api Headers response into its own component and sub components - A lot of these are also used by queries and js so maybe we will create a common folder for that - Add a logic to render the bottom tabs in the module. Allows for extension via hook Fixes #36155 ## Automation /ok-to-test tags="@tag.Datasource" ### :mag: 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/11026260058> > Commit: c3b5b4b8f0e0668ff43adae1b22d320a5e6d347d > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11026260058&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Datasource` > Spec: > <hr>Wed, 25 Sep 2024 05:04:24 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced new components for displaying API responses, including `ApiFormatSegmentedResponse` and `ApiResponseHeaders`. - Enhanced user interaction with a segmented control for switching between different API response formats. - **Improvements** - Added utility functions for improved handling and validation of API response headers and HTML content. - **Bug Fixes** - Improved error handling for API response states to ensure accurate feedback during user interactions. - **Chores** - Added tests for new utility functions to validate their functionality and ensure reliability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-25 07:44:26 +00:00
const actionResponse = actionResponses[action.id];
chore: Plugin Action Editor Context (#36187) ## Description - Introduce the PluginActionEditor module structure - Add basic handling and states in the PluginActionContext - Update AppIDE to use the new Editor when the feature flag is active. This will later be updated and the component will be used from the route level itself Fixes #36152 ## Automation /ok-to-test tags="@tag.Datasource" ### :mag: 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/10805408539> > Commit: 1b8259b32c0df05137b01e25d7ff942b936e8110 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10805408539&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Datasource` > Spec: > <hr>Wed, 11 Sep 2024 05:53:02 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a `PluginActionEditor` component for managing plugin actions. - Added `PluginActionContext` for improved state management of plugin actions. - Implemented feature flag checks to conditionally render the redesigned action editor interface in both the `ApiEditorWrapper` and `QueryEditor` components. - **Documentation** - Added centralized export files for easier access to new components and context providers. - **Bug Fixes** - Enhanced error handling for missing plugin settings and configurations in the `PluginActionEditor`. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-12 04:41:54 +00:00
return (
<PluginActionContextProvider
action={action}
chore: Init Plugin Action Response (#36485) ## Description Response Pane stuff - Move Api Response into its own component and sub components - Move Api Headers response into its own component and sub components - A lot of these are also used by queries and js so maybe we will create a common folder for that - Add a logic to render the bottom tabs in the module. Allows for extension via hook Fixes #36155 ## Automation /ok-to-test tags="@tag.Datasource" ### :mag: 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/11026260058> > Commit: c3b5b4b8f0e0668ff43adae1b22d320a5e6d347d > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11026260058&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Datasource` > Spec: > <hr>Wed, 25 Sep 2024 05:04:24 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced new components for displaying API responses, including `ApiFormatSegmentedResponse` and `ApiResponseHeaders`. - Enhanced user interaction with a segmented control for switching between different API response formats. - **Improvements** - Added utility functions for improved handling and validation of API response headers and HTML content. - **Bug Fixes** - Improved error handling for API response states to ensure accurate feedback during user interactions. - **Chores** - Added tests for new utility functions to validate their functionality and ensure reliability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-25 07:44:26 +00:00
actionResponse={actionResponse}
chore: Plugin Action Editor Context (#36187) ## Description - Introduce the PluginActionEditor module structure - Add basic handling and states in the PluginActionContext - Update AppIDE to use the new Editor when the feature flag is active. This will later be updated and the component will be used from the route level itself Fixes #36152 ## Automation /ok-to-test tags="@tag.Datasource" ### :mag: 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/10805408539> > Commit: 1b8259b32c0df05137b01e25d7ff942b936e8110 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10805408539&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Datasource` > Spec: > <hr>Wed, 11 Sep 2024 05:53:02 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a `PluginActionEditor` component for managing plugin actions. - Added `PluginActionContext` for improved state management of plugin actions. - Implemented feature flag checks to conditionally render the redesigned action editor interface in both the `ApiEditorWrapper` and `QueryEditor` components. - **Documentation** - Added centralized export files for easier access to new components and context providers. - **Bug Fixes** - Enhanced error handling for missing plugin settings and configurations in the `PluginActionEditor`. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-12 04:41:54 +00:00
datasource={datasource}
editorConfig={editorConfig}
plugin={plugin}
settingsConfig={settingsConfig}
>
{props.children}
</PluginActionContextProvider>
);
};
export default PluginActionEditor;