Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/client/src/ce/api/JSActionAPI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export interface RefactorAction {
oldName: string;
collectionName: string;
moduleId?: string;
workflowId?: string;
contextType?: ActionParentEntityTypeInterface;
}
export interface RefactorActionRequest extends RefactorAction {
Expand Down
1 change: 1 addition & 0 deletions app/client/src/sagas/JSPaneSagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ function* handleEachUpdateJSCollection(update: JSUpdate) {
collectionName: jsAction.name,
pageId: data.nameChangedActions[i].pageId || "",
moduleId: data.nameChangedActions[i].moduleId,
workflowId: data.nameChangedActions[i].workflowId,
oldName: data.nameChangedActions[i].oldName,
newName: data.nameChangedActions[i].newName,
},
Expand Down
1 change: 1 addition & 0 deletions app/client/src/utils/JSPaneUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ const resultRenamedActions = {
id: "fun1",
collectionId: "1234",
moduleId: undefined,
workflowId: undefined,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

Ensure the workflowId field is appropriately tested.

The workflowId field is currently set to undefined in the test file JSPaneUtils.test.ts. To ensure comprehensive testing, please update the test cases to include meaningful values for workflowId and validate its handling within the function.

  • app/client/src/utils/JSPaneUtils.test.ts: Update test cases to include meaningful values for workflowId.
Analysis chain

Ensure the workflowId field is appropriately tested.

The workflowId field has been added to various data structures as per the PR description, but it is not clear if this field is being tested or used appropriately in this test scenario.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify if `workflowId` is used in the function `getDifferenceInJSCollection`.

# Test: Search for the function implementation. Expect: Usage of `workflowId`.
ast-grep --lang javascript --pattern $'function getDifferenceInJSCollection($_, $_) {
  $$$
  workflowId($_)
  $$$
}'

Length of output: 118



Script:

#!/bin/bash
# Description: Search for the implementation of the function `getDifferenceInJSCollection` and inspect its contents.

# Search for the function implementation
ast-grep --lang javascript --pattern 'function getDifferenceInJSCollection($_, $_) {
  $$$
}'

Length of output: 95



Script:

#!/bin/bash
# Description: Search for the function name `getDifferenceInJSCollection` across the entire codebase.

# Search for the function name
rg 'getDifferenceInJSCollection'

Length of output: 1190



Script:

#!/bin/bash
# Description: Extract the implementation of the function `getDifferenceInJSCollection` from `JSPaneUtils.tsx` and inspect its contents for `workflowId`.

# Extract the function implementation
ast-grep --lang typescript --pattern 'export const getDifferenceInJSCollection = ($_$) => {
  $$$
}' -- 'app/client/src/utils/JSPaneUtils.tsx'

Length of output: 142



Script:

#!/bin/bash
# Description: Extract lines containing `getDifferenceInJSCollection` from `JSPaneUtils.tsx` to inspect its implementation.

# Extract the function definition and its implementation
rg -A 20 'export const getDifferenceInJSCollection' app/client/src/utils/JSPaneUtils.tsx

Length of output: 1035



Script:

#!/bin/bash
# Description: Extract additional lines containing `getDifferenceInJSCollection` from `JSPaneUtils.tsx` to capture the complete implementation.

# Extract the function definition and its implementation with more lines
rg -A 50 'export const getDifferenceInJSCollection' app/client/src/utils/JSPaneUtils.tsx

Length of output: 2000



Script:

#!/bin/bash
# Description: Extract additional lines containing `getDifferenceInJSCollection` from `JSPaneUtils.tsx` to capture the complete implementation.

# Extract the function definition and its implementation with even more lines
rg -A 100 'export const getDifferenceInJSCollection' app/client/src/utils/JSPaneUtils.tsx

Length of output: 3628



Script:

#!/bin/bash
# Description: Search for the usage of `workflowId` in `JSPaneUtils.test.ts` to confirm it is included in the test data and assertions.

# Search for `workflowId` in the test file
rg 'workflowId' app/client/src/utils/JSPaneUtils.test.ts

Length of output: 85

oldName: "myFun1",
newName: "myFun11",
pageId: "page123",
Expand Down
2 changes: 2 additions & 0 deletions app/client/src/utils/JSPaneUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface JSCollectionDifference {
newName: string;
pageId: string;
moduleId?: string;
workflowId?: string;
}>;
changedVariables: Variable[];
}
Expand Down Expand Up @@ -104,6 +105,7 @@ export const getDifferenceInJSCollection = (
newName: newActions[i].name,
pageId: updateExisting.pageId,
moduleId: updateExisting.moduleId,
workflowId: updateExisting.workflowId,
});
newActions.splice(i, 1);
toBearchivedActions.splice(indexOfArchived, 1);
Expand Down