Spaces:
Running
Running
solidprivacy-nl commited on
Commit ·
c60b9b4
1
Parent(s): c4667b5
Integrate export sanity warnings into UI patch
Browse files
fix_streamlit_nested_expanders.py
CHANGED
|
@@ -11,6 +11,7 @@ Patches currently applied:
|
|
| 11 |
- v12.3: simplify the main review table and move audit details to a technical view.
|
| 12 |
- v12.4: add clear review guidance text around the review workflow.
|
| 13 |
- v12.5: show a final review summary before download/export.
|
|
|
|
| 14 |
"""
|
| 15 |
|
| 16 |
from pathlib import Path
|
|
@@ -132,6 +133,14 @@ text = replace_once(
|
|
| 132 |
'from review_summary import build_review_summary, review_summary_markdown\n',
|
| 133 |
)
|
| 134 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
# v12.1: add review status fields to remembered rows.
|
| 136 |
text = replace_once(
|
| 137 |
text,
|
|
@@ -337,10 +346,16 @@ review_summary_block = ''' st.subheader("4. Download opgeschoonde bestand
|
|
| 337 |
else:
|
| 338 |
st.success(final_review_summary.get("readiness_label", "Klaar voor export na gebruikerscontrole"))
|
| 339 |
st.markdown(review_summary_markdown(final_review_summary))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 340 |
st.warning(EXPORT_GUIDANCE)
|
| 341 |
'''
|
| 342 |
|
| 343 |
-
# v12.5: add final review summary
|
|
|
|
| 344 |
text = replace_once(
|
| 345 |
text,
|
| 346 |
''' st.subheader("4. Download opgeschoonde bestanden")
|
|
@@ -356,6 +371,22 @@ text = replace_once(
|
|
| 356 |
review_summary_block,
|
| 357 |
)
|
| 358 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 359 |
# v12.1: include status in the scrub report rows where downstream exporters keep it.
|
| 360 |
text = replace_once(
|
| 361 |
text,
|
|
|
|
| 11 |
- v12.3: simplify the main review table and move audit details to a technical view.
|
| 12 |
- v12.4: add clear review guidance text around the review workflow.
|
| 13 |
- v12.5: show a final review summary before download/export.
|
| 14 |
+
- v12.6: show advisory export sanity warnings before download/export.
|
| 15 |
"""
|
| 16 |
|
| 17 |
from pathlib import Path
|
|
|
|
| 133 |
'from review_summary import build_review_summary, review_summary_markdown\n',
|
| 134 |
)
|
| 135 |
|
| 136 |
+
# v12.6: import advisory export sanity helpers without changing export behavior.
|
| 137 |
+
text = replace_once(
|
| 138 |
+
text,
|
| 139 |
+
'from review_summary import build_review_summary, review_summary_markdown\n',
|
| 140 |
+
'from review_summary import build_review_summary, review_summary_markdown\n'
|
| 141 |
+
'from export_sanity import build_export_sanity_checks, export_sanity_warnings\n',
|
| 142 |
+
)
|
| 143 |
+
|
| 144 |
# v12.1: add review status fields to remembered rows.
|
| 145 |
text = replace_once(
|
| 146 |
text,
|
|
|
|
| 346 |
else:
|
| 347 |
st.success(final_review_summary.get("readiness_label", "Klaar voor export na gebruikerscontrole"))
|
| 348 |
st.markdown(review_summary_markdown(final_review_summary))
|
| 349 |
+
export_sanity_checks = build_export_sanity_checks(edited_replacements_df)
|
| 350 |
+
st.markdown("**Extra exportcontrole**")
|
| 351 |
+
for export_sanity_warning in export_sanity_warnings(export_sanity_checks):
|
| 352 |
+
st.warning(export_sanity_warning)
|
| 353 |
+
st.caption("Deze exportcontrole is adviserend: downloads blijven beschikbaar en de exportinstellingen blijven ongewijzigd.")
|
| 354 |
st.warning(EXPORT_GUIDANCE)
|
| 355 |
'''
|
| 356 |
|
| 357 |
+
# v12.5/v12.6: add final review summary and advisory export sanity warnings before downloads.
|
| 358 |
+
# Handle both unpatched and v12.4-patched app text.
|
| 359 |
text = replace_once(
|
| 360 |
text,
|
| 361 |
''' st.subheader("4. Download opgeschoonde bestanden")
|
|
|
|
| 371 |
review_summary_block,
|
| 372 |
)
|
| 373 |
|
| 374 |
+
# v12.6: extend an existing v12.5 review-summary block with advisory sanity warnings.
|
| 375 |
+
text = replace_once(
|
| 376 |
+
text,
|
| 377 |
+
''' st.markdown(review_summary_markdown(final_review_summary))
|
| 378 |
+
st.warning(EXPORT_GUIDANCE)
|
| 379 |
+
''',
|
| 380 |
+
''' st.markdown(review_summary_markdown(final_review_summary))
|
| 381 |
+
export_sanity_checks = build_export_sanity_checks(edited_replacements_df)
|
| 382 |
+
st.markdown("**Extra exportcontrole**")
|
| 383 |
+
for export_sanity_warning in export_sanity_warnings(export_sanity_checks):
|
| 384 |
+
st.warning(export_sanity_warning)
|
| 385 |
+
st.caption("Deze exportcontrole is adviserend: downloads blijven beschikbaar en de exportinstellingen blijven ongewijzigd.")
|
| 386 |
+
st.warning(EXPORT_GUIDANCE)
|
| 387 |
+
''',
|
| 388 |
+
)
|
| 389 |
+
|
| 390 |
# v12.1: include status in the scrub report rows where downstream exporters keep it.
|
| 391 |
text = replace_once(
|
| 392 |
text,
|