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
74
Issues
74
List
Boards
Labels
Service Desk
Milestones
Merge Requests
7
Merge Requests
7
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
c6a494a4
Commit
c6a494a4
authored
Jun 05, 2019
by
Steffen Michels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use list editor for steps
parent
efaa3082
Pipeline
#24609
passed with stage
in 5 minutes and 50 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
19 deletions
+18
-19
Examples/DynamicEditor/DynEditorExample.icl
Examples/DynamicEditor/DynEditorExample.icl
+17
-19
Libraries/iTasks/Extensions/Editors/DynamicEditor.dcl
Libraries/iTasks/Extensions/Editors/DynamicEditor.dcl
+1
-0
No files found.
Examples/DynamicEditor/DynEditorExample.icl
View file @
c6a494a4
...
...
@@ -20,11 +20,8 @@ editTask = forever
::
TaskConstExpr
=
Apply
TaskFuncExpr
Expr
|
EnterInformation
String
Type
|
Bind
TaskConstExpr
TaskFuncExpr
|
Blind
TaskConstExpr
TaskConstExpr
|
Or
TaskConstExpr
TaskConstExpr
|
And
TaskConstExpr
TaskConstExpr
// | When TaskConstExpr FunExpr String TaskFuncExpr
// | When TaskConstExpr [(FunExpr, String, TaskFuncExpr)]
|
When
TaskConstExpr
TaskStepExpr
|
When
TaskConstExpr
[(
FunExpr
,
String
,
TaskFuncExpr
)]
::
TaskFuncExpr
=
ViewInformation
String
|
UpdateInformation
String
|
Return
::
TaskStepExpr
=
StepN
FunExpr
String
TaskFuncExpr
TaskStepExpr
|
Step1
FunExpr
String
TaskFuncExpr
::
Expr
=
Int
Int
|
Bool
Bool
|
String
String
|
Tuple
Expr
Expr
|
Fst
Expr
|
Snd
Expr
|
Eq
Expr
Expr
...
...
@@ -34,7 +31,7 @@ editTask = forever
::
Type
=
E
.
a
:
Type
(
a
->
Value
)
&
iTask
a
::
Typed
a
b
=:
Typed
a
derive
class
iTask
TaskConstExpr
,
TaskFuncExpr
,
TaskStepExpr
,
Expr
,
Value
,
Typed
,
FunExpr
derive
class
iTask
TaskConstExpr
,
TaskFuncExpr
,
Expr
,
Value
,
Typed
,
FunExpr
// instances are never used
gDefault
{|
Type
|}
=
undef
...
...
@@ -79,24 +76,25 @@ where
->
Typed
TaskConstExpr
(
Task
(
a
,
b
))
)
,
functionConsDyn
"When"
"when"
(
dynamic
\(
Typed
task1
)
(
Typed
step
)
->
Typed
(
When
task1
step
)
::
(
dynamic
\(
Typed
task1
)
(
Typed
step
s
)
->
Typed
(
When
task1
steps
)
::
A
.
a
b
:
(
Typed
TaskConstExpr
(
Task
a
))
(
Typed
TaskStepExpr
(
a
->
Task
b
))
(
Typed
TaskConstExpr
(
Task
a
))
(
Typed
[(
FunExpr
,
String
,
TaskFuncExpr
)]
(
a
->
Task
b
))
->
Typed
TaskConstExpr
(
Task
b
)
)
<<@@@
applyHorizontalClasses
,
functionConsDyn
"StepN"
">>* (>1)
"
(
dynamic
\
(
Typed
funExpr
)
s
(
Typed
taskFunc
)
(
Typed
taskStepExpr
)
->
Typed
(
StepN
funExpr
s
taskFunc
taskStepExpr
)
::
,
listConsDyn
"[(FunExpr, String, TaskFuncExpr)]"
"[(FunExpr, String, TaskFuncExpr)]
"
(
dynamic
\
typedSteps
->
Typed
((\(
Typed
expr
)
->
expr
)
<$>
typedSteps
)
::
A
.
a
b
:
(
Typed
FunExpr
a
)
String
(
Typed
TaskFuncExpr
(
a
->
Task
b
))
(
Typed
TaskStepExpr
(
a
->
Task
b
)
)
->
Typed
TaskStepExpr
(
a
->
Task
b
)
)
<<@@@
applyHorizontalClasses
,
functionConsDyn
"
Step1"
">>* (1
)"
(
dynamic
\(
Typed
funExpr
)
s
(
Typed
taskFunc
)
->
Typed
(
Step1
funExpr
s
taskFunc
)
::
[
Typed
(
FunExpr
,
String
,
TaskFuncExpr
)
(
a
->
Task
b
)]
->
Typed
[(
FunExpr
,
String
,
TaskFuncExpr
)]
(
a
->
Task
b
)
)
<<@@@
HideIfOnlyChoice
,
functionConsDyn
"
(FunExpr, String, TaskFuncExpr)"
"(FunExpr, String, TaskFuncExpr
)"
(
dynamic
\(
Typed
funExpr
)
s
(
Typed
taskFunc
)
->
Typed
(
funExpr
,
s
,
taskFunc
)
::
A
.
a
b
:
(
Typed
FunExpr
a
)
String
(
Typed
TaskFuncExpr
(
a
->
Task
b
))
->
Typed
TaskStepExpr
(
a
->
Task
b
)
)
<<@@@
applyHorizontalClasses
]
->
Typed
(
FunExpr
,
String
,
TaskFuncExpr
)
(
a
->
Task
b
)
)
<<@@@
HideIfOnlyChoice
]
,
DynamicConsGroup
"Editors"
[
functionConsDyn
"Apply"
"apply"
(
dynamic
\(
Typed
taskFunc
)
(
Typed
expr
)
->
Typed
(
Apply
taskFunc
expr
)
::
...
...
@@ -201,7 +199,7 @@ evalTaskConstExpr (Or task1 task2) = evalTaskConstExpr task1
evalTaskConstExpr
(
And
task1
task2
)
=
evalTaskConstExpr
task1
-&&-
evalTaskConstExpr
task2
@
\(
a
,
b
)
->
VTuple
a
b
evalTaskConstExpr
(
When
task1
options
)
=
evalTaskConstExpr
task1
>>*
reverse
(
mkSteps
options
[])
/*
evalTaskConstExpr (When task1 options) = evalTaskConstExpr task1 >>* reverse (mkSteps options [])
where
mkSteps (Step1 pred butName task) steps = [OnAction (Action butName) (ifValue (test pred) (evalTaskFuncExpr task)):steps]
mkSteps (StepN pred butName task mStep) steps = mkSteps mStep [OnAction (Action butName) (ifValue (test pred) (evalTaskFuncExpr task)):steps]
...
...
@@ -213,7 +211,7 @@ where
test pred (VBool i) = case pred of
(EqV (VBool j)) = i==j
(LessV (VBool j)) = False
(
GrtV
(
VBool
j
))
=
False
(GrtV (VBool j)) = False
*/
evalTaskFuncExpr
::
TaskFuncExpr
Value
->
Task
Value
evalTaskFuncExpr
(
ViewInformation
p
)
(
VInt
i
)
=
(
viewInformation
p
[]
i
@
VInt
)
<<@
ApplyLayout
arrangeHorizontal
...
...
Libraries/iTasks/Extensions/Editors/DynamicEditor.dcl
View file @
c6a494a4
...
...
@@ -28,6 +28,7 @@ listCons :: !String !String !([a] -> b) -> DynamicCons | TC a & TC b
customEditorCons
::
!
String
!
String
!(
Editor
a
)
->
DynamicCons
|
TC
,
JSONEncode
{|*|},
JSONDecode
{|*|},
gText
{|*|}
a
// dynamic variants are required because this is the only way to use quantified type variables
functionConsDyn
::
!
String
!
String
!
Dynamic
->
DynamicCons
// The `Dynamic` argument must be a dynamic of type `[a] -> b`.
listConsDyn
::
!
String
!
String
!
Dynamic
->
DynamicCons
dynamicEditor
::
!(
DynamicEditor
a
)
->
Editor
(
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