Hotfix merge
Gitea Scan/plate-tool/pipeline/head This commit looks good
Details
Gitea Scan/plate-tool/pipeline/head This commit looks good
Details
This commit is contained in:
commit
e836c4264a
|
@ -2,7 +2,7 @@ use yew::prelude::*;
|
|||
use yewdux::prelude::*;
|
||||
|
||||
use wasm_bindgen::JsCast;
|
||||
use web_sys::{EventTarget, FormData, HtmlDialogElement, HtmlFormElement};
|
||||
use web_sys::{EventTarget, FormData, HtmlFormElement};
|
||||
|
||||
use crate::components::states::MainState;
|
||||
use crate::data::plate::*;
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
use lazy_static::lazy_static;
|
||||
use regex::Regex;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::rc::Rc;
|
||||
use uuid::Uuid;
|
||||
use wasm_bindgen::JsCast;
|
||||
|
|
|
@ -8,6 +8,8 @@ use yewdux::prelude::*;
|
|||
use crate::components::states::{CurrentTransfer, MainState};
|
||||
use crate::data::transfer_region::Region;
|
||||
|
||||
type NoParamsCallback = Box<dyn Fn(()) -> ()>;
|
||||
|
||||
pub fn open_plate_info_callback(
|
||||
plate_menu_id: UseStateHandle<Option<Uuid>>,
|
||||
) -> Callback<MouseEvent> {
|
||||
|
@ -24,8 +26,8 @@ pub fn open_plate_info_callback(
|
|||
|
||||
pub fn plate_info_close_callback(
|
||||
plate_menu_id: UseStateHandle<Option<Uuid>>,
|
||||
) -> Callback<MouseEvent> {
|
||||
Callback::from(move |_| {
|
||||
) -> NoParamsCallback {
|
||||
Box::new(move |_| {
|
||||
plate_menu_id.set(None);
|
||||
})
|
||||
}
|
||||
|
@ -33,8 +35,8 @@ pub fn plate_info_close_callback(
|
|||
pub fn plate_info_delete_callback(
|
||||
main_dispatch: Dispatch<MainState>,
|
||||
plate_menu_id: UseStateHandle<Option<Uuid>>,
|
||||
) -> Callback<MouseEvent> {
|
||||
Callback::from(move |_| {
|
||||
) -> NoParamsCallback {
|
||||
Box::new(move |_| {
|
||||
if let Some(id) = *plate_menu_id {
|
||||
main_dispatch.reduce_mut(|state| {
|
||||
state.del_plate(id);
|
||||
|
@ -87,7 +89,7 @@ pub fn destination_plate_select_callback(
|
|||
})
|
||||
}
|
||||
|
||||
pub fn transfer_select_callback(main_state: Rc<MainState>) -> Callback<MouseEvent> {
|
||||
pub fn transfer_select_callback(main_state: Rc<MainState>, main_dispatch: Dispatch<MainState>, ct_dispatch: Dispatch<CurrentTransfer>) -> Callback<MouseEvent> {
|
||||
Callback::from(move |e: MouseEvent| {
|
||||
let target: Option<EventTarget> = e.target();
|
||||
let li = target.and_then(|t| t.dyn_into::<HtmlElement>().ok());
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
use yew::prelude::*;
|
||||
use yewdux::prelude::*;
|
||||
|
||||
use wasm_bindgen::JsCast;
|
||||
use web_sys::{EventTarget, FormData, HtmlDialogElement, HtmlFormElement};
|
||||
use web_sys::HtmlDialogElement;
|
||||
|
||||
use crate::components::states::MainState;
|
||||
use crate::data::plate::*;
|
||||
use crate::data::plate_instances::PlateInstance;
|
||||
|
||||
use crate::components::callbacks::new_plate_dialog_callbacks;
|
||||
|
|
|
@ -3,14 +3,11 @@
|
|||
use lazy_static::lazy_static;
|
||||
use regex::Regex;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use uuid::Uuid;
|
||||
use wasm_bindgen::JsCast;
|
||||
use web_sys::{EventTarget, HtmlInputElement};
|
||||
use yew::prelude::*;
|
||||
use yewdux::prelude::*;
|
||||
|
||||
use crate::components::callbacks::transfer_menu_callbacks;
|
||||
use crate::data::{transfer::Transfer, transfer_region::Region};
|
||||
use crate::data::transfer_region::Region;
|
||||
|
||||
use super::states::{CurrentTransfer, MainState};
|
||||
|
||||
|
|
|
@ -46,7 +46,9 @@ pub fn Tree(props: &TreeProps) -> Html {
|
|||
|
||||
let transfer_select_callback = {
|
||||
let main_state = main_state.clone();
|
||||
tree_callbacks::transfer_select_callback(main_state)
|
||||
let main_dispatch = main_dispatch.clone();
|
||||
let ct_dispatch = ct_dispatch.clone();
|
||||
tree_callbacks::transfer_select_callback(main_state, main_dispatch, ct_dispatch)
|
||||
};
|
||||
|
||||
let source_plates = main_state
|
||||
|
|
Loading…
Reference in New Issue