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

[Active users][Settings] Kebab options #195

Closed
wants to merge 12 commits into from

Conversation

carma12
Copy link
Collaborator

@carma12 carma12 commented Nov 20, 2023

The options associated with the dropdown options (for each user) have been implemented. Those are:
For 'Active users':

  • 'Reset password': Reset or create a new password associated with that user account.
  • 'Enable' / 'Disable' option: Change the status of a given user.
  • 'Delete': Remove a given user from the 'Active users' list.
  • 'Unlock': Unlocks a specific account when a user has exceeded the maximum amount of login attempts (6 according to the global policy).
  • 'Add OTP token': Creates a new OTP token associated with a specific user.
  • 'Rebuild auto membership': Applies a set of specific rules to a given user.
  • 'New certificate': Creates and associates a new certificate to a given user.
  • 'Auto assign subordinate ids': Assigns a range of IDs to a given user.

For 'Stage users':

  • 'Delete': Remove a given user from the 'Stage users' list.
  • 'Activate': Enables the account of a given user, moving it from the 'Stage users' to the 'Active users' page.

For 'Preserved users':

  • 'Delete': Remove a given user from the 'Preserved users' list.
  • 'Stage': Moves a given user from 'Preserved' to 'Stage'.
  • 'Restore': Moves a given user from 'Preserved' to 'Active'.

@carma12 carma12 added the WIP Work in Progress (do not merge) label Nov 20, 2023
@carma12 carma12 force-pushed the active-users-settings-kebab branch 2 times, most recently from 96339fe to b43f3cc Compare November 21, 2023 15:04
@carma12
Copy link
Collaborator Author

carma12 commented Nov 22, 2023

This PR containing the new 'User' parameters needs to be merged first before this one.

@carma12 carma12 force-pushed the active-users-settings-kebab branch from 83b6cf7 to ba093d8 Compare November 22, 2023 14:18
@carma12 carma12 force-pushed the active-users-settings-kebab branch 6 times, most recently from 53928a5 to 939e172 Compare December 5, 2023 15:54
@carma12 carma12 force-pushed the active-users-settings-kebab branch from 939e172 to 7effe87 Compare December 7, 2023 12:53
The 'Reset password' option should
take the new password values
associated to the user account.

Signed-off-by: Carla Martinez <carlmart@redhat.com>
The 'Enable'/'Disable' option should
change the status of a given user.

For this solution, the
`DisableEnableUsers` component
has been adapted to perform the
API calls needed.

Signed-off-by: Carla Martinez <carlmart@redhat.com>
@carma12 carma12 force-pushed the active-users-settings-kebab branch from 7effe87 to c59bf3f Compare December 7, 2023 13:12
The 'Delete' option allows
to remove a given user from
its 'Settings' page. The
solution has been adapted to
the three user pages (Active,
Stage, and Preserved).

Signed-off-by: Carla Martinez <carlmart@redhat.com>
The 'Unlock' option should
unlock a specific account
when a user has exceeded
the maximum amount of login
attempts (6 according the
global policy).

Signed-off-by: Carla Martinez <carlmart@redhat.com>
After adding a new OTP Token,
a QR code to configure the
token must be generated.
Thus, a React-compatible
library to generate those
QR codes need to be used in
the project.

The qrcode.react[1] library has
been chosen by its effective way
of create and customize QR codes.

[1] - https://github.com/zpao/qrcode.react
Signed-off-by: Carla Martinez <carlmart@redhat.com>
The 'Add OTP token' option
creates a new OTP token
associated to a specific user.

The QR code has been generated
using the qrcode.react[1]
library.

[1]- https://github.com/zpao/qrcode.react
Signed-off-by: Carla Martinez <carlmart@redhat.com>
The 'Rebuild auto membership' option
should apply any specified rule to
a given user.

Signed-off-by: Carla Martinez <carlmart@redhat.com>
The 'New certificate' option should
create and associate a new certificate
to a given user.

Signed-off-by: Carla Martinez <carlmart@redhat.com>
The 'Auto assign subordinate ids' option
should assign a range of IDs to a given
user.

Signed-off-by: Carla Martinez <carlmart@redhat.com>
@carma12 carma12 force-pushed the active-users-settings-kebab branch from c59bf3f to 240fab0 Compare December 7, 2023 15:18
The 'Activate' option enables the
account of a given user, moving it
from the 'Stage users' to the 'Active
users' page. This option is only
accessible form the 'Stage useres'
page.

The solution has adapted the API
call made. Instead of using a
generalistic batch endpoint a new
specific endpoint has been created:
`useActivateUserMutation`. This is
being used from the main page and
the kebab options located in the
'Settings' page.

Signed-off-by: Carla Martinez <carlmart@redhat.com>
@carma12 carma12 force-pushed the active-users-settings-kebab branch from 735973b to 159dfac Compare December 12, 2023 09:18
The 'Stage' option allows to move
a given user from 'Preserved' to
'Stage'.

Signed-off-by: Carla Martinez <carlmart@redhat.com>
The 'Restore' options moves a given user
from 'Preserved' to 'Active' state.

The `RestorePreservedUsers` component has
been optimized for simplification, removing
the `ErrorModal` component and relying the
output messages on the `Alert` one.

Also, a new endpoint `useRestoreUserMutation`
has been created to be used instead of the
generalistic one (`useSimpleMutCommandMutation`).

Signed-off-by: Carla Martinez <carlmart@redhat.com>
@carma12 carma12 force-pushed the active-users-settings-kebab branch from 159dfac to 295fa10 Compare December 12, 2023 10:47
@carma12 carma12 removed the WIP Work in Progress (do not merge) label Dec 12, 2023
@carma12 carma12 requested a review from mreynolds389 December 12, 2023 11:01
@carma12 carma12 requested a review from pvoborni December 12, 2023 11:01
@pvoborni
Copy link
Member

Hi, thank for the PR.

Regrettably, I think I will not be able to review this PR with its current size. 12 commits with 2600+ lines change is too much for one PR. I'd borrow: https://google.github.io/eng-practices/review/developer/small-cls.html for the reasoning(cl == pr in this case).

It's already nicely split into multiple commits, so e.g., each action can be in on PR.

@carma12
Copy link
Collaborator Author

carma12 commented Dec 14, 2023

This PR will be split into several PRs to make it easier to review. Setting the 'WIP' tag.

@carma12 carma12 added the WIP Work in Progress (do not merge) label Dec 14, 2023
@carma12
Copy link
Collaborator Author

carma12 commented Dec 15, 2023

Closing this PR as it will be resolved in the newly created PRs.

@carma12 carma12 closed this Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Work in Progress (do not merge)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants