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

[BUG] [Workspace] workspace name missing validation on blank input #7280

Closed
Hailong-am opened this issue Jul 17, 2024 · 2 comments
Closed

[BUG] [Workspace] workspace name missing validation on blank input #7280

Hailong-am opened this issue Jul 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Hailong-am
Copy link
Collaborator

Describe the bug

when we create a new workspace, the validation rule for workspace name is to check it don't have special character and only allow a-z, A-Z, 0-9, (), [], _ (underscore), - (hyphen) and (space).

export const isValidFormTextInput = (input?: string) => {
/**
* This regular expression is from the workspace form name and description field UI.
* It only accepts below characters.
**/
const regex = /^[0-9a-zA-Z()_\[\]\-\s]+$/;
return typeof input === 'string' && regex.test(input);
};

But for blank input as workspace name, it can pass the validation and created successfully.

workspace with blank name will be not clickable on workspace list page and hard to tell what it is in workspace switcher.

image

image

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

workspace name with blank should be blocked for creation and updation

OpenSearch Version
Please list the version of OpenSearch being used.

Dashboards Version
Please list the version of OpenSearch Dashboards being used.

Plugins

Please list all plugins currently enabled.

Screenshots

If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Browser and version [e.g. 22]

Additional context

Add any other context about the problem here.

@Hailong-am Hailong-am added bug Something isn't working untriaged labels Jul 17, 2024
@ananzh
Copy link
Member

ananzh commented Jul 23, 2024

@Hailong-am I will remove the untriaged label for now.

@SuZhou-Joe
Copy link
Member

#7512

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants