Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iTasks-SDK
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
73
Issues
73
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clean-and-itasks
iTasks-SDK
Commits
d098061e
Commit
d098061e
authored
Jun 11, 2019
by
Steffen Michels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
place error icon right of cons UI
parent
3531794a
Pipeline
#25117
passed with stage
in 5 minutes and 48 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
Libraries/iTasks/Extensions/Editors/DynamicEditor.icl
Libraries/iTasks/Extensions/Editors/DynamicEditor.icl
+10
-6
No files found.
Libraries/iTasks/Extensions/Editors/DynamicEditor.icl
View file @
d098061e
...
@@ -299,7 +299,7 @@ where
...
@@ -299,7 +299,7 @@ where
#
removals
=
removeNChildren
$
length
childrenSts
#
removals
=
removeNChildren
$
length
childrenSts
// add "itasks-container" classes as this class always has to be present for containers
// add "itasks-container" classes as this class always has to be present for containers
#
uiAttrs
=
withContainerClassAttr
cons
.
uiAttributes
#
uiAttrs
=
withContainerClassAttr
cons
.
uiAttributes
#
change
=
ChangeUI
(
uncurry
SetAttribute
<$>
'
Map
'.
toList
uiAttrs
)
(
removals
++
inserts
)
#
change
=
ChangeUI
[]
[(
0
,
ChangeChild
$
ChangeUI
(
uncurry
SetAttribute
<$>
'
Map
'.
toList
uiAttrs
)
(
removals
++
inserts
))]
#
builderChooseState
=
LeafState
{
touched
=
True
,
state
=
JSONInt
$
length
uis
}
#
builderChooseState
=
LeafState
{
touched
=
True
,
state
=
JSONInt
$
length
uis
}
=
(
Ok
(
change
,
Just
(
cons
.
consId
,
type
,
True
),
[
builderChooseState
:
childSts
]),
vst
)
=
(
Ok
(
change
,
Just
(
cons
.
consId
,
type
,
True
),
[
builderChooseState
:
childSts
]),
vst
)
Error
e
=
(
Error
e
,
vst
)
Error
e
=
(
Error
e
,
vst
)
...
@@ -308,7 +308,7 @@ where
...
@@ -308,7 +308,7 @@ where
onEdit
dp
([],
e
)
_
[_:
childSts
]
vst
onEdit
dp
([],
e
)
_
[_:
childSts
]
vst
|
e
=:
JSONNull
||
e
=:
(
JSONArray
[])
// A null or an empty array are accepted as a reset events
|
e
=:
JSONNull
||
e
=:
(
JSONArray
[])
// A null or an empty array are accepted as a reset events
//If necessary remove the fields of the previously selected cons
//If necessary remove the fields of the previously selected cons
#
change
=
ChangeUI
[]
$
removeNChildren
$
length
childSts
#
change
=
ChangeUI
[]
[(
0
,
ChangeChild
$
ChangeUI
[]
$
removeNChildren
$
length
childSts
)]
=
(
Ok
(
change
,
Nothing
,
[
nullState
]),
vst
)
=
(
Ok
(
change
,
Nothing
,
[
nullState
]),
vst
)
|
otherwise
|
otherwise
=
(
Error
$
concat
[
"Unknown dynamic editor select event: '"
,
toString
e
,
"'"
],
vst
)
=
(
Error
$
concat
[
"Unknown dynamic editor select event: '"
,
toString
e
,
"'"
],
vst
)
...
@@ -329,13 +329,13 @@ where
...
@@ -329,13 +329,13 @@ 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
[]
([(
argIdx
+
if
hideCons
0
1
,
ChangeChild
change
)]
++
mbErrorIconChange
)
#
change
=
ChangeUI
[]
$
[(
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
|
typeWasCorrect
&&
isError
typeIsCorrect
=
|
typeWasCorrect
&&
isError
typeIsCorrect
=
[(
length
childSts
,
InsertChild
errorIcon
)]
[(
1
,
InsertChild
errorIcon
)]
with
with
errorIcon
=
errorIcon
=
UI
UI
...
@@ -343,7 +343,7 @@ where
...
@@ -343,7 +343,7 @@ where
('
Map
'.
union
(
iconClsAttr
"icon-invalid"
)
(
tooltipAttr
$
fromError
typeIsCorrect
))
('
Map
'.
union
(
iconClsAttr
"icon-invalid"
)
(
tooltipAttr
$
fromError
typeIsCorrect
))
[]
[]
|
not
typeWasCorrect
&&
isOk
typeIsCorrect
=
|
not
typeWasCorrect
&&
isOk
typeIsCorrect
=
[(
length
childSts
,
RemoveChild
)]
[(
1
,
RemoveChild
)]
|
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
...
@@ -483,7 +483,11 @@ where
...
@@ -483,7 +483,11 @@ where
listBuilderEditor
_
=
abort
"dynamic editors: invalid list builder value"
listBuilderEditor
_
=
abort
"dynamic editors: invalid list builder value"
uiContainer
::
!
UIAttributes
![
UI
]
->
UI
uiContainer
::
!
UIAttributes
![
UI
]
->
UI
uiContainer
attr
uis
=
UI
UIRecord
attr
uis
uiContainer
attr
uis
=
UI
UIContainer
('
Map
'.
singleton
"class"
$
JSONArray
[
JSONString
"itasks-container"
,
JSONString
"itasks-horizontal"
])
[
UI
UIRecord
attr
uis
]
valueFromState
::
!(
Maybe
(!
DynamicConsId
,
!
ConsType
,
!
Bool
))
![
EditState
]
->
*
Maybe
(
DynamicEditorValue
a
)
valueFromState
::
!(
Maybe
(!
DynamicConsId
,
!
ConsType
,
!
Bool
))
![
EditState
]
->
*
Maybe
(
DynamicEditorValue
a
)
valueFromState
(
Just
(
cid
,
CustomEditor
,
True
))
[_:
[
editorSt
]]
=
valueFromState
(
Just
(
cid
,
CustomEditor
,
True
))
[_:
[
editorSt
]]
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment