mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-21 09:26:43 +00:00
Automation: dialog fields can't add the Replace prompt's marker
The Replace prompt (`__replaceSaved`) routes `confirm` and `cancel` like the other dialog markers, so `ROUTES` lists it and `ui.dialog.set` / `ui.dialog.open` refuse to add it.
This commit is contained in:
1 parent
ebdddbe1f5
commit
a89554eb83
2 files changed
+3
No files matched your search
@@ -2707,6 +2707,8 @@ mod tests {
|
||||
assert!(r.get("error").is_none(), "{r}");
|
||||
}
|
||||
let injected = call(&mut app, &ctx, "ui.dialog.set", json!({"dialog": dialog, "field": "__diskChanged", "value": true}));
|
||||
let replace = call(&mut app, &ctx, "ui.dialog.set", json!({"dialog": dialog, "field": "__replaceSaved", "value": true}));
|
||||
assert!(replace["error"].as_str().is_some_and(|e| e.contains("set only by the dialog")), "{replace}");
|
||||
call(&mut app, &ctx, "ui.dialog.confirm", json!({"dialog": dialog}));
|
||||
assert!(written.borrow().is_empty(), "nothing is written: {:?}", written.borrow());
|
||||
assert!(injected["error"].as_str().is_some_and(|e| e.contains("set only by the dialog")), "{injected}");
|
||||
|
||||
@@ -718,6 +718,7 @@ const ROUTES: &[fn(&Fields) -> bool] = &[
|
||||
crate::color_range_ui::owns,
|
||||
crate::prefs_ui::owns,
|
||||
crate::open_prompt::owns,
|
||||
crate::replace_prompt::owns,
|
||||
crate::layer_style::color_picker::owns,
|
||||
|f| f.contains_key("__export"),
|
||||
|f| f.contains_key("__smartFilter"),
|
||||
|
||||
Reference in new issue
Block a user