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
83
Issues
83
List
Boards
Labels
Service Desk
Milestones
Merge Requests
10
Merge Requests
10
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
22473c7f
Commit
22473c7f
authored
Jan 24, 2021
by
Bas Lijnse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed comparison of UI's in dynamic editor
parent
a5896c2b
Pipeline
#48315
passed with stages
in 9 minutes and 56 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
Libraries/iTasks/Extensions/Editors/DynamicEditor.icl
Libraries/iTasks/Extensions/Editors/DynamicEditor.icl
+10
-2
No files found.
Libraries/iTasks/Extensions/Editors/DynamicEditor.icl
View file @
22473c7f
...
...
@@ -5,7 +5,7 @@ import Data.Func, Data.Functor, Data.Tuple
import
qualified
Data
.
Map
as
Map
import
Text
,
Text
.
GenPrint
,
Text
.
HTML
import
iTasks
,
iTasks
.
UI
.
Editor
.
Common
from
Data
.
List
import
intersperse
,
zip4
from
Data
.
List
import
intersperse
,
zip4
,
zipWith
dynamicEditor
::
!(
DynamicEditor
a
)
->
Editor
(
DynamicEditorValue
a
)
(?(
DynamicEditorValue
a
))
|
TC
a
dynamicEditor
dynEditor
=
compoundEditorToEditor
$
dynamicCompoundEditor
dynEditor
...
...
@@ -37,7 +37,9 @@ where
#
(
uiForNewP
,
vst
)
=
(
dynamicCompoundEditor
$
editor
p
).
CompoundEditor
.
onReset
'
Map
'.
newMap
(?
Just
new
)
vst
|
isError
uiForNewP
=
(
liftError
uiForNewP
,
vst
)
#
(
uiForNewP
,
newSt
,
newChildSts
,
newMbW
)
=
fromOk
uiForNewP
|
uiForOldP
===
uiForNewP
=
//Because the generated UI's each have a fresh unique editorId generated during onReset
//We must ignore all 'editorId' attributes during the comparison
|
isEqualExceptEditorId
uiForOldP
uiForNewP
=
appFst
(
fmap
\(
change
,
st
,
cst
,
mbw
)
->
(
change
,(
p
,
st
),
cst
,
fmap
(
fmap
(\
w
->
(
p
,
w
)))
mbw
))
((
dynamicCompoundEditor
$
editor
p
).
CompoundEditor
.
onRefresh
new
mbSt
childSts
vst
)
...
...
@@ -47,6 +49,12 @@ where
Ok
res
=
Ok
$
mapMaybe
(\
val
->
(
p
,
val
))
res
Error
e
=
Error
e
isEqualExceptEditorId
(
UI
t1
a1
i1
)
(
UI
t2
a2
i2
)
=
t1
===
t2
&&
'
Map
'.
del
"editorId"
a1
===
'
Map
'.
del
"editorId"
a2
&&
length
i1
==
length
i2
&&
(
and
$
zipWith
isEqualExceptEditorId
i1
i2
)
// Bool part of result indicates whether the type is correct, i.e. the child types are matching
dynamicCompoundEditor
::
!(
DynamicEditor
a
)
->
CompoundEditor
(?(!
DynamicConsId
,
!
ConsType
,
!
Bool
))
(
DynamicEditorValue
a
)
(?(
DynamicEditorValue
a
))
|
TC
a
...
...
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