mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-07 18:08:52 -04:00
Merge pull request #2162 from GSA/2161-toggle-side-nav-items-when-featured-flag-is-onoff
making sub nav items conditional based on feature flag
This commit is contained in:
@@ -292,7 +292,6 @@ def benchmark_performance():
|
||||
)
|
||||
|
||||
|
||||
@main.route("/using-notify/guidance")
|
||||
@main.route("/guides/using-notify/guidance")
|
||||
@user_is_logged_in
|
||||
def guidance_index():
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
from flask import current_app
|
||||
|
||||
|
||||
def features_nav():
|
||||
return [
|
||||
{
|
||||
@@ -22,46 +25,20 @@ def features_nav():
|
||||
|
||||
|
||||
def using_notify_nav():
|
||||
return [
|
||||
{
|
||||
"name": "Get started",
|
||||
"link": "main.get_started",
|
||||
},
|
||||
{
|
||||
"name": "Guides",
|
||||
"link": "main.best_practices",
|
||||
},
|
||||
{
|
||||
"name": "Trial mode",
|
||||
"link": "main.trial_mode_new",
|
||||
},
|
||||
{
|
||||
"name": "Tracking usage",
|
||||
"link": "main.pricing",
|
||||
},
|
||||
{
|
||||
"name": "Delivery status",
|
||||
"link": "main.message_status",
|
||||
},
|
||||
{
|
||||
"name": "Guidance",
|
||||
"link": "main.guidance_index",
|
||||
# "sub_navigation_items": [
|
||||
# {
|
||||
# "name": "Formatting",
|
||||
# "link": "main.edit_and_format_messages",
|
||||
# },
|
||||
# {
|
||||
# "name": "Send files by email",
|
||||
# "link": "main.send_files_by_email",
|
||||
# },
|
||||
# ]
|
||||
# {
|
||||
# "name": "API documentation",
|
||||
# "link": "main.documentation",
|
||||
# },
|
||||
},
|
||||
nav_items = [
|
||||
{"name": "Get started", "link": "main.get_started"},
|
||||
{"name": "Guides", "link": "main.best_practices"},
|
||||
{"name": "Trial mode", "link": "main.trial_mode_new"},
|
||||
{"name": "Tracking usage", "link": "main.pricing"},
|
||||
{"name": "Delivery Status", "link": "main.message_status"},
|
||||
{"name": "Guidance", "link": "main.guidance_index"},
|
||||
]
|
||||
if not current_app.config.get("FEATURE_BEST_PRACTICES_ENABLED"):
|
||||
nav_items = [
|
||||
item for item in nav_items if item["link"] != "main.best_practices"
|
||||
]
|
||||
|
||||
return nav_items
|
||||
|
||||
|
||||
def best_practices_nav():
|
||||
|
||||
@@ -11,7 +11,7 @@ E2E_TEST_URI = os.getenv("NOTIFY_E2E_TEST_URI")
|
||||
def test_best_practices_side_menu(authenticated_page):
|
||||
page = authenticated_page
|
||||
|
||||
page.goto(f"{E2E_TEST_URI}/best-practices")
|
||||
page.goto(f"{E2E_TEST_URI}/guides/best-practices")
|
||||
|
||||
page.wait_for_load_state("domcontentloaded")
|
||||
check_axe_report(page)
|
||||
@@ -58,7 +58,7 @@ def test_best_practices_side_menu(authenticated_page):
|
||||
def test_breadcrumbs_best_practices(authenticated_page):
|
||||
page = authenticated_page
|
||||
|
||||
page.goto(f"{E2E_TEST_URI}/best-practices")
|
||||
page.goto(f"{E2E_TEST_URI}/guides/best-practices")
|
||||
|
||||
page.wait_for_load_state("domcontentloaded")
|
||||
check_axe_report(page)
|
||||
|
||||
2
urls.js
2
urls.js
@@ -8,7 +8,7 @@ const sublinks = [
|
||||
{ label: 'Trial Mode', path: '/using-notify/trial-mode' },
|
||||
{ label: 'Pricing', path: '/using-notify/pricing' },
|
||||
{ label: 'Delivery Status', path: '/using-notify/delivery-status' },
|
||||
{ label: 'Guidance', path: '/using-notify/guidance' },
|
||||
{ label: 'Guidance', path: '/guides/using-notify/guidance' },
|
||||
{ label: 'Features', path: '/features' },
|
||||
{ label: 'Roadmap', path: '/features/roadmap' },
|
||||
{ label: 'Security', path: '/features/security' },
|
||||
|
||||
Reference in New Issue
Block a user