User management fields#2921
Conversation
There was a problem hiding this comment.
This is a great start. See the specific code comments, but there are also some functional issues:
- When using the new user form, the submit doesn't work because it returns an API error
- When changing fields of an existing user, they don't automatically save like they used to. We need to hook up the code to capture change events and trigger the API requests
- Those will probably require js changes. Try to find the js code that was specific to the old form fields and remove it as you implement the new code for the components.
There was a problem hiding this comment.
Looking better.
- We still need the margin adjustments on the user management page for editing existing users.
- I found a weird issue when editing users. I set the gender of a user to Female (had been blank), and then when I opened up any other user, it also showed Female even though they should have been blank. I'm having trouble reproducing it again after setting those values.
- Related to that, as I was trying to reproduce it, I also had a situation where I changed another user to Male from blank, it saved, I closed to modal and then opened the same user, but the gender was blank again. If I refreshed the page, it correctly showed Male. I think whatever js is loading the modal had the original value instead of the updated one.
|
Just fixed those bugs! Let me know any other suggestions. For the Gender bug, I realize it was because I had |
cairocoder01
left a comment
There was a problem hiding this comment.
I pushed one commit to reset all of the component fields before loading in new values. It was causing an issue where saved icons were still displaying on a second user modal and the gender field wasn't cleared out if the value was "none" and the previous had a value.
As I was looking in the subassigned code, I see there's a feature to check the URL for a query param and preset the subassigned field (/user-management/add-user?contact_id=691). Let's make sure that still works. It happens when you're on a contact, open the Admin Actions dropdown, and select the option to make that contact into a user.
Code ReviewHigh1. Password field rendered as plain text —
|
| $data_optional = isset( $params['data-optional'] ) ? 'data-optional' : ''; | ||
|
|
||
| $shared_attributes = ' | ||
| id="' . esc_attr( $display_field_id ) . '" | ||
| name="' . esc_attr( $field_key ) . '" | ||
| placeholder="' . esc_attr( $params['placeholder'] ?? '' ) . '" | ||
| data_type="' . esc_attr( $params['data_type'] ?? '' ) . '" | ||
| ' . $data_optional . ' |
There was a problem hiding this comment.
I originally set this up for type="password" for dt-text, but it was causing formatting errors from some native styling. So, I changed the "type" to "data_type" in my local dt-web-components file in the meantime. How do you recommend we handle this?
There was a problem hiding this comment.
@brady-lamansky-gtt Can you explain more about the formatting errors it was causing?
…ools-theme into user-management-fields


@cairocoder01 This resolves #2847 to replace user management fields w dt-web-components.
Please specifically look at the syntax and formatting of my changes to make sure it's what you're looking for!