PromucFlow_constructor/app/client/src/entities/JSCollection/index.ts
Ankita Kinger 1c6f026970
chore: Refactor JS action entity button checks (#29774)
## Description

Refactoring JS action entity button checks

#### 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

- **Refactor**
- Simplified display logic for JavaScript collections by removing unused
properties.
  
- **Bug Fixes**
- Corrected the conditional display of context menus and edit icons in
the JavaScript editor.

- **Style**
- Updated user interface elements to reflect changes in display
properties.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2023-12-21 14:26:49 +05:30

45 lines
1.3 KiB
TypeScript

import type { BaseAction } from "../Action";
import type { PluginType } from "entities/Action";
import type { LayoutOnLoadActionErrors } from "constants/AppsmithActionConstants/ActionConstants";
import type { ActionContextTypeInterface } from "@appsmith/entities/Engine/actionHelpers";
export interface Variable {
name: string;
value: any;
}
export interface JSCollection {
id: string;
applicationId: string;
workspaceId: string;
name: string;
pageId: string;
pluginId: string;
pluginType: PluginType.JS;
actions: Array<JSAction>;
body: string;
variables: Array<Variable>;
userPermissions?: string[];
errorReports?: Array<LayoutOnLoadActionErrors>;
isPublic?: boolean;
moduleId?: string;
moduleInstanceId?: string;
workflowId?: string;
contextType?: ActionContextTypeInterface;
// This is used to identify the main js collection of a workflow
// main js collection is the entrypoint for a workflow
// cannot be deleted or renamed
isMainJSCollection?: boolean;
displayName?: string;
}
export interface JSActionConfig {
body: string;
timeoutInMillisecond: number;
jsArguments: Array<Variable>;
}
export interface JSAction extends BaseAction {
actionConfiguration: JSActionConfig;
clientSideExecution: boolean;
fullyQualifiedName?: string;
}