Close delete epic modal when have related issues

This commit is contained in:
Adrian Woźniak 2021-01-16 19:31:45 +01:00
parent 1c8c78aadf
commit ce6205f61d
10 changed files with 66 additions and 39 deletions

View File

@ -162,6 +162,22 @@
}
}
}
> .actions {
display: flex;
justify-content: flex-end;
margin: {
bottom: 10px;
top: 10px;
}
padding: {
right: 40px;
left: 40px;
};
> .styledButton {
}
}
}
}
}

View File

@ -1,9 +1,11 @@
use seed::{prelude::*, *};
use jirs_data::TimeTracking;
use crate::shared::{ToChild, ToNode};
use crate::{FieldId, Msg};
use {
crate::{
shared::{ToChild, ToNode},
FieldId, Msg,
},
jirs_data::TimeTracking,
seed::{prelude::*, *},
};
#[derive(Debug)]
pub struct StyledCheckboxState {

View File

@ -1,7 +1,7 @@
use seed::{prelude::*, *};
use crate::shared::ToNode;
use crate::Msg;
use {
crate::{shared::ToNode, Msg},
seed::{prelude::*, *},
};
#[derive(Debug)]
pub struct StyledField<'l> {

View File

@ -1,11 +1,9 @@
use std::borrow::Cow;
use seed::{prelude::*, *};
use jirs_data::{IssuePriority, IssueType};
use crate::shared::ToNode;
use crate::Msg;
use {
crate::{shared::ToNode, Msg},
jirs_data::{IssuePriority, IssueType},
seed::{prelude::*, *},
std::borrow::Cow,
};
#[allow(dead_code)]
#[derive(Copy, Clone, Debug)]

View File

@ -1,8 +1,8 @@
use seed::{prelude::*, *};
use web_sys::File;
use crate::shared::ToNode;
use crate::{FieldId, Msg};
use {
crate::{shared::ToNode, FieldId, Msg},
seed::{prelude::*, *},
web_sys::File,
};
#[derive(Debug, Clone)]
pub struct StyledImageInputState {

View File

@ -1,7 +1,7 @@
use seed::{prelude::*, *};
use crate::shared::ToNode;
use crate::Msg;
use {
crate::{shared::ToNode, Msg},
seed::{prelude::*, *},
};
pub struct StyledLink<'l> {
children: Vec<Node<Msg>>,

View File

@ -10,8 +10,6 @@ use {
seed::{prelude::*, *},
};
// pub trait ChildIter<'l> = Iterator<Item = StyledSelectChildBuilder<'l>>;
#[derive(Clone, Debug, PartialEq)]
pub enum StyledSelectChanged {
Text(String),

View File

@ -1,7 +1,7 @@
use seed::{prelude::*, *};
use crate::shared::ToNode;
use crate::{FieldId, Msg};
use {
crate::{shared::ToNode, FieldId, Msg},
seed::{prelude::*, *},
};
#[derive(Debug)]
pub struct StyledTextarea<'l> {

View File

@ -1,7 +1,7 @@
use seed::{prelude::*, *};
use crate::shared::ToNode;
use crate::Msg;
use {
crate::{shared::ToNode, Msg},
seed::{prelude::*, *},
};
#[derive(Debug, Copy, Clone)]
pub enum Variant {

View File

@ -1,6 +1,6 @@
use {
crate::{
components::{styled_confirm_modal::*, styled_icon::*, styled_modal::*},
components::{styled_button::*, styled_confirm_modal::*, styled_icon::*, styled_modal::*},
modals::epic_delete::Model,
model,
shared::ToNode,
@ -45,12 +45,25 @@ fn warning(model: &model::Model, modal: &Model) -> Node<Msg> {
]]
})
.collect();
let close = StyledButton::build()
.text("Close")
.on_click(mouse_ev("click", move |ev| {
ev.stop_propagation();
ev.prevent_default();
Msg::ModalDropped
}))
.secondary()
.build()
.into_node();
section![
h3![C!["header"], "Cannot delete epic"],
div![
C!["warning"],
"This epic have related issues. Please move or delete them first."
],
ol![C!["relatedList"], issues]
ol![C!["relatedList"], issues],
div![C!["actions"], close]
]
}