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

Allow edit groups from an agent #6250

Merged

Conversation

lucianogorza
Copy link
Contributor

@lucianogorza lucianogorza commented Dec 26, 2023

Description

In order to allow users to edit the groups from an agent, we have to introduce the following changes:

  • Modify the agent's table actions to add the option Edit groups.
  • Add a new generic component WzElementPermissions to manage permission when we need a component different to a button.
  • Migrate the AgentsTable class component to a functional component because we need to use an existing hook to disable the Edit groups action button.

Issues Resolved

#6138

Evidence

Actions menú

image

Actions menú when never connected

image
image

Edit groups modal

image

Actions menú with read only user

image
image

Deploy new agent button with readonly user

image

Test

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

@lucianogorza lucianogorza self-assigned this Dec 26, 2023
@lucianogorza lucianogorza changed the title Enhancement/6138 improve groups operations in agents table 6138 Allow edit groups from an agent Dec 26, 2023
@lucianogorza lucianogorza changed the title 6138 Allow edit groups from an agent Allow edit groups from an agent Dec 26, 2023
@lucianogorza lucianogorza linked an issue Dec 26, 2023 that may be closed by this pull request
2 tasks
@lucianogorza lucianogorza marked this pull request as ready for review December 27, 2023 12:11
@lucianogorza lucianogorza requested a review from a team as a code owner December 27, 2023 12:11
@lucianogorza lucianogorza force-pushed the enhancement/6138-improve-groups-operations-in-agents-table branch from 3fe44c6 to cb98c77 Compare December 27, 2023 14:00
@jbiset jbiset self-requested a review December 27, 2023 14:52
Copy link
Member

@jbiset jbiset left a comment

Choose a reason for hiding this comment

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

CR 🟢 (See comments)

Test

Actions menú 🟢

Evidence_1

Actions menú when never connected 🟢

Evidence_2

Evidence_2_B

Edit groups modal 🟢

Evidence_3

Actions menú with read only user 🟢

Evidence_4

Deploy new agent button with read only user 🟢

Evidence_5

Verify that actions work consistently with agent state and user permissions 🟢

Test buttons that have permission validations 🟢

Test table filters 🟢

Test table add/remove columns 🟡

Cannot change visibility of actions column

Issue_actions.webm

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.

Test 🟢 (See 🟡 comments)

Test

Actions menú 🟢

image

Actions menú when never connected 🟡

image

Note

I'm not sure if it makes any sense to allow to see the Agent Details and then show the "Agent never connected" message. Even more when there's no quick way to go back.

image

image

Edit groups modal 🟢

image

Actions menú with read-only user 🟢

Deploy new agent button with read-only user 🟢

image

Verify that actions work consistently with agent state and user permissions 🟢

image

Test buttons that have permission validations 🟢

Test table filters 🟢

Copy link
Contributor

Wazuh Core plugin code coverage (Jest) test % values
Statements 22.02% ( 176 / 799 )
Branches 19.55% ( 79 / 404 )
Functions 14.63% ( 36 / 246 )
Lines 22.23% ( 173 / 778 )

Copy link
Contributor

Wazuh Check Updates plugin code coverage (Jest) test % values
Statements 76.33% ( 171 / 224 )
Branches 57.57% ( 57 / 99 )
Functions 61.7% ( 29 / 47 )
Lines 76.33% ( 171 / 224 )

Copy link
Contributor

Main plugin code coverage (Jest) test % values
Statements 11.33% ( 3917 / 34542 )
Branches 7.5% ( 1713 / 22824 )
Functions 10.9% ( 900 / 8254 )
Lines 11.51% ( 3808 / 33059 )

@asteriscos asteriscos merged commit e649ae2 into master Dec 28, 2023
4 checks passed
@asteriscos asteriscos deleted the enhancement/6138-improve-groups-operations-in-agents-table branch December 28, 2023 18:01
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.

Allow edit groups from an agent
3 participants