toggle off requests workflow with config option
This commit is contained in:
parent
e0ba35324d
commit
3415436f54
@ -64,9 +64,12 @@ def make_app(config):
|
|||||||
make_error_pages(app)
|
make_error_pages(app)
|
||||||
app.register_blueprint(bp)
|
app.register_blueprint(bp)
|
||||||
app.register_blueprint(workspace_routes)
|
app.register_blueprint(workspace_routes)
|
||||||
app.register_blueprint(requests_bp)
|
|
||||||
app.register_blueprint(task_orders_bp)
|
app.register_blueprint(task_orders_bp)
|
||||||
app.register_blueprint(user_routes)
|
app.register_blueprint(user_routes)
|
||||||
|
|
||||||
|
if app.config.get("REQUESTS_WORKFLOW"):
|
||||||
|
app.register_blueprint(requests_bp)
|
||||||
|
|
||||||
if ENV != "prod":
|
if ENV != "prod":
|
||||||
app.register_blueprint(dev_routes)
|
app.register_blueprint(dev_routes)
|
||||||
|
|
||||||
@ -131,6 +134,7 @@ def map_config(config):
|
|||||||
"REQUIRE_CRLS": config.getboolean("default", "REQUIRE_CRLS"),
|
"REQUIRE_CRLS": config.getboolean("default", "REQUIRE_CRLS"),
|
||||||
"RQ_REDIS_URL": config["default"]["REDIS_URI"],
|
"RQ_REDIS_URL": config["default"]["REDIS_URI"],
|
||||||
"RQ_QUEUES": [config["default"]["RQ_QUEUES"]],
|
"RQ_QUEUES": [config["default"]["RQ_QUEUES"]],
|
||||||
|
"REQUESTS_WORKFLOW": config.getboolean("default", "REQUESTS_WORKFLOW"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,13 +48,19 @@ def helpdocs(doc=None):
|
|||||||
def home():
|
def home():
|
||||||
user = g.current_user
|
user = g.current_user
|
||||||
|
|
||||||
|
resource_index = (
|
||||||
|
"requests.requests_index"
|
||||||
|
if app.config.get("REQUESTS_WORKFLOW")
|
||||||
|
else "workspaces.workspaces"
|
||||||
|
)
|
||||||
|
|
||||||
if user.atat_role_name == "ccpo":
|
if user.atat_role_name == "ccpo":
|
||||||
return redirect(url_for("requests.requests_index"))
|
return redirect(url_for(resource_index))
|
||||||
|
|
||||||
num_workspaces = len(user.workspace_roles)
|
num_workspaces = len(user.workspace_roles)
|
||||||
|
|
||||||
if num_workspaces == 0:
|
if num_workspaces == 0:
|
||||||
return redirect(url_for("requests.requests_index"))
|
return redirect(url_for(resource_index))
|
||||||
elif num_workspaces == 1:
|
elif num_workspaces == 1:
|
||||||
workspace_role = user.workspace_roles[0]
|
workspace_role = user.workspace_roles[0]
|
||||||
workspace_id = workspace_role.workspace.id
|
workspace_id = workspace_role.workspace.id
|
||||||
|
@ -25,3 +25,4 @@ SESSION_USE_SIGNER = True
|
|||||||
STORAGE_CONTAINER=uploads
|
STORAGE_CONTAINER=uploads
|
||||||
STORAGE_PROVIDER=LOCAL
|
STORAGE_PROVIDER=LOCAL
|
||||||
WTF_CSRF_ENABLED = true
|
WTF_CSRF_ENABLED = true
|
||||||
|
REQUESTS_WORKFLOW=false
|
||||||
|
@ -4,3 +4,4 @@ PGDATABASE = atat_test
|
|||||||
REDIS_URI = redis://redishost:6379
|
REDIS_URI = redis://redishost:6379
|
||||||
CRL_DIRECTORY = tests/fixtures/crl
|
CRL_DIRECTORY = tests/fixtures/crl
|
||||||
WTF_CSRF_ENABLED = false
|
WTF_CSRF_ENABLED = false
|
||||||
|
REQUESTS_WORKFLOW=true
|
||||||
|
@ -4,3 +4,4 @@ PGDATABASE = atat_test
|
|||||||
CRL_DIRECTORY = tests/fixtures/crl
|
CRL_DIRECTORY = tests/fixtures/crl
|
||||||
WTF_CSRF_ENABLED = false
|
WTF_CSRF_ENABLED = false
|
||||||
STORAGE_PROVIDER=LOCAL
|
STORAGE_PROVIDER=LOCAL
|
||||||
|
REQUESTS_WORKFLOW=true
|
||||||
|
@ -2,14 +2,16 @@
|
|||||||
|
|
||||||
<div class="global-navigation sidenav {% if workspace %}global-navigation__context--workspace{% endif %}">
|
<div class="global-navigation sidenav {% if workspace %}global-navigation__context--workspace{% endif %}">
|
||||||
<ul>
|
<ul>
|
||||||
{{ SidenavItem("Requests",
|
{% if config.get("REQUESTS_WORKFLOW") %}
|
||||||
href="/requests",
|
{{ SidenavItem("Requests",
|
||||||
icon="document",
|
href="/requests",
|
||||||
active=g.matchesPath('/requests'),
|
icon="document",
|
||||||
subnav=[
|
active=g.matchesPath('/requests'),
|
||||||
{"label":"New Request", "href":url_for("requests.requests_form_new", screen=1), "icon": "plus", "active": g.matchesPath('/requests/new')},
|
subnav=[
|
||||||
]
|
{"label":"New Request", "href":url_for("requests.requests_form_new", screen=1), "icon": "plus", "active": g.matchesPath('/requests/new')},
|
||||||
) }}
|
]
|
||||||
|
) }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{{ SidenavItem("New Task Order",
|
{{ SidenavItem("New Task Order",
|
||||||
href=url_for("task_orders.new", screen=1),
|
href=url_for("task_orders.new", screen=1),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user