-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EREGCSC-2346 -- Internal Docs in Reader Sidebar (#1107)
* 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]>
- Loading branch information
Showing
36 changed files
with
2,829 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
solution/backend/regulations/templates/regulations/partials/login_sidebar_banner.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<div class="div__login-sidebar"> | ||
{% if user.is_authenticated %} | ||
Resources you can access include policy documents internal to CMCS. | ||
{% else %} | ||
CMCS staff participating in the Policy Repository pilot can | ||
<a id="loginSidebar" href="{% url 'login' %}?next={{ request.path }}" | ||
>sign in</a | ||
> | ||
to see internal resources. | ||
{% endif %} | ||
</div> |
44 changes: 35 additions & 9 deletions
44
solution/backend/regulations/templates/regulations/partials/sidebar_right.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,49 @@ | ||
{% load string_formatters %} | ||
|
||
{{ categories|json_script:"categories" }} | ||
{{ node_list|json_script:"node_list" }} | ||
|
||
<section id="right-sidebar" data-cache-key="sidebar" data-cache-value="{{label_id}}"> | ||
{% include "regulations/partials/view-button.html" %} | ||
<print-btn btn_type="labeled-icon"></print-btn> | ||
<hr /> | ||
|
||
{% if node_list %} | ||
<supplemental-content | ||
api-url="{{ API_BASE }}" | ||
title="{{ title }}" | ||
part="{{ reg_part }}" | ||
resources-url="{% url 'resources' %}" | ||
:resource-display=true | ||
:sections="{{ node_list.sections }}" | ||
:subparts="{{ node_list.subparts }}" | ||
> | ||
<template #login-banner> | ||
{% include "regulations/partials/login_sidebar_banner.html" %} | ||
</template> | ||
{% if user.is_authenticated %} | ||
<template #public-label> | ||
<div class="label__container"> | ||
<doc-type-label icon-type="external" doc-type="Public" /> | ||
</div> | ||
</template> | ||
{% endif %} | ||
</supplemental-content> | ||
{% if user.is_authenticated %} | ||
<div class="authed__container"> | ||
<hr /> | ||
<div class="label__container label__container--internal"> | ||
<doc-type-label icon-type="internal" doc-type="Internal" /> | ||
</div> | ||
|
||
<supplemental-content | ||
api-url="{{ API_BASE }}" | ||
title="{{ title }}" | ||
part="{{ reg_part }}" | ||
resources-url="{% url 'resources' %}" | ||
:resource-display=true | ||
:sections="{{ node_list.sections }}" | ||
:subparts="{{ node_list.subparts }}" | ||
></supplemental-content> | ||
<internal-docs-container | ||
api-url="{{ API_BASE }}" | ||
title="{{ title }}" | ||
part="{{ reg_part }}" | ||
></internal-docs-container> | ||
</div> | ||
<div class="login__spacer"></div> | ||
{% endif %} | ||
{% endif %} | ||
|
||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.