Bug 27060 - Allow undoing changes to the password on SMTP config
Summary: Allow undoing changes to the password on SMTP config
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Keywords: release-notes-needed
Depends on: 22343
Blocks:
  Show dependency treegraph
 
Reported: 2020-11-19 18:58 UTC by Tomás Cohen Arazi
Modified: 2021-01-12 22:13 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 27060: Handle password changes more robustly (3.80 KB, patch)
2020-11-19 19:00 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 27060: Handle password changes more robustly (3.86 KB, patch)
2020-11-20 13:33 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2020-11-19 18:58:40 UTC
The only way to undo changes when you are editing, is by writing the "****" string on the input. We should provide a simpler method.
Comment 1 Tomás Cohen Arazi 2020-11-19 19:00:45 UTC
Created attachment 113846 [details] [review]
Bug 27060: Handle password changes more robustly

This patch makes the changes in the password input trigger an event that
marks the password as changed. This way we don't need to compare with
the "****" string in the controller. A convenient link for restoring the
original password is added with a proper description that marks the
password as untouched, also restoring the "****" value.

To test:
1. Apply this patch
2. Have an SMTP server set
3. Open for edition
4. In paralell, have a terminal with
   $ koha-mysql kohadev
   > SELECT * FROM smtp_servers;
=> SUCCESS: The password you chose is there
5. Edit the password, save
=> SUCCESS: The password is there
6. Edit the password, choose to reset it to the one in the DB, save
=> SUCCESS: The password hasn't been changed!
7. Edit the password, put ****. save
=> SUCCESS: The password has been updated to ****
8. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Martin Renvoize 2020-11-20 13:33:17 UTC
Created attachment 113881 [details] [review]
Bug 27060: Handle password changes more robustly

This patch makes the changes in the password input trigger an event that
marks the password as changed. This way we don't need to compare with
the "****" string in the controller. A convenient link for restoring the
original password is added with a proper description that marks the
password as untouched, also restoring the "****" value.

To test:
1. Apply this patch
2. Have an SMTP server set
3. Open for edition
4. In paralell, have a terminal with
   $ koha-mysql kohadev
   > SELECT * FROM smtp_servers;
=> SUCCESS: The password you chose is there
5. Edit the password, save
=> SUCCESS: The password is there
6. Edit the password, choose to reset it to the one in the DB, save
=> SUCCESS: The password hasn't been changed!
7. Edit the password, put ****. save
=> SUCCESS: The password has been updated to ****
8. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize 2020-11-20 13:33:53 UTC
Nice little usability enhancement here.. signing off
Comment 4 Katrin Fischer 2021-01-12 22:12:34 UTC
Hm, I think instead of "clear password changes" (which sounds like it will empty the field), "undo password changes" would be better, what do you think?

But: it doesn't always appear to work right. 

What I think it should do:
- Edit an existing SMTP server
- Change the password
- Clear the changes
- Save
- Password in the db remains unchanged

I think this happens if you only add something to the password instead of completely replacing it. I also had multiple occasions where *** appeared in the password.

To test:
- Set password to password.
- Update to password1 - hit clear icon, save.
- password in db is now: ****1

I am not sure this works right. A suggestion:
When you click into the password field, it could empty out so you have to type in the password in full.
This would also mean, that the "Undo" link would have a visual effect, right now you can't really tell if it worked.