From 1f8687ea8f4dc3f2c82a982a1c26efe175550e98 Mon Sep 17 00:00:00 2001 From: Phil Reese Date: Tue, 23 Jan 2024 15:15:16 -0500 Subject: [PATCH] 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 --- solution/backend/content_search/views.py | 6 +- .../partials/login_sidebar_banner.html | 11 + .../regulations/partials/sidebar_right.html | 44 +- solution/ui/e2e/cypress/e2e/api.spec.cy.js | 4 +- solution/ui/e2e/cypress/e2e/part.spec.cy.js | 71 +- .../fixtures/42.431.internal-formatted.js | 514 ++++++++++++ .../e2e/cypress/fixtures/42.431.internal.json | 460 +++++++++++ .../fixtures/42.433.10.public-formatted.js | 761 ++++++++++++++++++ .../cypress/fixtures/42.433.10.public.json | 319 ++++++++ .../cypress/fixtures/categories-internal.json | 50 ++ .../scss/partials/_buttons_and_tooltip.scss | 20 +- .../css/scss/partials/_results_item.scss | 14 +- .../css/scss/partials/_sidebar_right.scss | 17 + .../scss/partials/_supplemental_content.scss | 12 + .../eregs-component-lib/package-lock.json | 43 +- .../eregs-component-lib/package.json | 1 + .../src/components/BlockingModal.vue | 7 +- .../src/components/BlockingModalTrigger.vue | 3 +- .../src/components/CollapseButton.vue | 10 +- .../src/components/Collapsible.vue | 4 +- .../src/components/SupplementalContent.vue | 31 +- .../SupplementalContentCategory.vue | 4 +- .../components/SupplementalContentList.vue | 15 +- .../components/SupplementalContentObject.vue | 152 ++-- .../src/components/ViewResourcesLink.vue | 3 +- .../src/components/index.js | 2 + .../reader-sidebar/InternalDocsContainer.vue | 159 ++++ .../results-item-parts/DocTypeLabel.test.js | 6 +- .../__snapshots__/DocTypeLabel.test.js.snap | 12 +- .../eregs-component-lib/src/eventbus/index.js | 3 + .../eregs-component-lib/src/main.js | 19 +- .../policy-repository/PolicyResults.test.js | 12 - .../policy-repository/PolicyResults.vue | 24 +- solution/ui/regulations/utilities/api.js | 30 + solution/ui/regulations/utilities/utils.js | 91 ++- .../ui/regulations/utilities/utils.test.js | 88 ++ 36 files changed, 2829 insertions(+), 193 deletions(-) create mode 100644 solution/backend/regulations/templates/regulations/partials/login_sidebar_banner.html create mode 100644 solution/ui/e2e/cypress/fixtures/42.431.internal-formatted.js create mode 100644 solution/ui/e2e/cypress/fixtures/42.431.internal.json create mode 100644 solution/ui/e2e/cypress/fixtures/42.433.10.public-formatted.js create mode 100644 solution/ui/e2e/cypress/fixtures/42.433.10.public.json create mode 100644 solution/ui/e2e/cypress/fixtures/categories-internal.json create mode 100644 solution/ui/regulations/eregs-component-lib/src/components/reader-sidebar/InternalDocsContainer.vue create mode 100644 solution/ui/regulations/eregs-component-lib/src/eventbus/index.js diff --git a/solution/backend/content_search/views.py b/solution/backend/content_search/views.py index 69a194821e..0280debe1f 100644 --- a/solution/backend/content_search/views.py +++ b/solution/backend/content_search/views.py @@ -18,13 +18,13 @@ from common.mixins import PAGINATION_PARAMS, OptionalPaginationMixin from file_manager.models import AbstractRepoCategory, DocumentType, Subject from resources.models import AbstractCategory, AbstractLocation -from resources.views.mixins import LocationExplorerViewSetMixin +from resources.views.mixins import LocationFiltererMixin from .models import ContentIndex from .serializers import ContentListSerializer, ContentSearchSerializer, ContentUpdateSerializer -class ContentSearchViewset(LocationExplorerViewSetMixin, OptionalPaginationMixin, viewsets.ReadOnlyModelViewSet): +class ContentSearchViewset(LocationFiltererMixin, OptionalPaginationMixin, viewsets.ReadOnlyModelViewSet): model = ContentIndex queryset = ContentIndex.objects.all() paginate_by_default = True @@ -52,7 +52,7 @@ class ContentSearchViewset(LocationExplorerViewSetMixin, OptionalPaginationMixin OpenApiQueryParameter("resource-type", "Limit results to only resources found within this resource type. Internal, External," "all. Use \"&resource-type=external\"", str, ''), - ] + LocationExplorerViewSetMixin.PARAMETERS + OptionalPaginationMixin.PARAMETERS + PAGINATION_PARAMS + ] + LocationFiltererMixin.PARAMETERS + OptionalPaginationMixin.PARAMETERS + PAGINATION_PARAMS ) def list(self, request): locations = self.request.GET.getlist("locations") diff --git a/solution/backend/regulations/templates/regulations/partials/login_sidebar_banner.html b/solution/backend/regulations/templates/regulations/partials/login_sidebar_banner.html new file mode 100644 index 0000000000..f039e8d67a --- /dev/null +++ b/solution/backend/regulations/templates/regulations/partials/login_sidebar_banner.html @@ -0,0 +1,11 @@ + diff --git a/solution/backend/regulations/templates/regulations/partials/sidebar_right.html b/solution/backend/regulations/templates/regulations/partials/sidebar_right.html index f54c7d892c..766e5e0a07 100644 --- a/solution/backend/regulations/templates/regulations/partials/sidebar_right.html +++ b/solution/backend/regulations/templates/regulations/partials/sidebar_right.html @@ -1,6 +1,7 @@ {% load string_formatters %} {{ categories|json_script:"categories" }} +{{ node_list|json_script:"node_list" }} diff --git a/solution/ui/e2e/cypress/e2e/api.spec.cy.js b/solution/ui/e2e/cypress/e2e/api.spec.cy.js index 7712fb4257..c266919cc6 100644 --- a/solution/ui/e2e/cypress/e2e/api.spec.cy.js +++ b/solution/ui/e2e/cypress/e2e/api.spec.cy.js @@ -24,8 +24,10 @@ const SPECIAL_CHARACTERS = [ const API_ENDPOINTS_V3 = [ `/v3/acts`, + `/v3/content-search`, `/v3/ecfr_parser_result/${TITLE}`, - `v3/file-manager/subjects`, + `/v3/file-manager/categories`, + `/v3/file-manager/subjects`, `/v3/parser_config`, `/v3/resources/`, `/v3/resources/categories`, diff --git a/solution/ui/e2e/cypress/e2e/part.spec.cy.js b/solution/ui/e2e/cypress/e2e/part.spec.cy.js index 392c203c22..9be12df4d5 100644 --- a/solution/ui/e2e/cypress/e2e/part.spec.cy.js +++ b/solution/ui/e2e/cypress/e2e/part.spec.cy.js @@ -1,3 +1,6 @@ +const username = Cypress.env("TEST_USERNAME"); +const password = Cypress.env("TEST_PASSWORD"); + describe("Part View", () => { beforeEach(() => { cy.clearIndexedDB(); @@ -63,6 +66,72 @@ describe("Part View", () => { }); }); + it("has a login call to action in the right sidebar of a subpart view", () => { + cy.viewport("macbook-15"); + cy.visit("/42/433/51"); + + cy.get(".div__login-sidebar").contains( + "CMCS staff participating in the Policy Repository pilot can sign in to see internal resources." + ); + + cy.get("a#loginSidebar") + .should("have.attr", "href") + .and("include", "/admin/login/?next=") + .and("include", "/42/433/Subpart-B/"); + }); + + it("has a login confirmation banner and internal documents in the right sidebar of a subpart view when logged in", () => { + cy.intercept("**/v3/resources/?&locations=42.431.A**").as("resources"); + cy.intercept("**/v3/file-manager/categories", { + fixture: "categories-internal.json", + }).as("internal-categories"); + cy.intercept( + "**/v3/content-search/?resource-type=internal&locations=42.431.A**", + { + fixture: "42.431.internal.json", + } + ).as("internal431"); + cy.viewport("macbook-15"); + cy.eregsLogin({ username, password }); + cy.visit("/42/431/10"); + + cy.get(".div__login-sidebar").contains( + "Resources you can access include policy documents internal to CMCS." + ); + cy.get("#loginIndicator").should("be.visible"); + cy.get("a#loginSidebar").should("not.exist"); + + cy.wait("@resources").then(() => { + cy.get(".right-sidebar").scrollTo("bottom"); + cy.get(`button[data-test=TestCat]`).click({ + force: true, + }); + cy.wait(250); + cy.get(".right-sidebar").scrollTo("bottom"); + cy.get(`button[data-test=TestSubCat]`).click({ + force: true, + }); + cy.wait(250); + cy.get(".right-sidebar").scrollTo("bottom"); + cy.get( + ".internal-docs__container div[data-test=TestSubCat] .supplemental-content" + ) + .first() + .get(".supplemental-content-date") + .contains("August 30, 2023"); + cy.get( + ".internal-docs__container div[data-test=TestSubCat] .supplemental-content" + ) + .first() + .get(".supplemental-content-description") + .contains("42 431 test"); + cy.get(".show-more-button") + .contains("+ Show More (6)") + .click({ force: true }) + .contains("- Show Less (6)"); + }); + }); + it("loads a subpart view in a mobile width", () => { cy.viewport("iphone-x"); cy.visit("/42/433/"); @@ -176,7 +245,7 @@ describe("Part View", () => { // it recently broke because the latest year changed from 2021 to 2022 // so I'm commenting it out for now until we can figure out a better way //cy.get( - //"#433-8 .reg-history-link-container .tooltip.clicked .gov-info-links a:nth-child(1)" + //"#433-8 .reg-history-link-container .tooltip.clicked .gov-info-links a:nth-child(1)" //).contains("2021"); cy.get( "#433-8 .reg-history-link-container .tooltip.clicked .gov-info-links a:nth-child(1)" diff --git a/solution/ui/e2e/cypress/fixtures/42.431.internal-formatted.js b/solution/ui/e2e/cypress/fixtures/42.431.internal-formatted.js new file mode 100644 index 0000000000..6c9b53a0cc --- /dev/null +++ b/solution/ui/e2e/cypress/fixtures/42.431.internal-formatted.js @@ -0,0 +1,514 @@ +export default [ + { + "id": 3, + "name": "test childless cat", + "description": "this category is childless.", + "order": 1, + "show_if_empty": true, + "type": "repositorycategory", + "supplemental_content": [ + { + "doc_name_string": "Childless cat doc test", + "file_name_string": "RE Draft PT Services Reply.rtf", + "date_string": null, + "summary_string": "", + "locations": [ + { + "id": 6, + "title": 42, + "part": 431, + "type": "section", + "section_id": 10, + "parent": 851 + } + ], + "document_type": null, + "resource_type": "internal", + "subjects": [], + "category": { + "id": 3, + "name": "test childless cat", + "description": "this category is childless.", + "order": 1, + "show_if_empty": true, + "type": "repositorycategory" + }, + "url": "/v3/file-manager/files/62f929f4-e65f-4acb-b5a7-87ae5164b79b", + "id": 1685, + "document_name_headline": null, + "summary_headline": null + } + ], + "sub_categories": [] + }, + { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": false, + "type": "repositorycategory", + "supplemental_content": [ + { + "doc_name_string": "What happens if I add a doc to a cat with a subcat?", + "file_name_string": "CON.txt", + "date_string": "2023-08-30", + "summary_string": "", + "locations": [ + { + "id": 6, + "title": 42, + "part": 431, + "type": "section", + "section_id": 10, + "parent": 851 + } + ], + "document_type": null, + "resource_type": "internal", + "subjects": [], + "category": { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": false, + "type": "repositorycategory" + }, + "url": "/v3/file-manager/files/33dfcd4c-1505-44ab-90ad-f5008b41b407", + "id": 1688, + "document_name_headline": null, + "summary_headline": null + }, + { + "doc_name_string": "and more", + "file_name_string": "less_than (1) (1).txt", + "date_string": null, + "summary_string": "", + "locations": [ + { + "id": 7, + "title": 42, + "part": 431, + "type": "section", + "section_id": 11, + "parent": 851 + } + ], + "document_type": null, + "resource_type": "internal", + "subjects": [], + "category": { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": false, + "type": "repositorycategory" + }, + "url": "/v3/file-manager/files/e9cf05e6-0af9-44f9-b99f-d0bf7397b6f3", + "id": 1695, + "document_name_headline": null, + "summary_headline": null + } + ], + "sub_categories": [ + { + "id": 2, + "name": "TestSubCat", + "description": "", + "order": 1, + "show_if_empty": false, + "type": "repositorysubcategory", + "parent": { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": false, + "type": "" + }, + "supplemental_content": [ + { + "doc_name_string": "42 431 test", + "file_name_string": "fftestem.pdf", + "date_string": "2023-08-30", + "summary_string": "Testing the ability to add a reg section to an uploaded file.", + "locations": [ + { + "id": 6, + "title": 42, + "part": 431, + "type": "section", + "section_id": 10, + "parent": 851 + } + ], + "document_type": { + "id": 2, + "name": "Curated Formal Guidance", + "description": "Collections of references and excerpts from public materials, such as State Medicaid Manual" + }, + "resource_type": "internal", + "subjects": [ + { + "id": 2, + "full_name": "Alternative Benefit Plan", + "short_name": null, + "abbreviation": "ABP" + }, + { + "id": 3, + "full_name": "Access to Services", + "short_name": null, + "abbreviation": null + }, + { + "id": 4, + "full_name": "Adult Day Health", + "short_name": null, + "abbreviation": null + } + ], + "category": { + "id": 2, + "name": "TestSubCat", + "description": "", + "order": 1, + "show_if_empty": false, + "type": "repositorysubcategory", + "parent": { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": false, + "type": "" + } + }, + "url": "/v3/file-manager/files/b3fd8a45-d938-43c4-b653-e7e493dc4cb0", + "id": 1677, + "document_name_headline": null, + "summary_headline": null + }, + { + "doc_name_string": "Space Jam ya'll", + "file_name_string": "Space Jam (1).html", + "date_string": "2023-08-30", + "summary_string": "", + "locations": [ + { + "id": 7, + "title": 42, + "part": 431, + "type": "section", + "section_id": 11, + "parent": 851 + } + ], + "document_type": null, + "resource_type": "internal", + "subjects": [], + "category": { + "id": 2, + "name": "TestSubCat", + "description": "", + "order": 1, + "show_if_empty": false, + "type": "repositorysubcategory", + "parent": { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": false, + "type": "" + } + }, + "url": "/v3/file-manager/files/5a3672c1-58b2-487a-b9bb-4bed40f81d45", + "id": 1681, + "document_name_headline": null, + "summary_headline": null + }, + { + "doc_name_string": "TXT Test", + "file_name_string": "less_than.txt", + "date_string": "2023-08-30", + "summary_string": "This is a summary.", + "locations": [ + { + "id": 6, + "title": 42, + "part": 431, + "type": "section", + "section_id": 10, + "parent": 851 + } + ], + "document_type": { + "id": 2, + "name": "Curated Formal Guidance", + "description": "Collections of references and excerpts from public materials, such as State Medicaid Manual" + }, + "resource_type": "internal", + "subjects": [ + { + "id": 6, + "full_name": "Asthma", + "short_name": null, + "abbreviation": null + }, + { + "id": 7, + "full_name": "Autism Spectrum Disorder", + "short_name": null, + "abbreviation": null + }, + { + "id": 8, + "full_name": "Blood Products", + "short_name": null, + "abbreviation": null + }, + { + "id": 9, + "full_name": "Care Coordination", + "short_name": null, + "abbreviation": null + }, + { + "id": 10, + "full_name": "Certified Community Behavioral Health Clinics", + "short_name": null, + "abbreviation": "CCBHCs" + } + ], + "category": { + "id": 2, + "name": "TestSubCat", + "description": "", + "order": 1, + "show_if_empty": false, + "type": "repositorysubcategory", + "parent": { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": false, + "type": "" + } + }, + "url": "/v3/file-manager/files/419edd9a-482a-445e-a1dc-0b21a80ac36d", + "id": 1687, + "document_name_headline": null, + "summary_headline": null + }, + { + "doc_name_string": "and even more than more", + "file_name_string": "less_than (1) (1).txt", + "date_string": null, + "summary_string": "", + "locations": [ + { + "id": 6, + "title": 42, + "part": 431, + "type": "section", + "section_id": 10, + "parent": 851 + } + ], + "document_type": null, + "resource_type": "internal", + "subjects": [], + "category": { + "id": 2, + "name": "TestSubCat", + "description": "", + "order": 1, + "show_if_empty": false, + "type": "repositorysubcategory", + "parent": { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": false, + "type": "" + } + }, + "url": "/v3/file-manager/files/b0b3b731-5ab6-4c89-8fce-1d0b047abcb0", + "id": 1692, + "document_name_headline": null, + "summary_headline": null + }, + { + "doc_name_string": "even more", + "file_name_string": "less_than (1).txt", + "date_string": null, + "summary_string": "", + "locations": [ + { + "id": 6, + "title": 42, + "part": 431, + "type": "section", + "section_id": 10, + "parent": 851 + } + ], + "document_type": null, + "resource_type": "internal", + "subjects": [], + "category": { + "id": 2, + "name": "TestSubCat", + "description": "", + "order": 1, + "show_if_empty": false, + "type": "repositorysubcategory", + "parent": { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": false, + "type": "" + } + }, + "url": "/v3/file-manager/files/ff0356df-6b35-4efb-b926-50df05b3a887", + "id": 1690, + "document_name_headline": null, + "summary_headline": null + }, + { + "doc_name_string": "more", + "file_name_string": "less_than.txt", + "date_string": null, + "summary_string": "", + "locations": [ + { + "id": 6, + "title": 42, + "part": 431, + "type": "section", + "section_id": 10, + "parent": 851 + } + ], + "document_type": null, + "resource_type": "internal", + "subjects": [], + "category": { + "id": 2, + "name": "TestSubCat", + "description": "", + "order": 1, + "show_if_empty": false, + "type": "repositorysubcategory", + "parent": { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": false, + "type": "" + } + }, + "url": "/v3/file-manager/files/f207924c-0924-4779-946b-3f1f8ae1dfd5", + "id": 1689, + "document_name_headline": null, + "summary_headline": null + } + ] + }, + { + "id": 4, + "name": "TestSubCat 2", + "description": "", + "order": 2, + "show_if_empty": false, + "type": "repositorysubcategory", + "parent": { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": false, + "type": "" + }, + "supplemental_content": [ + { + "doc_name_string": "another subcat", + "file_name_string": "less_than (1).txt", + "date_string": null, + "summary_string": "", + "locations": [ + { + "id": 6, + "title": 42, + "part": 431, + "type": "section", + "section_id": 10, + "parent": 851 + } + ], + "document_type": { + "id": 2, + "name": "Curated Formal Guidance", + "description": "Collections of references and excerpts from public materials, such as State Medicaid Manual" + }, + "resource_type": "internal", + "subjects": [ + { + "id": 8, + "full_name": "Blood Products", + "short_name": null, + "abbreviation": null + }, + { + "id": 9, + "full_name": "Care Coordination", + "short_name": null, + "abbreviation": null + }, + { + "id": 6, + "full_name": "Asthma", + "short_name": null, + "abbreviation": null + }, + { + "id": 7, + "full_name": "Autism Spectrum Disorder", + "short_name": null, + "abbreviation": null + } + ], + "category": { + "id": 4, + "name": "TestSubCat 2", + "description": "", + "order": 2, + "show_if_empty": false, + "type": "repositorysubcategory", + "parent": { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": false, + "type": "" + } + }, + "url": "/v3/file-manager/files/8064ce75-2806-4eaf-890b-681363d7f22c", + "id": 1686, + "document_name_headline": null, + "summary_headline": null + } + ] + } + ] + } +] diff --git a/solution/ui/e2e/cypress/fixtures/42.431.internal.json b/solution/ui/e2e/cypress/fixtures/42.431.internal.json new file mode 100644 index 0000000000..ff9a88280a --- /dev/null +++ b/solution/ui/e2e/cypress/fixtures/42.431.internal.json @@ -0,0 +1,460 @@ +{ + "count": 10, + "next": null, + "previous": null, + "results": [ + { + "doc_name_string": "42 431 test", + "file_name_string": "fftestem.pdf", + "date_string": "2023-08-30", + "summary_string": "Testing the ability to add a reg section to an uploaded file.", + "locations": [ + { + "id": 6, + "title": 42, + "part": 431, + "type": "section", + "section_id": 10, + "parent": 851 + } + ], + "document_type": { + "id": 2, + "name": "Curated Formal Guidance", + "description": "Collections of references and excerpts from public materials, such as State Medicaid Manual" + }, + "resource_type": "internal", + "subjects": [ + { + "id": 2, + "full_name": "Alternative Benefit Plan", + "short_name": null, + "abbreviation": "ABP" + }, + { + "id": 3, + "full_name": "Access to Services", + "short_name": null, + "abbreviation": null + }, + { + "id": 4, + "full_name": "Adult Day Health", + "short_name": null, + "abbreviation": null + } + ], + "category": { + "id": 2, + "name": "TestSubCat", + "description": "", + "order": 1, + "show_if_empty": false, + "type": "repositorysubcategory", + "parent": { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": true, + "type": "" + } + }, + "url": "b3fd8a45-d938-43c4-b653-e7e493dc4cb0", + "id": 1677, + "document_name_headline": null, + "summary_headline": null + }, + { + "doc_name_string": "Space Jam ya'll", + "file_name_string": "Space Jam (1).html", + "date_string": "2023-08-30", + "summary_string": "", + "locations": [ + { + "id": 7, + "title": 42, + "part": 431, + "type": "section", + "section_id": 11, + "parent": 851 + } + ], + "document_type": null, + "resource_type": "internal", + "subjects": [], + "category": { + "id": 2, + "name": "TestSubCat", + "description": "", + "order": 1, + "show_if_empty": false, + "type": "repositorysubcategory", + "parent": { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": false, + "type": "" + } + }, + "url": "5a3672c1-58b2-487a-b9bb-4bed40f81d45", + "id": 1681, + "document_name_headline": null, + "summary_headline": null + }, + { + "doc_name_string": "TXT Test", + "file_name_string": "less_than.txt", + "date_string": "2023-08-30", + "summary_string": "This is a summary.", + "locations": [ + { + "id": 6, + "title": 42, + "part": 431, + "type": "section", + "section_id": 10, + "parent": 851 + } + ], + "document_type": { + "id": 2, + "name": "Curated Formal Guidance", + "description": "Collections of references and excerpts from public materials, such as State Medicaid Manual" + }, + "resource_type": "internal", + "subjects": [ + { + "id": 6, + "full_name": "Asthma", + "short_name": null, + "abbreviation": null + }, + { + "id": 7, + "full_name": "Autism Spectrum Disorder", + "short_name": null, + "abbreviation": null + }, + { + "id": 8, + "full_name": "Blood Products", + "short_name": null, + "abbreviation": null + }, + { + "id": 9, + "full_name": "Care Coordination", + "short_name": null, + "abbreviation": null + }, + { + "id": 10, + "full_name": "Certified Community Behavioral Health Clinics", + "short_name": null, + "abbreviation": "CCBHCs" + } + ], + "category": { + "id": 2, + "name": "TestSubCat", + "description": "", + "order": 1, + "show_if_empty": false, + "type": "repositorysubcategory", + "parent": { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": false, + "type": "" + } + }, + "url": "419edd9a-482a-445e-a1dc-0b21a80ac36d", + "id": 1687, + "document_name_headline": null, + "summary_headline": null + }, + { + "doc_name_string": "What happens if I add a doc to a cat with a subcat?", + "file_name_string": "CON.txt", + "date_string": "2023-08-30", + "summary_string": "", + "locations": [ + { + "id": 6, + "title": 42, + "part": 431, + "type": "section", + "section_id": 10, + "parent": 851 + } + ], + "document_type": null, + "resource_type": "internal", + "subjects": [], + "category": { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": false, + "type": "repositorycategory" + }, + "url": "33dfcd4c-1505-44ab-90ad-f5008b41b407", + "id": 1688, + "document_name_headline": null, + "summary_headline": null + }, + { + "doc_name_string": "and even more than more", + "file_name_string": "less_than (1) (1).txt", + "date_string": null, + "summary_string": "", + "locations": [ + { + "id": 6, + "title": 42, + "part": 431, + "type": "section", + "section_id": 10, + "parent": 851 + } + ], + "document_type": null, + "resource_type": "internal", + "subjects": [], + "category": { + "id": 2, + "name": "TestSubCat", + "description": "", + "order": 1, + "show_if_empty": false, + "type": "repositorysubcategory", + "parent": { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": false, + "type": "" + } + }, + "url": "b0b3b731-5ab6-4c89-8fce-1d0b047abcb0", + "id": 1692, + "document_name_headline": null, + "summary_headline": null + }, + { + "doc_name_string": "and more", + "file_name_string": "less_than (1) (1).txt", + "date_string": null, + "summary_string": "", + "locations": [ + { + "id": 7, + "title": 42, + "part": 431, + "type": "section", + "section_id": 11, + "parent": 851 + } + ], + "document_type": null, + "resource_type": "internal", + "subjects": [], + "category": { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": false, + "type": "repositorycategory" + }, + "url": "e9cf05e6-0af9-44f9-b99f-d0bf7397b6f3", + "id": 1695, + "document_name_headline": null, + "summary_headline": null + }, + { + "doc_name_string": "another subcat", + "file_name_string": "less_than (1).txt", + "date_string": null, + "summary_string": "", + "locations": [ + { + "id": 6, + "title": 42, + "part": 431, + "type": "section", + "section_id": 10, + "parent": 851 + } + ], + "document_type": { + "id": 2, + "name": "Curated Formal Guidance", + "description": "Collections of references and excerpts from public materials, such as State Medicaid Manual" + }, + "resource_type": "internal", + "subjects": [ + { + "id": 8, + "full_name": "Blood Products", + "short_name": null, + "abbreviation": null + }, + { + "id": 9, + "full_name": "Care Coordination", + "short_name": null, + "abbreviation": null + }, + { + "id": 6, + "full_name": "Asthma", + "short_name": null, + "abbreviation": null + }, + { + "id": 7, + "full_name": "Autism Spectrum Disorder", + "short_name": null, + "abbreviation": null + } + ], + "category": { + "id": 4, + "name": "TestSubCat 2", + "description": "", + "order": 2, + "show_if_empty": false, + "type": "repositorysubcategory", + "parent": { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": false, + "type": "" + } + }, + "url": "8064ce75-2806-4eaf-890b-681363d7f22c", + "id": 1686, + "document_name_headline": null, + "summary_headline": null + }, + { + "doc_name_string": "Childless cat doc test", + "file_name_string": "RE Draft PT Services Reply.rtf", + "date_string": null, + "summary_string": "", + "locations": [ + { + "id": 6, + "title": 42, + "part": 431, + "type": "section", + "section_id": 10, + "parent": 851 + } + ], + "document_type": null, + "resource_type": "internal", + "subjects": [], + "category": { + "id": 3, + "name": "test childless cat", + "description": "this category is childless.", + "order": 1, + "show_if_empty": true, + "type": "repositorycategory" + }, + "url": "62f929f4-e65f-4acb-b5a7-87ae5164b79b", + "id": 1685, + "document_name_headline": null, + "summary_headline": null + }, + { + "doc_name_string": "even more", + "file_name_string": "less_than (1).txt", + "date_string": null, + "summary_string": "", + "locations": [ + { + "id": 6, + "title": 42, + "part": 431, + "type": "section", + "section_id": 10, + "parent": 851 + } + ], + "document_type": null, + "resource_type": "internal", + "subjects": [], + "category": { + "id": 2, + "name": "TestSubCat", + "description": "", + "order": 1, + "show_if_empty": false, + "type": "repositorysubcategory", + "parent": { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": false, + "type": "" + } + }, + "url": "ff0356df-6b35-4efb-b926-50df05b3a887", + "id": 1690, + "document_name_headline": null, + "summary_headline": null + }, + { + "doc_name_string": "more", + "file_name_string": "less_than.txt", + "date_string": null, + "summary_string": "", + "locations": [ + { + "id": 6, + "title": 42, + "part": 431, + "type": "section", + "section_id": 10, + "parent": 851 + } + ], + "document_type": null, + "resource_type": "internal", + "subjects": [], + "category": { + "id": 2, + "name": "TestSubCat", + "description": "", + "order": 1, + "show_if_empty": false, + "type": "repositorysubcategory", + "parent": { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": false, + "type": "" + } + }, + "url": "f207924c-0924-4779-946b-3f1f8ae1dfd5", + "id": 1689, + "document_name_headline": null, + "summary_headline": null + } + ] +} diff --git a/solution/ui/e2e/cypress/fixtures/42.433.10.public-formatted.js b/solution/ui/e2e/cypress/fixtures/42.433.10.public-formatted.js new file mode 100644 index 0000000000..961e904c11 --- /dev/null +++ b/solution/ui/e2e/cypress/fixtures/42.433.10.public-formatted.js @@ -0,0 +1,761 @@ +export default [ + { + description: "", + id: 139, + is_fr_doc_category: false, + name: "Topic Briefs and Reports", + order: 0, + parent: { + description: + "HHS, CMS, and ASPE policy analysis and research reports", + id: 19, + is_fr_doc_category: false, + name: "Reports and Evaluations", + order: 550, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + sub_categories: [], + type: "subcategory", + }, + { + description: "", + id: 7, + is_fr_doc_category: false, + name: "State Medicaid Director Letter (SMDL)", + order: 100, + parent: { + description: "SMDLs, SHOs, CIBs, FAQs, SMM", + id: 5, + is_fr_doc_category: false, + name: "Subregulatory Guidance", + order: 400, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + sub_categories: [], + type: "subcategory", + }, + { + description: "", + id: 12, + is_fr_doc_category: false, + name: "SPA Resources", + order: 101, + parent: { + description: + "State Technical Assistance, Toolkits, SPA/Waiver Resources", + id: 11, + is_fr_doc_category: false, + name: "Implementation Resources", + order: 500, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + sub_categories: [], + type: "subcategory", + }, + { + description: "", + id: 13, + is_fr_doc_category: false, + name: "Technical Assistance for States", + order: 200, + parent: { + description: + "State Technical Assistance, Toolkits, SPA/Waiver Resources", + id: 11, + is_fr_doc_category: false, + name: "Implementation Resources", + order: 500, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + sub_categories: [], + type: "subcategory", + }, + { + description: "", + id: 135, + is_fr_doc_category: false, + name: "HHS and CMS Reports to Congress", + order: 200, + parent: { + description: + "HHS, CMS, and ASPE policy analysis and research reports", + id: 19, + is_fr_doc_category: false, + name: "Reports and Evaluations", + order: 550, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + sub_categories: [], + type: "subcategory", + }, + { + description: + "Statutes that relate to the subject matter of the subpart or section", + id: 3, + is_fr_doc_category: false, + name: "Related Statutes", + order: 200, + show_if_empty: false, + sub_categories: [], + type: "category", + }, + { + description: "", + id: 6, + is_fr_doc_category: false, + name: "State Health Official (SHO) Letter", + order: 200, + parent: { + description: "SMDLs, SHOs, CIBs, FAQs, SMM", + id: 5, + is_fr_doc_category: false, + name: "Subregulatory Guidance", + order: 400, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + sub_categories: [], + type: "subcategory", + }, + { + description: + "Federal Register documents with agency policy proposals and decisions", + id: 67, + is_fr_doc_category: true, + name: "Proposed and Final Rules", + order: 250, + show_if_empty: false, + sub_categories: [], + type: "category", + }, + { + description: "", + id: 9, + is_fr_doc_category: false, + name: "CMCS Informational Bulletin (CIB)", + order: 300, + parent: { + description: "SMDLs, SHOs, CIBs, FAQs, SMM", + id: 5, + is_fr_doc_category: false, + name: "Subregulatory Guidance", + order: 400, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + sub_categories: [], + type: "subcategory", + }, + { + description: "", + id: 14, + is_fr_doc_category: false, + name: "Templates", + order: 300, + parent: { + description: + "State Technical Assistance, Toolkits, SPA/Waiver Resources", + id: 11, + is_fr_doc_category: false, + name: "Implementation Resources", + order: 500, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + sub_categories: [], + type: "subcategory", + }, + { + description: + "Regulations outside the Subpart related to the subject matter", + id: 4, + is_fr_doc_category: false, + name: "Related Regulations", + order: 300, + show_if_empty: false, + sub_categories: [], + type: "category", + }, + { + description: "SMDLs, SHOs, CIBs, FAQs, SMM", + id: 5, + is_fr_doc_category: false, + name: "Subregulatory Guidance", + order: 400, + show_if_empty: true, + sub_categories: [ + { + description: "", + id: 6, + is_fr_doc_category: false, + name: "State Health Official (SHO) Letter", + order: 200, + parent: { + description: "SMDLs, SHOs, CIBs, FAQs, SMM", + id: 5, + is_fr_doc_category: false, + name: "Subregulatory Guidance", + order: 400, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + supplemental_content: [ + { + approved: true, + category: { + description: "", + id: 6, + is_fr_doc_category: false, + name: "State Health Official (SHO) Letter", + order: 200, + parent: { + description: "SMDLs, SHOs, CIBs, FAQs, SMM", + id: 5, + is_fr_doc_category: false, + name: "Subregulatory Guidance", + order: 400, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + type: "subcategory", + }, + created_at: "2022-01-04 11:34:42.959000", + date: "2021-12-08", + description: + "RE: Medicaid Guidance on the Scope of and Payments for Qualifying Community-Based Mobile Crisis ␍␊", + description_headline: null, + id: 242, + internalURL: "/supplemental_content/242/", + locations: [ + 671, 14, 200, 332, 380, 360, 36, 26, 27, 44, 51, 73, + 17, 18, 405, 392, 428, + ], + name: "SHO # 21-008", + name_headline: null, + type: "supplemental_content", + updated_at: "2022-05-20 15:26:03.936000", + url: "https://www.medicaid.gov/federal-policy-guidance/downloads/sho21008.pdf", + }, + { + approved: true, + category: { + description: "", + id: 6, + is_fr_doc_category: false, + name: "State Health Official (SHO) Letter", + order: 200, + parent: { + description: "SMDLs, SHOs, CIBs, FAQs, SMM", + id: 5, + is_fr_doc_category: false, + name: "Subregulatory Guidance", + order: 400, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + type: "subcategory", + }, + created_at: "2021-10-25 16:50:39.768000", + date: "2021-08-30", + description: + "RE: Temporary increases to FMAP under sections 9811, 9814, 9815, and 9821 of the ARP and administrative claiming for vaccine incentives", + description_headline: null, + id: 915, + internalURL: "/supplemental_content/915/", + locations: [ + 3, 160, 200, 203, 221, 206, 238, 348, 401, 472, 634, + 633, 630, 604, 632, 631, + ], + name: "SHO# 21-004", + name_headline: null, + type: "supplemental_content", + updated_at: "2022-05-20 15:26:15.367000", + url: "https://www.medicaid.gov/federal-policy-guidance/downloads/sho-21-004.pdf", + }, + ], + type: "subcategory", + }, + { + description: "", + id: 9, + is_fr_doc_category: false, + name: "CMCS Informational Bulletin (CIB)", + order: 300, + parent: { + description: "SMDLs, SHOs, CIBs, FAQs, SMM", + id: 5, + is_fr_doc_category: false, + name: "Subregulatory Guidance", + order: 400, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + supplemental_content: [ + { + approved: true, + category: { + description: "", + id: 9, + is_fr_doc_category: false, + name: "CMCS Informational Bulletin (CIB)", + order: 300, + parent: { + description: "SMDLs, SHOs, CIBs, FAQs, SMM", + id: 5, + is_fr_doc_category: false, + name: "Subregulatory Guidance", + order: 400, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + type: "subcategory", + }, + created_at: "2021-10-25 16:50:43.884000", + date: "2021-06-03", + description: + "Medicaid, Children’s Health Insurance Program (CHIP), and Basic Health Program (BHP) Related Provisions in the American Rescue Plan Act of 2021", + description_headline: null, + id: 1267, + internalURL: "/supplemental_content/1267/", + locations: [ + 200, 224, 242, 238, 11, 110, 401, 44, 51, 73, 17, + 18, 418, 493, 486, + ], + name: null, + name_headline: null, + type: "supplemental_content", + updated_at: "2022-05-20 15:26:21.180000", + url: "https://www.medicaid.gov/federal-policy-guidance/downloads/cib060321.pdf", + }, + { + approved: true, + category: { + description: "", + id: 9, + is_fr_doc_category: false, + name: "CMCS Informational Bulletin (CIB)", + order: 300, + parent: { + description: "SMDLs, SHOs, CIBs, FAQs, SMM", + id: 5, + is_fr_doc_category: false, + name: "Subregulatory Guidance", + order: 400, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + type: "subcategory", + }, + created_at: "2021-10-25 16:50:38.797000", + date: "2019-11-27", + description: + "New Reporting Measures for Substance Use Disorder (SUD)-focused Health Homes", + description_headline: null, + id: 834, + internalURL: "/supplemental_content/834/", + locations: [200, 44], + name: null, + name_headline: null, + type: "supplemental_content", + updated_at: "2022-05-20 15:26:13.988000", + url: "https://www.medicaid.gov/federal-policy-guidance/downloads/cib112719.pdf", + }, + { + approved: true, + category: { + description: "", + id: 9, + is_fr_doc_category: false, + name: "CMCS Informational Bulletin (CIB)", + order: 300, + parent: { + description: "SMDLs, SHOs, CIBs, FAQs, SMM", + id: 5, + is_fr_doc_category: false, + name: "Subregulatory Guidance", + order: 400, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + type: "subcategory", + }, + created_at: "2021-10-25 16:50:30.601000", + date: "2019-05-07", + description: + "Guidance for States on the Availability of an Extension of the Enhanced Federal Medical Assistance Percentage (FMAP) Period for Certain Medicaid Health Homes for Individuals with Substance Use Disorders (SUD)", + description_headline: null, + id: 245, + internalURL: "/supplemental_content/245/", + locations: [200], + name: null, + name_headline: null, + type: "supplemental_content", + updated_at: "2022-05-20 15:26:03.982000", + url: "https://www.medicaid.gov/federal-policy-guidance/downloads/cib050719.pdf", + }, + ], + type: "subcategory", + }, + ], + type: "category", + }, + { + description: "", + id: 10, + is_fr_doc_category: false, + name: "Frequently Asked Questions (FAQs)", + order: 400, + parent: { + description: "SMDLs, SHOs, CIBs, FAQs, SMM", + id: 5, + is_fr_doc_category: false, + name: "Subregulatory Guidance", + order: 400, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + sub_categories: [], + type: "subcategory", + }, + { + description: "", + id: 138, + is_fr_doc_category: false, + name: "Associate Regional Administrator (ARA) Memo", + order: 450, + parent: { + description: "SMDLs, SHOs, CIBs, FAQs, SMM", + id: 5, + is_fr_doc_category: false, + name: "Subregulatory Guidance", + order: 400, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + sub_categories: [], + type: "subcategory", + }, + { + description: + "State Technical Assistance, Toolkits, SPA/Waiver Resources", + id: 11, + is_fr_doc_category: false, + name: "Implementation Resources", + order: 500, + show_if_empty: true, + sub_categories: [ + { + description: "", + id: 13, + is_fr_doc_category: false, + name: "Technical Assistance for States", + order: 200, + parent: { + description: + "State Technical Assistance, Toolkits, SPA/Waiver Resources", + id: 11, + is_fr_doc_category: false, + name: "Implementation Resources", + order: 500, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + supplemental_content: [ + { + approved: true, + category: { + description: "", + id: 13, + is_fr_doc_category: false, + name: "Technical Assistance for States", + order: 200, + parent: { + description: + "State Technical Assistance, Toolkits, SPA/Waiver Resources", + id: 11, + is_fr_doc_category: false, + name: "Implementation Resources", + order: 500, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + type: "subcategory", + }, + created_at: "2021-11-04 16:50:48.411000", + date: "2021-11-03", + description: + "Medicaid, CHIP and BHP COVID-19 Vaccine Administration Coverage, Cost-Sharing, and Reimbursement Fact Sheet", + description_headline: null, + id: 1237, + internalURL: "/supplemental_content/1237/", + locations: [200, 36, 53, 405, 493, 573, 575, 610], + name: null, + name_headline: null, + type: "supplemental_content", + updated_at: "2022-05-20 15:26:20.684000", + url: "https://www.medicaid.gov/state-resource-center/downloads/covid19-fact-sheet-11032021.pdf", + }, + ], + type: "subcategory", + }, + ], + type: "category", + }, + { + description: "", + id: 15, + is_fr_doc_category: false, + name: "Toolkits", + order: 500, + parent: { + description: + "State Technical Assistance, Toolkits, SPA/Waiver Resources", + id: 11, + is_fr_doc_category: false, + name: "Implementation Resources", + order: 500, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + sub_categories: [], + type: "subcategory", + }, + { + description: "", + id: 8, + is_fr_doc_category: false, + name: "State Medicaid Manual (SMM)", + order: 500, + parent: { + description: "SMDLs, SHOs, CIBs, FAQs, SMM", + id: 5, + is_fr_doc_category: false, + name: "Subregulatory Guidance", + order: 400, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + sub_categories: [], + type: "subcategory", + }, + { + description: + "CMS policy analysis and research reports sent to Congress", + id: 19, + is_fr_doc_category: false, + name: "Reports to Congress", + order: 501, + show_if_empty: true, + sub_categories: [], + supplemental_content: [ + { + approved: true, + category: { + description: + "CMS policy analysis and research reports sent to Congress", + id: 19, + is_fr_doc_category: false, + name: "Reports to Congress", + order: 501, + show_if_empty: true, + type: "category", + }, + created_at: "2021-10-25 16:50:30.851000", + date: "2021", + description: + "Efforts to Improve the Quality of Health Care for Children and Adults Enrolled in Medicaid and the Children’s Health Insurance Program (CHIP) 2017-2019", + description_headline: null, + id: 277, + internalURL: "/supplemental_content/277/", + locations: [ + 670, 671, 40, 163, 181, 194, 185, 158, 200, 203, 79, 75, 8, + 110, 98, 99, 687, 372, 373, 376, 352, 638, 640, 36, 32, 51, + 399, 447, 448, 544, 554, 547, 566, 555, 169, 573, 598, 599, + ], + name: null, + name_headline: null, + type: "supplemental_content", + updated_at: "2022-05-20 15:26:04.496000", + url: "https://www.medicaid.gov/sites/default/files/2021-07/medicaid-chip-rtc-2017-2019.pdf", + }, + ], + type: "category", + }, + { + description: "Overview pages from HHS and CMS", + id: 133, + is_fr_doc_category: false, + name: "Informational Summaries", + order: 520, + show_if_empty: false, + sub_categories: [], + type: "category", + }, + { + description: "", + id: 25, + is_fr_doc_category: false, + name: "OIG Reports", + order: 550, + parent: { + description: + "Reports from HHS Office of Inspector General and U.S. Government Accountability Office", + id: 23, + is_fr_doc_category: false, + name: "Oversight Reports", + order: 600, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + sub_categories: [], + type: "subcategory", + }, + { + description: "HHS, CMS, and ASPE policy analysis and research reports", + id: 19, + is_fr_doc_category: false, + name: "Reports and Evaluations", + order: 550, + show_if_empty: true, + sub_categories: [], + type: "category", + }, + { + description: "", + id: 16, + is_fr_doc_category: false, + name: "Waiver Resources", + order: 600, + parent: { + description: + "State Technical Assistance, Toolkits, SPA/Waiver Resources", + id: 11, + is_fr_doc_category: false, + name: "Implementation Resources", + order: 500, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + sub_categories: [], + type: "subcategory", + }, + { + description: + "Reports from HHS Office of Inspector General and U.S. Government Accountability Office", + id: 23, + is_fr_doc_category: false, + name: "Oversight Reports", + order: 600, + show_if_empty: true, + sub_categories: [], + type: "category", + }, + { + description: "", + id: 24, + is_fr_doc_category: false, + name: "GAO Reports", + order: 601, + parent: { + description: + "Reports from HHS Office of Inspector General and U.S. Government Accountability Office", + id: 23, + is_fr_doc_category: false, + name: "Oversight Reports", + order: 600, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + sub_categories: [], + type: "subcategory", + }, + { + description: "HHS Departmental Appeals Board", + id: 134, + is_fr_doc_category: false, + name: "Appeals Decisions", + order: 650, + show_if_empty: false, + sub_categories: [], + type: "category", + }, + { + description: "Key abbreviations and definitions", + id: 17, + is_fr_doc_category: false, + name: "Terms", + order: 700, + show_if_empty: false, + sub_categories: [], + type: "category", + }, + { + description: "", + id: 69, + is_fr_doc_category: false, + name: "Other Reports", + order: 900, + parent: { + description: + "Reports from HHS Office of Inspector General and U.S. Government Accountability Office", + id: 23, + is_fr_doc_category: false, + name: "Oversight Reports", + order: 600, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + sub_categories: [], + type: "subcategory", + }, + { + description: "", + id: 68, + is_fr_doc_category: false, + name: "Other Resources", + order: 900, + parent: { + description: + "State Technical Assistance, Toolkits, SPA/Waiver Resources", + id: 11, + is_fr_doc_category: false, + name: "Implementation Resources", + order: 500, + show_if_empty: true, + type: "", + }, + show_if_empty: false, + sub_categories: [], + type: "subcategory", + }, +]; diff --git a/solution/ui/e2e/cypress/fixtures/42.433.10.public.json b/solution/ui/e2e/cypress/fixtures/42.433.10.public.json new file mode 100644 index 0000000000..c4546c11c4 --- /dev/null +++ b/solution/ui/e2e/cypress/fixtures/42.433.10.public.json @@ -0,0 +1,319 @@ +{ + "count": 64, + "next": null, + "previous": null, + "results": [ + { + "approved": true, + "category": { + "description": "", + "id": 6, + "is_fr_doc_category": false, + "name": "State Health Official (SHO) Letter", + "order": 200, + "parent": { + "description": "SMDLs, SHOs, CIBs, FAQs, SMM", + "id": 5, + "is_fr_doc_category": false, + "name": "Subregulatory Guidance", + "order": 400, + "show_if_empty": true, + "type": "" + }, + "show_if_empty": false, + "type": "subcategory" + }, + "created_at": "2022-01-04 11:34:42.959000", + "date": "2021-12-08", + "description": "RE: Medicaid Guidance on the Scope of and Payments for Qualifying Community-Based Mobile Crisis \r\nInterventionServices", + "description_headline": null, + "id": 242, + "internalURL": "/supplemental_content/242/", + "locations": [ + 671, + 14, + 200, + 332, + 380, + 360, + 36, + 26, + 27, + 44, + 51, + 73, + 17, + 18, + 405, + 392, + 428 + ], + "name": "SHO # 21-008", + "name_headline": null, + "type": "supplemental_content", + "updated_at": "2022-05-20 15:26:03.936000", + "url": "https://www.medicaid.gov/federal-policy-guidance/downloads/sho21008.pdf" + }, + { + "approved": true, + "category": { + "description": "", + "id": 13, + "is_fr_doc_category": false, + "name": "Technical Assistance for States", + "order": 200, + "parent": { + "description": "State Technical Assistance, Toolkits, SPA/Waiver Resources", + "id": 11, + "is_fr_doc_category": false, + "name": "Implementation Resources", + "order": 500, + "show_if_empty": true, + "type": "" + }, + "show_if_empty": false, + "type": "subcategory" + }, + "created_at": "2021-11-04 16:50:48.411000", + "date": "2021-11-03", + "description": "Medicaid, CHIP and BHP COVID-19 Vaccine Administration Coverage, Cost-Sharing, and Reimbursement Fact Sheet", + "description_headline": null, + "id": 1237, + "internalURL": "/supplemental_content/1237/", + "locations": [200, 36, 53, 405, 493, 573, 575, 610], + "name": null, + "name_headline": null, + "type": "supplemental_content", + "updated_at": "2022-05-20 15:26:20.684000", + "url": "https://www.medicaid.gov/state-resource-center/downloads/covid19-fact-sheet-11032021.pdf" + }, + { + "approved": true, + "category": { + "description": "", + "id": 6, + "is_fr_doc_category": false, + "name": "State Health Official (SHO) Letter", + "order": 200, + "parent": { + "description": "SMDLs, SHOs, CIBs, FAQs, SMM", + "id": 5, + "is_fr_doc_category": false, + "name": "Subregulatory Guidance", + "order": 400, + "show_if_empty": true, + "type": "" + }, + "show_if_empty": false, + "type": "subcategory" + }, + "created_at": "2021-10-25 16:50:39.768000", + "date": "2021-08-30", + "description": "RE: Temporary increases to FMAP under sections 9811, 9814, 9815, and 9821 of the ARP and administrative claiming for vaccine incentives", + "description_headline": null, + "id": 915, + "internalURL": "/supplemental_content/915/", + "locations": [ + 3, + 160, + 200, + 203, + 221, + 206, + 238, + 348, + 401, + 472, + 634, + 633, + 630, + 604, + 632, + 631 + ], + "name": "SHO# 21-004", + "name_headline": null, + "type": "supplemental_content", + "updated_at": "2022-05-20 15:26:15.367000", + "url": "https://www.medicaid.gov/federal-policy-guidance/downloads/sho-21-004.pdf" + }, + { + "approved": true, + "category": { + "description": "", + "id": 9, + "is_fr_doc_category": false, + "name": "CMCS Informational Bulletin (CIB)", + "order": 300, + "parent": { + "description": "SMDLs, SHOs, CIBs, FAQs, SMM", + "id": 5, + "is_fr_doc_category": false, + "name": "Subregulatory Guidance", + "order": 400, + "show_if_empty": true, + "type": "" + }, + "show_if_empty": false, + "type": "subcategory" + }, + "created_at": "2021-10-25 16:50:43.884000", + "date": "2021-06-03", + "description": "Medicaid, Children’s Health Insurance Program (CHIP), and Basic Health Program (BHP) Related Provisions in the American Rescue Plan Act of 2021", + "description_headline": null, + "id": 1267, + "internalURL": "/supplemental_content/1267/", + "locations": [ + 200, + 224, + 242, + 238, + 11, + 110, + 401, + 44, + 51, + 73, + 17, + 18, + 418, + 493, + 486 + ], + "name": null, + "name_headline": null, + "type": "supplemental_content", + "updated_at": "2022-05-20 15:26:21.180000", + "url": "https://www.medicaid.gov/federal-policy-guidance/downloads/cib060321.pdf" + }, + { + "approved": true, + "category": { + "description": "CMS policy analysis and research reports sent to Congress", + "id": 19, + "is_fr_doc_category": false, + "name": "Reports to Congress", + "order": 501, + "show_if_empty": true, + "type": "category" + }, + "created_at": "2021-10-25 16:50:30.851000", + "date": "2021", + "description": "Efforts to Improve the Quality of Health Care for Children and Adults Enrolled in Medicaid and the Children’s Health Insurance Program (CHIP) 2017-2019", + "description_headline": null, + "id": 277, + "internalURL": "/supplemental_content/277/", + "locations": [ + 670, + 671, + 40, + 163, + 181, + 194, + 185, + 158, + 200, + 203, + 79, + 75, + 8, + 110, + 98, + 99, + 687, + 372, + 373, + 376, + 352, + 638, + 640, + 36, + 32, + 51, + 399, + 447, + 448, + 544, + 554, + 547, + 566, + 555, + 169, + 573, + 598, + 599 + ], + "name": null, + "name_headline": null, + "type": "supplemental_content", + "updated_at": "2022-05-20 15:26:04.496000", + "url": "https://www.medicaid.gov/sites/default/files/2021-07/medicaid-chip-rtc-2017-2019.pdf" + }, + { + "approved": true, + "category": { + "description": "", + "id": 9, + "is_fr_doc_category": false, + "name": "CMCS Informational Bulletin (CIB)", + "order": 300, + "parent": { + "description": "SMDLs, SHOs, CIBs, FAQs, SMM", + "id": 5, + "is_fr_doc_category": false, + "name": "Subregulatory Guidance", + "order": 400, + "show_if_empty": true, + "type": "" + }, + "show_if_empty": false, + "type": "subcategory" + }, + "created_at": "2021-10-25 16:50:38.797000", + "date": "2019-11-27", + "description": "New Reporting Measures for Substance Use Disorder (SUD)-focused Health Homes", + "description_headline": null, + "id": 834, + "internalURL": "/supplemental_content/834/", + "locations": [200, 44], + "name": null, + "name_headline": null, + "type": "supplemental_content", + "updated_at": "2022-05-20 15:26:13.988000", + "url": "https://www.medicaid.gov/federal-policy-guidance/downloads/cib112719.pdf" + }, + { + "approved": true, + "category": { + "description": "", + "id": 9, + "is_fr_doc_category": false, + "name": "CMCS Informational Bulletin (CIB)", + "order": 300, + "parent": { + "description": "SMDLs, SHOs, CIBs, FAQs, SMM", + "id": 5, + "is_fr_doc_category": false, + "name": "Subregulatory Guidance", + "order": 400, + "show_if_empty": true, + "type": "" + }, + "show_if_empty": false, + "type": "subcategory" + }, + "created_at": "2021-10-25 16:50:30.601000", + "date": "2019-05-07", + "description": "Guidance for States on the Availability of an Extension of the Enhanced Federal Medical Assistance Percentage (FMAP) Period for Certain Medicaid Health Homes for Individuals with Substance Use Disorders (SUD)", + "description_headline": null, + "id": 245, + "internalURL": "/supplemental_content/245/", + "locations": [200], + "name": null, + "name_headline": null, + "type": "supplemental_content", + "updated_at": "2022-05-20 15:26:03.982000", + "url": "https://www.medicaid.gov/federal-policy-guidance/downloads/cib050719.pdf" + } + ] +} diff --git a/solution/ui/e2e/cypress/fixtures/categories-internal.json b/solution/ui/e2e/cypress/fixtures/categories-internal.json new file mode 100644 index 0000000000..b2e4b2d719 --- /dev/null +++ b/solution/ui/e2e/cypress/fixtures/categories-internal.json @@ -0,0 +1,50 @@ +[ + { + "id": 3, + "name": "test childless cat", + "description": "this category is childless.", + "order": 1, + "show_if_empty": true, + "type": "repositorycategory" + }, + { + "id": 2, + "name": "TestSubCat", + "description": "", + "order": 1, + "show_if_empty": false, + "type": "repositorysubcategory", + "parent": { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": false, + "type": "" + } + }, + { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": false, + "type": "repositorycategory" + }, + { + "id": 4, + "name": "TestSubCat 2", + "description": "", + "order": 2, + "show_if_empty": false, + "type": "repositorysubcategory", + "parent": { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 2, + "show_if_empty": false, + "type": "" + } + } +] diff --git a/solution/ui/regulations/css/scss/partials/_buttons_and_tooltip.scss b/solution/ui/regulations/css/scss/partials/_buttons_and_tooltip.scss index 9d3001c507..602493b260 100644 --- a/solution/ui/regulations/css/scss/partials/_buttons_and_tooltip.scss +++ b/solution/ui/regulations/css/scss/partials/_buttons_and_tooltip.scss @@ -4,6 +4,13 @@ @import "../application_settings"; +@mixin sidebar-hr-styles { + height: 1px; + background: $light_gray; + border: none; + margin: 15px 0; +} + .text-btn { border: none; background: none; @@ -210,7 +217,8 @@ &.reg-history-link-container { .tooltip.clicked { width: calc( - 80% - $spacer-2 - $spacer-2 - $collapsed-sidebar-width - 40px + 80% - $spacer-2 - $spacer-2 - $collapsed-sidebar-width - + 40px ); @include screen-sm { @@ -325,13 +333,11 @@ aside.right-sidebar { font-size: $font-size-xxs; } } + } - + hr { - height: 1px; - background: $light_gray; - border: none; - margin: 15px 0; - } + hr, + .authed__container + hr { + @include sidebar-hr-styles; } } diff --git a/solution/ui/regulations/css/scss/partials/_results_item.scss b/solution/ui/regulations/css/scss/partials/_results_item.scss index 6a5eb68aea..0cf2115649 100644 --- a/solution/ui/regulations/css/scss/partials/_results_item.scss +++ b/solution/ui/regulations/css/scss/partials/_results_item.scss @@ -19,18 +19,18 @@ padding: 2px 5px 3px; } +.doc-type__label { + @include common-label-styles; + + color: #FFF; + background: $mid_gray; +} + .category-labels { display: flex; flex-wrap: wrap; gap: 5px; - .doc-type__label { - @include common-label-styles; - - color: #FFF; - background: $mid_gray; - } - .result-label { @include common-label-styles; diff --git a/solution/ui/regulations/css/scss/partials/_sidebar_right.scss b/solution/ui/regulations/css/scss/partials/_sidebar_right.scss index edf20fe774..6066ff4805 100644 --- a/solution/ui/regulations/css/scss/partials/_sidebar_right.scss +++ b/solution/ui/regulations/css/scss/partials/_sidebar_right.scss @@ -35,6 +35,19 @@ aside.right-sidebar { margin-bottom: 0px !important; } + .div__login-sidebar { + background-color: $secondary_background_color; + border: 1px solid $border_color; + border-radius: 0.25rem; + padding: 0.5rem; + margin: 1rem 0; + } + + .label__container { + display: flex; + margin-top: 1rem; + } + #view-button { box-sizing: border-box; font-size: $base-font-size; @@ -216,3 +229,7 @@ button.collapsible-title { .bold { font-weight: 600; } + +.login__spacer { + margin-bottom: 75px; +} diff --git a/solution/ui/regulations/css/scss/partials/_supplemental_content.scss b/solution/ui/regulations/css/scss/partials/_supplemental_content.scss index 61f3271018..94abc944eb 100644 --- a/solution/ui/regulations/css/scss/partials/_supplemental_content.scss +++ b/solution/ui/regulations/css/scss/partials/_supplemental_content.scss @@ -147,7 +147,19 @@ } } +.internal-docs__container { + .supplemental-content-description > span { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 6px; + } +} + .supplemental-content-container + .supplemental-content-category + .category-content:not(.show-more-content), +.internal-docs__container .supplemental-content-category .category-content:not(.show-more-content) { margin-left: 10px; diff --git a/solution/ui/regulations/eregs-component-lib/package-lock.json b/solution/ui/regulations/eregs-component-lib/package-lock.json index a45dea9373..f4b944abff 100644 --- a/solution/ui/regulations/eregs-component-lib/package-lock.json +++ b/solution/ui/regulations/eregs-component-lib/package-lock.json @@ -11,6 +11,7 @@ "chokidar": "^3.5.3", "localforage": "^1.10.0", "lodash": "^4.17.21", + "mitt": "^3.0.1", "shelljs": "^0.8.5", "vite-plugin-css-injected-by-js": "^3.3.0", "vue": "^2.7.15", @@ -50,7 +51,6 @@ "cpu": [ "arm" ], - "dev": true, "optional": true, "os": [ "android" @@ -66,7 +66,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "android" @@ -82,7 +81,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "android" @@ -98,7 +96,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "darwin" @@ -114,7 +111,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "darwin" @@ -130,7 +126,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "freebsd" @@ -146,7 +141,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "freebsd" @@ -162,7 +156,6 @@ "cpu": [ "arm" ], - "dev": true, "optional": true, "os": [ "linux" @@ -178,7 +171,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -194,7 +186,6 @@ "cpu": [ "ia32" ], - "dev": true, "optional": true, "os": [ "linux" @@ -210,7 +201,6 @@ "cpu": [ "loong64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -226,7 +216,6 @@ "cpu": [ "mips64el" ], - "dev": true, "optional": true, "os": [ "linux" @@ -242,7 +231,6 @@ "cpu": [ "ppc64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -258,7 +246,6 @@ "cpu": [ "riscv64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -274,7 +261,6 @@ "cpu": [ "s390x" ], - "dev": true, "optional": true, "os": [ "linux" @@ -290,7 +276,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -306,7 +291,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "netbsd" @@ -322,7 +306,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "openbsd" @@ -338,7 +321,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "sunos" @@ -354,7 +336,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "win32" @@ -370,7 +351,6 @@ "cpu": [ "ia32" ], - "dev": true, "optional": true, "os": [ "win32" @@ -386,7 +366,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "win32" @@ -465,7 +444,6 @@ "cpu": [ "arm" ], - "dev": true, "optional": true, "os": [ "android" @@ -478,7 +456,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "android" @@ -491,7 +468,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "darwin" @@ -504,7 +480,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "darwin" @@ -517,7 +492,6 @@ "cpu": [ "arm" ], - "dev": true, "optional": true, "os": [ "linux" @@ -530,7 +504,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -543,7 +516,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -556,7 +528,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -569,7 +540,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -582,7 +552,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "win32" @@ -595,7 +564,6 @@ "cpu": [ "ia32" ], - "dev": true, "optional": true, "os": [ "win32" @@ -608,7 +576,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "win32" @@ -757,7 +724,6 @@ "version": "0.19.6", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.6.tgz", "integrity": "sha512-Xl7dntjA2OEIvpr9j0DVxxnog2fyTGnyVoQXAMQI6eR3mf9zCQds7VIKUDCotDgE/p4ncTgeRqgX8t5d6oP4Gw==", - "dev": true, "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" @@ -1077,6 +1043,11 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/mitt": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", + "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==" + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -1244,7 +1215,6 @@ "version": "4.5.0", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.5.0.tgz", "integrity": "sha512-41xsWhzxqjMDASCxH5ibw1mXk+3c4TNI2UjKbLxe6iEzrSQnqOzmmK8/3mufCPbzHNJ2e04Fc1ddI35hHy+8zg==", - "dev": true, "bin": { "rollup": "dist/bin/rollup" }, @@ -1398,7 +1368,6 @@ "version": "5.0.5", "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.5.tgz", "integrity": "sha512-OekeWqR9Ls56f3zd4CaxzbbS11gqYkEiBtnWFFgYR2WV8oPJRRKq0mpskYy/XaoCL3L7VINDhqqOMNDiYdGvGg==", - "dev": true, "dependencies": { "esbuild": "^0.19.3", "postcss": "^8.4.32", diff --git a/solution/ui/regulations/eregs-component-lib/package.json b/solution/ui/regulations/eregs-component-lib/package.json index 1ab1328cdc..523113b01e 100644 --- a/solution/ui/regulations/eregs-component-lib/package.json +++ b/solution/ui/regulations/eregs-component-lib/package.json @@ -14,6 +14,7 @@ "chokidar": "^3.5.3", "localforage": "^1.10.0", "lodash": "^4.17.21", + "mitt": "^3.0.1", "shelljs": "^0.8.5", "vite-plugin-css-injected-by-js": "^3.3.0", "vue": "^2.7.15", diff --git a/solution/ui/regulations/eregs-component-lib/src/components/BlockingModal.vue b/solution/ui/regulations/eregs-component-lib/src/components/BlockingModal.vue index 10a9357e7b..dcfc7abb95 100644 --- a/solution/ui/regulations/eregs-component-lib/src/components/BlockingModal.vue +++ b/solution/ui/regulations/eregs-component-lib/src/components/BlockingModal.vue @@ -38,6 +38,7 @@ diff --git a/solution/ui/regulations/eregs-component-lib/src/components/ViewResourcesLink.vue b/solution/ui/regulations/eregs-component-lib/src/components/ViewResourcesLink.vue index 106e12c61d..4a34e3e1cd 100644 --- a/solution/ui/regulations/eregs-component-lib/src/components/ViewResourcesLink.vue +++ b/solution/ui/regulations/eregs-component-lib/src/components/ViewResourcesLink.vue @@ -19,6 +19,7 @@ + + + + diff --git a/solution/ui/regulations/eregs-component-lib/src/components/shared-components/results-item-parts/DocTypeLabel.test.js b/solution/ui/regulations/eregs-component-lib/src/components/shared-components/results-item-parts/DocTypeLabel.test.js index 6a22825145..a5972e628c 100644 --- a/solution/ui/regulations/eregs-component-lib/src/components/shared-components/results-item-parts/DocTypeLabel.test.js +++ b/solution/ui/regulations/eregs-component-lib/src/components/shared-components/results-item-parts/DocTypeLabel.test.js @@ -7,8 +7,8 @@ describe("Public/Private label", () => { it("Renders a Public Label", async () => { const wrapper = render(DocTypeLabel, { props: { - iconType: "users", - docType: "External", + iconType: "external", + docType: "Public", }, }); @@ -18,7 +18,7 @@ describe("Public/Private label", () => { it("Renders a Private Label", async () => { const wrapper = render(DocTypeLabel, { props: { - iconType: "key", + iconType: "internal", docType: "Internal", }, }); diff --git a/solution/ui/regulations/eregs-component-lib/src/components/shared-components/results-item-parts/__snapshots__/DocTypeLabel.test.js.snap b/solution/ui/regulations/eregs-component-lib/src/components/shared-components/results-item-parts/__snapshots__/DocTypeLabel.test.js.snap index 0835ad1b41..7e98f5729d 100644 --- a/solution/ui/regulations/eregs-component-lib/src/components/shared-components/results-item-parts/__snapshots__/DocTypeLabel.test.js.snap +++ b/solution/ui/regulations/eregs-component-lib/src/components/shared-components/results-item-parts/__snapshots__/DocTypeLabel.test.js.snap @@ -8,7 +8,7 @@ exports[`Public/Private label > Renders a Private Label 1`] = ` class="doc-type__label" > Internal @@ -19,7 +19,7 @@ exports[`Public/Private label > Renders a Private Label 1`] = ` class="doc-type__label" > Internal @@ -89,9 +89,9 @@ exports[`Public/Private label > Renders a Public Label 1`] = ` class="doc-type__label" > - External + Public , @@ -100,9 +100,9 @@ exports[`Public/Private label > Renders a Public Label 1`] = ` class="doc-type__label" > - External + Public , "debug": [Function], diff --git a/solution/ui/regulations/eregs-component-lib/src/eventbus/index.js b/solution/ui/regulations/eregs-component-lib/src/eventbus/index.js new file mode 100644 index 0000000000..3470ab0a26 --- /dev/null +++ b/solution/ui/regulations/eregs-component-lib/src/eventbus/index.js @@ -0,0 +1,3 @@ +import mitt from "mitt"; + +export default mitt(); diff --git a/solution/ui/regulations/eregs-component-lib/src/main.js b/solution/ui/regulations/eregs-component-lib/src/main.js index a382b0db8c..f501d3799d 100644 --- a/solution/ui/regulations/eregs-component-lib/src/main.js +++ b/solution/ui/regulations/eregs-component-lib/src/main.js @@ -8,6 +8,7 @@ import { CollapseButton, Collapsible, CopyCitation, + DocTypeLabel, Dropdown, DropdownContent, DropdownHeader, @@ -18,6 +19,7 @@ import { HeaderLinks, HeaderSearch, IFrameContainer, + InternalDocsContainer, JumpTo, CategoryLabel, LastParserSuccessDate, @@ -46,7 +48,12 @@ import { } from "../dist/eregs-components.es"; import { goToVersion } from "./go-to-version"; -import { highlightText, getQueryParam, scrollToElement } from "utilities/utils"; +import { + highlightText, + getCurrentSectionFromHash, + getQueryParam, + scrollToElement, +} from "utilities/utils"; import Clickaway from "../../eregs-vite/src/directives/clickaway"; @@ -117,15 +124,9 @@ function deactivateAllTOCLinks() { }); } -function getCurrentSectionFromHash() { - const hash = window.location.hash.substring(1); - const citations = hash.split("-"); - return citations.slice(0, 2).join("-"); -} - function activateTOCLink() { deactivateAllTOCLinks(); - const section = getCurrentSectionFromHash(); + const section = getCurrentSectionFromHash(window.location.hash); const el = document.querySelector(`[data-section-id='${section}']`); if (!el) return; @@ -201,6 +202,7 @@ function main() { CollapseButton, Collapsible, CopyCitation, + DocTypeLabel, Dropdown, DropdownContent, DropdownHeader, @@ -211,6 +213,7 @@ function main() { HeaderLinks, HeaderSearch, IFrameContainer, + InternalDocsContainer, JumpTo, CategoryLabel, LastParserSuccessDate, diff --git a/solution/ui/regulations/eregs-vite/src/components/policy-repository/PolicyResults.test.js b/solution/ui/regulations/eregs-vite/src/components/policy-repository/PolicyResults.test.js index 02165b0c94..41148e0f66 100644 --- a/solution/ui/regulations/eregs-vite/src/components/policy-repository/PolicyResults.test.js +++ b/solution/ui/regulations/eregs-vite/src/components/policy-repository/PolicyResults.test.js @@ -99,18 +99,6 @@ describe("addSurroundingEllipses", () => { }); }); -describe("getFileTypeButton", () => { - it("is a DOCX file", async () => { - expect(PolicyResults.getFileTypeButton(MOCK_RESULTS[0])).toBe( - "Download DOCX" - ); - }); - - it("is a PDF file", async () => { - expect(PolicyResults.getFileTypeButton(MOCK_RESULTS[4])).toBe(""); - }); -}); - describe("getResultLinkText", () => { it("is internal and has a document_name_headline", async () => { expect(PolicyResults.getResultLinkText(MOCK_RESULTS[1])).toBe( diff --git a/solution/ui/regulations/eregs-vite/src/components/policy-repository/PolicyResults.vue b/solution/ui/regulations/eregs-vite/src/components/policy-repository/PolicyResults.vue index 9a45c055a9..51451b9467 100644 --- a/solution/ui/regulations/eregs-vite/src/components/policy-repository/PolicyResults.vue +++ b/solution/ui/regulations/eregs-vite/src/components/policy-repository/PolicyResults.vue @@ -5,7 +5,7 @@ import { useRoute } from "vue-router/composables"; import _isEmpty from "lodash/isEmpty"; import { formatDate } from "utilities/filters"; -import { getFileNameSuffix, DOCUMENT_TYPES_MAP } from "utilities/utils"; +import { getFileTypeButton, DOCUMENT_TYPES_MAP } from "utilities/utils"; import CategoryLabel from "sharedComponents/results-item-parts/CategoryLabel.vue"; import DocTypeLabel from "sharedComponents/results-item-parts/DocTypeLabel.vue"; @@ -33,19 +33,6 @@ const getResultLinkText = (item) => { return `${linkText}`; }; -const getFileTypeButton = (item) => { - const fileTypeSuffix = getFileNameSuffix(item.file_name_string); - - let fileTypeButton; - if (item.file_name_string && fileTypeSuffix) { - fileTypeButton = `Download ${fileTypeSuffix.toUpperCase()}`; - } - - return `${fileTypeButton ?? ""}`; -}; - const showResultSnippet = (item) => { if ( item.resource_type === "internal" && @@ -86,7 +73,6 @@ const getResultSnippet = (item) => { export default { addSurroundingEllipses, - getFileTypeButton, getResultLinkText, getResultSnippet, showResultSnippet, @@ -205,7 +191,13 @@ const resultLinkClasses = (doc) => ({ rel="noopener noreferrer" class="document__link document__link--filename" :class="resultLinkClasses(doc)" - v-html="getResultLinkText(doc) + getFileTypeButton(doc)" + v-html=" + getResultLinkText(doc) + + getFileTypeButton({ + fileName: doc.file_name_string, + url: doc.url, + }) + " >