Bulk create HTML snapshots#1132
Conversation
| <option value="bulk_unshare">Unshare</option> | ||
| {% endif %} | ||
| <option value="bulk_refresh">Refresh from website</option> | ||
| <option value="bulk_snapshot">Create HTML snapshot</option> |
There was a problem hiding this comment.
This is only supported in the plus image, so it would be better to only show this if the feature is actually active. Here is a check that implements this when scheduling a background task:
linkding/bookmarks/services/tasks.py
Lines 254 to 255 in 887e42a
To make this available in the template I would suggest to expose settings.LD_ENABLE_SNAPSHOTS in a field in BookmarkListContext.
Would also be good to have tests to verify that the option is only shown when the feature is enabled.
There was a problem hiding this comment.
Thank you for pointing out the aspects I had overlooked. I’ve made the corresponding adjustments and added unit test cases.
Should I further refine the way settings.LD_ENABLE_SNAPSHOTS is exposed? Using a naming like bookmark_list.snapshot_feature_enabled in the bulk_edit/bar.html template feels somewhat less intuitive in conveying the meaning.
Also, do you think it would be beneficial to include end-to-end test cases as well?
There was a problem hiding this comment.
Should be good enough for now
55983f6 to
87df770
Compare
|
Sorry, I recently switched from using git to jujutsu, and the force push above should have been pushed to a branch in my fork repository. |
This test case covers the scenario where the bulk actions panel displays the corresponding options when the HTML snapshot feature is enabled.
87df770 to
148f8d2
Compare
* Add option to create HTML snapshot for bulk edit * Add the prerequisite for displaying the "Create HTML Snapshot" bulk action option * Add test case This test case covers the scenario where the bulk actions panel displays the corresponding options when the HTML snapshot feature is enabled. * Use the existing `tasks.create_html_snapshots()` instead of the for loop * Fix the exposure of `settings.LD_ENABLE_SNAPSHOTS` within `BookmarkListContext` * add service tests * cleanup context --------- Co-authored-by: Sascha Ißbrücker <sascha.issbruecker@gmail.com>
Closes #869