-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Support sorting HTML export #7011
Support sorting HTML export #7011
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #7011 +/- ##
===========================================
- Coverage 64.21% 64.12% -0.10%
===========================================
Files 334 335 +1
Lines 42221 42284 +63
===========================================
Hits 27111 27111
- Misses 15110 15173 +63
Continue to review full report at Codecov.
|
Could someone perhaps give some hints/point me to some information regarding the translation failure? Also, are there any options on the future work / open issues sections? |
For translation run I'm not sure what you mean by your second question |
Thanks! Did that. I was talking about the questions mentioned in the "open issues" section of the PR:
and
|
I would remove the Ascending selection box entirely. Give three choices in the "Sort by..." drop down:
For testing, I am not too hung up on test cases for this, it isn't a critical feature. If you want to write them though, use the NewDatabase.kdbx |
The original idea behind the "Ascending" checkbox was that i'd like to extend the system to cover several exporters/be more generic. If output is sortable by several columns, then an ascending checkbox is quickly worth it's weight. I think this is out of scope for this PR though. I've hence updated the dialog according to your suggestions. I have a final question though: How do you properly associate an enum value with a string? Is there some way to leverage the Qt Property/Meta Type system? I've used a QMap for this purpose (with fallback to the enum key). I've tried to wrap the enums key in a call to tr() and insert the proper strings in the translation table, but that does not work with automatic translation generation :/. |
Use a function that maps an enum to a string in a switch statement. For extending to this other exporters, like csv, it would be far more useful to have a "sort column" choice in addition to the three sort by choices. Ascending checkbox doesn't make sense on its own. |
Thanks @droidmonkey ! I've updated the code accordingly. It should be ready for merging now. |
Is there anything else that needs to be done? If not, could you perhaps label the PR as "hacktoberfest-accepted" (see https://hacktoberfest.digitalocean.com/resources/maintainers)? I |
I might do some style changes but otherwise I'll approve the PR for Hacktoberfest reasons |
a6edc5f
to
92de8b0
Compare
- Closes keepassxreboot#6164 - Implement sorting support in HtmlExporter - Add ExportDialog class and UI, which allows to configure export options.
92de8b0
to
231662c
Compare
I made the changes I wanted to make (simplified the code quite a bit) and this is ready for merge. |
Resolved #6164.
Screenshots
Current integration:
The export dialog:
Export in descending order:
Export in ascending order:
Export in database order:
Testing strategy
Test on local databases.
Type of change
Open issues
Discussion / Future work
Common Exporter Interfance
Both CSV & HTML Exporter share a lot of functionality, especially if we want to include support for sorting, exporting only specific groups, etc. in the future. This should also make implementing new exporters easier. I think we should address this issue and refactor in a future PR.