mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-06 01:58:24 -04:00
added feature flag
This commit is contained in:
@@ -161,7 +161,7 @@
|
|||||||
"filename": "app/config.py",
|
"filename": "app/config.py",
|
||||||
"hashed_secret": "577a4c667e4af8682ca431857214b3a920883efc",
|
"hashed_secret": "577a4c667e4af8682ca431857214b3a920883efc",
|
||||||
"is_verified": false,
|
"is_verified": false,
|
||||||
"line_number": 118,
|
"line_number": 123,
|
||||||
"is_secret": false
|
"is_secret": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -634,5 +634,5 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"generated_at": "2025-10-07T17:43:26Z"
|
"generated_at": "2025-10-14T19:37:07Z"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,6 +78,8 @@ class Config(object):
|
|||||||
# TODO: reassign this
|
# TODO: reassign this
|
||||||
NOTIFY_SERVICE_ID = "d6aa2c68-a2d9-4437-ab19-3ae8eb202553"
|
NOTIFY_SERVICE_ID = "d6aa2c68-a2d9-4437-ab19-3ae8eb202553"
|
||||||
|
|
||||||
|
ORGANIZATION_DASHBOARD_ENABLED = getenv("ORGANIZATION_DASHBOARD_ENABLED", "False") == "True"
|
||||||
|
|
||||||
NOTIFY_BILLING_DETAILS = json.loads(getenv("NOTIFY_BILLING_DETAILS") or "null") or {
|
NOTIFY_BILLING_DETAILS = json.loads(getenv("NOTIFY_BILLING_DETAILS") or "null") or {
|
||||||
"account_number": "98765432",
|
"account_number": "98765432",
|
||||||
"sort_code": "01-23-45",
|
"sort_code": "01-23-45",
|
||||||
@@ -109,6 +111,9 @@ class Development(Config):
|
|||||||
ASSET_PATH = "/static/"
|
ASSET_PATH = "/static/"
|
||||||
NOTIFY_LOG_LEVEL = "DEBUG"
|
NOTIFY_LOG_LEVEL = "DEBUG"
|
||||||
|
|
||||||
|
# Feature Flags - Enable in development for testing
|
||||||
|
ORGANIZATION_DASHBOARD_ENABLED = getenv("ORGANIZATION_DASHBOARD_ENABLED", "True") == "True"
|
||||||
|
|
||||||
# Buckets
|
# Buckets
|
||||||
CSV_UPLOAD_BUCKET = _s3_credentials_from_env("CSV")
|
CSV_UPLOAD_BUCKET = _s3_credentials_from_env("CSV")
|
||||||
LOGO_UPLOAD_BUCKET = _s3_credentials_from_env("LOGO")
|
LOGO_UPLOAD_BUCKET = _s3_credentials_from_env("LOGO")
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ from collections import OrderedDict
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
from flask import flash, redirect, render_template, request, url_for
|
from flask import current_app, flash, redirect, render_template, request, url_for
|
||||||
from flask_login import current_user
|
from flask_login import current_user
|
||||||
|
|
||||||
from app import (
|
from app import (
|
||||||
@@ -70,6 +70,9 @@ def add_organization():
|
|||||||
@main.route("/organizations/<uuid:org_id>", methods=["GET"])
|
@main.route("/organizations/<uuid:org_id>", methods=["GET"])
|
||||||
@user_has_permissions()
|
@user_has_permissions()
|
||||||
def organization_dashboard(org_id):
|
def organization_dashboard(org_id):
|
||||||
|
if not current_app.config.get("ORGANIZATION_DASHBOARD_ENABLED", False):
|
||||||
|
return redirect(url_for(".organization_usage", org_id=org_id))
|
||||||
|
|
||||||
year, current_financial_year = requested_and_current_financial_year(request)
|
year, current_financial_year = requested_and_current_financial_year(request)
|
||||||
services = current_organization.services_and_usage(financial_year=year)["services"]
|
services = current_organization.services_and_usage(financial_year=year)["services"]
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
<nav id="nav-org-nav" aria-label="Organization navigation" class="nav margin-bottom-4">
|
<nav id="nav-org-nav" aria-label="Organization navigation" class="nav margin-bottom-4">
|
||||||
<ul class="usa-sidenav">
|
<ul class="usa-sidenav">
|
||||||
|
{% if config.ORGANIZATION_DASHBOARD_ENABLED %}
|
||||||
<li class="usa-sidenav__item"><a class="usa-link{{ org_navigation.is_selected('dashboard') }}" href="{{ url_for('.organization_dashboard', org_id=current_org.id) }}">Dashboard</a></li>
|
<li class="usa-sidenav__item"><a class="usa-link{{ org_navigation.is_selected('dashboard') }}" href="{{ url_for('.organization_dashboard', org_id=current_org.id) }}">Dashboard</a></li>
|
||||||
|
{% endif %}
|
||||||
<li class="usa-sidenav__item"><a class="usa-link{{ org_navigation.is_selected('usage') }}" href="{{ url_for('.organization_usage', org_id=current_org.id) }}">Usage</a></li>
|
<li class="usa-sidenav__item"><a class="usa-link{{ org_navigation.is_selected('usage') }}" href="{{ url_for('.organization_usage', org_id=current_org.id) }}">Usage</a></li>
|
||||||
<li class="usa-sidenav__item"><a class="usa-link{{ org_navigation.is_selected('team-members') }}" href="{{ url_for('.manage_org_users', org_id=current_org.id) }}">Team members</a></li>
|
<li class="usa-sidenav__item"><a class="usa-link{{ org_navigation.is_selected('team-members') }}" href="{{ url_for('.manage_org_users', org_id=current_org.id) }}">Team members</a></li>
|
||||||
{% if current_user.platform_admin %}
|
{% if current_user.platform_admin %}
|
||||||
|
|||||||
@@ -8,3 +8,4 @@ redis_enabled: 1
|
|||||||
nr_agent_id: '1134302465'
|
nr_agent_id: '1134302465'
|
||||||
nr_app_id: '1083160688'
|
nr_app_id: '1083160688'
|
||||||
API_PUBLIC_URL: https://notify-api-demo.app.cloud.gov
|
API_PUBLIC_URL: https://notify-api-demo.app.cloud.gov
|
||||||
|
ORGANIZATION_DASHBOARD_ENABLED: False
|
||||||
|
|||||||
@@ -8,3 +8,4 @@ redis_enabled: 1
|
|||||||
nr_agent_id: '1050708682'
|
nr_agent_id: '1050708682'
|
||||||
nr_app_id: '1050708682'
|
nr_app_id: '1050708682'
|
||||||
API_PUBLIC_URL: https://notify-api-production.app.cloud.gov
|
API_PUBLIC_URL: https://notify-api-production.app.cloud.gov
|
||||||
|
ORGANIZATION_DASHBOARD_ENABLED: False
|
||||||
|
|||||||
@@ -12,3 +12,4 @@ SECRET_KEY: sandbox-notify-secret-key
|
|||||||
nr_agent_id: ''
|
nr_agent_id: ''
|
||||||
nr_app_id: ''
|
nr_app_id: ''
|
||||||
NR_BROWSER_KEY: ''
|
NR_BROWSER_KEY: ''
|
||||||
|
ORGANIZATION_DASHBOARD_ENABLED: False
|
||||||
|
|||||||
@@ -8,3 +8,4 @@ redis_enabled: 1
|
|||||||
nr_agent_id: '1134291385'
|
nr_agent_id: '1134291385'
|
||||||
nr_app_id: '1031640326'
|
nr_app_id: '1031640326'
|
||||||
API_PUBLIC_URL: https://notify-api-staging.app.cloud.gov
|
API_PUBLIC_URL: https://notify-api-staging.app.cloud.gov
|
||||||
|
ORGANIZATION_DASHBOARD_ENABLED: True
|
||||||
|
|||||||
@@ -63,3 +63,5 @@ applications:
|
|||||||
LOGIN_DOT_GOV_CERTS_URL: ((LOGIN_DOT_GOV_CERTS_URL))
|
LOGIN_DOT_GOV_CERTS_URL: ((LOGIN_DOT_GOV_CERTS_URL))
|
||||||
|
|
||||||
API_PUBLIC_URL: ((API_PUBLIC_URL))
|
API_PUBLIC_URL: ((API_PUBLIC_URL))
|
||||||
|
|
||||||
|
ORGANIZATION_DASHBOARD_ENABLED: ((ORGANIZATION_DASHBOARD_ENABLED))
|
||||||
|
|||||||
Reference in New Issue
Block a user