Commit ffedc8de authored by Bas Lijnse's avatar Bas Lijnse

Maded workflow-admin css based. New tasks are now properly started in a window...

Maded workflow-admin css based. New tasks are now properly started in a window and styling is done with css.
parent 5905e647
Pipeline #20783 passed with stage
in 4 minutes and 42 seconds
<!DOCTYPE html>
<html style="width: 100%; height: 100%;">
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="/css/itasks.css" type="text/css" >
<link rel="stylesheet" href="/css/WorkflowAdmin.css" type="text/css" >
<!-- Sapl dependencies -->
<script type="text/javascript" src="/js/sapl-utils.js"></script>
<script type="text/javascript" src="/js/sapl-builtin.js"></script>
<script type="text/javascript" src="/js/sapl-dynamic.js"></script>
<script type="text/javascript" src="/js/sapl-itasks.js"></script>
<script type="text/javascript" src="/js/sapl-rt.js"></script>
<script type="text/javascript" src="/js/sapl-support.js"></script>
<script type="text/javascript" src="/js/sapl-debug.js"></script>
<!-- iTasks framework -->
<script type="text/javascript" src="/js/itasks-core.js"></script>
<script type="text/javascript" src="/js/itasks-components-raw.js"></script>
<script type="text/javascript" src="/js/itasks-components-form.js"></script>
<script type="text/javascript" src="/js/itasks-components-display.js"></script>
<script type="text/javascript" src="/js/itasks-components-selection.js"></script>
<script type="text/javascript" src="/js/itasks-components-container.js"></script>
<script type="text/javascript" src="/js/itasks-js-interface.js"></script>
<!-- load iTasks viewport -->
<script type="text/javascript">
window.onload = function() {
itasks.viewport({syncTitle: true}, document.body);
};
</script>
</head>
<body style="width: 100%; height: 100%">
</body>
</html>
div.itasks-container.manage-work-header {
padding: 2px 2px 2px 10px;
flex-direction: row;
}
div.itasks-window.new-work-window {
min-width: 600px;
min-height: 350px;
}
......@@ -156,7 +156,7 @@ where
[layoutSubUIs SelectChildren actionToButton
,layoutSubUIs (SelectByPath [0]) (setUIType UIContainer)
,setUIType UIContainer
,addCSSClass "itasks-compact-header"
,addCSSClass "manage-work-header"
]
layoutWhatToDo = sequenceLayouts [arrangeWithSideBar 0 LeftSide True, layoutSubUIs (SelectByPath [1]) unwrapUI]
......@@ -176,7 +176,6 @@ where
manageWork :: Task ()
manageWork = parallel [(Embedded, manageList)] [] <<@ ApplyLayout layoutManageWork @! ()
where
manageList taskList
= get currentUser @ userRoles
>>- \roles ->
......@@ -188,7 +187,7 @@ where
worklist roles = if (isMember "admin" roles) allWork myWork
continuations roles taskList = if (isMember "manager" roles) [new,open,delete] [open]
where
new = OnAction (Action "New") (always (appendTask Embedded (removeWhenStable (addNewTask taskList)) taskList @! () ))
new = OnAction (Action "New") (always (appendTask Embedded (removeWhenStable (addNewTask taskList <<@ InWindow <<@ AddCSSClass "new-work-window")) taskList @! () ))
open = OnAction (Action "Open") (hasValue (\(taskId,_) -> openTask taskList taskId @! ()))
delete = OnAction (Action "Delete") (ifValue (\x -> snd x || isMember "admin" roles) (\(taskId,_) -> removeTask taskId topLevelTasks @! ()))
......@@ -328,9 +327,10 @@ where
removeWhenStable :: (Task a) (SharedTaskList a) -> Task a | iTask a
removeWhenStable task slist
= task
= (task
>>* [OnValue (ifStable (\_ -> get (taskListSelfId slist) >>- \selfId -> removeTask selfId slist))]
@? const NoValue
@? const NoValue)
<<@ ApplyLayout unwrapUI
addWorkflows :: ![Workflow] -> Task [Workflow]
addWorkflows additional
......
......@@ -105,6 +105,9 @@ instance tune ArrangeHorizontal Task
:: ScrollContent = ScrollContent
instance tune ScrollContent Task
:: AddCSSClass = AddCSSClass !String
instance tune AddCSSClass Task
//Changing container types
toContainer :: LayoutRule
......
......@@ -199,11 +199,14 @@ toWindow :: UIWindowType UIVAlign UIHAlign -> LayoutRule
toWindow windowType vpos hpos = sequenceLayouts
[wrapUI UIWindow
,interactToWindow
,copySubUIAttributes (SelectKeys [TITLE_ATTRIBUTE]) [0] []
,layoutSubUIs (SelectByPath [0]) (delUIAttributes (SelectKeys [TITLE_ATTRIBUTE]))
//Move title and class attributes to window
,copySubUIAttributes (SelectKeys ["title","class"]) [0] []
,layoutSubUIs (SelectByPath [0]) (delUIAttributes (SelectKeys ["title","class"]))
//Set window specific attributes
,setUIAttributes ('DM'.unions [windowTypeAttr windowType,vposAttr vpos, hposAttr hpos])
]
where
//If the first child is an interact, move the title one level up
interactToWindow = layoutSubUIs (SelectAND (SelectByPath []) (SelectByContains (SelectAND (SelectByPath [0]) (SelectByType UIInteract))))
(sequenceLayouts [copySubUIAttributes (SelectKeys ["title"]) [0,0] []
,layoutSubUIs (SelectByPath [0,0]) (delUIAttributes (SelectKeys ["title"]))
......@@ -305,6 +308,10 @@ instance tune ScrollContent Task
where
tune ScrollContent t = tune (ApplyLayout scrollContent) t
instance tune AddCSSClass Task
where
tune (AddCSSClass s) t = tune (ApplyLayout (addCSSClass s)) t
instance tune ToWindow Task
where
tune (ToWindow windowType vpos hpos) t = tune (ApplyLayout (toWindow windowType vpos hpos)) t
......
......@@ -638,7 +638,7 @@ div.itasks-exception {
display: flex;
flex-direction: column;
}
.itasks-tabset .itasks-tabitem {
.itasks-tabset .itasks-container.itasks-tabitem, .itasks-tabset .itasks-panel.itasks-tabitem {
display: none;
}
.itasks-tabset .itasks-panel.itasks-tabitem.itasks-selected {
......
......@@ -638,7 +638,7 @@ div.itasks-exception {
display: flex;
flex-direction: column;
}
.itasks-tabset .itasks-tabitem {
.itasks-tabset .itasks-container.itasks-tabitem, .itasks-tabset .itasks-panel.itasks-tabitem {
display: none;
}
.itasks-tabset .itasks-panel.itasks-tabitem.itasks-selected {
......
......@@ -313,7 +313,7 @@
display: flex;
flex-direction: column;
}
.#{$prefix}tabitem {
.#{$prefix}container.#{$prefix}tabitem, .#{$prefix}panel.#{$prefix}tabitem {
display: none;
}
.#{$prefix}panel.#{$prefix}tabitem.#{$prefix}selected {
......@@ -567,9 +567,3 @@
flex: 0 0 200px;
align-self: stretch;
}
/* Headers of various sorts */
.#{$prefix}compact-header {
padding: 2px 2px 2px 10px;
flex-direction: row;
}
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