mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-22 17:08:44 -04:00
making sub nav items conditional 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,7 @@
|
||||
from flask import (
|
||||
current_app,
|
||||
)
|
||||
|
||||
def features_nav():
|
||||
return [
|
||||
{
|
||||
@@ -22,46 +26,19 @@ 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():
|
||||
|
||||
Reference in New Issue
Block a user