PromucFlow_constructor/app/client/src/api/ActionAPI.tsx

272 lines
7.8 KiB
TypeScript
Raw Normal View History

import type React from "react";
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> ## Description This PR upgrades Prettier to v2 + enforces TypeScript’s [`import type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export) syntax where applicable. It’s submitted as a separate PR so we can merge it easily. As a part of this PR, we reformat the codebase heavily: - add `import type` everywhere where it’s required, and - re-format the code to account for Prettier 2’s breaking changes: https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes This PR is submitted against `release` to make sure all new code by team members will adhere to new formatting standards, and we’ll have fewer conflicts when merging `bundle-optimizations` into `release`. (I’ll merge `release` back into `bundle-optimizations` once this PR is merged.) ### Why is this needed? This PR is needed because, for the Lodash optimization from https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3, we need to use `import type`. Otherwise, `babel-plugin-lodash` complains that `LoDashStatic` is not a lodash function. However, just using `import type` in the current codebase will give you this: <img width="962" alt="Screenshot 2023-03-08 at 17 45 59" src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png"> That’s because Prettier 1 can’t parse `import type` at all. To parse it, we need to upgrade to Prettier 2. ### Why enforce `import type`? Apart from just enabling `import type` support, this PR enforces specifying `import type` everywhere it’s needed. (Developers will get immediate TypeScript and ESLint errors when they forget to do so.) I’m doing this because I believe `import type` improves DX and makes refactorings easier. Let’s say you had a few imports like below. Can you tell which of these imports will increase the bundle size? (Tip: it’s not all of them!) ```ts // app/client/src/workers/Linting/utils.ts import { Position } from "codemirror"; import { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` It’s pretty hard, right? What about now? ```ts // app/client/src/workers/Linting/utils.ts import type { Position } from "codemirror"; import type { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` Now, it’s clear that only `lodash` will be bundled. This helps developers to see which imports are problematic, but it _also_ helps with refactorings. Now, if you want to see where `codemirror` is bundled, you can just grep for `import \{.*\} from "codemirror"` – and you won’t get any type-only imports. This also helps (some) bundlers. Upon transpiling, TypeScript erases type-only imports completely. In some environment (not ours), this makes the bundle smaller, as the bundler doesn’t need to bundle type-only imports anymore. ## Type of change - Chore (housekeeping or task changes that don't impact user perception) ## How Has This Been Tested? This was tested to not break the build. ### Test Plan > Add Testsmith test cases links that relate to this PR ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
import type { HttpMethod } from "api/Api";
import API from "api/Api";
import type { ApiResponse } from "./ApiResponses";
import { DEFAULT_EXECUTE_ACTION_TIMEOUT_MS } from "ee/constants/ApiConstants";
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> ## Description This PR upgrades Prettier to v2 + enforces TypeScript’s [`import type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export) syntax where applicable. It’s submitted as a separate PR so we can merge it easily. As a part of this PR, we reformat the codebase heavily: - add `import type` everywhere where it’s required, and - re-format the code to account for Prettier 2’s breaking changes: https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes This PR is submitted against `release` to make sure all new code by team members will adhere to new formatting standards, and we’ll have fewer conflicts when merging `bundle-optimizations` into `release`. (I’ll merge `release` back into `bundle-optimizations` once this PR is merged.) ### Why is this needed? This PR is needed because, for the Lodash optimization from https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3, we need to use `import type`. Otherwise, `babel-plugin-lodash` complains that `LoDashStatic` is not a lodash function. However, just using `import type` in the current codebase will give you this: <img width="962" alt="Screenshot 2023-03-08 at 17 45 59" src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png"> That’s because Prettier 1 can’t parse `import type` at all. To parse it, we need to upgrade to Prettier 2. ### Why enforce `import type`? Apart from just enabling `import type` support, this PR enforces specifying `import type` everywhere it’s needed. (Developers will get immediate TypeScript and ESLint errors when they forget to do so.) I’m doing this because I believe `import type` improves DX and makes refactorings easier. Let’s say you had a few imports like below. Can you tell which of these imports will increase the bundle size? (Tip: it’s not all of them!) ```ts // app/client/src/workers/Linting/utils.ts import { Position } from "codemirror"; import { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` It’s pretty hard, right? What about now? ```ts // app/client/src/workers/Linting/utils.ts import type { Position } from "codemirror"; import type { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` Now, it’s clear that only `lodash` will be bundled. This helps developers to see which imports are problematic, but it _also_ helps with refactorings. Now, if you want to see where `codemirror` is bundled, you can just grep for `import \{.*\} from "codemirror"` – and you won’t get any type-only imports. This also helps (some) bundlers. Upon transpiling, TypeScript erases type-only imports completely. In some environment (not ours), this makes the bundle smaller, as the bundler doesn’t need to bundle type-only imports anymore. ## Type of change - Chore (housekeeping or task changes that don't impact user perception) ## How Has This Been Tested? This was tested to not break the build. ### Test Plan > Add Testsmith test cases links that relate to this PR ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
import type { AxiosPromise, CancelTokenSource } from "axios";
import axios from "axios";
import type { Action, ActionViewMode } from "entities/Action";
import type { APIRequest } from "constants/AppsmithActionConstants/ActionConstants";
import type { WidgetType } from "constants/WidgetConstants";
import type { ActionParentEntityTypeInterface } from "ee/entities/Engine/actionHelpers";
feat: enable post run actions for plugin queries (#39325) ## Description This PR enables the response pane of DB queries in appsmith to show a form container once the action is executed and the server returns with a `postRunAction` config. The contents to be shown inside the container are controlled by the `postRunAction` config. The config has a unique identifier which should be registered in the client. Based on this registry, client can render the required form inside the container. If no form is found, the container is not shown. Fixes #39402 ## Automation /test 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/13493868532> > Commit: 75b13354c6147717360831fff06b60063d14c3ed > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13493868532&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Sanity` > Spec: > <hr>Mon, 24 Feb 2025 09:13:40 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** - Enhanced action response experience: The application now conditionally displays an interactive post-run action interface. When additional configuration is detected after an action execution, a streamlined modal form appears to guide you through follow-up tasks, making post-action interactions more intuitive and visible. This update offers a smoother, clearer workflow where supplementary steps are seamlessly integrated into your experience. - **Tests** - Added new test cases for the `Response` component to validate the rendering logic based on post-run actions. - Introduced tests for utility functions related to post-run actions to ensure correct behavior and output. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-02-24 09:18:34 +00:00
import type { PostActionRunConfig } from "./types";
2019-09-12 11:44:18 +00:00
export interface Property {
key: string;
2020-06-04 13:49:22 +00:00
value?: string;
}
export type ActionCreateUpdateResponse = ApiResponse & {
2019-10-21 15:12:45 +00:00
id: string;
baseId: string;
2019-10-21 15:12:45 +00:00
jsonPathKeys: Record<string, string>;
feat: Enable fetch datasource structure for action (#24195) Users have to toggle the datasource entity to fetch the structure of their datasources. This PR makes the datasource structure of used datasources in the current app to be fetched on page load. It also fetches the datasource structure when a new action is created of a datasource (that doesn't have its structure present) Fixes #23958 - New feature (non-breaking change which adds functionality) ## Testing > #### How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration. > Delete anything that is not relevant - [ ] Manual - [ ] Jest - [ ] Cypress > > #### Test Plan > Add Testsmith test cases links that relate to this PR > > #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#areas-of-interest) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-06-13 11:00:37 +00:00
datasource: {
id?: string;
};
};
2019-10-21 15:12:45 +00:00
2020-03-12 20:27:39 +00:00
export type PaginationField = "PREV" | "NEXT";
2020-02-07 02:32:52 +00:00
2019-09-12 13:44:25 +00:00
export interface ExecuteActionRequest extends APIRequest {
[API breaking change : Automated Tests Will Fail] Page And Action Refactor (#549) * Introduced new page which stores the published and unpublished pages as separate. * Mid level commit to save the state. * Parity of new page repository with old page repository (custom functions) * WIP : Delete a page. This requires changes across application structure as well. * Added publishedPages construct inside application to store the pages in the deployed view as well as isDefault so that the same changes (delete or isDefault) in unpublished view doesn't alter these fields for the published application * Parity reached with PageService. * Minor ActionService refactor to remove unnecessary code. ApplicationPageService, LayoutActionService, LayoutService use the new page service to fetch the pages Minor corrections in fetching the page from new page service in tests * New save function which sets the PageDTO for unpublished page and then saves the new page into repository. * Migration of page service functions to new page service functions across other services/tests/controller * Finished migrating all the page service functions to the new page service functions * Application Service Tests have been fixed. * All the existing test cases are working now. * Publish application implemented to store published pages as well. Added a basic test case to check that published pages is being set and that page's publishedPageDTO is being set accordingly. * Minor TODOs added to add test cases for published application. * A few tests to ascertain that published application page fields (deleted, isDefault) does not get changed when these statuses are changed for a page in edit mode. * Added a new controller end point to fetch application in view mode. * Added new endpoint for fetching an application in view mode on the client. * Bug fix where get application in view mode API was not getting called. * Fixed the get page names by application & archive pages which have been deleted in edit mode during publishing of application. * During delete page, if a page was never published and it was deleted during edit, delete the entire page instead of just deleting the unpublished PageDTO * Minor formatting. * Non working client side code to fetch page list using view mode. * revert unnecassary changes and streamlined view and edit actions * Fix missed import * Fixed a bug where if a page is not published, it should not be returned in view mode in list of page names api. * Fixed update for a page which was not working in integration test. * ActionDTO added. * Solidified the new action structure. * Migration added for NewAction index creation and NewAction per Action insertion in the database. * Basic file structure added the new repository, custom repository, service, etc. * Delete OldPage.java * Repo functions added - TODO : Haven;t handled the published/edited views * Helper functions added to convert Action to NewAction and vice-versa. Removed unused currentUserMono usage. * Create & update action functionality added. * Execute Action refactored. Removed dry run specific code. * Repository migrated to handle new data structure. Execute action refactored to no longer support dry runs of actions. * TODO added for special handling of change view of application to handle edge cases of pages/actions which either exist in published mode but don't exist in unpublished mode or vice versa. * Migrated finding on load actions from spring repository to custom repository. * In view mode, now actions are being fetched by application id directly instead of first fetching application and then using the page ids, fetching the actions. This reduces the db calls from 2 to 1 per fetch actions in view mode api call. * Delete action and get all actions (used in edit mode on the client side) implemented. * Updated CollectionService and ActionCollectionService to use the new action service instead of the old one. * LayoutActionService refactored to now use the new service functions. * ActionController now no longer used ActionService. The remaining service functions have been migrated to the new action service. * Refactor across ACL code for addition/removal of policies during addition/removal of users to organization, making app public, refactor for services like policy utils, item service, etc. * Removed the last of action repository and action service and replaced with new action repo and new action service. * Compile and run time issues fixed. The server is coming up without any spring dependency errors. * WIP in fixing fetching actions by page id. * Finally!!! Fixed the fetch actions (both published and unpublished actions) by page id repository function. * Fixed create action bug where null datasource in published actiondto (inside newly created action) leads to error. * Fixed the execute action issues : 1. Removed the dry runs from the tests 2. Fixed the null pointer error in variable substituted action and datasource configurations. * 1. Fixed the custom action repository field names. 2. Fixed the data structures used in ExamplesOrganizationClonerTests * Fixed countByDatasourceId repository function which was querying the actions incorrectly. * Fixed the clone example organization error where the id of the action was not getting updated in the page correctly. Yay! * Fixed post merge compilation failure. * Fixed more compilation time failures in ActionServiceTest * Fixed failing test case for fetching actions in view mode. * Minor changes to resolve merge changes and incorporate in the new refactored code. * 1. Fixed compile time errors on Client code. 2. Fixed fetching of actions in view mode by application id. The repository function did not need name parameter. Removed the same. * [Integration Testing Error Fix] : Added a new test case for refactor action name. * Instead of fetching actions in the page, mistakenly used the base service which was fetching all the actions in the repository, barring none which led to the name refactor being blocked even though no action in the current page exists with the new proposed name, * Added delete functionality to action service. * Minor code cleanup * Adding viewMode to action execution * Replacing action with actionId. * 1. Bug fix for deletion of unpublished action. In case of never published action, the entire action should be deleted. In case an action was published, only the unpublished action should be deleted. 2. In case of DB actions (external datasources), only the bare minimum fields should be stored inside the action (datasource id and datasource plugin id). The other fields should not be duplicated across code. * Fixed yarn build compilation issues. * Update app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ActionController.java Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com> * Changed the API path for GET applications in view mode. Some minor code formatting. * Incorporated review comments. * Some more unnecessary code removed. * Instead of returning Page, now the interface object between client and server for Pages is PageDTO * Migrated Page and Action to PageDTO and ActionDTO Fixed the compilation issues. TODO : Fix the test compilation issues. * Fixed compilation time issues with all the tests by migrating Page and Action to PageDTO and ActionDTO respectively * Action Controller and Page Controller no longer extend Base Controller. All the required functions have now been implemented and no base line API end points are being re-used from the base. * Test case fixes. * Bug Fix : Updating an action was not updating execute on load. Fixed the data flow leading to the error. * Deprecating Page and Action domain objects. This is to ensure no new code is written with these till we remove this old code. * Cloned example applications are now published before returning. This is to ensure that the applications are in ready to view mode when the new user signs up. * Added a function comment to expand on the usage of new param introduced. * When cloning a page, new actions were not being stored. Added that. Also updated the clonePage test to assert that the actions are also cloned when the pages are cloned. * Updated a Api call * removed extra slash Co-authored-by: Hetu Nandu <hetunandu@gmail.com> Co-authored-by: Satbir Singh <satbir121@gmail.com> Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com> Co-authored-by: nandan.anantharamu <nandan@thinkify.io>
2020-10-26 12:34:23 +00:00
actionId: string;
2019-11-01 07:11:32 +00:00
params?: Property[];
2020-03-12 20:27:39 +00:00
paginationField?: PaginationField;
[API breaking change : Automated Tests Will Fail] Page And Action Refactor (#549) * Introduced new page which stores the published and unpublished pages as separate. * Mid level commit to save the state. * Parity of new page repository with old page repository (custom functions) * WIP : Delete a page. This requires changes across application structure as well. * Added publishedPages construct inside application to store the pages in the deployed view as well as isDefault so that the same changes (delete or isDefault) in unpublished view doesn't alter these fields for the published application * Parity reached with PageService. * Minor ActionService refactor to remove unnecessary code. ApplicationPageService, LayoutActionService, LayoutService use the new page service to fetch the pages Minor corrections in fetching the page from new page service in tests * New save function which sets the PageDTO for unpublished page and then saves the new page into repository. * Migration of page service functions to new page service functions across other services/tests/controller * Finished migrating all the page service functions to the new page service functions * Application Service Tests have been fixed. * All the existing test cases are working now. * Publish application implemented to store published pages as well. Added a basic test case to check that published pages is being set and that page's publishedPageDTO is being set accordingly. * Minor TODOs added to add test cases for published application. * A few tests to ascertain that published application page fields (deleted, isDefault) does not get changed when these statuses are changed for a page in edit mode. * Added a new controller end point to fetch application in view mode. * Added new endpoint for fetching an application in view mode on the client. * Bug fix where get application in view mode API was not getting called. * Fixed the get page names by application & archive pages which have been deleted in edit mode during publishing of application. * During delete page, if a page was never published and it was deleted during edit, delete the entire page instead of just deleting the unpublished PageDTO * Minor formatting. * Non working client side code to fetch page list using view mode. * revert unnecassary changes and streamlined view and edit actions * Fix missed import * Fixed a bug where if a page is not published, it should not be returned in view mode in list of page names api. * Fixed update for a page which was not working in integration test. * ActionDTO added. * Solidified the new action structure. * Migration added for NewAction index creation and NewAction per Action insertion in the database. * Basic file structure added the new repository, custom repository, service, etc. * Delete OldPage.java * Repo functions added - TODO : Haven;t handled the published/edited views * Helper functions added to convert Action to NewAction and vice-versa. Removed unused currentUserMono usage. * Create & update action functionality added. * Execute Action refactored. Removed dry run specific code. * Repository migrated to handle new data structure. Execute action refactored to no longer support dry runs of actions. * TODO added for special handling of change view of application to handle edge cases of pages/actions which either exist in published mode but don't exist in unpublished mode or vice versa. * Migrated finding on load actions from spring repository to custom repository. * In view mode, now actions are being fetched by application id directly instead of first fetching application and then using the page ids, fetching the actions. This reduces the db calls from 2 to 1 per fetch actions in view mode api call. * Delete action and get all actions (used in edit mode on the client side) implemented. * Updated CollectionService and ActionCollectionService to use the new action service instead of the old one. * LayoutActionService refactored to now use the new service functions. * ActionController now no longer used ActionService. The remaining service functions have been migrated to the new action service. * Refactor across ACL code for addition/removal of policies during addition/removal of users to organization, making app public, refactor for services like policy utils, item service, etc. * Removed the last of action repository and action service and replaced with new action repo and new action service. * Compile and run time issues fixed. The server is coming up without any spring dependency errors. * WIP in fixing fetching actions by page id. * Finally!!! Fixed the fetch actions (both published and unpublished actions) by page id repository function. * Fixed create action bug where null datasource in published actiondto (inside newly created action) leads to error. * Fixed the execute action issues : 1. Removed the dry runs from the tests 2. Fixed the null pointer error in variable substituted action and datasource configurations. * 1. Fixed the custom action repository field names. 2. Fixed the data structures used in ExamplesOrganizationClonerTests * Fixed countByDatasourceId repository function which was querying the actions incorrectly. * Fixed the clone example organization error where the id of the action was not getting updated in the page correctly. Yay! * Fixed post merge compilation failure. * Fixed more compilation time failures in ActionServiceTest * Fixed failing test case for fetching actions in view mode. * Minor changes to resolve merge changes and incorporate in the new refactored code. * 1. Fixed compile time errors on Client code. 2. Fixed fetching of actions in view mode by application id. The repository function did not need name parameter. Removed the same. * [Integration Testing Error Fix] : Added a new test case for refactor action name. * Instead of fetching actions in the page, mistakenly used the base service which was fetching all the actions in the repository, barring none which led to the name refactor being blocked even though no action in the current page exists with the new proposed name, * Added delete functionality to action service. * Minor code cleanup * Adding viewMode to action execution * Replacing action with actionId. * 1. Bug fix for deletion of unpublished action. In case of never published action, the entire action should be deleted. In case an action was published, only the unpublished action should be deleted. 2. In case of DB actions (external datasources), only the bare minimum fields should be stored inside the action (datasource id and datasource plugin id). The other fields should not be duplicated across code. * Fixed yarn build compilation issues. * Update app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ActionController.java Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com> * Changed the API path for GET applications in view mode. Some minor code formatting. * Incorporated review comments. * Some more unnecessary code removed. * Instead of returning Page, now the interface object between client and server for Pages is PageDTO * Migrated Page and Action to PageDTO and ActionDTO Fixed the compilation issues. TODO : Fix the test compilation issues. * Fixed compilation time issues with all the tests by migrating Page and Action to PageDTO and ActionDTO respectively * Action Controller and Page Controller no longer extend Base Controller. All the required functions have now been implemented and no base line API end points are being re-used from the base. * Test case fixes. * Bug Fix : Updating an action was not updating execute on load. Fixed the data flow leading to the error. * Deprecating Page and Action domain objects. This is to ensure no new code is written with these till we remove this old code. * Cloned example applications are now published before returning. This is to ensure that the applications are in ready to view mode when the new user signs up. * Added a function comment to expand on the usage of new param introduced. * When cloning a page, new actions were not being stored. Added that. Also updated the clonePage test to assert that the actions are also cloned when the pages are cloned. * Updated a Api call * removed extra slash Co-authored-by: Hetu Nandu <hetunandu@gmail.com> Co-authored-by: Satbir Singh <satbir121@gmail.com> Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com> Co-authored-by: nandan.anantharamu <nandan@thinkify.io>
2020-10-26 12:34:23 +00:00
viewMode: boolean;
feat: remove bloat from large files during upload (WIP) (#21757) ## Description Currently, we try to upload large files by converting their binaries into strings which leads to bloat in size. This is because converting to bytes in a multi-byte encoding usually takes a larger space and white characters are also included. We were also doing multiple modifications which were just adding to the bloat. Hence, we are now converting the binary data into an array buffer to prevent this. This buffer is added to the multi-part form data request as a new part and we add a pointer in the pace of the data which used to be present earlier. This allows us to have minimal bloat on the payload while sending the request. TLDR: fix for uploading large files by changing the data type used for upload. *TODO:* - [x] Client side payload changes - [x] Server side double escape logic fixes - [x] Server side tests - [x] Server side refactor - [ ] Cypress tests Fixes #20642 Media ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Manual ### Test Plan > Add Testsmith test cases links that relate to this PR ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: Nidhi Nair <nidhi@appsmith.com>
2023-04-27 03:33:32 +00:00
paramProperties: Record<
string,
| string
| Record<string, Array<string>>
| Record<string, string>
| Record<string, Record<string, Array<string>>>
>;
analyticsProperties?: Record<string, boolean>;
}
2020-06-19 16:27:12 +00:00
export interface ActionApiResponseReq {
headers: Record<string, string[]>;
body: Record<string, unknown> | null;
2020-06-19 16:27:12 +00:00
httpMethod: HttpMethod | "";
url: string;
chore: Address misc one click binding feedbacks (#24735) ## Description Fixes miscellaneous feedback in the one-click binding feature. - Order of queries - show select queries on top and order by last executed query - Converting from JS to dropdown should be possible for the following cases - {{Query.data}} - Improve query names to be generated using the data table or collection we use - undefined table data value should show an error on the property pane - Download option should be disabled when table is generated using one click binding - Remove the insert binding option from the dropdown #### PR fixes following issue(s) Fixes https://github.com/appsmithorg/appsmith/issues/24605 > if no issue exists, please create an issue and ask the maintainers about this first > > #### Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video > > #### Type of change > Please delete options that are not relevant. - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) - Breaking change (fix or feature that would cause existing functionality to not work as expected) - Chore (housekeeping or task changes that don't impact user perception) - This change requires a documentation update > > > ## Testing > #### How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration. > Delete anything that is not relevant - [x] Manual - [x] Jest - [x] Cypress > > #### Test Plan > Add Testsmith test cases links that relate to this PR > > #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-06-29 13:53:25 +00:00
requestedAt?: number;
2020-06-19 16:27:12 +00:00
}
export type ActionExecutionResponse = ApiResponse<{
body: Record<string, unknown> | string;
headers: Record<string, string[]>;
statusCode: string;
isExecutionSuccess: boolean;
request: ActionApiResponseReq;
errorType?: string;
// TODO: Fix this the next time the file is edited
// eslint-disable-next-line @typescript-eslint/no-explicit-any
dataTypes: any[];
}> & {
2019-11-12 09:43:13 +00:00
clientMeta: {
duration: string;
size: string;
};
};
2019-11-12 09:43:13 +00:00
[Feature] new nav sniping mode (#5746) * added sniping mode toggle option to header * added cover to components on hover in sniping mode * fixed the transition time * using filled icon * Show dependencies in action pane * Added a wrapper to make a widget snipeable * removed older parts of sniping from Positioned Container * removed onclick action from snipeable wrapper * Showing widget name in different color * Added a mechanism to send user to sniping mode from successful API screen * created new property pane saga to bind the data * Fix datasource list width issue * Fix sidebar going out of view when the response is a table * Minor refactor * Show add widgets section on the sidebar * Stop showing autocomplete option after adding a widget * fetching pageId, appId from store * Get suggested widget from response * Fix table data not getting evaluated after adding binding * Fix property pane going below the entity explorer while navigating from query/api pane * Fix width of sidepane shifting for apis * Fix vertical margins of connections * Fix api pane suggested widget showing up for errors * Fix margins * can show select in canvas btn in sidebar * can get the action object at the end to bind the data * updated saga and action names * can bind data to table * Use themes * Use new image url for Table widget * Added conditional mapping for sniping mode binding. * updated the widget name tags and seq of calls to open property pane * pushed all sniping mode decoration to header * moved setting sniping mode logic to editor reducer * Added keyboard short cut to get out of sniping mode * updated reset sniping mechanism * removed a divider line * if there are no relationships, will not show the complete section * Connect Data will automatically show relevant tab in integrations * Update list and dropdown image urls * Remove create table button * no wrapping bind to text * minor review considerations * showing the widget name to left in sniping mode * can set data to datepicker * will not show snipe btn if there are no widgets in canvas * Changes for multiple suggested widgets * removed dependency of sniping from suggested widgets * Added analytics events for sniping mode * logic for binding data to a widget, moved to snipeable component * changed binding widget func from capture to onClick and took care of sniping from widget wrapper too. * added tests to check sniping mode for table * updated test spec * minor fix * Fix copy changes * Update test to use table widget from suggested widget list * if fails to bind will generate warning and keep user in sniping mode * in sniping mode will only show name plate if it is under focus * fixed the test case * added a comment * minor fix to capture on click event in sniping mode * updated text * Hide connections UI when there are no connections * Increase width to 90% * Show placeholder text and back button in sidepane * Show tooltip on hover * Add analyitcs events for suggested widgets and connections * Update label based on whether widgets are there or not * binding related changes * renamed the saga file containing sinping mode sagas * Changes for inspect entity * Revert "binding related changes" temporarily This reverts commit 54ae9667fecf24bc3cf9912a5356d06600b25c84. * Update suggested widgets url * Update table url * Fix chart data field not getting evaluated * a minor fix to show proper tool tip when user hovers on widget name * Show sidepane when there is output * Update locators * Use constants for messages * Update file name to ApiRightPane * Remove delay * Revert "Revert "binding related changes" temporarily" This reverts commit ee7f75e83218137250b4b9a28fcf63080c185150. * Fix width * Fix overlap Co-authored-by: Akash N <akash@codemonk.in>
2021-07-26 16:44:10 +00:00
export interface SuggestedWidget {
type: WidgetType;
bindingQuery: string;
}
2019-11-12 09:43:13 +00:00
export interface ActionResponse {
body: React.ReactNode;
headers: Record<string, string[]>;
2020-06-19 17:33:02 +00:00
request?: ActionApiResponseReq;
2020-03-12 20:27:39 +00:00
statusCode: string;
dataTypes: Record<string, string>[];
duration: string;
size: string;
isExecutionSuccess?: boolean;
[Feature] new nav sniping mode (#5746) * added sniping mode toggle option to header * added cover to components on hover in sniping mode * fixed the transition time * using filled icon * Show dependencies in action pane * Added a wrapper to make a widget snipeable * removed older parts of sniping from Positioned Container * removed onclick action from snipeable wrapper * Showing widget name in different color * Added a mechanism to send user to sniping mode from successful API screen * created new property pane saga to bind the data * Fix datasource list width issue * Fix sidebar going out of view when the response is a table * Minor refactor * Show add widgets section on the sidebar * Stop showing autocomplete option after adding a widget * fetching pageId, appId from store * Get suggested widget from response * Fix table data not getting evaluated after adding binding * Fix property pane going below the entity explorer while navigating from query/api pane * Fix width of sidepane shifting for apis * Fix vertical margins of connections * Fix api pane suggested widget showing up for errors * Fix margins * can show select in canvas btn in sidebar * can get the action object at the end to bind the data * updated saga and action names * can bind data to table * Use themes * Use new image url for Table widget * Added conditional mapping for sniping mode binding. * updated the widget name tags and seq of calls to open property pane * pushed all sniping mode decoration to header * moved setting sniping mode logic to editor reducer * Added keyboard short cut to get out of sniping mode * updated reset sniping mechanism * removed a divider line * if there are no relationships, will not show the complete section * Connect Data will automatically show relevant tab in integrations * Update list and dropdown image urls * Remove create table button * no wrapping bind to text * minor review considerations * showing the widget name to left in sniping mode * can set data to datepicker * will not show snipe btn if there are no widgets in canvas * Changes for multiple suggested widgets * removed dependency of sniping from suggested widgets * Added analytics events for sniping mode * logic for binding data to a widget, moved to snipeable component * changed binding widget func from capture to onClick and took care of sniping from widget wrapper too. * added tests to check sniping mode for table * updated test spec * minor fix * Fix copy changes * Update test to use table widget from suggested widget list * if fails to bind will generate warning and keep user in sniping mode * in sniping mode will only show name plate if it is under focus * fixed the test case * added a comment * minor fix to capture on click event in sniping mode * updated text * Hide connections UI when there are no connections * Increase width to 90% * Show placeholder text and back button in sidepane * Show tooltip on hover * Add analyitcs events for suggested widgets and connections * Update label based on whether widgets are there or not * binding related changes * renamed the saga file containing sinping mode sagas * Changes for inspect entity * Revert "binding related changes" temporarily This reverts commit 54ae9667fecf24bc3cf9912a5356d06600b25c84. * Update suggested widgets url * Update table url * Fix chart data field not getting evaluated * a minor fix to show proper tool tip when user hovers on widget name * Show sidepane when there is output * Update locators * Use constants for messages * Update file name to ApiRightPane * Remove delay * Revert "Revert "binding related changes" temporarily" This reverts commit ee7f75e83218137250b4b9a28fcf63080c185150. * Fix width * Fix overlap Co-authored-by: Akash N <akash@codemonk.in>
2021-07-26 16:44:10 +00:00
suggestedWidgets?: SuggestedWidget[];
messages?: Array<string>;
errorType?: string;
readableError?: string;
responseDisplayFormat?: string;
feat: Error handling phase 1 (#20629) ## Description This PR updates the error logs - Establishing a consistent format for all error messages. - Revising error titles and details for improved understanding. - Compiling internal documentation of all error categories, subcategories, and error descriptions. Updated Error Interface: https://www.notion.so/appsmith/Error-Interface-for-Plugin-Execution-Error-7b3f5323ba4c40bfad281ae717ccf79b PRD: https://www.notion.so/appsmith/PRD-Error-Handling-Framework-4ac9747057fd4105a9d52cb8b42f4452?pvs=4#008e9c79ff3c484abf0250a5416cf052 >TL;DR Fixes # Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Manual - Jest - Cypress ### Test Plan ### Issues raised during DP testing ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [x] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: subrata <subrata@appsmith.com>
2023-02-18 12:55:46 +00:00
pluginErrorDetails?: PluginErrorDetails;
feat: enable post run actions for plugin queries (#39325) ## Description This PR enables the response pane of DB queries in appsmith to show a form container once the action is executed and the server returns with a `postRunAction` config. The contents to be shown inside the container are controlled by the `postRunAction` config. The config has a unique identifier which should be registered in the client. Based on this registry, client can render the required form inside the container. If no form is found, the container is not shown. Fixes #39402 ## Automation /test 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/13493868532> > Commit: 75b13354c6147717360831fff06b60063d14c3ed > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13493868532&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Sanity` > Spec: > <hr>Mon, 24 Feb 2025 09:13:40 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** - Enhanced action response experience: The application now conditionally displays an interactive post-run action interface. When additional configuration is detected after an action execution, a streamlined modal form appears to guide you through follow-up tasks, making post-action interactions more intuitive and visible. This update offers a smoother, clearer workflow where supplementary steps are seamlessly integrated into your experience. - **Tests** - Added new test cases for the `Response` component to validate the rendering logic based on post-run actions. - Introduced tests for utility functions related to post-run actions to ensure correct behavior and output. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-02-24 09:18:34 +00:00
postRunAction?: PostActionRunConfig;
feat: Error handling phase 1 (#20629) ## Description This PR updates the error logs - Establishing a consistent format for all error messages. - Revising error titles and details for improved understanding. - Compiling internal documentation of all error categories, subcategories, and error descriptions. Updated Error Interface: https://www.notion.so/appsmith/Error-Interface-for-Plugin-Execution-Error-7b3f5323ba4c40bfad281ae717ccf79b PRD: https://www.notion.so/appsmith/PRD-Error-Handling-Framework-4ac9747057fd4105a9d52cb8b42f4452?pvs=4#008e9c79ff3c484abf0250a5416cf052 >TL;DR Fixes # Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Manual - Jest - Cypress ### Test Plan ### Issues raised during DP testing ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [x] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: subrata <subrata@appsmith.com>
2023-02-18 12:55:46 +00:00
}
//This contains the error details from the plugin that is sent to the client in the response
//title: The title of the error
//errorType: The type of error that occurred
//appsmithErrorCode: The error code that is used to identify the error in the appsmith
//appsmithErrorMessage: The appsmith error message that is shown to the user
//downstreamErrorCode: The error code that is sent by the plugin
//downstreamErrorMessage: The error message that is sent by the plugin
export interface PluginErrorDetails {
title: string;
errorType: string;
appsmithErrorCode: string;
appsmithErrorMessage: string;
downstreamErrorCode?: string;
downstreamErrorMessage?: string;
}
2020-01-24 09:54:40 +00:00
export interface MoveActionRequest {
action: Action;
2020-01-24 09:54:40 +00:00
destinationPageId: string;
}
2020-06-16 10:23:19 +00:00
export interface UpdateActionNameRequest {
chore: Refactoring API wiring for actions and JS actions to support private entity renaming on EE (#29763) ## Description Refactoring API wiring for actions and JS actions to support private entity renaming on EE. Also handles a couple of other issues (refer the issue attached below) #### PR fixes following issue(s) Fixes [#29762](https://github.com/appsmithorg/appsmith/issues/29762) #### Type of change - Chore (housekeeping or task changes that don't impact user perception) ## Testing > #### How Has This Been Tested? - [x] Manual - [ ] JUnit - [ ] Jest - [x] Cypress ## Checklist: #### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit - **New Features** - Enhanced action and JS object naming capabilities with new context-aware options. - Added support for organizing actions and JS objects within modules. - **Improvements** - Streamlined the process of renaming actions and JS objects to be more intuitive and context-sensitive. - **Refactor** - Updated internal type declarations for consistency and future extensibility. - **User Interface** - Improved UI elements to reflect the new naming and organizational features for actions and JS objects. - **Bug Fixes** - Corrected logic to ensure proper handling of the `isPublic` flag within JS collections. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2023-12-21 04:52:54 +00:00
pageId?: string;
actionId: string;
chore: Refactoring API wiring for actions and JS actions to support private entity renaming on EE (#29763) ## Description Refactoring API wiring for actions and JS actions to support private entity renaming on EE. Also handles a couple of other issues (refer the issue attached below) #### PR fixes following issue(s) Fixes [#29762](https://github.com/appsmithorg/appsmith/issues/29762) #### Type of change - Chore (housekeeping or task changes that don't impact user perception) ## Testing > #### How Has This Been Tested? - [x] Manual - [ ] JUnit - [ ] Jest - [x] Cypress ## Checklist: #### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit - **New Features** - Enhanced action and JS object naming capabilities with new context-aware options. - Added support for organizing actions and JS objects within modules. - **Improvements** - Streamlined the process of renaming actions and JS objects to be more intuitive and context-sensitive. - **Refactor** - Updated internal type declarations for consistency and future extensibility. - **User Interface** - Improved UI elements to reflect the new naming and organizational features for actions and JS objects. - **Bug Fixes** - Corrected logic to ensure proper handling of the `isPublic` flag within JS collections. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2023-12-21 04:52:54 +00:00
layoutId?: string;
2020-06-16 10:23:19 +00:00
newName: string;
oldName: string;
chore: Refactoring API wiring for actions and JS actions to support private entity renaming on EE (#29763) ## Description Refactoring API wiring for actions and JS actions to support private entity renaming on EE. Also handles a couple of other issues (refer the issue attached below) #### PR fixes following issue(s) Fixes [#29762](https://github.com/appsmithorg/appsmith/issues/29762) #### Type of change - Chore (housekeeping or task changes that don't impact user perception) ## Testing > #### How Has This Been Tested? - [x] Manual - [ ] JUnit - [ ] Jest - [x] Cypress ## Checklist: #### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit - **New Features** - Enhanced action and JS object naming capabilities with new context-aware options. - Added support for organizing actions and JS objects within modules. - **Improvements** - Streamlined the process of renaming actions and JS objects to be more intuitive and context-sensitive. - **Refactor** - Updated internal type declarations for consistency and future extensibility. - **User Interface** - Improved UI elements to reflect the new naming and organizational features for actions and JS objects. - **Bug Fixes** - Corrected logic to ensure proper handling of the `isPublic` flag within JS collections. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2023-12-21 04:52:54 +00:00
moduleId?: string;
workflowId?: string;
fix: Refactoring code to fix a couple of issues related to modules on EE (#29843) ## Description Refactoring code to fix a couple of issues related to modules on EE #### PR fixes following issue(s) Fixes [#29842](https://github.com/appsmithorg/appsmith/issues/29842) [#29445](https://github.com/appsmithorg/appsmith/issues/29445) #### Type of change - Bug fix (non-breaking change which fixes an issue) ## Testing #### How Has This Been Tested? - [x] Manual - [ ] JUnit - [ ] Jest - [x] Cypress ## Checklist: #### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [x] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new interface for improved action context handling. - Added functionality to create API actions based on the editor type. - Implemented a new hook for retrieving parent entity information in the datasource editor. - **Refactor** - Updated various components to utilize the new `ActionParentEntityTypeInterface`. - Enhanced reducer logic for better handling of action configurations. - Streamlined entity exports and imports for consistency. - **Bug Fixes** - Fixed redirection logic in the Datasource Blank State component for a smoother user experience. - **Chores** - Removed unused event listeners from sagas to optimize performance. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2023-12-26 06:08:00 +00:00
contextType?: ActionParentEntityTypeInterface;
2020-06-16 10:23:19 +00:00
}
feat: workflows query actions CRUD code split (#29156) ## Description Code split for workflow queries CRUD. Included changes - Added context for explorer entity files component. - Updated sub menu actions to handle different parent entity types (pages or workflows) - Made changes to certain API calls (using payload object instead of pageID) - Created intermediate actions to check parent entity types. Main PR in EE: [#2960](https://github.com/appsmithorg/appsmith-ee/pull/2960) #### PR fixes following issue(s) Fixes #29227 #### Type of change - New feature (non-breaking change which adds functionality) ## Testing > #### How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration. > Delete anything that is not relevant - [ ] Manual - [ ] JUnit - [ ] Jest - [ ] Cypress > > #### Test Plan > Add Testsmith test cases links that relate to this PR > > #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced search functionality to accept additional parameters for more refined results. - Introduced new helper functions to streamline the creation of queries, APIs, and JS collections based on parent entity types. - Implemented an improved URL building mechanism that accounts for different types of parent entities. - Upgraded the Global Search feature to filter file operations based on user permissions. - Refined the Partial Export Modal's file selection process to include additional entity types. - **Improvements** - Updated the Entity Explorer to provide context-sensitive options based on user permissions and feature flags. - Optimized the Add Query pane to conditionally display options based on user permissions and feature availability. - **Bug Fixes** - Fixed issues with entity ID resolution in URL building to ensure correct redirections within the app. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Druthi Polisetty <druthi@appsmith.com> Co-authored-by: Ankita Kinger <ankita@appsmith.com> Co-authored-by: Hetu Nandu <hetunandu@gmail.com>
2023-12-13 17:43:43 +00:00
export interface FetchActionsPayload {
applicationId?: string;
workflowId?: string;
}
class ActionAPI extends API {
static url = "v1/actions";
static apiUpdateCancelTokenSource: CancelTokenSource;
static queryUpdateCancelTokenSource: CancelTokenSource;
static abortActionExecutionTokenSource: CancelTokenSource;
2019-09-12 11:44:18 +00:00
static async createAction(
2020-12-30 07:31:20 +00:00
apiConfig: Partial<Action>,
): Promise<AxiosPromise<ActionCreateUpdateResponse>> {
chore: Strict schema for datasource and action APIs (#34366) Part of https://github.com/appsmithorg/appsmith/pull/33724. This is an effort to harden the server in terms of what request payloads are acceptable. **/test all** <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced API request payload handling for creating actions to include additional properties, improving data integrity and server-side validation. - **Improvements** - Refined data manipulation and payload structures in datasource-related API requests for better compatibility with server requirements. <!-- end of auto-generated comment: release notes by coderabbit.ai --><!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/9626214547> > Commit: fe5db45aeb916b176aec3ded06f1a9da1bf08898 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9626214547&attempt=2&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: `` > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor3_spec.ts > <li>cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor_1_spec.js > <li>cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor_2_spec.js </ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. <!-- end of auto-generated comment: Cypress test results -->
2024-06-24 11:47:23 +00:00
const payload = {
...apiConfig,
eventData: undefined,
isValid: undefined,
entityReferenceType: undefined,
datasource: {
...apiConfig.datasource,
isValid: undefined,
new: undefined,
},
};
chore: add blank line eslint rule (#36369) ## Description Added ESLint rule to force blank lines between statements. Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10924926728> > Commit: 34f57714a1575ee04e94e03cbcaf95e57a96c86c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10924926728&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > Spec: > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Anvil/AnvilModal_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCheckboxGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInlineButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilParagraphWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilStatsWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilTableWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilToolbarButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilZoneSectionWidgetSnapshot_spec.ts</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. > <hr>Wed, 18 Sep 2024 16:33:36 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No --------- Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-09-18 16:35:28 +00:00
chore: Strict schema for datasource and action APIs (#34366) Part of https://github.com/appsmithorg/appsmith/pull/33724. This is an effort to harden the server in terms of what request payloads are acceptable. **/test all** <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced API request payload handling for creating actions to include additional properties, improving data integrity and server-side validation. - **Improvements** - Refined data manipulation and payload structures in datasource-related API requests for better compatibility with server requirements. <!-- end of auto-generated comment: release notes by coderabbit.ai --><!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/9626214547> > Commit: fe5db45aeb916b176aec3ded06f1a9da1bf08898 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9626214547&attempt=2&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: `` > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor3_spec.ts > <li>cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor_1_spec.js > <li>cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor_2_spec.js </ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. <!-- end of auto-generated comment: Cypress test results -->
2024-06-24 11:47:23 +00:00
return API.post(ActionAPI.url, payload);
2019-10-21 15:12:45 +00:00
}
static async fetchActions(
feat: workflows query actions CRUD code split (#29156) ## Description Code split for workflow queries CRUD. Included changes - Added context for explorer entity files component. - Updated sub menu actions to handle different parent entity types (pages or workflows) - Made changes to certain API calls (using payload object instead of pageID) - Created intermediate actions to check parent entity types. Main PR in EE: [#2960](https://github.com/appsmithorg/appsmith-ee/pull/2960) #### PR fixes following issue(s) Fixes #29227 #### Type of change - New feature (non-breaking change which adds functionality) ## Testing > #### How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration. > Delete anything that is not relevant - [ ] Manual - [ ] JUnit - [ ] Jest - [ ] Cypress > > #### Test Plan > Add Testsmith test cases links that relate to this PR > > #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced search functionality to accept additional parameters for more refined results. - Introduced new helper functions to streamline the creation of queries, APIs, and JS collections based on parent entity types. - Implemented an improved URL building mechanism that accounts for different types of parent entities. - Upgraded the Global Search feature to filter file operations based on user permissions. - Refined the Partial Export Modal's file selection process to include additional entity types. - **Improvements** - Updated the Entity Explorer to provide context-sensitive options based on user permissions and feature flags. - Optimized the Add Query pane to conditionally display options based on user permissions and feature availability. - **Bug Fixes** - Fixed issues with entity ID resolution in URL building to ensure correct redirections within the app. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Druthi Polisetty <druthi@appsmith.com> Co-authored-by: Ankita Kinger <ankita@appsmith.com> Co-authored-by: Hetu Nandu <hetunandu@gmail.com>
2023-12-13 17:43:43 +00:00
payload: FetchActionsPayload,
): Promise<AxiosPromise<ApiResponse<Action[]>>> {
feat: workflows query actions CRUD code split (#29156) ## Description Code split for workflow queries CRUD. Included changes - Added context for explorer entity files component. - Updated sub menu actions to handle different parent entity types (pages or workflows) - Made changes to certain API calls (using payload object instead of pageID) - Created intermediate actions to check parent entity types. Main PR in EE: [#2960](https://github.com/appsmithorg/appsmith-ee/pull/2960) #### PR fixes following issue(s) Fixes #29227 #### Type of change - New feature (non-breaking change which adds functionality) ## Testing > #### How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration. > Delete anything that is not relevant - [ ] Manual - [ ] JUnit - [ ] Jest - [ ] Cypress > > #### Test Plan > Add Testsmith test cases links that relate to this PR > > #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced search functionality to accept additional parameters for more refined results. - Introduced new helper functions to streamline the creation of queries, APIs, and JS collections based on parent entity types. - Implemented an improved URL building mechanism that accounts for different types of parent entities. - Upgraded the Global Search feature to filter file operations based on user permissions. - Refined the Partial Export Modal's file selection process to include additional entity types. - **Improvements** - Updated the Entity Explorer to provide context-sensitive options based on user permissions and feature flags. - Optimized the Add Query pane to conditionally display options based on user permissions and feature availability. - **Bug Fixes** - Fixed issues with entity ID resolution in URL building to ensure correct redirections within the app. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Druthi Polisetty <druthi@appsmith.com> Co-authored-by: Ankita Kinger <ankita@appsmith.com> Co-authored-by: Hetu Nandu <hetunandu@gmail.com>
2023-12-13 17:43:43 +00:00
return API.get(ActionAPI.url, payload);
2019-10-21 15:12:45 +00:00
}
static async fetchActionsForViewMode(
applicationId: string,
): Promise<AxiosPromise<ApiResponse<ActionViewMode[]>>> {
return API.get(`${ActionAPI.url}/view`, { applicationId });
}
static async fetchActionsByPageId(
2020-02-21 12:16:49 +00:00
pageId: string,
): Promise<AxiosPromise<ApiResponse<Action[]>>> {
2020-02-21 12:16:49 +00:00
return API.get(ActionAPI.url, { pageId });
}
static async updateAction(
apiConfig: Partial<Action>,
): Promise<AxiosPromise<ActionCreateUpdateResponse>> {
if (ActionAPI.apiUpdateCancelTokenSource) {
ActionAPI.apiUpdateCancelTokenSource.cancel();
}
chore: add blank line eslint rule (#36369) ## Description Added ESLint rule to force blank lines between statements. Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10924926728> > Commit: 34f57714a1575ee04e94e03cbcaf95e57a96c86c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10924926728&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > Spec: > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Anvil/AnvilModal_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCheckboxGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInlineButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilParagraphWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilStatsWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilTableWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilToolbarButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilZoneSectionWidgetSnapshot_spec.ts</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. > <hr>Wed, 18 Sep 2024 16:33:36 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No --------- Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-09-18 16:35:28 +00:00
ActionAPI.apiUpdateCancelTokenSource = axios.CancelToken.source();
const payload: Partial<Action & { entityReferenceType: unknown }> = {
...apiConfig,
name: undefined,
entityReferenceType: undefined,
actionConfiguration: apiConfig.actionConfiguration && {
...apiConfig.actionConfiguration,
autoGeneratedHeaders:
apiConfig.actionConfiguration.autoGeneratedHeaders?.map(
// TODO: Fix this the next time the file is edited
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(header: any) => ({
...header,
isInvalid: undefined,
}),
) ?? undefined,
},
datasource: apiConfig.datasource && {
// TODO: Fix this the next time the file is edited
// eslint-disable-next-line @typescript-eslint/no-explicit-any
...(apiConfig as any).datasource,
datasourceStorages: undefined,
isValid: undefined,
chore: Strict schema for datasource and action APIs (#34366) Part of https://github.com/appsmithorg/appsmith/pull/33724. This is an effort to harden the server in terms of what request payloads are acceptable. **/test all** <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced API request payload handling for creating actions to include additional properties, improving data integrity and server-side validation. - **Improvements** - Refined data manipulation and payload structures in datasource-related API requests for better compatibility with server requirements. <!-- end of auto-generated comment: release notes by coderabbit.ai --><!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/9626214547> > Commit: fe5db45aeb916b176aec3ded06f1a9da1bf08898 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9626214547&attempt=2&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: `` > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor3_spec.ts > <li>cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor_1_spec.js > <li>cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor_2_spec.js </ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. <!-- end of auto-generated comment: Cypress test results -->
2024-06-24 11:47:23 +00:00
new: undefined,
},
};
chore: add blank line eslint rule (#36369) ## Description Added ESLint rule to force blank lines between statements. Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10924926728> > Commit: 34f57714a1575ee04e94e03cbcaf95e57a96c86c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10924926728&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > Spec: > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Anvil/AnvilModal_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCheckboxGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInlineButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilParagraphWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilStatsWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilTableWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilToolbarButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilZoneSectionWidgetSnapshot_spec.ts</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. > <hr>Wed, 18 Sep 2024 16:33:36 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No --------- Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-09-18 16:35:28 +00:00
return API.put(`${ActionAPI.url}/${apiConfig.id}`, payload, undefined, {
cancelToken: ActionAPI.apiUpdateCancelTokenSource.token,
});
2019-09-12 11:44:18 +00:00
}
static async updateActionName(
updateActionNameRequest: UpdateActionNameRequest,
) {
2020-06-16 10:23:19 +00:00
return API.put(ActionAPI.url + "/refactor", updateActionNameRequest);
}
static async deleteAction(id: string) {
2019-10-21 15:12:45 +00:00
return API.delete(`${ActionAPI.url}/${id}`);
2019-09-12 11:44:18 +00:00
}
chore: frontend and backend telemetry updates for execute flow #28800 and #28805 (#28936) ## Description 1. Added frontend and backend custom OTLP telemetry to track execute flow 2. Updated end vars in client side code to match with server sdk intialisation code. #### PR fixes following issue(s) Fixes #28800 and #28805 #### Type of change - Chore (housekeeping or task changes that don't impact user perception) #### How Has This Been Tested? - [x] Manual - [ ] JUnit - [ ] Jest - [ ] Cypress > > #### Test Plan > Add Testsmith test cases links that relate to this PR > > #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-11-24 07:39:02 +00:00
private static async executeApiCall(
executeAction: FormData,
2020-05-07 08:07:29 +00:00
timeout?: number,
): Promise<AxiosPromise<ActionExecutionResponse>> {
2020-05-05 08:13:39 +00:00
return API.post(ActionAPI.url + "/execute", executeAction, undefined, {
2020-05-07 08:07:29 +00:00
timeout: timeout || DEFAULT_EXECUTE_ACTION_TIMEOUT_MS,
headers: {
accept: "application/json",
"Content-Type": "multipart/form-data",
},
cancelToken: ActionAPI.abortActionExecutionTokenSource.token,
2020-05-05 08:13:39 +00:00
});
2019-09-16 10:37:38 +00:00
}
2020-01-24 09:54:40 +00:00
chore: frontend and backend telemetry updates for execute flow #28800 and #28805 (#28936) ## Description 1. Added frontend and backend custom OTLP telemetry to track execute flow 2. Updated end vars in client side code to match with server sdk intialisation code. #### PR fixes following issue(s) Fixes #28800 and #28805 #### Type of change - Chore (housekeeping or task changes that don't impact user perception) #### How Has This Been Tested? - [x] Manual - [ ] JUnit - [ ] Jest - [ ] Cypress > > #### Test Plan > Add Testsmith test cases links that relate to this PR > > #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-11-24 07:39:02 +00:00
static async executeAction(
executeAction: FormData,
timeout?: number,
): Promise<AxiosPromise<ActionExecutionResponse>> {
ActionAPI.abortActionExecutionTokenSource = axios.CancelToken.source();
chore: add blank line eslint rule (#36369) ## Description Added ESLint rule to force blank lines between statements. Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10924926728> > Commit: 34f57714a1575ee04e94e03cbcaf95e57a96c86c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10924926728&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > Spec: > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Anvil/AnvilModal_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCheckboxGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInlineButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilParagraphWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilStatsWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilTableWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilToolbarButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilZoneSectionWidgetSnapshot_spec.ts</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. > <hr>Wed, 18 Sep 2024 16:33:36 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No --------- Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-09-18 16:35:28 +00:00
return await this.executeApiCall(executeAction, timeout);
chore: frontend and backend telemetry updates for execute flow #28800 and #28805 (#28936) ## Description 1. Added frontend and backend custom OTLP telemetry to track execute flow 2. Updated end vars in client side code to match with server sdk intialisation code. #### PR fixes following issue(s) Fixes #28800 and #28805 #### Type of change - Chore (housekeeping or task changes that don't impact user perception) #### How Has This Been Tested? - [x] Manual - [ ] JUnit - [ ] Jest - [ ] Cypress > > #### Test Plan > Add Testsmith test cases links that relate to this PR > > #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-11-24 07:39:02 +00:00
}
static async moveAction(moveRequest: MoveActionRequest) {
const payload = {
...moveRequest,
action: moveRequest.action && {
...moveRequest.action,
entityReferenceType: undefined,
datasource: moveRequest.action.datasource && {
...moveRequest.action.datasource,
isValid: undefined,
new: undefined,
},
},
};
chore: add blank line eslint rule (#36369) ## Description Added ESLint rule to force blank lines between statements. Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10924926728> > Commit: 34f57714a1575ee04e94e03cbcaf95e57a96c86c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10924926728&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > Spec: > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Anvil/AnvilModal_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCheckboxGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInlineButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilParagraphWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilStatsWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilTableWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilToolbarButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilZoneSectionWidgetSnapshot_spec.ts</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. > <hr>Wed, 18 Sep 2024 16:33:36 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No --------- Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-09-18 16:35:28 +00:00
return API.put(ActionAPI.url + "/move", payload, undefined, {
timeout: DEFAULT_EXECUTE_ACTION_TIMEOUT_MS,
});
2020-01-24 09:54:40 +00:00
}
static async toggleActionExecuteOnLoad(
actionId: string,
shouldExecute: boolean,
) {
return API.put(ActionAPI.url + `/executeOnLoad/${actionId}`, undefined, {
flag: shouldExecute.toString(),
});
}
2019-09-12 12:19:46 +00:00
}
2019-09-12 11:44:18 +00:00
2019-09-16 10:37:38 +00:00
export default ActionAPI;