Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix table mapping for events when cloning and creating new versions #10444

Merged

Conversation

Kartik18g
Copy link
Collaborator

@Kartik18g Kartik18g commented Jul 24, 2024

When cloning or creating a new version, event mapping for table were incorrect. This PR fixes it.

@TooljetBot
Copy link
Collaborator

TooljetBot commented Jul 24, 2024

Code Review Agent Run #05fa10

  • AI Based Review: ✔️ Successful

High-level Feedback

Ensure strict equality checks by replacing '==' with '===' to avoid type coercion issues. Validate the event definitions thoroughly to prevent potential bugs. Consider adding unit tests to cover the new logic introduced for handling 'set-table-page' actionId.

Actionable Issues

📄 server/src/services/app_import_export.service.ts
Issues: Total - 1, High importance - 1
Line 1791-1791 🔴 High importance - 1   

AI Code Review powered by Bito Logo

@@ -1788,6 1788,10 @@ export class AppImportExportService {
eventDefinition.modal = oldComponentToNewComponentMapping[eventDefinition.modal];
}

if (eventDefinition?.actionId == 'set-table-page' && oldComponentToNewComponentMapping[eventDefinition.table]) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Bito Code Review Agent Run #05fa10 - 07/24/2024, 01:39 pm

🔴 High importance
Issue: The use of '==' for comparison can lead to unexpected type coercion issues. It is safer to use '===' for strict equality checks.
Fix: Replace '==' with '===' to ensure strict equality checking.
Code suggestion
 @@ -1791,3  1791,3 @@
 -      if (eventDefinition?.actionId == 'set-table-page' && oldComponentToNewComponentMapping[eventDefinition.table]) {
        if (eventDefinition?.actionId === 'set-table-page' && oldComponentToNewComponentMapping[eventDefinition.table]) {

Is this a valid issue, or was it incorrectly flagged by the Agent?

  • it was incorrectly flagged

Copy link

sonarcloud bot commented Jul 29, 2024

@kavinvenkatachalam kavinvenkatachalam merged commit f405d3d into fix/appbuilder-stability-and-ui Jul 31, 2024
4 checks passed
@kavinvenkatachalam kavinvenkatachalam deleted the fix/event-table-mappings branch July 31, 2024 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants