hotfix
Gitea Scan/plate-tool/pipeline/head This commit looks good Details
temp/pipeline/head There was a failure building this commit Details

This commit is contained in:
Emilia Allison 2024-02-10 16:47:32 -05:00
parent 4710335750
commit 5430b3d42c
Signed by: emilia
GPG Key ID: 05D5D1107E5100A1
6 changed files with 13 additions and 17 deletions

View File

@ -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::*;

View File

@ -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;

View File

@ -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());

View File

@ -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;

View File

@ -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};

View File

@ -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