diff --git a/app/callbacks/data_callbacks.py b/app/callbacks/data_callbacks.py index ca4133a..b83c074 100644 --- a/app/callbacks/data_callbacks.py +++ b/app/callbacks/data_callbacks.py @@ -34,6 +34,7 @@ Output("username_input", "style"), Output("password_input", "style"), Output("send_form_button", "style"), + Output("form_feedback_area", "style"), Output("loading_spinner", "style"), ], Input("send_form_button", "n_clicks"), @@ -60,10 +61,10 @@ def login_callback(n_clicks, username, password, user_headers): the login form is hidden and a spinner is displayed. Returns: - dash.dependencies.Output: Updated user credentials and headers, and form feedback + styles to hide/show login and loading spinners. + dash.dependencies.Output: Updated user credentials and headers, and form feedback + styles to hide/show login elements and loading spinners. """ input_style_unchanged = {"width": "250px"} - connection_button_style_unchanged = {} + empty_style_unchanged = {"": ""} hide_element_style = {"display": "none"} show_spinner_style = {"transform": "scale(4)"} @@ -74,7 +75,8 @@ def login_callback(n_clicks, username, password, user_headers): dash.no_update, input_style_unchanged, input_style_unchanged, - connection_button_style_unchanged, + empty_style_unchanged, + empty_style_unchanged, hide_element_style, ) @@ -95,7 +97,8 @@ def login_callback(n_clicks, username, password, user_headers): form_feedback, input_style_unchanged, input_style_unchanged, - connection_button_style_unchanged, + empty_style_unchanged, + empty_style_unchanged, hide_element_style, ) else: @@ -110,6 +113,7 @@ def login_callback(n_clicks, username, password, user_headers): hide_element_style, hide_element_style, hide_element_style, + hide_element_style, show_spinner_style, ) except Exception: @@ -122,7 +126,8 @@ def login_callback(n_clicks, username, password, user_headers): form_feedback, input_style_unchanged, input_style_unchanged, - connection_button_style_unchanged, + empty_style_unchanged, + empty_style_unchanged, hide_element_style, ) diff --git a/app/pages/login.py b/app/pages/login.py index 6f73e66..3160307 100644 --- a/app/pages/login.py +++ b/app/pages/login.py @@ -42,14 +42,14 @@ def login_layout(): color="primary", className="ml-3", ), + html.Div(style={"height": "15px"}), # Spacing + # Feedback message area + html.Div(id="form_feedback_area"), html.Div( dbc.Spinner(size="xl"), id="loading_spinner", style={"display": "none"}, ), - html.Div(style={"height": "15px"}), # Spacing - # Feedback message area - html.Div(id="form_feedback_area"), ], ), ]