Skip to content

Commit bed7f32

Browse files
authored
Merge pull request #16 from danyoungday/misc-cleanup
Some miscellaneous cleanup before deployment
2 parents e137a6b + a4efb30 commit bed7f32

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

app/components/context.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def create_context_div(self):
164164
dbc.Button(
165165
"AI Generate Policies for Scenario",
166166
id="presc-button",
167-
className="me-1 mb-2",
167+
className="me-1 mb-2 w-25",
168168
n_clicks=0
169169
)
170170
]
@@ -229,3 +229,29 @@ def update_ssp_desc(*context_values):
229229
html.H4("Custom Scenario Selected")
230230
]
231231
)
232+
233+
@app.callback(
234+
Output("presc-button", "disabled", allow_duplicate=True),
235+
Output("presc-button", "children", allow_duplicate=True),
236+
Output("presc-button", "color", allow_duplicate=True),
237+
Input("presc-button", "n_clicks"),
238+
prevent_initial_call=True
239+
)
240+
def disable_button(n_clicks):
241+
"""
242+
Disables the button after it is clicked and displays a loading message.
243+
"""
244+
return n_clicks > 0, "Please wait...", "warning"
245+
246+
@app.callback(
247+
Output("presc-button", "disabled", allow_duplicate=True),
248+
Output("presc-button", "children", allow_duplicate=True),
249+
Output("presc-button", "color", allow_duplicate=True),
250+
Input("reset-button", "disabled"),
251+
prevent_initial_call=True
252+
)
253+
def enable_button(reset_disabled):
254+
"""
255+
Enables the button when the filtering is done and resets it.
256+
"""
257+
return False, "AI Generate Policies for Scenario", "primary"

app/components/intro.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def create_intro_div(self):
4949
)
5050
),
5151
dbc.Row(
52-
style={"height": "60vh"}
52+
style={"height": "70vh"}
5353
),
5454
dbc.Row(
5555
html.P("Get Started:", className="w-50 text-center mx-auto text-white h4")

app/components/references.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def create_references_div(self):
3030
aspx")
3131
]),
3232
html.P([
33-
"Project Resilience is a collaboration between the United Nations and Cognizant Advanced \
33+
"Project Resilience is a collaboration between the United Nations and Cognizant \
3434
AI Labs. More info about the lab can be found here: ",
3535
html.A("https://www.cognizant.com/us/en/services/ai/ai-lab",
3636
href="https://www.cognizant.com/us/en/services/ai/ai-lab")

0 commit comments

Comments
 (0)