0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-30 19:20:56 +01:00
Commit Graph

12085 Commits

Author SHA1 Message Date
Shohan
d402deef08 [refactor] Set delete action as the last action, and remove unneccesary save on document in add tags on documnets bulk action 2021-10-15 16:51:18 +01:00
Shohan
f43476a82b [refactor] Reword confirmation strings and button label for adding tags in documents bulk actions 2021-10-15 16:51:18 +01:00
Shohan
81ab3f1ed2 [refactor] Dedent extra indented blocks in documents bulk action confirmation templates 2021-10-15 16:51:18 +01:00
Shohan
c0348c1b0c Remove duplicate css and js from documents bulk actions confirmation templates 2021-10-15 16:51:18 +01:00
Shohan
742cb14fbc [refactor] Set delete action as the last action, and remove unneccesary save on image in add tags 2021-10-15 16:51:18 +01:00
Shohan
391f1618b0 [fix] Fix bug that caused bulk actions to retain the num_objects after the action 2021-10-15 16:51:18 +01:00
Shohan
096f9e07c9 [refactor] Reword confirmation strings and button label for adding tags 2021-10-15 16:51:18 +01:00
Shohan
96e636f7ae [refactor] Dedent extra indented blocks 2021-10-15 16:51:18 +01:00
Shohan
7f32f2859c [refactor] Add common css and js to base confirmation template 2021-10-15 16:51:18 +01:00
Shohan
27e0b925cb [feat] Add tests for images bulk actions 2021-10-15 16:51:18 +01:00
Shohan
d773e9b4d2 [feat] Add bulk action ui to images listing 2021-10-15 16:51:18 +01:00
Shohan
855591cf8f [feat] Add action dispatcher for images bulk actions 2021-10-15 16:51:18 +01:00
Shohan
e0ce91f035 [feat] Add view and template to add images to a collection in bulk 2021-10-15 16:51:18 +01:00
Shohan
bdf9880d44 [feat] Add view and template to add tags to images in bulk 2021-10-15 16:51:18 +01:00
Shohan
857445e38e [feat] Add bulk delete view and template for images 2021-10-15 16:51:18 +01:00
Shohan
1b9facb377 [fix] Fix bug that caused disconnect between ui and javascipt state when using the navigate back button in chrome to cancel a bulk action (#7394) 2021-10-15 16:51:18 +01:00
Shohan
ebf2351cff [refactor] Fix typo 2021-10-15 16:51:18 +01:00
Shohan
28abe204cd [refactor] Bulk action data attributes are now added in a more generic manner 2021-10-15 16:51:18 +01:00
Shohan
11d50333b5 [refactor] namespace data attributes for bulk actions 2021-10-15 16:51:18 +01:00
Shohan
a1941da856 Bulk actions for documents (#7350)
* [feat] Add bulk delete view and template for documents

* [feat] Add view and template to add tags to documents in bulk

* [feat] Add view and template to add documents to a collection in bulk

* [feat] Add action dispatcher for documents bulk actions

* [feat] Add bulk action ui to documents listing

* [refactor] Refactor code to align with changes in bulk action base class

Changed following
- Change execute_action from classmethod to instance method
- Use cleaned form data instead of accessing request.POST data
- Add can_edit property to objects with no access

* [refactor] Refactor code to use the reusable confirmation templates

* [feat] Add tests for document bulk actions

* [refactor] Change code in execute_action to align with changes in base bulk action class

* [refactor] Use counter instead of num_docs in confirmation templates

* [refactor] Change aria label for checkbox

* [refactor] Use context instead of ctx, and change 'can_edit' to check for 'change' permission

* Show filters only for pages

* [refactor] Reduce width of checkbox column in documents listing
2021-10-15 16:51:18 +01:00
Shohan
48e9508fc1 [refactor] Refactor based on review comments
Changed following
- Use data- attributes to select elements instead of using classes
2021-10-15 16:51:18 +01:00
Shohan
d2ce53903c [refactor] Refactor based on review comments
Changed following
- action bar now uses translate for animation instead of changing layout
- action bar is now hidden from both text readers and keyboard navigation when it is out of view
- css now doesn't use elements for styling
- 'Show all in listing' is now a button instead of an <a>
- Changed aria labels to more suitable and meaningful ones
2021-10-15 16:51:18 +01:00
Shohan
1f1bc4f8aa [refactor] Refactor page bulk actions to align with changes to base bulk action 2021-10-15 16:51:18 +01:00
Shohan
6e2bfba045 [refactor] Make execute_action a classmethod, which now accepts additional keyword arguments from another instance method 2021-10-15 16:51:18 +01:00
Shohan
023f292208 [refactor] Reuse existing templates 2021-10-15 16:51:18 +01:00
Shohan
9848bb3bc3 [fix] Fix failing tests 2021-10-15 16:51:18 +01:00
Shohan
02fb709446 [refactor] Refactor execute_action to be an instance method instead of a class method
Changed following
- execute_action requires the use of several instance variables like cleaned form and request, which cannot be accessed if it were a class method. It was working till now since the classmethod decorator was not applied in the inherited class
2021-10-15 16:51:18 +01:00
Shohan
1fe1b15623 [fix] destination is evaluated when formis created, not in a class variable, which caused failing of some tests 2021-10-15 16:51:18 +01:00
Shohan
8eaaa9967d [refactor] Use the new reusable templates for the forms in page bulk actions 2021-10-15 16:51:18 +01:00
Shohan
2b09a653d1 [feat] Add reusable templates to generate forms 2021-10-15 16:51:18 +01:00
Shohan
d6c787fc51 [refactor] Use the cleaned form data instead of directly accessing request.POST 2021-10-15 16:51:18 +01:00
Shohan
fc280f92a3 [refactor] Base bulk action class now uses FormView instead of TemplateView
Changed following
- Most bulk actions have a form requirement. Therefore, subclassing FormView makes everything easier, the form is cleaned before the bulk action is processed, and any errors are returned with appropriate error strings. The cleaned form data is available to all methods after the form is cleaned.
2021-10-15 16:51:18 +01:00
Shohan
3749f6022a [feat] Check for edit permissions in the move bulk action for pages with no move permission 2021-10-15 16:51:18 +01:00
Shohan
02b4ee3412 [refactor] Change existing page bulk actions confirmation templates to use the base templates 2021-10-15 16:51:18 +01:00
Shohan
de9d87056a [feat] Add resuable templates that can be extended to create confirmation templates 2021-10-15 16:51:18 +01:00
Shohan
d5481b0df5 [fix] Fix small ui issues and inconsistencies in the action bar
Fixed following
- Fixed the transition time of the action bar
- Fixed the sudden jerk due to text change in the action bar
- select all text in the action bar now appears only if there are more objects to display
2021-10-15 16:51:18 +01:00
Shohan
0415ab4023 [refactor] Update code and tests in page bulk actions to work with changes in page bulk action url and reusable templatetags 2021-10-15 16:51:18 +01:00
Shohan
b7f24a2d81 [refactor] Refactor existing bulk action code for reusability 2021-10-15 16:51:18 +01:00
Shohan
539dc79af5 [fix] Fix jinjalint error 2021-10-15 16:51:18 +01:00
Shohan
6163609655 [refactor] Move bulk action related elements to separate templates for reusability, and make aria label strings translatable 2021-10-15 16:51:18 +01:00
Shohan
bc24f1eb5e [refactor] Use template literals instead of string concatention, and reduce dependency on html structure for querySelector 2021-10-15 16:51:18 +01:00
Shohan
75764a99e7 [refactor] Capitalise 'More' text using css rather than rendering uppercase text in html 2021-10-15 16:51:18 +01:00
Shohan
263d652a61 [fix] Fix css issues regarding footer and bulk action buttons
Fixed following
- The text color on the bulk action buttons used to turn white on hover. Now, the text color changes acoordingly
- Changes to footer css changed caused changes in some unwanted places. Fixed that by namespacing the css changes
2021-10-15 16:51:18 +01:00
Shohan
020f8dcfaf [feat] Move actions bar to footer and ad bulk actions to search page
Added following
- Add 'More' dropdown if there are more than 4 bulk actions
- Add bulk actions to 'Pages search' page

Changed following
- Move actions bar from headers to footer
2021-10-15 16:51:18 +01:00
Shohan
9b463f0429 [refactor] Remove repeated logic in bulk-actions.js 2021-10-15 16:51:18 +01:00
Shohan
a40d4de316 [refactor] Refactor after review commits
Added following
- Add prepare action method that runs before transaction starts
- Add a default form with a default field

Changed following
- Move permissions check in bulk move from before hook to a method that runs before the transaction starts
- Select all pages now doesn't fetch all ids, but passes id as all and the parent page id
- Change no access permissions

Fixed following
- Fix tests for changes in html
2021-10-15 16:51:18 +01:00
Shohan
e95135d5cf [refactor] Refactor after review comments
Added following
- Added comments

Changed following
- Displays confirm action button only when there are actionable objectsg
- Bulk actions are displayed in same order as page listing buttons

Fixed following
- Fix tests due to change in html of confirmation pages
2021-10-15 16:51:18 +01:00
Shohan
403cd5eb29 [feat] Add 'Select all pages in listing' support 2021-10-15 16:51:18 +01:00
Shohan
e524ccb995 [feat] Reintroduced ordering column and remove search input box and related views 2021-10-15 16:51:18 +01:00
Shohan
d2c09ec5af [feat] Add descendant context in publish page, and delete previously created bulk_move_choose_dest template 2021-10-15 16:51:18 +01:00