Verified Commit b34f44c9 authored by Camil Staps's avatar Camil Staps 🚀

Rename >>= to >>? and >>| to >?| to avoid clashes with Control.Monad

parent 09092ff0
Pipeline #38657 passed with stage
in 7 minutes and 11 seconds
......@@ -353,9 +353,9 @@ where
where
configureDelayed attr configer task list
= configer initContacts initIncidents
>>= \(config,status) ->
>>? \(config,status) ->
set status (selfActionStatus list)
>>| task config (selfActionStatus list) <<@ attr
>-| task config (selfActionStatus list) <<@ attr
initStatus {ItemMeta|title,description}
= {ActionStatus|title=title,description=description,progress=ActionActive,contacts=initContacts,incidents=initIncidents}
......@@ -467,7 +467,7 @@ where
= createCommunication P2000Message Out (Just contactNo)
>>- \communicationNo ->
maybe (return ()) (initMessageFromTemplate communicationNo contactNo) mbP2000Template
>>| doOrClose (composeP2000Message communicationNo) <<@ InWindow
>-| doOrClose (composeP2000Message communicationNo) <<@ InWindow
>>- \mbCommunication -> case mbCommunication of
Nothing
= return ()
......@@ -582,7 +582,7 @@ where
>>- \mbReplacement -> case mbReplacement of
Just (ActionTasks configer task)
= viewInformation [] "Because the software was upgraded, this action must unfortunately be reconfigured" ||- configer [] []
>>= \(c,_) ->
>>! \(c,_) ->
replaceTask taskId (\l -> (task c (selfActionStatus l) @? const NoValue)) topLevelTasks
_
= viewInformation [] "Sorry, this action is no longer available in the current version of Incidone."
......@@ -608,7 +608,7 @@ where
deleteActionItem :: InstanceNo -> Task (Maybe ActionStatus)
deleteActionItem instanceNo
= ( Title "Delete" @>> Hint "Are you sure you want to remove this action?" @>> viewSharedInformation [ViewAs view] status
>>? \stat -> removeTask (TaskId instanceNo 0) topLevelTasks @! stat
>?? \stat -> removeTask (TaskId instanceNo 0) topLevelTasks @! stat
) <<@ InWindow
where
status = sdsFocus instanceNo actionStatusByNo
......@@ -638,7 +638,7 @@ edit task sds
= get sds
>>- \current ->
task current
>>? \updated ->
>?? \updated ->
set updated sds
enterActionStatus :: [ContactNo] [IncidentNo] -> Task ActionStatus
......@@ -737,15 +737,15 @@ where
configureAction selSds = whileUnchanged selSds configTask
where
configTask Nothing = (Title "Configure" @>> viewInformation [] "Select an action first..." @? const NoValue) /* <<@ AfterLayout (uiDefSetHeight FlexSize) */
>>? return
>?? return
configTask (Just item=:{CatalogAction|identity,tasks=ActionTasks configer task})
= configer initContacts initIncidents <<@ Title "Configure" /* <<@ AfterLayout (uiDefSetHeight FlexSize) */
>>? \(config,initStatus) -> addAction identity initStatus list (\l -> task config l)
>?? \(config,initStatus) -> addAction identity initStatus list (\l -> task config l)
addAction :: String ActionStatus (SharedTaskList a) ((SimpleSDSLens ActionStatus) -> Task ()) -> Task TaskId | iTask a
addAction identity initStatus list task
= logActionAdded initStatus
>>| appendTask (Detached True attributes) (\l -> (task (selfActionStatus l)) @? const NoValue) list
>?| appendTask (Detached True attributes) (\l -> (task (selfActionStatus l)) @? const NoValue) list
where
attributes = initAttributes identity initStatus
......@@ -753,7 +753,7 @@ where
addSubActionItem :: [ContactNo] [IncidentNo] CatalogAction (SharedTaskList a) -> Task (Maybe TaskId) | iTask a
addSubActionItem initContacts initIncidents item=:{CatalogAction|identity,tasks=ActionTasks configer task} list
= (configer initContacts initIncidents
>>? \(config,initStatus) ->
>?? \(config,initStatus) ->
appendTask (Detached True (initAttributes identity initStatus)) (\list -> (task config (selfActionStatus list)) @? const NoValue) list
) <<@ InWindow
......@@ -777,17 +777,17 @@ manageUserActionCatalog
where
addCatalogItem
= Title "Add" @>> enterInformation []
>>? \nx ->
>?? \nx ->
upd (\xs -> xs++[nx]) userActionCatalog @! ()
editCatalogItem item
= Title "Edit" @>> updateInformation [] item
>>? \nx ->
>?? \nx ->
upd (\xs -> [if (x.UserCatalogAction.identity == nx.UserCatalogAction.identity) nx x \\ x<- xs]) userActionCatalog @! ()
removeCatalogItem item
= Title "Remove" @>> viewInformation [] ("Remove " <+++ item.UserCatalogAction.identity <+++ "?")
>>? \nx ->
>?? \nx ->
upd (\xs -> [x \\ x <- xs | x.UserCatalogAction.identity <> item.UserCatalogAction.identity]) userActionCatalog @! ()
exportCatalog
......@@ -804,7 +804,7 @@ where
importCatalog
= doOrClose (
Hint instructions @>> enterInformation []
>>= \doc -> catchAll (
>>! \doc -> catchAll (
importJSONDocument doc
>>- \actions ->
set actions userActionCatalog
......
......@@ -65,7 +65,7 @@ where
= (Hint "Enter a number to use when refering to this contact" @>> enterInformation []
-&&-
selectKnownOrDefineNewContact)
>>? (\(aliasNo,def) -> createContactIfNew def >>- \contactNo -> upd (\r -> r++[(aliasNo,contactNo)]) refs)
>?? (\(aliasNo,def) -> createContactIfNew def >>- \contactNo -> upd (\r -> r++[(aliasNo,contactNo)]) refs)
@! ()
derefAliasList :: [(Int,ContactNo)] [ContactShort] -> [(Int,ContactShort)]
......
......@@ -19,7 +19,7 @@ where
= get asteriskLinkConfig
>>- \{AsteriskConfig|host,port,username,password} ->
set ([],False,[authEvent username password],False) channel
>>| syncNetworkChannel host port "\r\n\r\n" decodeAsteriskEvent encodeAsteriskEvent channel
>-| syncNetworkChannel host port "\r\n\r\n" decodeAsteriskEvent encodeAsteriskEvent channel
consume channel
= consumeNetworkStream processEvents channel
......
......@@ -29,13 +29,13 @@ updateCommunication communicationNo
(P2000Message,Out) = composeP2000Message communicationNo
_
= (Title "Communication details:") @>> viewSharedInformation [] (sdsFocus communicationNo communicationDetailsByNo)
>>| return communicationNo
>!| return communicationNo
//Answer an incoming call
answerPhoneCall :: CommunicationNo -> Task CommunicationNo
answerPhoneCall communicationNo
= setInitialHandledBy communicationNo
>>| connectInboundPhoneCall communicationNo
>?| connectInboundPhoneCall communicationNo
||- ((manageCommunicationContact communicationNo
-&&-
manageVoiceCallContent PhoneCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide True)
......@@ -48,7 +48,7 @@ answerPhoneCall communicationNo
initiatePhoneCall :: CommunicationNo -> Task CommunicationNo
initiatePhoneCall communicationNo
= setInitialHandledBy communicationNo
>>| connectOutboundPhoneCall communicationNo
>?| connectOutboundPhoneCall communicationNo
||- ((manageCommunicationContact communicationNo
-&&-
manageVoiceCallContent PhoneCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide True)
......@@ -61,7 +61,7 @@ initiatePhoneCall communicationNo
answerRadioCall :: CommunicationNo -> Task CommunicationNo
answerRadioCall communicationNo
= setInitialHandledBy communicationNo
>>| updateRadioCallMeta communicationNo
>?| updateRadioCallMeta communicationNo
||- ((manageCommunicationContact communicationNo
-&&-
manageVoiceCallContent RadioCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide True)
......@@ -74,7 +74,7 @@ answerRadioCall communicationNo
initiateRadioCall :: CommunicationNo -> Task CommunicationNo
initiateRadioCall communicationNo
= setInitialHandledBy communicationNo
>>| updateRadioCallMeta communicationNo
>?| updateRadioCallMeta communicationNo
||- ((manageCommunicationContact communicationNo
-&&-
manageVoiceCallContent RadioCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide True)
......@@ -87,7 +87,7 @@ initiateRadioCall communicationNo
composeEmailMessage :: CommunicationNo -> Task CommunicationNo
composeEmailMessage communicationNo
= setInitialHandledBy communicationNo
>>| updateMessageMeta communicationNo
>?| updateMessageMeta communicationNo
||- ((composeAndSendMessage communicationNo message transmitEmailMessage
-&&-
relateMessageToIncidents communicationNo) <<@ ArrangeWithTabs True)
......@@ -102,7 +102,7 @@ where
composeP2000Message :: CommunicationNo -> Task CommunicationNo
composeP2000Message communicationNo
= setInitialHandledBy communicationNo
>>| updateMessageMeta communicationNo
>?| updateMessageMeta communicationNo
||- ((composeAndSendMessage communicationNo message transmitP2000Message
-&&-
relateMessageToIncidents communicationNo) <<@ ArrangeWithTabs True)
......@@ -144,7 +144,7 @@ where
@! ()
add = selectKnownOrDefineNewIncident <<@ Title "+"
>>= createIncidentIfNew
>>? createIncidentIfNew
/**
* Interact with the PBX integration to establish an actual phone connection
......@@ -354,18 +354,18 @@ transmitP2000Message communicationNo
reportPhoneCallBegin :: (Maybe String) (Maybe String) -> Task CommunicationNo
reportPhoneCallBegin externalNo externalRef
= traceValue ("Call started: " <+++ externalNo <+++ " " <+++ externalRef)
>>| createPhoneCall In
>-| createPhoneCall In
>>- \communicationNo ->
upd (\c -> {Communication|c & status = Just Ringing}) (sdsFocus communicationNo communicationByNo)
>>| upd (\p -> {PhoneCall|p & externalNo = externalNo, externalRef = externalRef}) (sdsFocus communicationNo phoneCallByNo)
>>| addNotification ("Incoming call from: "+++ fromMaybe "(unknown)" externalNo)
>-| upd (\p -> {PhoneCall|p & externalNo = externalNo, externalRef = externalRef}) (sdsFocus communicationNo phoneCallByNo)
>-| addNotification ("Incoming call from: "+++ fromMaybe "(unknown)" externalNo)
@! communicationNo
reportPhoneCallConnected :: (Either CommunicationNo String) -> Task ()
reportPhoneCallConnected (Left communicationNo) = upd (\c -> {Communication|c & status = Just Connected}) (sdsFocus communicationNo communicationByNo) @! ()
reportPhoneCallConnected (Right externalRef)
= traceValue ("Call connected: " +++ externalRef)
>>| updateCommunicationByCallReference externalRef updateFun
>-| updateCommunicationByCallReference externalRef updateFun
where
updateFun c = {Communication|c & status = Just Connected}
......@@ -373,7 +373,7 @@ reportPhoneCallEnd :: (Either CommunicationNo String) -> Task ()
reportPhoneCallEnd (Left communicationNo) = upd (\c -> {Communication|c & status = Just Answered}) (sdsFocus communicationNo communicationByNo) @! ()
reportPhoneCallEnd (Right externalRef)
= traceValue ("Call ended: " +++ externalRef)
>>| updateCommunicationByCallReference externalRef updateFun
>-| updateCommunicationByCallReference externalRef updateFun
where
updateFun c=:{Communication|status=Just Connected} = {Communication|c & status = Just Answered}
updateFun c = {Communication|c & status = Just Missed}
......
......@@ -128,10 +128,10 @@ where
editContactBasics contactNo
= (get (contactBasics contactNo)
>>= \old ->
>>- \old ->
updateInformation [] old
>>? \new -> set new (contactBasics contactNo)
>>| logContactBasicsUpdated contactNo old new
>?? \new -> set new (contactBasics contactNo)
>-| logContactBasicsUpdated contactNo old new
) @! ()
shareContact contactNo
......@@ -157,8 +157,8 @@ where
editDetails share log
= get share
>>- \old -> Icon "details" @>> Title "Details (editing)" @>> updateInformation [] old
>>? \new -> set new share
>>| log old new
>?? \new -> set new share
>-| log old new
manageContactPhotos :: ContactNo -> Task ()
manageContactPhotos contactNo
......@@ -174,11 +174,11 @@ where
addPhoto
= Title "Add photo" @>> Hint "Please select a photo to upload" @>> enterInformation []
>>? addContactPhoto contactNo
>?? addContactPhoto contactNo
delPhoto photo
= Title "Delete photo" @>> Hint "Do you want to delete this photo?" @>> viewInformation [ViewAs (\{original} ->original.Document.name)] photo
>>? removeContactPhoto contactNo
>?? removeContactPhoto contactNo
manageContactCommunication :: ContactNo -> Task ()
manageContactCommunication contactNo
......@@ -221,7 +221,7 @@ where
addMean contactNo
= Title "Add communication mean" @>> enterInformation [EnterAs toNewCommunicationMean]
>>? createCommunicationMean contactNo
>?? createCommunicationMean contactNo
editMean id
= get (sdsFocus id communicationMeanById)
......@@ -234,7 +234,7 @@ where
@ \{EmailAccountDetails|emailAddress} -> {CommunicationMean|c & emailAddress = emailAddress}
CMP2000 -> (Title "Edit P2000 details") @>> updateInformation [] {P2000ReceiverDetails|capCode = capCode}
@ \{P2000ReceiverDetails|capCode} -> {CommunicationMean|c & capCode = capCode}
>>? \new ->
>?? \new ->
set new (sdsFocus id communicationMeanById)
removeMean id = deleteCommunicationMean id
......@@ -278,13 +278,13 @@ where
open sel = manageIncidentInformation ws sel
add = Title "Add contact to incident" @>> Hint "Select an incident to add this contact to" @>>
enterChoiceWithSharedAs [] allIncidentsShort incidentShortIdentity
>>? \i ->
>?? \i ->
upd (\is -> [incidentNo \\{IncidentDetails|incidentNo} <-is] ++ [i]) incidents
>>| logContactAdded i contactNo
>-| logContactAdded i contactNo
remove sel = Title "Remove contact from incident" @>> Hint "Are your sure you want this contact to be removed from this incident?" @>>
viewSharedInformation [] (sdsFocus sel incidentTitleByNo)
>>* [OnAction ActionNo (always (return ()))
,OnAction ActionYes (always (upd (\is -> [ incidentNo \\ {IncidentDetails|incidentNo} <- is | incidentNo <> sel]) incidents >>| logContactRemoved sel contactNo))
,OnAction ActionYes (always (upd (\is -> [ incidentNo \\ {IncidentDetails|incidentNo} <- is | incidentNo <> sel]) incidents >-| logContactRemoved sel contactNo))
]
viewNoSelection = return () //FIXME
......@@ -320,7 +320,7 @@ where
-&&-
(Label "Access level" @>> updateChoice [ChooseFromCheckGroup viewLevel] [PartnerAccess,WOAccess] (fromMaybe PartnerAccess original.ContactAccess.access))
)
>>? \(updatedAccount,updatedAccess) ->
>?? \(updatedAccount,updatedAccess) ->
set {ContactAccess|account=updatedAccount,access=Just updatedAccess} access
viewLevel WOAccess = "Watch Officer access"
......@@ -403,9 +403,9 @@ updateContactPosition contactNo
-||-
(Hint "Search the web" @>> viewSharedInformation [ViewAs (toSearchURLs o fst)] tmpInfo)
) @ fst
>>? \newPosition ->
>?? \newPosition ->
upd (\c -> {Contact|c&position=newPosition}) (sdsFocus contactNo contactByNo)
>>| logContactPositionUpdated contactNo position newPosition
>-| logContactPositionUpdated contactNo position newPosition
@! newPosition
where
initPerspective position = {ContactMapPerspective|defaultValue & center = fromMaybe defaultValue.ContactMapPerspective.center contactPos, zoom = 7, cursor = contactPos}
......@@ -435,9 +435,9 @@ updateContactStatus contactNo
= get (sdsFocus contactNo contactByNo)
>>- \{Contact|status} ->
Title "Status" @>> updateInformation [] status
>>? \newStatus ->
>?? \newStatus ->
upd (\c -> {Contact|c&status = newStatus}) (sdsFocus contactNo contactByNo)
>>| logContactStatusUpdated contactNo status newStatus
>-| logContactStatusUpdated contactNo status newStatus
@! newStatus
updateSharedContactRefList :: (Shared sds [ContactNo]) -> Task [ContactNo] | RWShared sds
......@@ -454,7 +454,7 @@ where
addItem
= selectKnownOrDefineNewContact
>>? (\def -> createContactIfNew def >>- \contactNo -> upd (\r -> r ++ [contactNo]) refs)
>?? (\def -> createContactIfNew def >>- \contactNo -> upd (\r -> r ++ [contactNo]) refs)
selectKnownOrDefineNewContact :: Task (Either ContactNo NewContact)
selectKnownOrDefineNewContact
......@@ -493,7 +493,7 @@ where
delete :: ContactNo -> Task ()
delete contactNo
= get databaseDef
>>= \db -> sqlExecute db ["allContacts"] (execDelete "DELETE FROM Contact WHERE contactNo = ?" (toSQL contactNo)) @! ()
>>- \db -> sqlExecute db ["allContacts"] (execDelete "DELETE FROM Contact WHERE contactNo = ?" (toSQL contactNo)) @! ()
addContactPhoto :: ContactNo Document -> Task ContactPhoto
addContactPhoto contactNo original
......
......@@ -79,11 +79,11 @@ where
add = Title "Add contact..." @>> oneOrAnother
("Known contact",enterChoiceWithSharedAs [ChooseFromDropdown id] allContactsShort contactNo)
("Add new contact",enterInformation [])
>>? \contact ->
>?? \contact ->
createContactIfNew contact
>>- \contactNo ->
upd (\cs -> map contactIdentity cs ++ [contactNo]) contacts
>>| logContactAdded incidentNo contactNo
>-| logContactAdded incidentNo contactNo
where
contactNo {ContactShort|contactNo} = contactNo
......@@ -93,7 +93,7 @@ where
remove sel
= Title "Remove contact from incident" @>> Hint "Are your sure you want to remove this contact?" @>> viewSharedInformation [] (mapRead contactTitle (sdsFocus sel contactByNo)) //TODO: Create contactTitle share
>>* [OnAction ActionNo (always (return ()))
,OnAction ActionYes (always (upd (\cs -> [c \\ c <- map contactIdentity cs | c <> sel]) contacts >>| logContactRemoved incidentNo sel))
,OnAction ActionYes (always (upd (\cs -> [c \\ c <- map contactIdentity cs | c <> sel]) contacts >-| logContactRemoved incidentNo sel))
]
manageIncidentActions :: IncidentNo -> Task ()
......@@ -180,7 +180,7 @@ where
addItem
= selectKnownOrDefineNewIncident
>>? (\def -> createIncidentIfNew def >>- \incidentNo -> upd (\r -> r ++ [incidentNo]) refs)
>?? (\def -> createIncidentIfNew def >>- \incidentNo -> upd (\r -> r ++ [incidentNo]) refs)
selectKnownOrDefineNewIncident :: Task (Either IncidentNo NewIncident)
selectKnownOrDefineNewIncident
......@@ -203,7 +203,7 @@ addLogMessage message incidentNo
>>- \(user,now) ->
set {LogEntry|incident = incidentNo,eventAt = now, loggedAt = now, loggedBy = user, message = toString message}
(sdsFocus incidentNo incidentLog)
>>| addNotification (toString message)
>-| addNotification (toString message)
@! incidentNo
addLogMessageForContact :: msg ContactNo -> Task [IncidentNo] | toString msg
......@@ -369,7 +369,7 @@ where
delete :: IncidentNo -> Task ()
delete incidentNo
= get databaseDef
>>= \db -> sqlExecute db ["allIncidents"] (execDelete "DELETE FROM Incident WHERE incidentNo = ?" (toSQL incidentNo)) @! ()
>>- \db -> sqlExecute db ["allIncidents"] (execDelete "DELETE FROM Incident WHERE incidentNo = ?" (toSQL incidentNo)) @! ()
closeIncident :: IncidentNo -> Task ()
closeIncident incidentNo
......
......@@ -63,14 +63,14 @@ where
where
editDatabaseConfig config
= Title "Database configuration" @>> Hint "Please edit settings" @>> updateInformation [] config
>>= \newConfig ->
>>! \newConfig ->
checkDatabaseConfig newConfig
>>- \mbError -> case mbError of
Ok config
= set config databaseConfig @! ()
Error NoDatabaseTables
= set newConfig databaseConfig
>>| Title "Create tables" @>> Hint "The database you configured does not have tables set up yet." @>> viewInformation [] "Do you want to create them now?"
>-| Title "Create tables" @>> Hint "The database you configured does not have tables set up yet." @>> viewInformation [] "Do you want to create them now?"
>>* [OnAction ActionYes (always (createIncidoneTables (toDatabaseDef newConfig) @! ()))
,OnAction ActionNo (always (return ()))
]
......@@ -115,7 +115,7 @@ where
deleteTable db table
= Hint "Are your sure you want to delete this table?" @>> viewInformation [] table
>>? \_ -> sqlExecuteDropTable db table
>?? \_ -> sqlExecuteDropTable db table
@! ()
createIncidoneTables db
......@@ -127,7 +127,7 @@ where
emptyDatabase db
= Title "Empty database" @>> viewInformation [] "Are your sure you want fully remove all database tables?"
>>? \_ ->
>?? \_ ->
get (sdsFocus db sqlTables)
>>- \tables ->
sequence [sqlExecuteDropTable db table \\ table <- tables]
......@@ -142,7 +142,7 @@ manageUsers = forever (catchAll (
,OnAction (Action "/Import from CSV") (always (importUsers <<@ InWindow))
,OnAction (Action "/Set admin password") (always (setAdminPassword <<@ InWindow))
]
) (\e -> Hint "Error" @>> viewInformation [] e >>| return ()))
) (\e -> Hint "Error" @>> viewInformation [] e >!| return ()))
where
manageExistingUsers
= (enterChoiceWithSharedAs [ChooseFromGrid id] allContactsShort contactIdentity
......@@ -152,12 +152,12 @@ where
viewNoSelection = Hint "Select a user" @>> viewInformation [] ()
addUser
= (Title "Add user") @>> enterInformation []
>>? \newUser -> (createContact newUser @! ())
>?? \newUser -> (createContact newUser @! ())
importUsers = doOrClose (
Hint instructions @>> enterInformation []
>>= \doc -> catchAll (
importContactsFromCSVFile doc >-| viewInformation [] "Succesfully imported contacts" >>| return ()
>>! \doc -> catchAll (
importContactsFromCSVFile doc >-| viewInformation [] "Succesfully imported contacts" >!| return ()
) (\_ -> viewInformation [] "Failed to import contacts" @! ())
) <<@ Title "Import contacts"
where
......@@ -178,10 +178,10 @@ where
@ \(o,(n1,n2)) -> (o,n1,n2)
updatePassword ((old,new1,new2),current)
| old =!= current = Hint "Error" @>> viewInformation [] "You did not enter the correct old password" >>| return Nothing
| new1 =!= new2 = Hint "Error" @>> viewInformation [] "The new passwords are not the same" >>| return Nothing
| old =!= current = Hint "Error" @>> viewInformation [] "You did not enter the correct old password" >!| return Nothing
| new1 =!= new2 = Hint "Error" @>> viewInformation [] "The new passwords are not the same" >!| return Nothing
= set new1 adminPassword
>>| viewInformation [] "The admin password has been updated" >>| return (Just ())
>-| viewInformation [] "The admin password has been updated" >!| return (Just ())
manageDemoData :: Task ()
manageDemoData
......@@ -194,7 +194,7 @@ where
= (Hint "Enter the number of demo incidents that you would like to create and press continue" @>> enterInformation [])
-&&-
(Hint "Immediate close the incidents?" @>> enterInformation [])
>>= \(num,closed) ->
>>! \(num,closed) ->
sequence (repeatn num (generateTestIncident closed))
@! ()
......@@ -238,7 +238,7 @@ where
configureWebLinks :: Task ()
configureWebLinks
= viewAndEdit (Hint "Web integration configuration" @>> viewSharedInformation [] webLinksConfig)
(get webLinksConfig >>- updateInformation [] >>? \updated -> set updated webLinksConfig)
(get webLinksConfig >>- updateInformation [] >?? \updated -> set updated webLinksConfig)
>^* [OnAction (Action "/Export") (always (exportConfig <<@ InWindow))
,OnAction (Action "/Import") (always (importConfig <<@ InWindow))]
@! ()
......@@ -257,7 +257,7 @@ where
importConfig
= doOrClose (
(Hint instructions @>> enterInformation [])
>>= \doc -> catchAll (
>>! \doc -> catchAll (
importJSONDocument doc
>>- \config ->
set config webLinksConfig
......
......@@ -83,7 +83,7 @@ where
addContact :: Task (Maybe ContactNo)
addContact
= (Title "Add contact") @>> enterInformation []
>>? createContact
>?? createContact
:: ActionSet = PersonalActions | IncidentActions !IncidentNo
......
......@@ -46,7 +46,7 @@ enterMultiple :: !String !Int (Task a) -> Task [a] | iTask a
manageSharedListWithDetails :: (Int -> Task ()) (Task Int) (Shared sds [Int]) -> Task () | RWShared sds
//Ok/Cancel transition
(>>?) infixl 1 :: !(Task a) !(a -> Task b) -> Task (Maybe b) | iTask a & iTask b
(>??) infixl 1 :: !(Task a) !(a -> Task b) -> Task (Maybe b) | iTask a & iTask b
//Start/stop a background task
manageBackgroundTask :: !String !String (Task a) -> Task () | iTask a
......
......@@ -23,12 +23,12 @@ where
createNewIncident :: Task (Maybe IncidentNo)
createNewIncident
= Title "Create new incident" @>> Hint "Fill in the following basic information to create a new incident" @>> enterInformation []
>>? createIncident
>?? createIncident
createNewContact :: Task (Maybe ContactNo)
createNewContact
= Title "New contact" @>> Hint "Enter the basic information of the new contact" @>> enterInformation []
>>? createContact
>?? createContact
indexedStore :: String v -> SDSLens k v v | Eq k & Ord k & iTask k & iTask v
indexedStore name def = sdsSplit "indexedStore" (\p -> ((),p)) read write (Just \p mapping. Ok (fromMaybe def ('DM'.get p mapping))) (sharedStore name 'DM'.newMap)
......@@ -97,9 +97,9 @@ where
view = viewSharedInformation [] s
edit old
= updateInformation [] old
>>? \new ->
>?? \new ->
set new s
>>| log old new
>-| log old new
doOrClose :: (Task a) -> Task (Maybe a) | iTask a