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

EREGCSC-2346 -- Internal Docs in Reader Sidebar #1107

Merged
merged 35 commits into from
Jan 23, 2024
Merged

Conversation

PhilR8
Copy link
Contributor

@PhilR8 PhilR8 commented Dec 13, 2023

Resolves EREGCSC-2346

Description:

Adds login link to right sidebar of reader view. Once logged in, users will see internal documents related to selected subpart or section at the bottom of the right sidebar.

This pull request changes:

  • ContentSearchViewset inherits from correct mixin to allow querying by section
  • Creates login Call To Action template partial for reader view's right sidebar
  • Creates InternalDocsContainer Vue component to fetch internal categories and docs
  • Renders those fetched internal docs using existing SupplementalContentCategory Vue component
  • Refactors FormatResourceCategories utility method to handle either public resources or eternal documents
  • Adds some unit test coverage and JSDoc documentation to FormatResourceCategories utility method
  • Adds mitt npm library to project to replace the deprecated Vue 2 event emitter interface in all places that it is used.

Steps to manually verify this change:

  1. Ensure you are logged out and then visit a subpart or section in the Reader View of the experimental deployment.
  2. Notice the right sidebar.
    • There should be a Call to Action banner at the top of the right sidebar inviting the user to log in
    • There should NOT be any Public/Internal labels or internal documents visible at the bottom of the right sidebar
  3. Use the Call to Action banner link at the top of the right sidebar to log in. You should be redirected back to 45 CFR 95.
  4. Notice that there are now Public and Internal labels in the right sidebar. Internal documents should be visible at the bottom of the right sidebar
  5. An empty category that is set to "Show if Empty" should be visible and match the disabled state of the empty Public categories
  6. An active category with a subcategory should be active and able to be toggled
    • Note that the expand/collapse behavior for internal documents should match the public doc behavior
  7. Visit the reader view for any other subpart or section.
  8. Note that there is only an empty, disabled category shown for Internal docs. These "Show if Empty" categories will be used as the empty state for subparts and sections that do not have any internal documents attached.

Copy link

✨ See the Django Site in action

Copy link

✨ See the Django Site in action

Copy link

github-actions bot commented Jan 3, 2024

✨ See the Django Site in action

Copy link

github-actions bot commented Jan 8, 2024

✨ See the Django Site in action

Copy link

✨ See the Django Site in action

Copy link

✨ See the Django Site in action

@PhilR8 PhilR8 marked this pull request as ready for review January 23, 2024 14:27
@PhilR8 PhilR8 added the Needs Review This PR needs a code review label Jan 23, 2024
Copy link

✨ See the Django Site in action

Copy link
Contributor

@cgodwin1 cgodwin1 left a comment

Choose a reason for hiding this comment

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

LGTM!

@PhilR8 PhilR8 added Approved and removed Needs Review This PR needs a code review labels Jan 23, 2024
@PhilR8 PhilR8 merged commit f20bcea into main Jan 23, 2024
19 checks passed
peggles2 pushed a commit that referenced this pull request Jan 24, 2024
* feat: right sidebar login banner

* test: update doctype label snapshot test assertion to use appropriate props

* feat: conditionally show public DocTypelabel

* Enable debug mode

* Fix 500 error when repo categories are present

* Remove debug = true

* feat: api method and container component setup

* feat: further table setting; get categories

* fix: inherit from correct mixin for section and subpart queries

* feat: get selected section and fetch on hash change

* feat: add mitt eventbus to replace deprecated vue 2.x root methods

* feat: clear eventbus listeners before destroy/unmount

* feat: fetch and watch logic

* feat: display crude item list

* feat: transform and load props in correct formats

* feat: getFileTypeButton moved to utils

* feat: logic cleanup

* feat: tweaks to bettery style doc lists

* feat: iron out styling

* chore: refactor existing categories method

for internal and external documents

* chore: remove comments

* emit and listen to clear sections event

* chore: formatting

* feat: add more space to bottom of right sidebar

* fix: tweak show if empty logic and category description logic

* test: update API test suite

* feat: tweak login call to action

* test: add unit tests for formatResourceCategories utility method

* chore: improve jsdoc documentation

* test: add e2e test coverage

* test: update contains assertion to take env into account

* test: remove potentially flaky assertions

* feat: remove unneeded styles that introduced side effect

---------

Co-authored-by: Caleb Godwin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants