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

Shadow PR for #36320 (testing external contribution) #36377

Conversation

alex-golovanov
Copy link
Contributor

@alex-golovanov alex-golovanov commented Sep 17, 2024

Description

Issue: Duplicate page name error does not disappear on navigating to other pages.

This PR addresses issue #35949 by resetting the isPageNameValid state to undefined using useEffect hook when the Page settings loads.

Fixes #35949

Automation

/ok-to-test tags="@tag.All"

🔍 Cypress test results

Caution

🔴 🔴 🔴 Some tests have failed.
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10904194090
Commit: a2df192
Cypress dashboard.
Tags: @tag.All
Spec:
The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/Regression/Apps/PgAdmin_spec.js
  2. cypress/e2e/Regression/ClientSide/Anvil/AnvilSuggestedWidgets_spec.ts
  3. cypress/e2e/Regression/ClientSide/Autocomplete/JS_AC1_spec.ts
  4. cypress/e2e/Regression/ClientSide/Autocomplete/Sql_AC_Spec.ts
  5. cypress/e2e/Regression/ClientSide/Binding/JSObject_Postgress_Table_spec.js
  6. cypress/e2e/Regression/ClientSide/Binding/Widget_loading_spec.js
  7. cypress/e2e/Regression/ClientSide/BugTests/AbortAction_Spec.ts
  8. cypress/e2e/Regression/ClientSide/BugTests/Binding_Bug28287_Spec.ts
  9. cypress/e2e/Regression/ClientSide/BugTests/DatasourceSchema_spec.ts
  10. cypress/e2e/Regression/ClientSide/BugTests/ListWidgetOnPageLoad_Spec.ts
  11. cypress/e2e/Regression/ClientSide/BugTests/Moment_Spec.ts
  12. cypress/e2e/Regression/ClientSide/ExplorerTests/CopyQuery_RenameDatasource_spec.js
  13. cypress/e2e/Regression/ClientSide/ExplorerTests/Query_Datasource_spec.js
  14. cypress/e2e/Regression/ClientSide/Git/GitDiscardChange/DiscardChanges_spec.js
  15. cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js
  16. cypress/e2e/Regression/ClientSide/IDE/Command_Click_Navigation_spec.js
  17. cypress/e2e/Regression/ClientSide/Linting/BasicLint_spec.ts
  18. cypress/e2e/Regression/ClientSide/MobileResponsiveTests/Snipping_mode_Basic_test.js
  19. cypress/e2e/Regression/ClientSide/MobileResponsiveTests/SuggestedWidgets_spec.js
  20. cypress/e2e/Regression/ClientSide/OtherUIFeatures/EntityBottomBar_spec.ts
  21. cypress/e2e/Regression/ClientSide/OtherUIFeatures/Replay_Editor_spec.js
  22. cypress/e2e/Regression/ClientSide/Refactoring/Refactoring_spec.ts
  23. cypress/e2e/Regression/ClientSide/Widgets/Chart/Chart_Widget_Loading_spec.js
  24. cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckboxGroup_withQuery_spec.js
  25. cypress/e2e/Regression/ClientSide/Widgets/Dropdown/Dropdown_onOptionChange_spec.js
  26. cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_PageNo_PageSize_spec.js
  27. cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicServerSideData_spec.js
  28. cypress/e2e/Regression/ClientSide/Widgets/Select/Select3_Spec.ts
  29. cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/Select1_spec.ts
  30. cypress/e2e/Regression/ServerSide/ActionExecution/Block_Execution.ts
  31. cypress/e2e/Regression/ServerSide/Datasources/Redis_Basic_Spec.ts
  32. cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL1_Spec.ts
  33. cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL2_Spec.ts
  34. cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres2_Spec.ts
  35. cypress/e2e/Regression/ServerSide/MySQL_Datatypes/Basic_Spec.ts
  36. cypress/e2e/Regression/ServerSide/MySQL_Datatypes/False_Spec.ts
  37. cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad_cyclic_dependency_errors_spec.js
  38. cypress/e2e/Regression/ServerSide/OnLoadTests/PostgresConnections_spec.ts
  39. cypress/e2e/Regression/ServerSide/Params/ExecutionParams_spec.js
  40. cypress/e2e/Regression/ServerSide/Params/PassingParams_Spec.ts
  41. cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Array_Spec.ts
  42. cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Binary_Spec.ts
  43. cypress/e2e/Regression/ServerSide/Postgres_DataTypes/BooleanEnum_Spec.ts
  44. cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Character_Spec.ts
  45. cypress/e2e/Regression/ServerSide/Postgres_DataTypes/DateTime_Spec.ts
  46. cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Json_Spec.ts
  47. cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Numeric_Spec.ts
  48. cypress/e2e/Regression/ServerSide/Postgres_DataTypes/UUID_Spec.ts
  49. cypress/e2e/Regression/ServerSide/QueryPane/AddWidgetTableAndBind_spec.js
  50. cypress/e2e/Regression/ServerSide/QueryPane/AddWidget_spec.js
  51. cypress/e2e/Regression/ServerSide/QueryPane/EmptyDataSource_spec.js
  52. cypress/e2e/Regression/ServerSide/QueryPane/QueryPane_MySQL_Spec.ts
  53. cypress/e2e/Regression/ServerSide/QueryPane/QueryPane_Postgres_Spec.js
  54. cypress/e2e/Sanity/Datasources/Arango_Basic_Spec.ts
  55. cypress/e2e/Sanity/Datasources/MockDBs_Spec.ts
  56. cypress/e2e/Sanity/Datasources/MySQLNoiseTest_spec.js
List of identified flaky tests.
Tue, 17 Sep 2024 14:56:47 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Enhanced page name validation with descriptive error messages.
    • Immediate feedback on input validity for a better user experience.
  • Bug Fixes

    • Improved error handling for invalid page names, including checks for empty names and conflicts.
  • Refactor

    • Updated state management for error handling related to page name validation.

Copy link
Contributor

coderabbitai bot commented Sep 17, 2024

Walkthrough

The changes in the PageSettings.tsx file focus on enhancing the validation and error handling for page names. The boolean state variable isPageNameValid has been replaced with pageNameError, which now stores specific error messages. The onPageNameChange function has been updated to provide detailed error feedback, and a new useEffect ensures that error messages are cleared when the page prop changes. The rendering logic has also been adjusted to display error messages based on the presence of pageNameError.

Changes

File Path Change Summary
app/client/src/pages/Editor/AppSettingsPane/AppSettings/PageSettings.tsx Replaced isPageNameValid with pageNameError for detailed error handling; updated validation logic in onPageNameChange and savePageName; added useEffect to reset error on page prop change; modified rendering logic to display error messages.

Assessment against linked issues

Objective Addressed Explanation
Error should disappear when navigating to a different page's settings ( #35949 )

🎉 In the realm of code, a change took flight,
With error messages shining, oh what a sight!
Page names now validated, clear and bright,
User experience enhanced, a true delight!
Let's celebrate this journey, from wrong to right! 🌟


Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 74933fc and a2df192.

Files selected for processing (1)
  • app/client/src/pages/Editor/AppSettingsPane/AppSettings/PageSettings.tsx (5 hunks)
Additional comments not posted (4)
app/client/src/pages/Editor/AppSettingsPane/AppSettings/PageSettings.tsx (4)

74-75: Good work initializing pageNameError to null!

This allows you to differentiate between the absence of an error and an empty error message. Keep up the great work!


129-131: Excellent job resetting pageNameError when the page prop changes!

This useEffect hook ensures that any previous error messages are cleared when navigating to a different page's settings. It enhances the user experience by preventing stale error messages from persisting. Fantastic work!


134-142: Great job updating the savePageName function!

The additional checks for pageNameError and user permissions make the save operation more robust. By preventing saves when there are validation errors or insufficient permissions, you've improved the overall reliability and security of the feature. Well done!


168-175: Excellent work enhancing the onPageNameChange function!

The updated validation rules provide more informative error messages to the user. Checking for empty names and conflicts with existing action names ensures data integrity and prevents confusion. These changes greatly improve the user experience and maintainability of the codebase. Keep up the fantastic work!


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    -- I pushed a fix in commit <commit_id>, please review it.
    -- Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    -- @coderabbitai generate unit testing code for this file.
    -- @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    -- @coderabbitai generate interesting stats about this repository and render them as a table.
    -- @coderabbitai read src/utils.ts and generate unit testing code.
    -- @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    -- @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added Bug Something isn't working IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product Inviting Contribution Issues that we would like contributions to Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage Page Management Issues related to configuring pages Production UX Improvement and removed Bug Something isn't working labels Sep 17, 2024
@alex-golovanov alex-golovanov added the ok-to-test Required label for CI label Sep 17, 2024
@github-actions github-actions bot added Bug Something isn't working and removed Bug Something isn't working labels Sep 17, 2024
@alex-golovanov alex-golovanov deleted the external-contri/fix/35949-duplicate-page-name-error-does-not-disappear branch September 17, 2024 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product Inviting Contribution Issues that we would like contributions to Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage ok-to-test Required label for CI Page Management Issues related to configuring pages Production UX Improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Duplicate page name error does not disappear on navigating to other pages
2 participants