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

[DO NOT MERGE] Feature/3869 commissioner document feed #4008

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

rfultz
Copy link
Contributor

@rfultz rfultz commented Aug 27, 2020

Summary

Impacted areas of the application

  • new page type for the Commissioner Items (models.py)
  • new URL structure to support a listing of the new page type items (urls.py)
  • new template for that listing page (commissioner_items_feed.html)
  • new template for each item on that listing page (commissioner-item.html)
  • new view for the new listing page (views.py)
  • define the options for the new items' taxonomy (constants.py)
  • migration(s) for the new page type
  • update documentation for lightly-related templates (commissioner_page.html, commissioners.html)
  • closed a previously-unclosed tag (latest_updates.html)
  • brought in some recent Snyk vulnerabilities updates to stay in sync w/ develop (requirements.txt)

Screenshots

Default listing page
image

Administering an item, category list
image

Related PRs

None

How to test

Strap in, this one's involved.

May be good to include a pre-set db for this testing (so we don't have to create test items) but right now we'll dupe your local db, switch to the duped db, do the migration(s), create some items, test things, then change back to the previous db.

  • pull the branch
  • Go into pyenv like normal
  • Dupe your current database and switch to the copy
    • Let's find out your current db name/url echo $DATABASE_URL
    • Make a note of that ☝️, save the part after postgresql://:@/. that's the name of the db you're currently using. I think we're all using cfdm_cms_test
    • Think of a name for a new, temporary db. I used db_test_comm_items
    • Make a copy of your current db createdb -T cfdm_cms_test db_test_comm_items (change cfdm_cms_test to your current db, change db_test_comm_items to your new temp db name
    • Switch to your new, temporary db export DATABASE_URL=postgresql://:@/db_test_comm_items (change db_test_comm_items to your new temp db name)
    • Yay!
  • Install requirements pip install -r requirements.txt (in the root directory of the repo. For me it's fec-cms)
  • Update any Node packages npm i (optional. probably not necessary but won't hurt)
  • Rebuild the front-end of the site npm run build (optional. probably not necessary but won't hurt)
  • Go into the fec directory cd fec
  • Make any migrations ./manage.py makemigrations
  • Apply the migration(s) ./manage.py migrate
  • Start the cms like normal ./manage.py runserver
  • Create some new Commissioner Items
    • Under Home or somewhere, click Create Child Page
    • choose Commissioner Item
    • Give it a title; HTML link, PDF link, Video link and/or choose a Related document [limit 1 related doc]; Display date; Category; and choose a Commissioner(s) (for our examples, we'll choose Commissioner Weintraub but feel free to add others
    • Publish
    • repeat with different combinations of links and categories
  • Test the listing page. If you chose Commissioner Weintraub, try http://127.0.0.1:8000/about/leadership-and-structure/ellen-l-weintraub/statements-and-opinions/; otherwise, swap the commissioner's page slug with one you chose
  • Test the filters (The year is the display year you chose, not the Wagtail go-live date)
  • Test for no-results filter results
  • Test that the taxonomy button thingy applies the filter accordingly
  • Test that the taxonomy link thingy (beside the button thingy) applies both filters accordingly

Feels like I'm forgetting something.

Optionally add a link to the main commissioner page:

  • Go into a commissioner's page
  • edit to add <a class="button--cta button--go" href="./statements-and-opinions/">Explore all statements and opinions</a> where you'd like the button to appear (link will work for any commissioner)

To change back to your non-temp db:

  • close the cms server (ctrl-c)
  • export DATABASE_URL=postgresql://:@/cfdm_cms_test (change cfdm_cms_test to your original db name)
  • Just for housekeeping, it would be good to delete that temp db (but after we're done testing this PR!)

⨂ ⨂ ⨂ DO NOT MERGE ⨂ ⨂ ⨂

TODO:

  • documentation
  • decide on final terms for the taxonomy
  • verify with team that displayed names/labels are cool ("Commissioner Items", "Category", "Subject", urls, etc)

Copy link
Member

@patphongs patphongs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of work on this @rfultz! It's going to take me a little more time to review, but a few things I've noticed so far are:

  1. There doesn't appear to be a way to navigate back to the associated Commissioner's landing page

Screen Shot 2020-09-01 at 1 31 26 PM

  1. Are the "Subject" filters working right now? I'm only able to filter by "Category" so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modify document page, document feed and commissioner page wagtail templates
2 participants