Commit 461fc850 authored by Steffen Michels's avatar Steffen Michels

indicate more clearly where error occurred

parent 9835827a
Pipeline #25321 passed with stage
in 5 minutes and 55 seconds
...@@ -264,7 +264,7 @@ taskEditor = DynamicEditor ...@@ -264,7 +264,7 @@ taskEditor = DynamicEditor
<<@@@ applyHorizontalClasses <<@@@ applyHorizontalClasses
, functionConsDyn "Not" "not" , functionConsDyn "Not" "not"
(dynamic Typed Not :: Typed Func (Bool -> Bool)) (dynamic Typed Not :: Typed Func (Bool -> Bool))
<<@@@ applyHorizontalClasses <<@@@ applyHorizontalClassesNoBorder
] ]
, DynamicConsGroup "Comparison" , DynamicConsGroup "Comparison"
[ functionConsDyn "Gt" "greater than" [ functionConsDyn "Gt" "greater than"
......
...@@ -2,3 +2,6 @@ ...@@ -2,3 +2,6 @@
align-self: center; align-self: center;
padding: 0.2em; padding: 0.2em;
} }
.itasks-dynamic-editor-error {
background-color: #FFDDDD;
}
...@@ -329,13 +329,16 @@ where ...@@ -329,13 +329,16 @@ where
= editor.Editor.onEdit (dp ++ [0]) (tp, e) (childSts !! 1) vst = editor.Editor.onEdit (dp ++ [0]) (tp, e) (childSts !! 1) vst
= case res of = case res of
Ok (change, childSt) Ok (change, childSt)
# change = ChangeUI [] $ [(0, ChangeChild $ ChangeUI [] [(argIdx + if hideCons 0 1, ChangeChild change)])] ++ mbErrorIconChange # change = ChangeUI mbErrorIconAttrChange $ [(0, ChangeChild $ ChangeUI [] [(argIdx + if hideCons 0 1, ChangeChild change)])] ++ mbErrorIconChange
// replace state for this child // replace state for this child
= (Ok (change, Just (cid, type, isOk typeIsCorrect), childSts`), vst) = (Ok (change, Just (cid, type, isOk typeIsCorrect), childSts`), vst)
where where
mbErrorIconChange (mbErrorIconChange, mbErrorIconAttrChange) = mbErrorIconUpd
mbErrorIconUpd
| typeWasCorrect && isError typeIsCorrect = | typeWasCorrect && isError typeIsCorrect =
[(1, InsertChild errorIcon)] ( [(1, InsertChild errorIcon)]
, [SetAttribute "class" $ JSONArray [JSONString "itasks-container", JSONString "itasks-horizontal", JSONString "itasks-dynamic-editor-error"]]
)
with with
errorIcon = errorIcon =
UI UI
...@@ -347,8 +350,8 @@ where ...@@ -347,8 +350,8 @@ where
[] []
] ]
| not typeWasCorrect && isOk typeIsCorrect = | not typeWasCorrect && isOk typeIsCorrect =
[(1, RemoveChild)] ([(1, RemoveChild)], [SetAttribute "class" $ JSONArray [JSONString "itasks-container", JSONString "itasks-horizontal"]])
| otherwise = [] | otherwise = ([], [])
typeIsCorrect = childTypesAreMatching cons.builder (drop 1 childSts`) typeIsCorrect = childTypesAreMatching cons.builder (drop 1 childSts`)
childSts` = updateAt (argIdx + 1) childSt childSts childSts` = updateAt (argIdx + 1) childSt childSts
Error e = (Error e, vst) Error e = (Error e, vst)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment