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 {
crate::{
use jirs_data::TimeTracking; shared::{ToChild, ToNode},
FieldId, Msg,
use crate::shared::{ToChild, ToNode}; },
use crate::{FieldId, Msg}; jirs_data::TimeTracking,
seed::{prelude::*, *},
};
#[derive(Debug)] #[derive(Debug)]
pub struct StyledCheckboxState { pub struct StyledCheckboxState {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
use { use {
crate::{ crate::{
components::{styled_confirm_modal::*, styled_icon::*, styled_modal::*}, components::{styled_button::*, styled_confirm_modal::*, styled_icon::*, styled_modal::*},
modals::epic_delete::Model, modals::epic_delete::Model,
model, model,
shared::ToNode, shared::ToNode,
@ -45,12 +45,25 @@ fn warning(model: &model::Model, modal: &Model) -> Node<Msg> {
]] ]]
}) })
.collect(); .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![ section![
h3![C!["header"], "Cannot delete epic"], h3![C!["header"], "Cannot delete epic"],
div![ div![
C!["warning"], C!["warning"],
"This epic have related issues. Please move or delete them first." "This epic have related issues. Please move or delete them first."
], ],
ol![C!["relatedList"], issues] ol![C!["relatedList"], issues],
div![C!["actions"], close]
] ]
} }