Skip to content

Commit

Permalink
fix: adding SMS App url to config so makes changing from staging to m…
Browse files Browse the repository at this point in the history
…aster easy
  • Loading branch information
hurshd0 committed Apr 20, 2020
1 parent 9b06b74 commit 025d86f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions ncov19_dash/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
class DataReadingError(Exception):
"""DataReadingError exception used for sanity checking.
"""

def __init__(self, *args):
super(DataReadingError, self).__init__(*args)
if args:
Expand Down Expand Up @@ -58,6 +59,9 @@ class StagingConfig:
# Drive Thru Facilities
DRIVE_THRU_URL = config("DRIVE_THRU_STAGING_URL")

# SMS App URL
SMS_APP_URL = config("SMS_APP_URL")


class ProductionConfig(StagingConfig):
"""Uses production database server."""
Expand Down Expand Up @@ -87,5 +91,6 @@ def get_config():

return ProductionConfig


config = get_config()
# print(f"[DEBUG] Config being used is: {config.__class__.__name__}")
4 changes: 2 additions & 2 deletions ncov19_dash/layout/desktop_nav.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import dash_bootstrap_components as dbc
import dash_html_components as html

from ncov19_dash import config

dropdown_bar = dbc.Row(
dbc.DropdownMenu(label="Location", children=[dbc.DropdownMenuItem("US"),]),
Expand Down Expand Up @@ -29,7 +29,7 @@
html.A(
"Get Mobile Updates",
className="navbar-brand-links",
href="https://ncov19-sms-bot-fe-staging.herokuapp.com/",
href=config.SMS_APP_URL,
id="get-mobile-updates",
),
# html.A(
Expand Down
4 changes: 2 additions & 2 deletions ncov19_dash/layout/mobile_nav.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import dash_bootstrap_components as dbc
import dash_html_components as html

from ncov19_dash import config

mobile_navbar = [
# User row and col to control vertical alignment of logo/brand
Expand Down Expand Up @@ -32,7 +32,7 @@
html.A(
html.P("Get Mobile Updates", className="mobile-nav-header"),
className="mobile-hidden-menu-anchor-tag",
href="https://ncov19-sms-bot-fe-staging.herokuapp.com/",
href=config.SMS_APP_URL,
),
html.A(
html.P("About", className="mobile-nav-header",),
Expand Down

0 comments on commit 025d86f

Please sign in to comment.