@danhachuel/thunderbolt 0.7.60 → 0.7.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/main.py +21 -20
- package/package.json +1 -1
package/app/main.py
CHANGED
|
@@ -9524,26 +9524,27 @@ def render_notifications():
|
|
|
9524
9524
|
st.rerun()
|
|
9525
9525
|
|
|
9526
9526
|
st.divider()
|
|
9527
|
-
st.
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
|
|
9531
|
-
|
|
9532
|
-
|
|
9533
|
-
|
|
9534
|
-
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
event["
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9527
|
+
with st.expander("Operações notificadas", expanded=False):
|
|
9528
|
+
st.subheader("Operações notificadas")
|
|
9529
|
+
st.caption("Ligue ou desligue cada tipo de notificação. As preferências ficam guardadas no storage local e aplicam-se às próximas conclusões.")
|
|
9530
|
+
grouped: dict[str, list[dict[str, str]]] = {}
|
|
9531
|
+
for event in catalog:
|
|
9532
|
+
grouped.setdefault(event["category"], []).append(event)
|
|
9533
|
+
with st.form("notification_preferences_form"):
|
|
9534
|
+
pending_preferences: dict[str, bool] = {}
|
|
9535
|
+
for category, events in grouped.items():
|
|
9536
|
+
st.markdown(f"**{category}**")
|
|
9537
|
+
for event in events:
|
|
9538
|
+
pending_preferences[event["code"]] = st.checkbox(
|
|
9539
|
+
event["label"],
|
|
9540
|
+
value=bool(preferences.get(event["code"], True)),
|
|
9541
|
+
help=event["description"],
|
|
9542
|
+
key=f"notification_preference_{event['code']}",
|
|
9543
|
+
)
|
|
9544
|
+
if st.form_submit_button("Guardar preferências", type="primary", width="stretch"):
|
|
9545
|
+
save_notification_preferences(pending_preferences)
|
|
9546
|
+
st.success("Preferências de notificação guardadas.")
|
|
9547
|
+
st.rerun()
|
|
9547
9548
|
|
|
9548
9549
|
st.divider()
|
|
9549
9550
|
st.subheader("Histórico de notificações")
|
package/package.json
CHANGED