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 validation to agent name #5021

Merged
merged 3 commits into from
Dec 21, 2022
Merged

Conversation

Tostti
Copy link
Member

@Tostti Tostti commented Dec 20, 2022

Description

This PR aims to add a 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 with invalid characters
Then it should show an error telling that, and not 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

@Tostti Tostti linked an issue Dec 20, 2022 that may be closed by this pull request
@Tostti Tostti mentioned this pull request Dec 20, 2022
6 tasks
@Tostti Tostti self-assigned this Dec 20, 2022
@Tostti Tostti marked this pull request as ready for review December 20, 2022 18:55
@Tostti Tostti requested a review from a team as a code owner December 20, 2022 18:55
asteriscos
asteriscos previously approved these changes Dec 21, 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: ✔️

Evidence

image

image

public/controllers/agent/components/register-agent.js Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

Code coverage (Jest) % values
Statements 8.69% ( 3212 / 36972 )
Branches 4.44% ( 1274 / 28702 )
Functions 7.59% ( 696 / 9167 )
Lines 8.75% ( 3099 / 35400 )

Copy link
Member

@Desvelao Desvelao left a comment

Choose a reason for hiding this comment

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

review

Code 🟢

Tests

Scenario Result
1 🟢
Scenario 1 🟢

image

@Desvelao Desvelao added the type/enhancement Enhancement issue label Dec 21, 2022
@Desvelao Desvelao merged commit 770e594 into 4.4-7.10 Dec 21, 2022
@Desvelao Desvelao deleted the fix/add-agent-name-validation branch December 21, 2022 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Enhancement issue
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
3 participants