0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-29 17:36:49 +01:00
Commit Graph

12015 Commits

Author SHA1 Message Date
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
Shohan
5c1046b2f0 [refactor] Refactor tests to not use parent page id 2021-10-15 16:51:18 +01:00
Shohan
31db97344f [refactor] Remove the use of parent page id in bulk actions 2021-10-15 16:51:18 +01:00
Shohan
2d29c12c6f [refactor] Revert earlier changes made for move confirmation page 2021-10-15 16:51:18 +01:00
Shohan
693471a942 [refactor] Fix linting issues 2021-10-15 16:51:18 +01:00
Shohan
8de4b23f38 [refactor] Refactor tests for bulk page move 2021-10-15 16:51:18 +01:00
Shohan
f7c4e2eb05 [refactor] Refactor move bulk action to use the PageBulkAction class 2021-10-15 16:51:18 +01:00
Shohan
6810bd6b33 [refactor] Remove unwanted space 2021-10-15 16:51:18 +01:00
Shohan
950fb45d98 [refactor] Refactor tests for page bulk actions
Changed following
- before and after hooks for each action are now changed to before_bulk_action and after_bulk_action hooks
2021-10-15 16:51:18 +01:00
Shohan
77fabffec4 [refactor] Refactor page bulk actions to use the PageBulkActionClass, and restructure the module location 2021-10-15 16:51:18 +01:00
Shohan
92027d4f50 [refactor] Refactor bulk_action_choices to page_bulk_action_choices
Changed following
- The tag now calls a hook to get a final list of the actions, and then generates buttons from that list
2021-10-15 16:51:18 +01:00
Shohan
89597cd233 [feat] Add dispatcher view for dispatching page bulk actions
Changed following
-Removed individual url patterns for each action, and use a single url pattern with action as a parameter
2021-10-15 16:51:18 +01:00
Shohan
1eaf53b181 [feat] Add base bulk action class, and page bulk action subclass 2021-10-15 16:51:18 +01:00
Shohan
525e328790 [refactor] Apply pluralisation and change success messages for bulk actions
Changed following
- Change f-strings to % formatting
- Change messages to impersonal
- Use pluralisation for messages
2021-10-15 16:51:18 +01:00
Shohan
ffd49116ce [refactor] Remove unused tag variables and use trans tag for all text in html files 2021-10-15 16:51:18 +01:00
Shohan
d4ec8292dc [refactor] Refactor bulk actions to not raise PermissionDenied for pages with no access
Changed following
- Earlier, if the user didnt have access to perform the action on even one of the pages, a PermissionDenied exception was raised. This was undesirable behaviour. Now, these pages are listed on the confirmation page of the action, where it is explicitly mentioned that the action cannot be performed on these pages.
2021-10-15 16:51:18 +01:00
Shohan
7b3309965b [feat] Add tests for bulk actions 2021-10-15 16:51:18 +01:00
Shohan
46bebde476 [feat] Add bulk action for move 2021-10-15 16:51:18 +01:00
Shohan
3ef56faac9 [refactor] Change filters implementation
Added following
- Separate routes for getting filter count with or without parent page id
- Use already existing parse_query_string function for parsing filter string

Changed following
- apply_filters now uses django's Q object, for more flexibility of filters

Fixed following
- bulk_action_choices hook now passes existing tests
2021-10-15 16:51:18 +01:00
Shohan
f96b9c829e [refactor] Refactor code to comply with style guide 2021-10-15 16:51:18 +01:00
Shohan
f875484f73 [feat] Add support for filters and bulk actions (del, pub, and unpub)
Added following
- Add support for filters
- Add bulk delete, publish and unpublish actions (views and templates)
- Add search textbox to get filtered results
- Add view to get count of pages corresponding to a set of given filters
2021-10-15 16:51:18 +01:00