mtyrrell commited on
Commit
d5fd2a5
·
1 Parent(s): cfd826b

Cleanup No filters

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -620,10 +620,12 @@ with gr.Blocks(title="Audit Q&A", css= "style.css", theme=theme,elem_id = "main-
620
  """Handler for getting client IP in Gradio context"""
621
  return get_client_ip(request)
622
 
623
- #-------------------- Filter Warning -------------------------
 
624
  warning_state = gr.State(False)
625
  pending_query = gr.State(None)
626
 
 
627
  with gr.Row(visible=False) as warning_row:
628
  gr.Markdown("**No report filter selected. Are you sure you want to proceed?**")
629
  with gr.Row():
@@ -638,6 +640,7 @@ with gr.Blocks(title="Audit Q&A", css= "style.css", theme=theme,elem_id = "main-
638
  """Hide warning popup"""
639
  return gr.update(visible=False)
640
 
 
641
  def check_filters(textbox_value, sources, reports, subtype, year):
642
  """Check if any filters are selected"""
643
  no_filters = (not reports) and (not sources) and (not subtype) and (not year)
 
620
  """Handler for getting client IP in Gradio context"""
621
  return get_client_ip(request)
622
 
623
+ #-------------------- No Filters Set Warning -------------------------
624
+ # Warn users when no filters are selected
625
  warning_state = gr.State(False)
626
  pending_query = gr.State(None)
627
 
628
+ # Warning UI is implemented as a hidden row (to keep it simple)
629
  with gr.Row(visible=False) as warning_row:
630
  gr.Markdown("**No report filter selected. Are you sure you want to proceed?**")
631
  with gr.Row():
 
640
  """Hide warning popup"""
641
  return gr.update(visible=False)
642
 
643
+ # Logic needs to be changed to accomodate default filter values (currently I have them all set to None)
644
  def check_filters(textbox_value, sources, reports, subtype, year):
645
  """Check if any filters are selected"""
646
  no_filters = (not reports) and (not sources) and (not subtype) and (not year)