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 onChange function for checkboxes #116

Closed
wants to merge 16 commits into from

Conversation

carma12
Copy link
Collaborator

@carma12 carma12 commented Jun 23, 2023

When clicking any checkbox that was checked already there was no effect on the element (the checkbox remained checked without any changes).

This has been fixed by adding an 'onChange' handler to manage any change for the 'User authentication types' checkboxes.

Signed-off-by: Carla Martinez carlmart@redhat.com

@carma12
Copy link
Collaborator Author

carma12 commented Jun 23, 2023

This PR depends on these ones to be merged: #115

@carma12 carma12 force-pushed the checkboxes-onchange-event branch 2 times, most recently from 89698a9 to 58e0505 Compare June 23, 2023 13:21
carma12 added 16 commits June 23, 2023 15:23
The audit-ci tool detected a vulnerability[1] of a
WebUI dependency. The semver library is a direct
dependency of the babel-loader library. Due to this
error, the gating tests are not passing.

This has been fixed by adding the babel-loader
library to the audit-ci whitelist (allowlisting[2]).

[1]- GHSA-c2qf-rxjj-qqgw
[2]- https://github.com/IBM/audit-ci#allowlisting
Related: babel/babel-loader#992
Signed-off-by: Carla Martinez <carlmart@redhat.com>
Some data coming from the IPA server
will refer to datetime formats, but the
data retrieved as a response from the
API calls is received as a string type.

Considering that the new WebUI is still
dealing with dummy data (hence, some data
can be only initialized as string) and the
`globalDataTypes.ts` file is managing those
data as `Date | string`, it is still needed
a way to parse the datetime format from
string to Date[1] to manage the dates
in a proper way and show them in the fields
(e.g: `krbpasswordexpiration`).

[1]- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date
Signed-off-by: Carla Martinez <carlmart@redhat.com>
The fields of the 'Active users' > 'Settings' section
need to show the IPA server data values.

The following calls are made when the user 'Settings'
page is loaded:
- Batch
  - `user_show` (with `{all: true, rights: true}` params)
    retrieves the full user data.
  - `pwpolicy_show` retrieves the password policy data.
  - `krbtpolicy_show` retrieves the kerberos ticket
    policy data.
  - `cert_find` retrieves the list of certificates.
- `radiusproxy_find` retrieves the list of RADIUS servers.
- `idp_find` retrieves the list of IdP servers.
- `user_find` retrieves the list of user IDs.

In order to manage the data coming from the certificates
and RADIUS servers, a new data types have been defined in
the `globalDataTypes.ts` file: `Certificate` and `RadiusServer`.
Some components have been adapted to take those types (e.g:
`CertificateMappingDataModal`)

The data from the IPA server has been retrieved from the
`UserSettings` component and has been propagated to the
following subsection components via props:
- `UsersIdentity`: Identity settings
- `UsersAccountSettings`: Account settings
- `UsersPasswordPolicy`: Password policy
- `UsersKerberosTicket`: Kerberos ticket policy
- `UsersContactSettings`: Contact settings
- `UsersMailingAddress`: Mailing address
- `UsersEmployeeInfo`: Employee information
- `UsersAttributesSMB`: User attributes for SMB services

The interaction between the API call response status and
the UI has been managed using a Spinner[1] component.

[1]- https://www.patternfly.org/v4/components/spinner/react
Signed-off-by: Carla Martinez <carlmart@redhat.com>
As the permission for the different UI elements
will be soon managed, the `CalendarLayout`
component needs to have the `isDisabled` prop
to disable the date-time textbox if the user
does not have writing permissions.

Signed-off-by: Carla Martinez <carlmart@redhat.com>
In order to manage the field permissions for a
specific user, it would be interesting using a
wrapper to manage the read and write permissions
instead of inserting it manually in all fields.

The `FieldWrapper` component is meant to be
wrapped around any `FormGroup` component that
contains a simple field layout structure. It
overrides the props of the parent and child
components and sets the visibility of a field
(if this should be readable/unreadable) and
the writability (provided by the `isDisabled`
prop in child component).

Signed-off-by: Carla Martinez <carlmart@redhat.com>
The `attributelevelrights` variable taken from
the `user_show` API call determines the permissions
of a specific field. This variable should be
interpreted from a utility function to check if it
has read and write permissions.

Signed-off-by: Carla Martinez <carlmart@redhat.com>
The permissions for the fields available in the
'Identity settings' section should be applied
using the `FieldWrapper` components, whenever is
possible.

Signed-off-by: Carla Martinez <carlmart@redhat.com>
The permissions for the fields available in the
'Account settings' section should be applied
using the `FieldWrapper` component, whenever is
possible.

Signed-off-by: Carla Martinez <carlmart@redhat.com>
The permissions for the fields available in the
'Password policy' section should be applied
using the `FieldWrapper` component, whenever is
possible.

Signed-off-by: Carla Martinez <carlmart@redhat.com>
The permissions for the fields available in the
'Kerberos ticket' section should be applied
using the `FieldWrapper` component, whenever is
possible.

Signed-off-by: Carla Martinez <carlmart@redhat.com>
The permissions for the fields available in the
'Contact settings' section should be applied
using the `FieldWrapper` component, whenever is
possible.

Signed-off-by: Carla Martinez <carlmart@redhat.com>
The permissions for the fields available in the
'Mailing address' section should be applied
using the `FieldWrapper` component, whenever is
possible.

Signed-off-by: Carla Martinez <carlmart@redhat.com>
The permissions for the fields available in the
'Employee information' section should be applied
using the `FieldWrapper` component, whenever is
possible.

Signed-off-by: Carla Martinez <carlmart@redhat.com>
The permissions for the fields available in the
'User attributes for SMB services' section should
be applied using the `FieldWrapper` component,
whenever is possible.

Signed-off-by: Carla Martinez <carlmart@redhat.com>
The 'Refresh' button functionality needs
to be implemented to retrieve the data
again from the API and update it to
the WebUI.

Signed-off-by: Carla Martinez <carlmart@redhat.com>
When clicking any checkbox that was checked
already there was no effect on the element
(the checkbox remained checked without any
changes).

This has been fixed by adding a 'onChange'
handler to manage any change for the 'User
authentication types' checkboxes.

Signed-off-by: Carla Martinez <carlmart@redhat.com>
@carma12 carma12 force-pushed the checkboxes-onchange-event branch from 58e0505 to 52a1dc0 Compare June 23, 2023 13:24
@carma12 carma12 requested review from pvoborni and removed request for pvoborni June 23, 2023 13:54
@carma12
Copy link
Collaborator Author

carma12 commented Aug 8, 2023

Closing this PR because this will be covered as part of another solution: #135

@carma12 carma12 closed this Aug 8, 2023
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.

1 participant