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

test: Shadow PR for 36320 (external contribution test) #36381

Conversation

alex-golovanov
Copy link
Contributor

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

Description

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

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

Automation

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

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10941077447
Commit: f2a4c6f
Cypress dashboard.
Tags: @tag.All
Spec:


Thu, 19 Sep 2024 15:59:24 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features
    • Enhanced validation for the page name input, providing clearer error messages for users.
  • Bug Fixes
    • Improved handling of page name conflicts and empty inputs, ensuring better user feedback during page creation.

Copy link
Contributor

coderabbitai bot commented Sep 17, 2024

Walkthrough

The changes in the pull request focus on enhancing the validation logic for the page name input within the PageSettings.tsx file. The previous boolean validation state has been replaced with a string-based error message system, allowing for more descriptive feedback. The error handling is improved through updated functions and a new useEffect hook that resets the error message when the page prop changes. This results in a clearer user experience when managing page names.

Changes

File Path Change Summary
app/client/src/pages/Editor/AppSettingsPane/AppSettings/PageSettings.tsx Updated validation logic for page name input, replacing boolean state with string error messages. Adjusted functions to handle new error state and introduced a reset mechanism on page prop change.

Assessment against linked issues

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

Suggested labels

Bug, Needs Triaging, IDE Product, ok-to-test

Poem

In the land of pages, names take flight,
Errors now vanish, bringing delight.
With messages clear, the users will cheer,
Navigating smoothly, no worries or fear!
Validation's a dance, so graceful and bright,
Thanks to these changes, all feels just right! 🎉


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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    -- @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 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
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

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

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

74-74: Good work on initializing the pageNameError state variable!

Using a string | null type allows for more informative error messages compared to just a boolean flag. This will provide a better user experience when displaying validation errors.


127-130: Excellent use of the useEffect hook to reset the pageNameError state!

Clearing the error state when the page prop changes is a thoughtful touch. It ensures that stale error messages from previous pages don't linger and confuse the user. This enhances the overall user experience when navigating between pages. Well done!


132-132: Great job with the savePageName condition!

The condition checks are in the perfect order. First, it confirms the user has permission to manage pages. Then it verifies there are no page name errors. Finally, it checks if the page name has actually changed before initiating a save. This sequence of checks optimizes both security and performance. Nicely done!


188-188: Nice use of conditional CSS classes based on the pageNameError state!

Adjusting the padding when there is no error message is a subtle but impactful UI enhancement. It maintains a consistent and polished look in the page settings form. The negation check on pageNameError is also logically sound. Good attention to detail!

@alex-golovanov alex-golovanov added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Sep 18, 2024
@github-actions github-actions bot added the Bug Something isn't working label Sep 18, 2024
a6hishekpandey and others added 3 commits September 18, 2024 22:16
…-name-error-does-not-disappear' into external-contri/fix/35949-duplicate-page-name-error-does-not-disappear
@alex-golovanov alex-golovanov changed the title Shadow PR for 36320 (external contribution test) test: Shadow PR for 36320 (external contribution test) Sep 19, 2024
@github-actions github-actions bot added skip-changelog Adding this label to a PR prevents it from being listed in the changelog Test and removed Bug Something isn't working labels Sep 19, 2024
@alex-golovanov alex-golovanov deleted the external-contri/fix/35949-duplicate-page-name-error-does-not-disappear branch September 20, 2024 08:04
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 skip-changelog Adding this label to a PR prevents it from being listed in the changelog Test 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