Commit 0f027c30 authored by Mart Lubbers's avatar Mart Lubbers

Fix multiuser stuff and remove trailing space in examples

parent 0f6de3a5
Pipeline #12627 passed with stage
in 3 minutes and 38 seconds
......@@ -33,7 +33,7 @@ import Incidone.OP.Concepts
}
:: ActionTasks
= E.c: ActionTasks
= E.c: ActionTasks
([ContactNo] [IncidentNo] -> Task (c,ActionStatus)) //Configuration task
(c (Shared ActionStatus) -> Task ()) & iTask c //An action item that needs to be configured before it can be deployed
......@@ -97,7 +97,7 @@ import Incidone.OP.Concepts
:: CommunicationMeanSuggestion
= CommunicateUsingPhone
| CommunicateUsingVHF
| CommunicateUsingP2000
| CommunicateUsingP2000
| CommunicateUsingEmail
:: UserActionListDefinition =
......
......@@ -166,7 +166,7 @@ contactOptions (Just group) = sdsFocus group contactsWithGroupShort
forIncident :: IncidentNo (ActionDefinition (ContactNo,IncidentNo)) -> ActionDefinition ContactNo
forIncident incidentNo item=:{ActionDefinition|task} = {ActionDefinition|item & task = task`}
where
task` contactNo status = task (contactNo,incidentNo) status
task` contactNo status = task (contactNo,incidentNo) status
addDefaultStatus :: (Task c) -> ([ContactNo] [IncidentNo] -> Task (c,ActionStatus)) | iTask c
addDefaultStatus task = \initContacts initIncidents -> task @ \c -> (c,{ActionStatus|defaultValue & contacts = initContacts, incidents = initIncidents})
......@@ -228,7 +228,7 @@ gEq{|ActionTasks|} x y = True
gDefault{|ActionTasks|} = ActionTasks (\_ _ -> return ((),defaultValue)) (\_ _ -> return ())
gText{|ActionTasks|} _ _ = ["Action item task definition"]
gEditor{|ActionTasks|} = emptyEditor
gEditor{|ActionTasks|} = emptyEditor
instance toString ActionProgress
where
......@@ -280,7 +280,7 @@ predefinedTodoItem :: String ItemMeta -> CatalogAction
predefinedTodoItem identity meta=:{ItemMeta|title,description}
= {CatalogAction|identity=identity,meta=meta,tasks=ActionTasks configer todoItemTask}
where
configer initContacts initIncidents
configer initContacts initIncidents
= return ((),{ActionStatus|title=title,description=description,progress=ActionActive,contacts=initContacts,incidents=initIncidents})
userTodoItem :: String ItemMeta -> CatalogAction
......@@ -293,14 +293,14 @@ alertItemTask contactNo status = communicationItemTask contactNo status
configureAlertItemTask :: [ContactNo] [IncidentNo] -> Task ((ContactNo, Maybe P2000Message),ActionStatus)
configureAlertItemTask initContacts initIncidents = configureCommunicationItemTask "Alert" initContacts initIncidents
configureUserAlertItemTask :: ItemMeta CommunicationActionDefinition [ContactNo] [IncidentNo] -> Task ((ContactNo,Maybe P2000Message),ActionStatus)
configureUserAlertItemTask :: ItemMeta CommunicationActionDefinition [ContactNo] [IncidentNo] -> Task ((ContactNo,Maybe P2000Message),ActionStatus)
configureUserAlertItemTask meta def initContacts initIncidents = configureUserCommunicationItemTask "Alert" meta def initContacts initIncidents
blankAlertItem :: CatalogAction
blankAlertItem = {CatalogAction|identity="blank-alert",meta={ItemMeta|title="Alert item",description=Nothing},tasks=ActionTasks configureAlertItemTask alertItemTask}
predefinedAlertItem :: String ItemMeta (ContactNo,Maybe P2000Message) -> CatalogAction
predefinedAlertItem identity meta=:{ItemMeta|title,description} config
predefinedAlertItem :: String ItemMeta (ContactNo,Maybe P2000Message) -> CatalogAction
predefinedAlertItem identity meta=:{ItemMeta|title,description} config
= {CatalogAction|identity=identity,meta=meta,tasks=ActionTasks configer alertItemTask}
where
configer initContacts initIncidents
......@@ -312,19 +312,19 @@ userAlertItem identity meta def
//Inform items
informItemTask :: (ContactNo,Maybe P2000Message) (Shared ActionStatus) -> Task ()
informItemTask contactNo status = communicationItemTask contactNo status
informItemTask contactNo status = communicationItemTask contactNo status
configureInformItemTask :: [ContactNo] [IncidentNo] -> Task ((ContactNo,Maybe P2000Message),ActionStatus)
configureInformItemTask initContacts initIncidents = configureCommunicationItemTask "Inform" initContacts initIncidents
configureInformItemTask initContacts initIncidents = configureCommunicationItemTask "Inform" initContacts initIncidents
configureUserInformItemTask :: ItemMeta CommunicationActionDefinition [ContactNo] [IncidentNo] -> Task ((ContactNo,Maybe P2000Message),ActionStatus)
configureUserInformItemTask :: ItemMeta CommunicationActionDefinition [ContactNo] [IncidentNo] -> Task ((ContactNo,Maybe P2000Message),ActionStatus)
configureUserInformItemTask meta def initContacts initIncidents = configureUserCommunicationItemTask "Inform" meta def initContacts initIncidents
blankInformItem :: CatalogAction
blankInformItem = {CatalogAction|identity="blank-inform",meta={ItemMeta|title="Inform item",description=Nothing}
,tasks=ActionTasks configureInformItemTask informItemTask}
predefinedInformItem :: String ItemMeta (ContactNo,Maybe P2000Message) -> CatalogAction
predefinedInformItem :: String ItemMeta (ContactNo,Maybe P2000Message) -> CatalogAction
predefinedInformItem identity meta=:{ItemMeta|title,description} config
= {CatalogAction|identity=identity,meta=meta,tasks=ActionTasks configer informItemTask}
where
......@@ -335,7 +335,7 @@ userInformItem :: String ItemMeta CommunicationActionDefinition -> CatalogAction
userInformItem identity meta def
= {CatalogAction|identity=identity,meta=meta,tasks=ActionTasks (configureUserInformItemTask meta def) informItemTask}
//List items
//List items
listItemTask :: (String,ActionPlan) (Shared ActionStatus) -> Task ()
listItemTask (title,plan) status
= upd (\s -> {ActionStatus|s & title = title}) status
......@@ -351,7 +351,7 @@ where
where
configureDelayed configer task list
= configer initContacts initIncidents
>>= \(config,status) ->
>>= \(config,status) ->
set status (selfActionStatus list)
>>| task config (selfActionStatus list)
initStatus {ItemMeta|title,description}
......@@ -361,11 +361,11 @@ where
/*
= [(Detached (initAttributes identity (initStatus [] [])) True, \list -> task (selfActionStatus list)) //TODO: Maybe inherit contact+incident from parent
\\ item=:{CatalogAction|identity,task=ConfigurableAction configer task} <- init]
*/
*/
configureListItemTask :: [ContactNo] [IncidentNo] -> Task ((String,ActionPlan),ActionStatus)
configureListItemTask initContacts initIncidents
= enterActionStatus initContacts initIncidents
= enterActionStatus initContacts initIncidents
@ \s -> ((s.ActionStatus.title, {ActionPlan|immediateActions=return [],suggestedActions=return []}),s)
blankListItem :: CatalogAction
......@@ -375,7 +375,7 @@ predefinedListItem :: String ItemMeta ActionPlan -> CatalogAction
predefinedListItem identity meta=:{ItemMeta|title,description} plan
= {CatalogAction|identity=identity,meta=meta,tasks=ActionTasks configer listItemTask}
where
configer initContacts initIncidents
configer initContacts initIncidents
= updateInitialActionStatus meta initContacts initIncidents
@ \s -> ((s.ActionStatus.title, plan),s)
......@@ -386,7 +386,7 @@ where
task c status = listItemTask (title,plan c) status
//TODO: Filter actions by their rules and watch data changes
userListItem :: String ItemMeta UserActionListDefinition -> CatalogAction
userListItem :: String ItemMeta UserActionListDefinition -> CatalogAction
userListItem identity meta=:{ItemMeta|title,description} {immediateActions,additionalActions}
= {CatalogAction|identity=identity,meta=meta,tasks=ActionTasks configer listItemTask}
where
......@@ -406,7 +406,7 @@ where
//These tasks are used both by alert and inform actions
configureCommunicationItemTask :: String [ContactNo] [IncidentNo] -> Task ((ContactNo,Maybe P2000Message),ActionStatus)
configureCommunicationItemTask type initContacts initIncidents
configureCommunicationItemTask type initContacts initIncidents
= (enterChoiceWithShared ("Select the contact to "+++ toLowerCase type) [] allContactsShort
-&&-
enterChoiceWithShared ("Select the incident to "+++toLowerCase type +++" about") [] openIncidentsShort
......@@ -416,28 +416,28 @@ configureCommunicationItemTask type initContacts initIncidents
,contacts=removeDup [contactIdentity c:initContacts]
,incidents=removeDup [incidentIdentity i:initIncidents]})
configureUserCommunicationItemTask :: String ItemMeta CommunicationActionDefinition [ContactNo] [IncidentNo] -> Task ((ContactNo,Maybe P2000Message),ActionStatus)
configureUserCommunicationItemTask type meta {CommunicationActionDefinition|contactReference=Just ref,p2000Template} initContacts initIncidents
= findReferencedContacts ref
>>- \contacts ->
configureUserCommunicationItemTask :: String ItemMeta CommunicationActionDefinition [ContactNo] [IncidentNo] -> Task ((ContactNo,Maybe P2000Message),ActionStatus)
configureUserCommunicationItemTask type meta {CommunicationActionDefinition|contactReference=Just ref,p2000Template} initContacts initIncidents
= findReferencedContacts ref
>>- \contacts ->
(enterChoiceAs ("Select the contact to " +++ toLowerCase type) [] contacts contactIdentity @ (\c -> (c,p2000Template)))
-&&-
updateInitialActionStatus meta initContacts initIncidents
configureUserCommunicationItemTask type _ _ initContacts initIncidents
configureUserCommunicationItemTask type _ _ initContacts initIncidents
= configureCommunicationItemTask type initContacts initIncidents
communicationItemTask :: (ContactNo,Maybe P2000Message) (Shared ActionStatus) -> Task ()
communicationItemTask (contactNo,mbP2000Template) status
//View action description
= viewSharedInformation () [ViewAs (\{ActionStatus|description} -> description)] status
= viewSharedInformation () [ViewAs (\{ActionStatus|description} -> description)] status
-&&- ((
//View contact communication means
(viewContactCommunicationMeans contactNo
>^* [OnAction ActionEdit (always (doOrClose (manageContactCommunicationMeans True contactNo) <<@ InWindow))]
)
//Manage list of communication attempts and initiate communications
-&&- attemptCommunication contactNo
-&&- attemptCommunication contactNo
) <<@ ArrangeWithSideBar 0 LeftSide 200 True) <<@ ArrangeWithSideBar 0 TopSide 50 True
@! ()
where
......@@ -464,7 +464,7 @@ where
addP2000Message status attempts
= createCommunication P2000Message Out (Just contactNo)
>>- \communicationNo ->
maybe (return ()) (initMessageFromTemplate communicationNo contactNo) mbP2000Template
maybe (return ()) (initMessageFromTemplate communicationNo contactNo) mbP2000Template
>>| doOrClose (composeP2000Message communicationNo) <<@ InWindow
>>- \mbCommunication -> case mbCommunication of
Nothing
......@@ -541,7 +541,7 @@ where
addActionToFolders a folders = [(match,if (match a) (add a folder) folder) \\ (match,folder) <- folders]
where
add item=:(i,(iNo,pNo,action)) folder
add item=:(i,(iNo,pNo,action)) folder
# (added,nodes) = inject item (choiceTreeChildren folder)
# nodes = if added nodes (nodes ++ [node i iNo action])
# type = case folder.ChoiceTree.type of
......@@ -689,7 +689,7 @@ manageCurrentSubActionItems status list
@! ()
where
//Filter the list for detached items
subTaskItems list = mapRead toActionStatusesTL (taskListMeta list)
subTaskItems list = mapRead toActionStatusesTL (taskListMeta list)
format {ActionStatus|title,progress}
= {ActionStatusShort|progress=formatProgress progress,title=title}
......@@ -785,7 +785,7 @@ where
removeCatalogItem item
= viewInformation (Title "Remove") [] ("Remove " <+++ item.UserCatalogAction.identity <+++ "?")
>>? \nx ->
>>? \nx ->
upd (\xs -> [x \\ x <- xs | x.UserCatalogAction.identity <> item.UserCatalogAction.identity]) userActionCatalog @! ()
exportCatalog
......@@ -810,7 +810,7 @@ where
) (\e -> viewInformation "Failed import action catalog" [] e @! ())
) <<@ Title "Import actions"
where
instructions = toString
instructions = toString
(PTag [] [Text "Please select a JSON export file to upload.",BrTag []
,Text "The file needs to be formatted like ",ATag [HrefAttr "/demo-content/actioncatalog.json",TargetAttr "_blank"] [Text "actioncatalog.json"]
])
......
implementation module Incidone.ContactPosition
import iTasks, iTasks.UI.Editor, iTasks.UI.Editor.Controls, iTasks.UI.Editor.Modifiers, iTasks.UI.Definition
import qualified Data.Map as DM
import Data.Functor, Data.List, Text
import Data.Functor, Data.List, Text
import qualified Text.Parsers.ZParsers.ParsersKernel as PK
import qualified Text.Parsers.ZParsers.ParsersDerived as PD
import qualified Control.Applicative as CA
......@@ -15,7 +15,7 @@ import Incidone.Util.TaskPatterns
derive JSONEncode ContactPosition
derive JSONDecode ContactPosition
gEditor{|ContactPosition|} = bijectEditorValue printPosition parsePosition textField
gEditor{|ContactPosition|} = bijectEditorValue printPosition parsePosition textField
gText{|ContactPosition|} _ val = [maybe "" printPosition val]
derive gDefault ContactPosition
......
......@@ -7,7 +7,7 @@ import Text.HTML
selectVideoWallContent :: Task ()
selectVideoWallContent
= (header ||- selectContent) <<@ (ArrangeWithSideBar 0 TopSide 30 False)
= (header ||- selectContent) <<@ (ArrangeWithSideBar 0 TopSide 30 False)
@! ()
where
header
......
......@@ -38,7 +38,7 @@ answerPhoneCall communicationNo
>>| connectInboundPhoneCall communicationNo
||- ((manageCommunicationContact communicationNo
-&&-
manageVoiceCallContent PhoneCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide 300 True)
manageVoiceCallContent PhoneCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide 300 True)
<<@ ArrangeWithSideBar 0 TopSide 60 False
<<@ Title ("Answer phone call")
/* <<@ AfterLayout (uiDefSetSize (ExactSize 800) (ExactSize 600)) */ //FIXME
......
......@@ -26,7 +26,7 @@ selectContact = withShared Nothing
(viewContactsOnMap mapContacts sel <<@ Title "Map")
<<@ ArrangeWithTabs True
)
where
where
mapContacts = mapRead (\(x,y) -> x++y) (contactsOfOpenIncidentsGeo |+| contactsProvidingHelpGeo)
selectContactFromLists :: (Shared (Maybe (Either ContactNo MMSI))) -> Task (Either ContactNo MMSI)
......@@ -40,7 +40,7 @@ where
/*
,(editSharedSelectionWithShared (Title "AIS") False
(SelectInTree ungrouped) (mapRead (sortBy (\x y -> contactTitle x < contactTitle y) o map aisToContact) allAISContacts) (Right o contactIdentity)) sel
*/ ] <<@ (ArrangeSplit Horizontal True) @? tvHd
*/ ] <<@ (ArrangeSplit Horizontal True) @? tvHd
fromOpenOption [{ContactShortWithIncidents|contactNo}] = contactNo
......@@ -195,7 +195,7 @@ manageContactCommunicationMeans compact contactNo = forever (
>^* [OnAction ActionAdd (always (addMean contactNo <<@ InWindow @! ()))
,OnAction ActionEdit (hasValue (\{CommunicationMean|id} -> editMean id <<@ InWindow @! ()))
,OnAction ActionRemove (hasValue (\{CommunicationMean|id} -> removeMean id))
]
]
)
where
ActionAdd = Action (if compact "Add" "/Add")
......@@ -263,7 +263,7 @@ manageContactIncidents :: Workspace ContactNo -> Task ()
manageContactIncidents ws contactNo
= feedForward choose
( \sel ->
withSelection viewNoSelection viewIncidentDetails sel
withSelection viewNoSelection viewIncidentDetails sel
-&&-
doAddRemoveOpen (add <<@ InWindow) (\c -> (remove c) <<@ InWindow) (\c -> doOrClose (open c)) ws sel
) <<@ (ArrangeWithSideBar 1 RightSide 300 True) <<@ (Icon "incidents") <<@ (Title "Incidents")
......@@ -596,7 +596,7 @@ where
selection _ = NoValue
sharePerspective (_,perspective) = set (WallOverview perspective) wallContent @! ()
toMarkers sel contacts
= [contactGeoToMapMarker ais (isSelected contactNo sel) c \\ (ais,c=:{ContactGeo|contactNo,name=Just _,position=Just _}) <- contacts]
......@@ -609,7 +609,7 @@ where
| startsWith "c" markerId = Just (Left (toInt (subString 1 (textSize markerId) markerId)))
| startsWith "a" markerId = Just (Right (toInt (subString 1 (textSize markerId) markerId)))
= updateSelection ms
findContactNo title contacts = case [(isAis,contactNo) \\ (isAis,{ContactGeo|contactNo,name}) <- contacts | name == title] of
[(False,contactNo)] = Just (Left contactNo)
[(True,mmsi)] = Just (Right mmsi)
......
......@@ -94,11 +94,11 @@ where
contactSummary :: Contact -> ContactShort
contactSummary {Contact|contactNo,name,type,group}
= {ContactShort|contactNo = contactNo, name = name, type = type, group = group}
incidentDetails :: Incident -> IncidentDetails
incidentDetails {Incident|incidentNo,title,summary,type,phase}
= {IncidentDetails|incidentNo = incidentNo, title = title, summary = summary, type = type, phase = phase}
contactDetails :: Contact -> ContactDetails
contactDetails {Contact|contactNo,name,type,position,notes}
= {ContactDetails|contactNo = contactNo, name = name, type = type, position = position, notes = notes}
......
......@@ -27,7 +27,7 @@ manageIncidentInformation ws incidentNo
,(Embedded, \_ -> manageIncidentContacts ws incidentNo)
,(Embedded, \_ -> manageIncidentActions incidentNo)
,(Embedded, \_ -> manageIncidentWeather incidentNo)
,(Embedded, \_ -> manageIncidentLog incidentNo)
,(Embedded, \_ -> manageIncidentLog incidentNo)
] [] <<@ ArrangeWithTabs False)
@! ()
......@@ -101,7 +101,7 @@ manageIncidentActions incidentNo
@! ()
where
selectAndWorkOnPlannedActions
= (feedForward (chooseActionItem (Title "Overview") False True (sdsFocus incidentNo actionStatusesByIncident) /* <<@ AfterLayout (tweakUI fill) */)
= (feedForward (chooseActionItem (Title "Overview") False True (sdsFocus incidentNo actionStatusesByIncident) /* <<@ AfterLayout (tweakUI fill) */)
(\s -> whileUnchanged s
(\t -> case t of
Just taskId = workOnActionItem taskId
......@@ -152,7 +152,7 @@ where
( enterInformation () [] @ string
>>* [OnAction (Action "Add log message") (hasValue (\msg -> addLogMessage msg incidentNo))]
)
string :: String -> String
string x = x
......@@ -350,7 +350,7 @@ createIncident incident
logIncidentCreated incidentNo incident
@! incidentNo
where
create :: NewIncident -> Task IncidentNo
create :: NewIncident -> Task IncidentNo
create {NewIncident|type,title,summary}
= get databaseDef
>>- \db -> sqlExecute db ["allIncidents"] (execInsert "INSERT INTO Incident (type,title,summary) VALUES (?,?,?)"
......
......@@ -143,7 +143,7 @@ where
# (err,cur) = execute "INSERT INTO PhoneCall (communicationNo,externalNo) VALUES (?,?)"
(flatten [toSQL communicationNo,mbToSQL externalNo]) cur
| isJust err
# (err,cur) = execute "UPDATE PhoneCall SET externalNo = ? WHERE communicationNo = ?"
# (err,cur) = execute "UPDATE PhoneCall SET externalNo = ? WHERE communicationNo = ?"
(flatten [mbToSQL externalNo,toSQL communicationNo]) cur
| isJust err = (Error (toString (fromJust err)),cur)
= (Ok (), cur)
......@@ -193,7 +193,7 @@ where
detailsIncidents :: (Maybe RowFilterDef) -> ReadOnlyShared [IncidentDetails]
detailsIncidents mbWhere = mapRead (map prj) (baseIncidents mbWhere)
where
where
prj {Incident|incidentNo,title,summary,type,phase}
= {IncidentDetails|incidentNo=incidentNo,title=title,summary=summary,type=type,phase=phase}
......@@ -327,7 +327,7 @@ where
, communications = fromMaybe [] ('DM'.get incident.Incident.incidentNo cmlinks)
, log = log
}
writePrj (incident=:{Incident|incidentNo,contacts,communications}) (((_,cnlinks),cmlinks),_)
= Just ((incident,'DM'.put incidentNo contacts cnlinks),'DM'.put incidentNo communications cmlinks)
writePrj _ _ = Nothing
......@@ -758,7 +758,7 @@ where
# (err,mbRow,cur) = fetchOne cur
| isJust err = (Error (toString (fromJust err)),cur)
= (Ok (fmap fromSQL mbRow), cur)
writeFun mmsi Nothing cur = (Ok (), cur) //Only write on Just
writeFun mmsi (Just contact=:{Contact|contactNo,type,name,group,position,heading,track,positionUpdated,needsHelp,providesHelp,notes,status}) cur
//Update contact info
......@@ -795,7 +795,7 @@ contactCommunicationMeans = sdsTranslate "contactCommunicationMeans" query (dbRe
where
query contactNo = {columns=columns,rows=rows contactNo,order = Nothing}
rows contactNo = Just (EqualsValue ("communicationMeans1_communicationMeans2","communicationMeans2") [SQLVInteger contactNo])
columns = InnerJoin columnsCommunicationMean
columns = InnerJoin columnsCommunicationMean
{name="communicationMeans1_communicationMeans2",alias="communicationMeans1_communicationMeans2",columns=[]}
("communicationMeans1_communicationMeans2","communicationMeans1") ("CommunicationMean","id")
......@@ -880,7 +880,7 @@ airplaneDetailsByNo = sdsTranslate "airplaneDetailsByNo" query (dbReadWriteOneSD
where
query contactNo = {columns=columnsAirplaneDetails,rows=Just (EqualsValue ("Airplane","contactNo") [SQLVInteger contactNo]), order=Nothing}
helicopterDetailsByNo :: RWShared ContactNo HelicopterDetails HelicopterDetails
helicopterDetailsByNo :: RWShared ContactNo HelicopterDetails HelicopterDetails
helicopterDetailsByNo = sdsTranslate "helicopterDetailsByNo" query (dbReadWriteOneSDS "helicopterDetailsByNo")
where
query contactNo = {columns=columnsHelicopterDetails,rows=Just (EqualsValue ("Helicopter","contactNo") [SQLVInteger contactNo]), order=Nothing}
......@@ -947,7 +947,7 @@ where
writeFun mmsi (Just {AISContact|position,heading,track,lastPositionMsg,lastInfoMsg,positionUpdated,infoUpdated}) cur
//Brute force upsert, try insert, if it fails, try update
# (res,cur) = execInsert "INSERT INTO AISContact (mmsi,position_lat,position_lon,position_desc,heading,track,lastPositionMsg,lastInfoMsg,positionUpdated,infoUpdated) VALUES (?,?,?,?,?,?,?,?,?,?)"
# (res,cur) = execInsert "INSERT INTO AISContact (mmsi,position_lat,position_lon,position_desc,heading,track,lastPositionMsg,lastInfoMsg,positionUpdated,infoUpdated) VALUES (?,?,?,?,?,?,?,?,?,?)"
(flatten [toSQL mmsi, mbToSQL position, mbToSQL heading, mbToSQL track, mbToSQL lastPositionMsg, mbToSQL lastInfoMsg,mbToSQL positionUpdated, mbToSQL infoUpdated]) cur
| res=:(Error _) //Try update
......
......@@ -141,7 +141,7 @@ manageUsers = forever (catchAll (
) (\e -> viewInformation "Error" [] e >>| return ()))
where
manageExistingUsers
= (enterChoiceWithSharedAs () [ChooseFromGrid id] allContactsShort contactIdentity
= (enterChoiceWithSharedAs () [ChooseFromGrid id] allContactsShort contactIdentity
>&> withSelection viewNoSelection manageContactAccess
)<<@ ArrangeWithSideBar 0 LeftSide 200 True
......@@ -222,7 +222,7 @@ configureMaps
where
previewMapLayers :: Task ContactMapPerspective
previewMapLayers = withShared defaultValue
\perspective -> updateSharedInformation (Title "Preview") [UpdateAs toPrj fromPrj] (perspective >*| standardMapLayers) <<@ ApplyLayout flexMap @ fst
\perspective -> updateSharedInformation (Title "Preview") [UpdateAs toPrj fromPrj] (perspective >*| standardMapLayers) <<@ ApplyLayout flexMap @ fst
where
toPrj (perspective,layers) = toLeafletMap {ContactMap|defaultValue & perspective=perspective,layers=layers}
fromPrj _ {LeafletMap|perspective} = fromLeafletPerspective perspective
......@@ -258,7 +258,7 @@ where
) (\e -> viewInformation "Failed import of web links" [] e @! ())
) <<@ Title "Import web links"
where
instructions = toString
instructions = toString
(PTag [] [Text "Please select a JSON export file to upload.",BrTag []
,Text "The file needs to be formatted like ",ATag [HrefAttr "/demo-content/weblinks.json",TargetAttr "_blank"] [Text "weblinks.json"]
])
......
......@@ -40,7 +40,7 @@ where
/*
* The incident dashboard gives an overview of all open incidents,
* provides ad-hoc creation of new incidents and provides
* provides ad-hoc creation of new incidents and provides
* a way to open the incident information browsing incident task for open incidents.
*/
browseIncidents :: Workspace -> Task ()
......@@ -91,7 +91,7 @@ where
{ status :: Maybe String
, title :: Maybe String
, createdOn :: Maybe String
, createdBy :: Maybe String
, createdBy :: Maybe String
}
derive class iTask ActionSet, ActionShort
......
......@@ -47,7 +47,7 @@ definition module Incidone.Util.AIS
, day :: Int // Day
, hour :: Int // Hour
, minute :: Int // Minute
, second :: Int // Second
, second :: Int // Second
, accuracy :: Bool // Fix quality
, lon :: Int // Longitude
, lat :: Int // Latitude
......
......@@ -56,7 +56,7 @@ TESTMESSAGES :==
, day :: Int // Day
, hour :: Int // Hour
, minute :: Int // Minute
, second :: Int // Second
, second :: Int // Second
, accuracy :: Bool // Fix quality
, lon :: Int // Longitude
, lat :: Int // Latitude
......@@ -113,7 +113,7 @@ where
= ([f6],remainder)
| otherwise
# (fragments,remainder) = decodeWrapper remainder
= ([f6:fragments],remainder)
= ([f6:fragments],remainder)
_ = ([],remainder)
//Decode the message data
......@@ -138,7 +138,7 @@ where
initMessage 4 = AIVDM4 initType4
initMessage 5 = AIVDM5 initType5
initMessage i = AIVDM i
initCNB type = {msgtype=type,repeat=0,mmsi=0,status=0,turn=0,speed=0,accuracy=False
,lon=0,lat=0,course=0,heading=0,second=0,maneuver=0,raim=False,radio=0}
initType4 = {msgtype=4,repeat=0,mmsi=0,year=0,month=0,day=0,hour=0,minute=0
......@@ -206,7 +206,7 @@ where
updMMSI i (AIVDM4 m) = AIVDM4 {AIVDM4|m & mmsi = i}
updMMSI i (AIVDM5 m) = AIVDM5 {AIVDM5|m & mmsi = i}
updMMSI i msg = msg
updCNB f i (AIVDM1 m) = AIVDM1 (f i m)
updCNB f i (AIVDM2 m) = AIVDM2 (f i m)
updCNB f i (AIVDM3 m) = AIVDM3 (f i m)
......
......@@ -4,7 +4,7 @@ import iTasks.Extensions.DateTime
import Text, System.Time
import Incidone.Util.TaskPatterns
//Notifications are stored newest first
//Notifications are stored newest first
notifications :: Shared [(DateTime,String)]
notifications = sharedStore "notifications" []
......@@ -15,7 +15,7 @@ where
prj (now,notifications) = [toString dt +++ msg \\ (dt,msg) <- notifications | limit now dt ]
limit t1 t2 = False //FIXME: We need an non-pure function to convert the datetime values, we can't do that with a mapRead...
/*
# (Timestamp s1) = datetimeToTimestamp t1
# (Timestamp s1) = datetimeToTimestamp t1
# (Timestamp s2) = datetimeToTimestamp t2
= s1 - s2 < 3
*/
......
......@@ -23,7 +23,7 @@ createNewIncident :: Task (Maybe IncidentNo)
createNewIncident
= enterInformation ("Create new incident", "Fill in the following basic information to create a new incident") []
>>? createIncident
createNewContact :: Task (Maybe ContactNo)
createNewContact
= enterInformation ("New contact","Enter the basic information of the new contact") []
......@@ -167,7 +167,7 @@ manageSharedListWithDetails :: (Int -> Task ()) (Task Int) (Shared [Int]) -> Tas
manageSharedListWithDetails detailsTask addTask refsList //Not the best implementation, but good enough for now