Skip to content

Commit

Permalink
Refresh available codes on code creation
Browse files Browse the repository at this point in the history
  • Loading branch information
edan-bainglass committed Dec 11, 2024
1 parent c81a22f commit 905c13e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 27 deletions.
42 changes: 18 additions & 24 deletions code_setup.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,7 @@
"languageId": "html"
}
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"<style>\n",
" .output_subarea {\n",
" max-width: none !important;\n",
" }\n",
"</style>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"%%html\n",
"\n",
Expand Down Expand Up @@ -97,7 +79,7 @@
")\n",
"\n",
"ipw.VBox(\n",
" [\n",
" children=[\n",
" widget,\n",
" setup_message,\n",
" ]\n",
Expand All @@ -119,17 +101,29 @@
"source": [
"from home.code_setup import create_paginated_table, fetch_code_data\n",
"\n",
"df = fetch_code_data()\n",
"paginated_table = create_paginated_table(df)\n",
"display(paginated_table)"
"output = ipw.Output()\n",
"\n",
"def render():\n",
" df = fetch_code_data()\n",
" paginated_table = create_paginated_table(df)\n",
" output.clear_output()\n",
" with output:\n",
" display(paginated_table)\n",
"\n",
"display(output)\n",
"render()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
"source": [
"widget.quick_setup_button.on_click(\n",
" lambda _: render()\n",
")"
]
}
],
"metadata": {
Expand Down
4 changes: 1 addition & 3 deletions home/code_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ def on_show_all_click(_):
render_table_with_filters()

def on_checkbox_change(change):
full_label = change.owner.full_label
is_hidden = change.new
update_code_visibility(full_label, is_hidden)
update_code_visibility(change.owner.full_label, change.new)
if show_active.value:
render_table_with_filters()

Expand Down

0 comments on commit 905c13e

Please sign in to comment.