-
Notifications
You must be signed in to change notification settings - Fork 4.6k
chore: Remove empty canvas prompts and improve widget editor header #33993
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4302d10
removes empty canvas prompts in favour of drag and drop building blocks.
rahulbarwal f72d02a
fixes spec by accomodating removal of empty canvas CTA.
rahulbarwal 846e3c0
Update test to add new page from template in Fork_Template_To_App_spe…
rahulbarwal 449f19a
Minor fix: forgot to remove`.first()`
rahulbarwal 5863f53
Minor fix: use correct `agHelper` using import.
rahulbarwal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
170 changes: 0 additions & 170 deletions
170
app/client/src/pages/Editor/WidgetsEditor/components/EmptyCanvasPrompts.tsx
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The updates to use custom functions and helper methods enhance the interaction with page elements. Consider converting these function expressions to arrow functions for better readability and consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coderabbitai I don't understand this. Can you explain more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rahulbarwal, I suggested converting function expressions to arrow functions primarily for syntactic cleanliness and consistency. Arrow functions offer a more concise syntax and do not have their own
thiscontext, which can simplify code, especially when dealing with nested functions.However, in the context of Cypress tests, it's important to note that using arrow functions might not always be appropriate. Cypress uses the
function()syntax for test callbacks to bind its own context (likethis.timeoutorthis.retries) to these functions. Using arrow functions, which don't bind their ownthis, could potentially lead to issues if you rely on Cypress's custom context.Therefore, while arrow functions are generally a good practice for cleaner and more concise code, they should be used cautiously within Cypress tests where traditional function expressions might be necessary to access Cypress-specific features tied to
this. I hope this clarifies the suggestion! If you have any more questions or need further assistance, feel free to ask.Learnings used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coderabbitai I still don't see where is the opportunity to replace the function expression to arrow function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rahulbarwal, thank you for your patience. Upon reviewing the context of the Cypress tests in the file
ForkTemplateToGitConnectedApp.js, I realize that the suggestion to convert function expressions to arrow functions was not appropriate.In Cypress, it's recommended to use traditional function expressions for test definitions (
itblocks). This is because Cypress extends the function'sthiscontext with its own set of properties and methods (likethis.timeoutorthis.retries). Arrow functions, which do not have their ownthiscontext, would not be able to access these Cypress-specific features, potentially leading to issues in your tests.Therefore, in the context of your Cypress tests, it's best to continue using function expressions as you currently are. The initial suggestion was more of a general coding practice and didn't account for the specific requirements and recommendations of writing Cypress tests. I appreciate your diligence in seeking clarification on this! If there's anything else you need, feel free to ask.
Learnings used