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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Extend character limit for API, query, and datasource names #34358

Open
wants to merge 1 commit into
base: release
Choose a base branch
from

Conversation

saiprabhu-dandanayak
Copy link

@saiprabhu-dandanayak saiprabhu-dandanayak commented Jun 20, 2024

Description of the PR

I have raised this PR inorder to To extends the character limit for API, query, and datasource names, allowing for more descriptive and clearer identifiers in the system.

馃摳 Screenshoots

here we gave query name more than 30 characters

image

When you hover over a query that isn't visible, a tooltip appears displaying the query's name as below.

querynamesimage

Summary by CodeRabbit

  • New Features

    • Enhanced the TextField component with a maxLength of 256 and useFullWidth attribute in ActionNameEditor.
    • Added special character removal functionality to FormTitle component using removeSpecialChars.
  • Improvements

    • Streamlined entity name validation logic in NameEditorComponent for improved performance.
    • Increased maxLength property to 256 characters in FormTitle component.

Copy link
Contributor

coderabbitai bot commented Jun 20, 2024

Walkthrough

The recent updates focus on enhancing input components by introducing maximum length constraints, full width usage, and improved validation logic. The changes span across various files, optimizing name validation, incorporating special character removal, and refining dependencies in functions and hooks within the codebase.

Changes

File Path Summary
app/client/src/components/editorComponents/ActionNameEditor.tsx Added maxLength and useFullWidth properties to the TextField component.
app/client/src/components/utils/NameEditorComponent.tsx Streamlined isInvalidNameForEntity function and updated useCallback hook dependencies.
app/client/src/pages/Editor/DataSourceEditor/FormTitle.tsx Added removeSpecialChars to valueTransform, increased maxLength to 256 characters.
app/client/src/utils/helpers.tsx Simplified removeSpecialChars function using a regular expression.

Poem

Amidst the bunny's code so bright,
New limits guide the naming flight.
Special chars now bow aside,
With max length broad and logic tied.
A coder's heart in code shall be,
Enhanced, refined, and error-free.

  /^-^\
 ( o_o )
  `|_|`

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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a5b1200 and 69755e0.

Files selected for processing (4)
  • app/client/src/components/editorComponents/ActionNameEditor.tsx (3 hunks)
  • app/client/src/components/utils/NameEditorComponent.tsx (3 hunks)
  • app/client/src/pages/Editor/DataSourceEditor/FormTitle.tsx (2 hunks)
  • app/client/src/utils/helpers.tsx (2 hunks)
Additional context used
Biome
app/client/src/pages/Editor/DataSourceEditor/FormTitle.tsx

[error] 88-90: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)

Unsafe fix: Omit the else clause.

app/client/src/utils/helpers.tsx

[error] 82-133: This function expression can be turned into an arrow function. (lint/complexity/useArrowFunction)

Function expressions that don't use this can be turned into arrow functions.
Safe fix: Use an arrow function instead.


[error] 328-348: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)

Unsafe fix: Omit the else clause.


[error] 344-347: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)

Unsafe fix: Omit the else clause.


[error] 353-353: Unexpected control character(s) in regular expression: \x00, \x1f (lint/suspicious/noControlCharactersInRegex)

Control characters are unusual and potentially incorrect inputs, so they are disallowed.


[error] 588-588: Change to an optional chain. (lint/complexity/useOptionalChain)

Unsafe fix: Change to an optional chain.


[error] 703-710: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)

Unsafe fix: Omit the else clause.


[error] 704-710: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)


[error] 705-710: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)


[error] 706-710: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)


[error] 707-710: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)


[error] 763-763: This default parameter should follow the last required parameter or should be a required parameter. (lint/style/useDefaultParameterLast)

The last required parameter is here:

A default parameter that precedes a required parameter cannot be omitted at call site.
Unsafe fix: Turn the parameter into a required parameter.


[error] 969-988: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)

Unsafe fix: Omit the else clause.


[error] 975-988: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)


[error] 982-988: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)


[error] 1055-1065: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)

Unsafe fix: Omit the else clause.


[error] 61-61: Use the '**' operator instead of 'Math.pow'. (lint/style/useExponentiationOperator)

Unsafe fix: Use the '**' operator instead of 'Math.pow'.

Additional comments not posted (5)
app/client/src/components/editorComponents/ActionNameEditor.tsx (1)

118-119: Increase the maxLength to 256 and set useFullWidth to ensure the input field utilizes the available space.

app/client/src/components/utils/NameEditorComponent.tsx (2)

114-116: Simplified the isInvalidNameForEntity function to improve readability and performance by merging conditions and reducing complexity.


127-127: Updated the useCallback dependencies to include suffixErrorMessage, ensuring that the hook recalculates when this message changes.

app/client/src/pages/Editor/DataSourceEditor/FormTitle.tsx (1)

13-13: Extended the maxLength to 256 and added valueTransform and useFullWidth properties to enhance input handling and UI consistency.

Also applies to: 146-146, 152-153

app/client/src/utils/helpers.tsx (1)

175-177: Simplified the removeSpecialChars function to enhance efficiency by using a regular expression to replace special characters with underscores.

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 Jun 27, 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.

None yet

1 participant