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

Add length validation to agent name #5028

Merged
merged 6 commits into from
Dec 22, 2022

Conversation

Tostti
Copy link
Member

@Tostti Tostti commented Dec 21, 2022

Description

This PR aims to add length validation to the agent name, in order to avoid entering incorrect names that may cause errors in different places of the app.

Issues Resolved

#4927

Evidence

image
image
image

Test

Scenario: have a Wazuh environment and navigate to agents/deploy new agent
When the users enter a name shorter than 2 characters
Then it should show an error telling that, and not show the deploy commands

Scenario: have a Wazuh environment and navigate to agents/deploy new agent
When the users doesn't enter any name
Then it should not show any errors and should show the deploy commands.

Check List

  • All tests pass
    • yarn test:jest
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Sorry, something went wrong.

Verified

This commit was signed with the committer’s verified signature.
nobu Nobuyoshi Nakada
@Tostti Tostti self-assigned this Dec 21, 2022
@Tostti Tostti marked this pull request as ready for review December 21, 2022 17:35
@Tostti Tostti requested a review from a team as a code owner December 21, 2022 17:35
yenienserrano
yenienserrano previously approved these changes Dec 21, 2022
Copy link
Member

@yenienserrano yenienserrano left a comment

Choose a reason for hiding this comment

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

LGTM

image

asteriscos
asteriscos previously approved these changes Dec 22, 2022
Copy link
Member

@asteriscos asteriscos left a comment

Choose a reason for hiding this comment

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

CR: ✔️
Test: ✔️

Nitpick: I think it would be better if the HTML form reserved vertical space for possible errors, so when an error pops up it doesn't displace the rest of the form downwards.

Peek 2022-12-22 12-36

CHANGELOG.md Outdated Show resolved Hide resolved
@asteriscos asteriscos dismissed stale reviews from yenienserrano and themself via d3ac68f December 22, 2022 14:20
Added a space between two pull request references.
@github-actions
Copy link
Contributor

Code coverage (Jest) % values
Statements 8.74% ( 3234 / 37004 )
Branches 4.57% ( 1313 / 28751 )
Functions 7.59% ( 696 / 9166 )
Lines 8.81% ( 3121 / 35430 )

@asteriscos asteriscos merged commit 2100800 into 4.4-7.10 Dec 22, 2022
@asteriscos asteriscos deleted the fix/add-agent-name-length-validation branch December 22, 2022 14:38
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.

Validate the agent name field in the "Deploy a new agent" section
4 participants