-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Adding the functionality of running and deleting an action und…
…er modularised flow (#36746) ## Description Adding the functionality of running and deleting an action under modularised flow. Fixes [#36645](#36645) [#36644](#36644) ## Automation /ok-to-test tags="@tag.Sanity" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!WARNING] > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/11254347110> > Commit: a1c8050 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11254347110&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: @tag.Sanity > Spec: > It seems like **no tests ran** 😔. We are not able to recognize it, please check <a href="https://github.com/appsmithorg/appsmith/actions/runs/11254347110" target="_blank">workflow here</a>. > <hr>Wed, 09 Oct 2024 12:34:20 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 ## Release Notes - **New Features** - Introduced new hooks, `useHandleRunClick` and `useHandleDeleteClick`, to enhance action handling for running and deleting actions. - **Improvements** - Updated the `APIEditorForm`, `PluginActionToolbar`, and `PluginActionMoreActions` components to utilize the new hooks, improving functionality and code organization. - Enhanced the user interface for deletion actions by integrating confirmation states and dynamic labels. - Streamlined the `PluginActionToolbar` and `PluginActionResponse` components for better action dispatching and menu management. - **Bug Fixes** - Removed unused `onTestClick` prop from various components, improving clarity and reducing complexity. - **Documentation** - Added a new file documenting circular dependencies within the codebase to assist developers in understanding module interrelations. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
1 parent
98ca412
commit 41d5ce7
Showing
17 changed files
with
77 additions
and
68 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
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
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
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
export { useActionSettingsConfig } from "ee/PluginActionEditor/hooks/useActionSettingsConfig"; | ||
export { useHandleDeleteClick } from "ee/PluginActionEditor/hooks/useHandleDeleteClick"; | ||
export { useHandleRunClick } from "ee/PluginActionEditor/hooks/useHandleRunClick"; |
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
26 changes: 26 additions & 0 deletions
26
app/client/src/ce/PluginActionEditor/hooks/useHandleDeleteClick.ts
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,26 @@ | ||
import { deleteAction } from "actions/pluginActionActions"; | ||
import { usePluginActionContext } from "PluginActionEditor/PluginActionContext"; | ||
import { useCallback } from "react"; | ||
import { useDispatch } from "react-redux"; | ||
|
||
function useHandleDeleteClick() { | ||
const { action } = usePluginActionContext(); | ||
const dispatch = useDispatch(); | ||
|
||
const handleDeleteClick = useCallback( | ||
({ onSuccess }: { onSuccess?: () => void }) => { | ||
dispatch( | ||
deleteAction({ | ||
id: action?.id ?? "", | ||
name: action?.name ?? "", | ||
onSuccess, | ||
}), | ||
); | ||
}, | ||
[action.id, action.name, dispatch], | ||
); | ||
|
||
return { handleDeleteClick }; | ||
} | ||
|
||
export { useHandleDeleteClick }; |
21 changes: 21 additions & 0 deletions
21
app/client/src/ce/PluginActionEditor/hooks/useHandleRunClick.ts
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,21 @@ | ||
import { runAction } from "actions/pluginActionActions"; | ||
import type { PaginationField } from "api/ActionAPI"; | ||
import { usePluginActionContext } from "PluginActionEditor/PluginActionContext"; | ||
import { useCallback } from "react"; | ||
import { useDispatch } from "react-redux"; | ||
|
||
function useHandleRunClick() { | ||
const { action } = usePluginActionContext(); | ||
const dispatch = useDispatch(); | ||
|
||
const handleRunClick = useCallback( | ||
(paginationField?: PaginationField) => { | ||
dispatch(runAction(action?.id ?? "", paginationField)); | ||
}, | ||
[action.id, dispatch], | ||
); | ||
|
||
return { handleRunClick }; | ||
} | ||
|
||
export { useHandleRunClick }; |
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
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
1 change: 1 addition & 0 deletions
1
app/client/src/ee/PluginActionEditor/hooks/useHandleDeleteClick.ts
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 @@ | ||
export * from "ce/PluginActionEditor/hooks/useHandleDeleteClick"; |
1 change: 1 addition & 0 deletions
1
app/client/src/ee/PluginActionEditor/hooks/useHandleRunClick.ts
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 @@ | ||
export * from "ce/PluginActionEditor/hooks/useHandleRunClick"; |
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
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
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
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
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
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