Improve the UX for Error messages related to validating DRD Agent connection when adding a core.

Created on 12 March 2023, almost 2 years ago
Updated 19 March 2023, almost 2 years ago

Problem/Motivation

The Ajax validation of the drd-agent isn't highly noticable and a user can click the "save" and not get feedback as to what is wrong when that process fails.

Original Ask
I thought that πŸ› jQuery once deprecated in 9.3 Fixed was causing the core form to not submit, but instead I'm getting a different error that seems to cause it

Trying to create a core results in error "An invalid form control with name='secret' is not focusable."

Steps to reproduce

New install of Drupal 10
Install Drd
Install real aes
Create your key
create your encryption profile
add a host
go to /drd/cores/add
fill out min requirements
click "save"

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Fixed

Version

4.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States generalredneck

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @generalredneck
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    This seems to be a different issue and has nothing to do with once.

    When adding a new core, the first thing to do is to fill in the URL. When the cursor is leaving that field, DRD is verifying if that is a valid URL for a remote site that has DRD Agent installed.

    In your screenshot you can see a not underneath the URL text field stating "There is no DRD Agent available at this domain." and because of that, DRD doesn't show extra fields for setting up the new core, like e.g. the secret and encryption settings. And that's where the error message comes from.

    This means that either there is really no DRD Agent available at the given remote URL or DRD can not properly communicate with the remote site, e.g. if there is a redirect involved.

  • πŸ‡ΊπŸ‡ΈUnited States generalredneck

    Well there is likely actually no DRD Agent on that site at the moment...

    I'll give it some testing... but do you think this is an opportunity to add some validation around that? Displaying an error message or something in the case that a DRD Agent isn't found or there is a communication issue?

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    I'll give it some testing... but do you think this is an opportunity to add some validation around that? Displaying an error message or something in the case that a DRD Agent isn't found or there is a communication issue?

    That's already in place. If you open that form to add a new core, you see the URL field with a comprehensive description. Then you fill in the URL and leave the field so that the validation happens right there and then. If the validation is successful, the form will be extended to show more details which depend on the capabilities of the remote site, of if it's not successful it shows that message "There is no DRD Agent available at this domain.".

  • πŸ‡ΊπŸ‡ΈUnited States generalredneck

    Hmmm... ok,

    So it appears that this error may partially be resolved by the fix I made over in πŸ› jQuery once deprecated in 9.3 Fixed and something specific to 4.0.9 + D10...

    If I use 4.0.9 or 4.1.0-alpha2 I don't get the "verifying URL..." Throbber.

    That said I do see that you are pointing out a "error message" that I clearly didn't see...

    In your screenshot you can see a not underneath the URL text field stating "There is no DRD Agent available at this domain." and because of that, DRD doesn't show extra fields for setting up the new core, like e.g. the secret and encryption settings. And that's where the error message comes from.

    The same is true with other error messages like "cannot connect with domain"

    Lastly, The fact that the save button isn't disabled or an error message highlighted when you click the save button makes it all seem to "not work"

    This is a feature improvement I think to increase the usability of this form.

  • @jurgenhaas opened merge request.
  • Status changed to Needs review almost 2 years ago
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    This is interesting. The components, i.e. the save button, has been hidden in the past until the main input (the URL) had been validated. This was done with the hidden class, but that doesn't exist any more in admin themes, it's now called visually-hidden.

    I've changed that in the MR and also added some visuals to the error message so that it shouldn't be able to miss that any more.

  • Status changed to RTBC almost 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States generalredneck

    This appears to be functioning minus the save button being initially hidden like it was in Seven. That said, this is a giant improvement in my opinion. Clicking the save button when the domain fails now makes the URL field Red and the error message is promoted to the error container up top.

  • Status changed to Fixed almost 2 years ago
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    Thanks for reviewing this.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024