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

feat: set title of the tab dynamically. #36275

Conversation

saicharan-zemoso
Copy link
Contributor

@saicharan-zemoso saicharan-zemoso commented Sep 12, 2024

fixes issue: 34260

added the code which can abilitate the user to set the title of the tab dynamically.

screen shot of the working application:
Screenshot from 2024-09-12 14-18-03

here is the video of the application:

feat.tab.name.dynamically.mp4

Summary by CodeRabbit

  • New Features

    • Introduced a dynamic naming feature for tabs in the TabsWidget, allowing users to customize tab labels.
    • Added a test suite to verify the functionality of dynamic tab naming and user interactions.
  • Bug Fixes

    • Enhanced validation for tab label input to ensure it accepts only text.

Copy link
Contributor

coderabbitai bot commented Sep 12, 2024

Walkthrough

The changes introduce a new Cypress test suite to validate the dynamic naming functionality of tabs in the TabsWidget. Additionally, a new property named "label" is added to the TabsWidget class, allowing users to set dynamic labels for the tabs. This enhancement aims to improve the customization and usability of the tab widget.

Changes

File Path Change Summary
app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tabs_dynamic_tab_name.ts Added a Cypress test suite to verify dynamic tab naming functionality, including test cases for setting and validating tab labels.
app/client/src/widgets/TabsWidget/widget/index.tsx Introduced a new property "label" in the TabsWidget class, enabling dynamic labeling of tabs with validation for text input.

Possibly related issues

Poem

In the world of tabs so bright,
Labels dance in dynamic light.
Users cheer, their wishes met,
Custom names, no more regret.
With each click, a joy to see,
Tabs now sing in harmony! 🎉


Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7ba06c8 and b569f94.

Files selected for processing (2)
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tabs_dynamic_tab_name.ts (1 hunks)
  • app/client/src/widgets/TabsWidget/widget/index.tsx (1 hunks)
Additional context used
Path-based instructions (1)
app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tabs_dynamic_tab_name.ts (1)

Pattern app/client/cypress/**/**.*: Review the following e2e test code written using the Cypress test library. Ensure that:

  • Follow best practices for Cypress code and e2e automation.
  • Avoid using cy.wait in code.
  • Avoid using cy.pause in code.
  • Avoid using agHelper.sleep().
  • Use locator variables for locators and do not use plain strings.
  • Use data-* attributes for selectors.
  • Avoid Xpaths, Attributes and CSS path.
  • Avoid selectors like .btn.submit or button[type=submit].
  • Perform logins via API with LoginFromAPI.
  • Perform logout via API with LogOutviaAPI.
  • Perform signup via API with SignupFromAPI.
  • Avoid using it.only.
  • Avoid using after and aftereach in test cases.
  • Use multiple assertions for expect statements.
  • Avoid using strings for assertions.
  • Do not use duplicate filenames even with different paths.
  • Avoid using agHelper.Sleep, this.Sleep in any file in code.
Additional comments not posted (2)
app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tabs_dynamic_tab_name.ts (1)

17-27: Great job on the test case! 👍

The test case follows the best practices for Cypress code and e2e automation. It is using locator variables and data-* attributes for selectors, which is exactly what we want to see. The test case is also well-structured and easy to understand.

Keep up the good work! 🌟

app/client/src/widgets/TabsWidget/widget/index.tsx (1)

322-329: Great work on adding the "label" property to enhance the customization of the TabsWidget!

The property is defined with appropriate attributes such as:

  • A clear label of "Label" to guide users.
  • Usage of the "INPUT_TEXT" control type for easy input.
  • Marking it as a bindable property to allow dynamic linking.
  • Setting validation to ensure the input is of type text.

These attributes will make it intuitive for users to specify labels for the tabs and improve the overall usability of the widget. Well done!


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>.
    • 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 show all the console.log statements in this repository.
    • @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.

} from "../../../../../support/Pages/EditorNavigation";

describe(
"Test to check if user name the tab dynamically",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we test this with unit testing please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok sure will work on that.

Copy link
Contributor Author

@saicharan-zemoso saicharan-zemoso Sep 16, 2024

Choose a reason for hiding this comment

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

Hello @sagar-qa007 ,

I don't know what to include in the unit test case.
As
I have added the cypress test should I try to replicate it using the react testing library??.

if Yes , can you please provide any reference test file or test case in which this as done??
That would be helpful .
Thank you in advance.

Copy link

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions bot added the Stale label Sep 23, 2024
@saicharan-zemoso
Copy link
Contributor Author

Hello @rahulbarwal , could you review this PR if you have some band width.

As the original component did not have any unit test case. I did't know what to add in the test as the change is only made in pane configurations.

If this PR needs a unit test can you suggest what to include or could you provide any reference unit test so that I can work on it.

It would be very helpful.
Thank you.

@github-actions github-actions bot removed the Stale label Sep 24, 2024
Copy link

github-actions bot commented Oct 1, 2024

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions bot added the Stale label Oct 1, 2024
Copy link

This PR has been closed because of inactivity.

@github-actions github-actions bot closed this Oct 17, 2024
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.

2 participants