Skip to content

User management fields#2921

Open
brady-lamansky-gtt wants to merge 7 commits into
DiscipleTools:developfrom
brady-lamansky-gtt:user-management-fields
Open

User management fields#2921
brady-lamansky-gtt wants to merge 7 commits into
DiscipleTools:developfrom
brady-lamansky-gtt:user-management-fields

Conversation

@brady-lamansky-gtt
Copy link
Copy Markdown
Contributor

@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!

Copy link
Copy Markdown
Collaborator

@cairocoder01 cairocoder01 left a comment

Choose a reason for hiding this comment

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

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.

'type' => 'text',
'default' => '',
]
], [], [ 'placeholder' => 'Nickname (Display Name)' ] ) ?>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This value needs to be localized so it's translated in other languages

'default' => '',
'required' => true,
]
], [], [ 'placeholder' => 'Email' ] ) ?>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Localize placeholder

'type' => 'text',
'default' => '',
]
], [], [ 'placeholder' => 'Username' ] ) ?>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Localize placeholder

'type' => 'text',
'default' => '',
]
], [], [ 'placeholder' => 'Password' ] ) ?>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Localize placeholder

'type' => 'text',
'default' => '',
]
], [], [ 'placeholder' => 'First Name' ] ) ?>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Localize placeholder

'type' => 'text',
'default' => '',
]
], [], [ 'placeholder' => 'Last Name' ] ) ?>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Localize placeholder

Comment on lines +542 to +543
<dt-toggle id="app_state_${app_key}"
class="app-state-switches" type="checkbox"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

When I toggle one of these, I get a js error that the request failed. But it seems to trigger the request twice and it was the second of the two that failed. Specifically, it's when I uncheck one of these toggles that it happens.

Comment on lines 229 to 231
<p>
<?php esc_html_e( 'Display Name', 'disciple_tools' ); ?>
<span id="<?php echo esc_html( 'update_display_name' ); ?>-spinner" class="loading-spinner"></span>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should replace these labels by setting the label attribute of the components. And the loading spinner should use the loading icon/attribute of the component

Comment on lines 113 to +115
<dl>
<dt><label for="eman"><?php esc_html_e( 'Display Name', 'disciple_tools' ); ?></label></dt>
<dd><input type="text" class="input" id="eman" placeholder="<?php esc_html_e( 'Nickname (Display Name)', 'disciple_tools' ); ?>" required autocomplete="off" /> </dd>
<dt><label for="liame"><?php esc_html_e( 'Email', 'disciple_tools' ); ?></label></dt>
<dd><input type="email" class="input" id="liame" placeholder="<?php esc_html_e( 'Email', 'disciple_tools' ); ?>" required autocomplete="off" /> </dd>
<dt></dt>
<dd>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We can get rid of this dl/dt/dd structure. A dl is a definition list for definition terms (dt) and descriptions (dd). It works well for labels and values, but those are contained within the components now. We can just put the components side-by-side (except maybe the hidden ones, which can stay in their own div).

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.

Replace components: user management

3 participants