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

[WIP] Wagtail Datatables and Datatables for audits docs and some legal canonical pages #5375

Draft
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

johnnyporkchops
Copy link
Contributor

@johnnyporkchops johnnyporkchops commented Aug 17, 2022

Summary

This WIP PR demoes three datatable functionalities, but may likely be betters served by separate PRs.
This is currently pushed to feature space for WIP testing.(NOTE: No longer on feature, ask John to push it there)

  1. Creates a DataTable Wagtail Block where editors can build datatables with a Wagtail standard TableBlock and indicate sort fields and initial column to order table by.
    • Files: dom-datatableblock2.js, home/templates/blocks/data-table-block.html and home/blocks.py > DatatableBlock
    • Currently only on ResourcePage, but also works on other pages as long as the block is available on the page's Wagtail editing template and the JS file is included on the page
    • Example page: https://fec-feature-cms.app.cloud.gov/test-dtables/ (Feel free to edit this page or create a new one)
  2. Converts certain legal resources canonical pages' tables to Datatables (AOs and AFs) (Probably should be done as separate branch/PR)
    • Files: fec/static/js/pages/legal-to-datatable
    • Example: AO-2022-14
  3. Converts generic Wagtail tableblocks on Audit pages to Datatables. (Probably should be done as separate branch/PR)
    • Files: fec/static/js/pages/mutli-inplace-datatable.js

- Migrations: There will be a Django migration associated with this work, but since blocks.py migrations do not have to be done for the functionality to work, I will hold off on migrations until creating a non WIP PR for merge to prod.

Required reviewers

(Include who is required to review prior to merge. For example: One designer and two front end developer reviews are required prior to merge)

Impacted areas of the application

General components of the application that this PR will affect:

This work will require a migration file, which has yet to be generated
new file: fec/static/js/pages/dom-datatableblock2.js
new file: fec/static/js/pages/mutli-inplace-datatable.js
new file: fec/static/js/pages/legal-to-datatable
modified: home/blocks.py
new file: home/templates/blocks/data-table-block.html
modified: home/templates/home/resource_page.html

Screenshots

(Include a screenshot of the new/updated features in context (“in the wild”). If it is an interface change, include both before and after screenshots)

Related PRs

Related PRs against other branches:

branch PR
fix/other_pr link
feature/other_pr link

How to test

This is currently pushed to feature for WIP testing.

@codecov-commenter
Copy link

Codecov Report

Merging #5375 (887bde7) into develop (7d986d7) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           develop    #5375   +/-   ##
========================================
  Coverage    75.08%   75.09%           
========================================
  Files          125      125           
  Lines         8132     8138    +6     
  Branches       648      648           
========================================
+ Hits          6106     6111    +5     
- Misses        2026     2027    +1     
Impacted Files Coverage Δ
fec/home/blocks.py 100.00% <100.00%> (ø)
fec/fec/static/js/modules/calendar.js 92.08% <0.00%> (-0.72%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@johnnyporkchops johnnyporkchops marked this pull request as draft August 21, 2022 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Add new table functionality to resource template
2 participants