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

Show UI warning for invalid URL's #3912

Conversation

@varjolintu
Copy link
Member

varjolintu commented Nov 22, 2019

Type of change

  • New feature (non-breaking change which adds functionality)

Description and Context

Shows a warning when editing entry if the URL field has an invalid value.

Also works with Additional URL's page, although the background color only changes after editing.

Screenshots

Valid URL:
Screen Shot 2019-11-22 at 13 56 59

Invalid URL:
Screen Shot 2019-11-22 at 13 57 09

Invalid URL in Additional URL's page:
Screen Shot 2019-11-22 at 23 17 21

Testing strategy

Tests added to TestBrowser class.

Checklist:

  • I have read the CONTRIBUTING document. [REQUIRED]
  • My code follows the code style of this project. [REQUIRED]
  • All new and existing tests passed. [REQUIRED]
  • I have compiled and verified my code with -DWITH_ASAN=ON. [REQUIRED]
  • I have added tests to cover my changes.
@varjolintu varjolintu added this to the v2.5.2 milestone Nov 22, 2019
@varjolintu varjolintu requested review from droidmonkey and phoerious and removed request for droidmonkey Nov 22, 2019
@varjolintu varjolintu force-pushed the varjolintu:hotfix/browser_url_ui_validation branch from 9ac0815 to b2723ec Nov 22, 2019
Copy link
Member

droidmonkey left a comment

See comment

src/gui/URLEdit.h Outdated Show resolved Hide resolved
@droidmonkey

This comment has been minimized.

Copy link
Member

droidmonkey commented Nov 22, 2019

Are we going to extend this to the multi url list or wait for 2.6.0?

@varjolintu

This comment has been minimized.

Copy link
Member Author

varjolintu commented Nov 22, 2019

@droidmonkey I'll test it today and see if it's possible to do. Should be a small fix.

@varjolintu

This comment has been minimized.

Copy link
Member Author

varjolintu commented Nov 22, 2019

@droidmonkey It was possible. Although only the background color changes after editing. QModelIndex has its limits.

src/gui/URLEdit.cpp Outdated Show resolved Hide resolved
@droidmonkey

This comment has been minimized.

Copy link
Member

droidmonkey commented Nov 22, 2019

You can show an icon in the QModelIndex, that is how I show the paperclip on the entry view model.

@varjolintu

This comment has been minimized.

Copy link
Member Author

varjolintu commented Nov 22, 2019

@droidmonkey Oh. Didn't know that. I'll add the icon.

@varjolintu

This comment has been minimized.

Copy link
Member Author

varjolintu commented Nov 22, 2019

Added the icon to the additional URL field's right side + removed the obsolete code from URLEdit class.

Thanks for the feedback everyone!

src/core/Tools.h Outdated Show resolved Hide resolved
@varjolintu varjolintu force-pushed the varjolintu:hotfix/browser_url_ui_validation branch 2 times, most recently from faaca1b to 47d5cd5 Nov 24, 2019
@varjolintu

This comment has been minimized.

Copy link
Member Author

varjolintu commented Nov 26, 2019

Removed the extra check, now tests with Linux are also fine. Everything's ready if there's nothing more to add.

@varjolintu varjolintu force-pushed the varjolintu:hotfix/browser_url_ui_validation branch from 47d5cd5 to 361dd56 Dec 6, 2019
@droidmonkey droidmonkey force-pushed the varjolintu:hotfix/browser_url_ui_validation branch from 361dd56 to 5a630cb Dec 21, 2019
@droidmonkey droidmonkey merged commit c0f29cc into keepassxreboot:release/2.5.2 Dec 21, 2019
4 checks passed
4 checks passed
Code Format (KeepassXC) TeamCity build finished
Details
MacOS (KeepassXC) TeamCity build finished
Details
Ubuntu Linux (KeepassXC) TeamCity build finished
Details
Windows 10 (KeepassXC) TeamCity build finished
Details
@varjolintu varjolintu deleted the varjolintu:hotfix/browser_url_ui_validation branch Dec 21, 2019
droidmonkey added a commit that referenced this pull request Jan 4, 2020
Added

- Browser: Show UI warning when entering invalid URLs [#3912]
- Browser: Option to use an entry only for HTTP auth [#3927]

Changed

- Disable the user interface when merging or saving the database [#3991]
- Ability to hide protected attribute after reveal [#3877]
- Remove mention of "snaps" in Windows and macOS [#3879]
- CLI: Merge parameter for source database key file (--key-file-from) [#3961]
- Improve GUI tests reliability on Hi-DPI displays [#4075]
- Disable deprecation warnings to allow building with Qt 5.14+ [#4075]
- OPVault: Use 'otp' attribute for TOTP field imports [#4075]

Fixed

- Fix crashes when saving a database to cloud storage [#3991]
- Fix crash when pressing enter twice while opening database [#3885]
- Fix handling of HTML when displayed in the entry preview panel [#3910]
- Fix start minimized to tray on Linux [#3899]
- Fix Auto Open with key file only databases [#4075]
- Fix escape key closing the standalone password generator [#3892]
- macOS: Fix monospace font usage in password field and notes [#4075]
- macOS: Fix building on macOS 10.9 to 10.11 [#3946]
- Fix TOTP setup dialog not closing on database lock [#4075]
- Browser: Fix condition where additional URLs are ignored [#4033]
- Browser: Fix subdomain matching to return only relevant site entries [#3854]
- Secret Service: Fix multiple crashes and incompatibilities [#3871, #4009, #4074]
- Secret Service: Fix searching of entries [#4008, #4036]
- Secret Service: Fix behavior when exposed group is recycled [#3914]
- CLI: Release the database instance before exiting interactive mode [#3889]
- Fix (most) memory leaks in tests [#3922]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.