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: duplicate page name error does not disappear on navigating to other pages #36320

Conversation

a6hishekpandey
Copy link
Contributor

@a6hishekpandey a6hishekpandey commented Sep 14, 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

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=""

🔍 Cypress test results

Caution

If you modify the content in this section, you are likely to disrupt the CI result for your PR.

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • Bug Fixes
    • Improved page name validation by resetting its state when the page data updates, ensuring accurate checks based on new information.
  • Style
    • Minor formatting adjustment for better code readability.

Copy link
Contributor

coderabbitai bot commented Sep 14, 2024

Walkthrough

The changes introduced in this pull request involve the addition of a useEffect hook in the PageSettings component. This hook resets the isPageNameValid state to undefined whenever the page prop is updated. This adjustment allows for a fresh validation check of the page name when navigating between different page settings, addressing potential issues with lingering validation errors.

Changes

File Change Summary
app/client/src/pages/Editor/AppSettingsPane/AppSettings/PageSettings.tsx Introduced a useEffect hook to reset isPageNameValid state on page prop changes; added an empty line for formatting.

Assessment against linked issues

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

Suggested labels

Bug, High, Production, Needs Triaging, ok-to-test

Poem

In the realm of pages, a change took flight,
Validity resets, making errors take flight.
With each new setting, fresh checks arise,
A smoother journey, beneath the skies! 🌟
So let us celebrate this code so bright,
For clearer paths and a user’s delight!


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.

@a6hishekpandey a6hishekpandey changed the title #35949: Fix duplicate page name error does not disappear fix: duplicate page name error does not disappear on navigating to other pages #35949 Sep 15, 2024
@a6hishekpandey a6hishekpandey changed the title fix: duplicate page name error does not disappear on navigating to other pages #35949 fix: duplicate page name error does not disappear on navigating to other pages Sep 15, 2024
@alex-golovanov
Copy link
Contributor

/build-deploy-preview skip-tests=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10901989464.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 36320.
recreate: .

Copy link

Deploy-Preview-URL: https://ce-36320.dp.appsmith.com

@alex-golovanov
Copy link
Contributor

@a6hishekpandey everything seems to be in order, we just need to run the test suite on a shadow PR, however some tests are failing for reasons unrelated to your changes, so we need to wait until the issue is resolved. Just keeping you updated.

@a6hishekpandey
Copy link
Contributor Author

@alex-golovanov okay, thanks for the update.

@a6hishekpandey
Copy link
Contributor Author

@alex-golovanov can you please check now if PR is ready for approval or not?

@alex-golovanov
Copy link
Contributor

@alex-golovanov can you please check now if PR is ready for approval or not?

The situation with failing tests has not been resolved yet, I'm keeping an eye on it, we'll merge this once everything is in order.

@a6hishekpandey
Copy link
Contributor Author

okay thankyou, I have 2 more open PRs if you can help me with the review of those as well it will be helpful, linking here #36378 and #36367.

@alex-golovanov
Copy link
Contributor

All tests are passing in the shadow PR.

@KelvinOm KelvinOm merged commit 66270b4 into appsmithorg:release Sep 19, 2024
16 of 17 checks passed
@a6hishekpandey a6hishekpandey deleted the fix/35949-duplicate-page-name-error-does-not-disappear branch September 19, 2024 17:29
@coderabbitai coderabbitai bot mentioned this pull request Sep 19, 2024
2 tasks
Shivam-z pushed a commit to Shivam-z/appsmith that referenced this pull request Sep 26, 2024
…her pages (appsmithorg#36320)

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

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

Fixes appsmithorg#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=""

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!CAUTION]  
> If you modify the content in this section, you are likely to disrupt
the CI result for your PR.

<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
- Improved page name validation by resetting its state when the page
data updates, ensuring accurate checks based on new information.
- **Style**
	- Minor formatting adjustment for better code readability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
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
3 participants