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
<<@@@ applyHorizontalClasses
, functionConsDyn "Not" "not"
(dynamic Typed Not :: Typed Func (Bool -> Bool))
<<@@@ applyHorizontalClasses
<<@@@ applyHorizontalClassesNoBorder
]
, DynamicConsGroup "Comparison"
[ functionConsDyn "Gt" "greater than"
......
......@@ -2,3 +2,6 @@
align-self: center;
padding: 0.2em;
}
.itasks-dynamic-editor-error {
background-color: #FFDDDD;
}
......@@ -329,13 +329,16 @@ where
= editor.Editor.onEdit (dp ++ [0]) (tp, e) (childSts !! 1) vst
= case res of
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
= (Ok (change, Just (cid, type, isOk typeIsCorrect), childSts`), vst)
where
mbErrorIconChange
(mbErrorIconChange, mbErrorIconAttrChange) = mbErrorIconUpd
mbErrorIconUpd
| typeWasCorrect && isError typeIsCorrect =
[(1, InsertChild errorIcon)]
( [(1, InsertChild errorIcon)]
, [SetAttribute "class" $ JSONArray [JSONString "itasks-container", JSONString "itasks-horizontal", JSONString "itasks-dynamic-editor-error"]]
)
with
errorIcon =
UI
......@@ -347,8 +350,8 @@ where
[]
]
| not typeWasCorrect && isOk typeIsCorrect =
[(1, RemoveChild)]
| otherwise = []
([(1, RemoveChild)], [SetAttribute "class" $ JSONArray [JSONString "itasks-container", JSONString "itasks-horizontal"]])
| otherwise = ([], [])
typeIsCorrect = childTypesAreMatching cons.builder (drop 1 childSts`)
childSts` = updateAt (argIdx + 1) childSt childSts
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