feat(webui): improve setup flows across chat channels (NAN-112) (#5356)
* feat(webui): improve channel setup flows * fix(webui): refine channel setup interactions (NAN-112) * fix(webui): keep email setup sections channel-owned * fix(webui): remove concrete channel details from shared components * refactor(webui): remove unused channel setup resources * fix(webui): finish channel-owned setup boundaries * fix(webui): update channel switches optimistically * test(channels): remove obsolete absence assertions * fix(webui): flatten channel instance settings disclosure * fix(webui): complete channel setup and connection flows * fix(whatsapp): wait for session database release * fix(webui): preserve scrolling channel controls * fix(webui): stage channel connection checks * fix(channels): align verification actions * fix(email): expose connection checks * fix(webui): align channel field actions * fix(email): verify account credentials * fix(wecom): bypass system proxy for websocket * fix(channels): stabilize async connection cleanup * fix(webui): autosave channel credentials * fix(email): make provider presets non-destructive * test(weixin): isolate persisted QR credentials
This commit is contained in:
1 parent
3cc3012b3a
commit
e8a29a0087
291 files changed
+12194
-3979
No files matched your search
@@ -1,8 +1,10 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from nanobot.channels.registry import load_channel_plugin
|
||||
from nanobot.config.schema import Config
|
||||
from nanobot.webui.settings_system import (
|
||||
coerce_channel_value,
|
||||
save_channel_config_values,
|
||||
system_settings_payload,
|
||||
update_agent_system_settings,
|
||||
)
|
||||
@@ -42,3 +44,24 @@ def test_system_domain_validates_channel_field_values() -> None:
|
||||
]
|
||||
assert coerce_channel_value("enabled", "yes", "bool") is True
|
||||
assert coerce_channel_value("port", "8765", "int") == 8765
|
||||
assert coerce_channel_value("delay", "0.6", "float") == 0.6
|
||||
assert coerce_channel_value("overrides", '{"123": "open"}', "json") == {
|
||||
"123": "open"
|
||||
}
|
||||
assert coerce_channel_value("token", None, "secret") == ""
|
||||
|
||||
|
||||
def test_channel_secret_is_cleared_only_by_explicit_null() -> None:
|
||||
config = Config.model_validate({
|
||||
"channels": {"matrix": {"password": "saved-password"}},
|
||||
})
|
||||
|
||||
saved = save_channel_config_values(
|
||||
config,
|
||||
"matrix",
|
||||
{"channels.matrix.password": None},
|
||||
load_channel_plugin=load_channel_plugin,
|
||||
)
|
||||
|
||||
assert saved == ["channels.matrix.password"]
|
||||
assert config.channels.matrix["password"] == ""
|
||||
Reference in new issue
Block a user