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 ...@@ -353,9 +353,9 @@ where
where where
configureDelayed attr configer task list configureDelayed attr configer task list
= configer initContacts initIncidents = configer initContacts initIncidents
>>= \(config,status) -> >>? \(config,status) ->
set status (selfActionStatus list) set status (selfActionStatus list)
>>| task config (selfActionStatus list) <<@ attr >-| task config (selfActionStatus list) <<@ attr
initStatus {ItemMeta|title,description} initStatus {ItemMeta|title,description}
= {ActionStatus|title=title,description=description,progress=ActionActive,contacts=initContacts,incidents=initIncidents} = {ActionStatus|title=title,description=description,progress=ActionActive,contacts=initContacts,incidents=initIncidents}
...@@ -467,7 +467,7 @@ where ...@@ -467,7 +467,7 @@ where
= createCommunication P2000Message Out (Just contactNo) = createCommunication P2000Message Out (Just contactNo)
>>- \communicationNo -> >>- \communicationNo ->
maybe (return ()) (initMessageFromTemplate communicationNo contactNo) mbP2000Template maybe (return ()) (initMessageFromTemplate communicationNo contactNo) mbP2000Template
>>| doOrClose (composeP2000Message communicationNo) <<@ InWindow >-| doOrClose (composeP2000Message communicationNo) <<@ InWindow
>>- \mbCommunication -> case mbCommunication of >>- \mbCommunication -> case mbCommunication of
Nothing Nothing
= return () = return ()
...@@ -582,7 +582,7 @@ where ...@@ -582,7 +582,7 @@ where
>>- \mbReplacement -> case mbReplacement of >>- \mbReplacement -> case mbReplacement of
Just (ActionTasks configer task) Just (ActionTasks configer task)
= viewInformation [] "Because the software was upgraded, this action must unfortunately be reconfigured" ||- configer [] [] = 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 replaceTask taskId (\l -> (task c (selfActionStatus l) @? const NoValue)) topLevelTasks
_ _
= viewInformation [] "Sorry, this action is no longer available in the current version of Incidone." = viewInformation [] "Sorry, this action is no longer available in the current version of Incidone."
...@@ -608,7 +608,7 @@ where ...@@ -608,7 +608,7 @@ where
deleteActionItem :: InstanceNo -> Task (Maybe ActionStatus) deleteActionItem :: InstanceNo -> Task (Maybe ActionStatus)
deleteActionItem instanceNo deleteActionItem instanceNo
= ( Title "Delete" @>> Hint "Are you sure you want to remove this action?" @>> viewSharedInformation [ViewAs view] status = ( 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 ) <<@ InWindow
where where
status = sdsFocus instanceNo actionStatusByNo status = sdsFocus instanceNo actionStatusByNo
...@@ -638,7 +638,7 @@ edit task sds ...@@ -638,7 +638,7 @@ edit task sds
= get sds = get sds
>>- \current -> >>- \current ->
task current task current
>>? \updated -> >?? \updated ->
set updated sds set updated sds
enterActionStatus :: [ContactNo] [IncidentNo] -> Task ActionStatus enterActionStatus :: [ContactNo] [IncidentNo] -> Task ActionStatus
...@@ -737,15 +737,15 @@ where ...@@ -737,15 +737,15 @@ where
configureAction selSds = whileUnchanged selSds configTask configureAction selSds = whileUnchanged selSds configTask
where where
configTask Nothing = (Title "Configure" @>> viewInformation [] "Select an action first..." @? const NoValue) /* <<@ AfterLayout (uiDefSetHeight FlexSize) */ 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}) configTask (Just item=:{CatalogAction|identity,tasks=ActionTasks configer task})
= configer initContacts initIncidents <<@ Title "Configure" /* <<@ AfterLayout (uiDefSetHeight FlexSize) */ = 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 :: String ActionStatus (SharedTaskList a) ((SimpleSDSLens ActionStatus) -> Task ()) -> Task TaskId | iTask a
addAction identity initStatus list task addAction identity initStatus list task
= logActionAdded initStatus = 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 where
attributes = initAttributes identity initStatus attributes = initAttributes identity initStatus
...@@ -753,7 +753,7 @@ where ...@@ -753,7 +753,7 @@ where
addSubActionItem :: [ContactNo] [IncidentNo] CatalogAction (SharedTaskList a) -> Task (Maybe TaskId) | iTask a addSubActionItem :: [ContactNo] [IncidentNo] CatalogAction (SharedTaskList a) -> Task (Maybe TaskId) | iTask a
addSubActionItem initContacts initIncidents item=:{CatalogAction|identity,tasks=ActionTasks configer task} list addSubActionItem initContacts initIncidents item=:{CatalogAction|identity,tasks=ActionTasks configer task} list
= (configer initContacts initIncidents = (configer initContacts initIncidents
>>? \(config,initStatus) -> >?? \(config,initStatus) ->
appendTask (Detached True (initAttributes identity initStatus)) (\list -> (task config (selfActionStatus list)) @? const NoValue) list appendTask (Detached True (initAttributes identity initStatus)) (\list -> (task config (selfActionStatus list)) @? const NoValue) list
) <<@ InWindow ) <<@ InWindow
...@@ -777,17 +777,17 @@ manageUserActionCatalog ...@@ -777,17 +777,17 @@ manageUserActionCatalog
where where
addCatalogItem addCatalogItem
= Title "Add" @>> enterInformation [] = Title "Add" @>> enterInformation []
>>? \nx -> >?? \nx ->
upd (\xs -> xs++[nx]) userActionCatalog @! () upd (\xs -> xs++[nx]) userActionCatalog @! ()
editCatalogItem item editCatalogItem item
= Title "Edit" @>> updateInformation [] item = Title "Edit" @>> updateInformation [] item
>>? \nx -> >?? \nx ->
upd (\xs -> [if (x.UserCatalogAction.identity == nx.UserCatalogAction.identity) nx x \\ x<- xs]) userActionCatalog @! () upd (\xs -> [if (x.UserCatalogAction.identity == nx.UserCatalogAction.identity) nx x \\ x<- xs]) userActionCatalog @! ()
removeCatalogItem item removeCatalogItem item
= Title "Remove" @>> viewInformation [] ("Remove " <+++ item.UserCatalogAction.identity <+++ "?") = Title "Remove" @>> viewInformation [] ("Remove " <+++ item.UserCatalogAction.identity <+++ "?")
>>? \nx -> >?? \nx ->
upd (\xs -> [x \\ x <- xs | x.UserCatalogAction.identity <> item.UserCatalogAction.identity]) userActionCatalog @! () upd (\xs -> [x \\ x <- xs | x.UserCatalogAction.identity <> item.UserCatalogAction.identity]) userActionCatalog @! ()
exportCatalog exportCatalog
...@@ -804,7 +804,7 @@ where ...@@ -804,7 +804,7 @@ where
importCatalog importCatalog
= doOrClose ( = doOrClose (
Hint instructions @>> enterInformation [] Hint instructions @>> enterInformation []
>>= \doc -> catchAll ( >>! \doc -> catchAll (
importJSONDocument doc importJSONDocument doc
>>- \actions -> >>- \actions ->
set actions userActionCatalog set actions userActionCatalog
......
...@@ -65,7 +65,7 @@ where ...@@ -65,7 +65,7 @@ where
= (Hint "Enter a number to use when refering to this contact" @>> enterInformation [] = (Hint "Enter a number to use when refering to this contact" @>> enterInformation []
-&&- -&&-
selectKnownOrDefineNewContact) 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)] derefAliasList :: [(Int,ContactNo)] [ContactShort] -> [(Int,ContactShort)]
......
...@@ -19,7 +19,7 @@ where ...@@ -19,7 +19,7 @@ where
= get asteriskLinkConfig = get asteriskLinkConfig
>>- \{AsteriskConfig|host,port,username,password} -> >>- \{AsteriskConfig|host,port,username,password} ->
set ([],False,[authEvent username password],False) channel 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 consume channel
= consumeNetworkStream processEvents channel = consumeNetworkStream processEvents channel
......
...@@ -29,13 +29,13 @@ updateCommunication communicationNo ...@@ -29,13 +29,13 @@ updateCommunication communicationNo
(P2000Message,Out) = composeP2000Message communicationNo (P2000Message,Out) = composeP2000Message communicationNo
_ _
= (Title "Communication details:") @>> viewSharedInformation [] (sdsFocus communicationNo communicationDetailsByNo) = (Title "Communication details:") @>> viewSharedInformation [] (sdsFocus communicationNo communicationDetailsByNo)
>>| return communicationNo >!| return communicationNo
//Answer an incoming call //Answer an incoming call
answerPhoneCall :: CommunicationNo -> Task CommunicationNo answerPhoneCall :: CommunicationNo -> Task CommunicationNo
answerPhoneCall communicationNo answerPhoneCall communicationNo
= setInitialHandledBy communicationNo = setInitialHandledBy communicationNo
>>| connectInboundPhoneCall communicationNo >?| connectInboundPhoneCall communicationNo
||- ((manageCommunicationContact communicationNo ||- ((manageCommunicationContact communicationNo
-&&- -&&-
manageVoiceCallContent PhoneCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide True) manageVoiceCallContent PhoneCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide True)
...@@ -48,7 +48,7 @@ answerPhoneCall communicationNo ...@@ -48,7 +48,7 @@ answerPhoneCall communicationNo
initiatePhoneCall :: CommunicationNo -> Task CommunicationNo initiatePhoneCall :: CommunicationNo -> Task CommunicationNo
initiatePhoneCall communicationNo initiatePhoneCall communicationNo
= setInitialHandledBy communicationNo = setInitialHandledBy communicationNo
>>| connectOutboundPhoneCall communicationNo >?| connectOutboundPhoneCall communicationNo
||- ((manageCommunicationContact communicationNo ||- ((manageCommunicationContact communicationNo
-&&- -&&-
manageVoiceCallContent PhoneCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide True) manageVoiceCallContent PhoneCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide True)
...@@ -61,7 +61,7 @@ initiatePhoneCall communicationNo ...@@ -61,7 +61,7 @@ initiatePhoneCall communicationNo
answerRadioCall :: CommunicationNo -> Task CommunicationNo answerRadioCall :: CommunicationNo -> Task CommunicationNo
answerRadioCall communicationNo answerRadioCall communicationNo
= setInitialHandledBy communicationNo = setInitialHandledBy communicationNo
>>| updateRadioCallMeta communicationNo >?| updateRadioCallMeta communicationNo
||- ((manageCommunicationContact communicationNo ||- ((manageCommunicationContact communicationNo
-&&- -&&-
manageVoiceCallContent RadioCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide True) manageVoiceCallContent RadioCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide True)
...@@ -74,7 +74,7 @@ answerRadioCall communicationNo ...@@ -74,7 +74,7 @@ answerRadioCall communicationNo
initiateRadioCall :: CommunicationNo -> Task CommunicationNo initiateRadioCall :: CommunicationNo -> Task CommunicationNo
initiateRadioCall communicationNo initiateRadioCall communicationNo
= setInitialHandledBy communicationNo = setInitialHandledBy communicationNo
>>| updateRadioCallMeta communicationNo >?| updateRadioCallMeta communicationNo
||- ((manageCommunicationContact communicationNo ||- ((manageCommunicationContact communicationNo
-&&- -&&-
manageVoiceCallContent RadioCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide True) manageVoiceCallContent RadioCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide True)
...@@ -87,7 +87,7 @@ initiateRadioCall communicationNo ...@@ -87,7 +87,7 @@ initiateRadioCall communicationNo
composeEmailMessage :: CommunicationNo -> Task CommunicationNo composeEmailMessage :: CommunicationNo -> Task CommunicationNo
composeEmailMessage communicationNo composeEmailMessage communicationNo
= setInitialHandledBy communicationNo = setInitialHandledBy communicationNo
>>| updateMessageMeta communicationNo >?| updateMessageMeta communicationNo
||- ((composeAndSendMessage communicationNo message transmitEmailMessage ||- ((composeAndSendMessage communicationNo message transmitEmailMessage
-&&- -&&-
relateMessageToIncidents communicationNo) <<@ ArrangeWithTabs True) relateMessageToIncidents communicationNo) <<@ ArrangeWithTabs True)
...@@ -102,7 +102,7 @@ where ...@@ -102,7 +102,7 @@ where
composeP2000Message :: CommunicationNo -> Task CommunicationNo composeP2000Message :: CommunicationNo -> Task CommunicationNo
composeP2000Message communicationNo composeP2000Message communicationNo
= setInitialHandledBy communicationNo = setInitialHandledBy communicationNo
>>| updateMessageMeta communicationNo >?| updateMessageMeta communicationNo
||- ((composeAndSendMessage communicationNo message transmitP2000Message ||- ((composeAndSendMessage communicationNo message transmitP2000Message
-&&- -&&-
relateMessageToIncidents communicationNo) <<@ ArrangeWithTabs True) relateMessageToIncidents communicationNo) <<@ ArrangeWithTabs True)
...@@ -144,7 +144,7 @@ where ...@@ -144,7 +144,7 @@ where
@! () @! ()
add = selectKnownOrDefineNewIncident <<@ Title "+" add = selectKnownOrDefineNewIncident <<@ Title "+"
>>= createIncidentIfNew >>? createIncidentIfNew
/** /**
* Interact with the PBX integration to establish an actual phone connection * Interact with the PBX integration to establish an actual phone connection
...@@ -354,18 +354,18 @@ transmitP2000Message communicationNo ...@@ -354,18 +354,18 @@ transmitP2000Message communicationNo
reportPhoneCallBegin :: (Maybe String) (Maybe String) -> Task CommunicationNo reportPhoneCallBegin :: (Maybe String) (Maybe String) -> Task CommunicationNo
reportPhoneCallBegin externalNo externalRef reportPhoneCallBegin externalNo externalRef
= traceValue ("Call started: " <+++ externalNo <+++ " " <+++ externalRef) = traceValue ("Call started: " <+++ externalNo <+++ " " <+++ externalRef)
>>| createPhoneCall In >-| createPhoneCall In
>>- \communicationNo -> >>- \communicationNo ->
upd (\c -> {Communication|c & status = Just Ringing}) (sdsFocus communicationNo communicationByNo) upd (\c -> {Communication|c & status = Just Ringing}) (sdsFocus communicationNo communicationByNo)
>>| upd (\p -> {PhoneCall|p & externalNo = externalNo, externalRef = externalRef}) (sdsFocus communicationNo phoneCallByNo) >-| upd (\p -> {PhoneCall|p & externalNo = externalNo, externalRef = externalRef}) (sdsFocus communicationNo phoneCallByNo)
>>| addNotification ("Incoming call from: "+++ fromMaybe "(unknown)" externalNo) >-| addNotification ("Incoming call from: "+++ fromMaybe "(unknown)" externalNo)
@! communicationNo @! communicationNo
reportPhoneCallConnected :: (Either CommunicationNo String) -> Task () reportPhoneCallConnected :: (Either CommunicationNo String) -> Task ()
reportPhoneCallConnected (Left communicationNo) = upd (\c -> {Communication|c & status = Just Connected}) (sdsFocus communicationNo communicationByNo) @! () reportPhoneCallConnected (Left communicationNo) = upd (\c -> {Communication|c & status = Just Connected}) (sdsFocus communicationNo communicationByNo) @! ()
reportPhoneCallConnected (Right externalRef) reportPhoneCallConnected (Right externalRef)
= traceValue ("Call connected: " +++ externalRef) = traceValue ("Call connected: " +++ externalRef)
>>| updateCommunicationByCallReference externalRef updateFun >-| updateCommunicationByCallReference externalRef updateFun
where where
updateFun c = {Communication|c & status = Just Connected} updateFun c = {Communication|c & status = Just Connected}
...@@ -373,7 +373,7 @@ reportPhoneCallEnd :: (Either CommunicationNo String) -> Task () ...@@ -373,7 +373,7 @@ reportPhoneCallEnd :: (Either CommunicationNo String) -> Task ()
reportPhoneCallEnd (Left communicationNo) = upd (\c -> {Communication|c & status = Just Answered}) (sdsFocus communicationNo communicationByNo) @! () reportPhoneCallEnd (Left communicationNo) = upd (\c -> {Communication|c & status = Just Answered}) (sdsFocus communicationNo communicationByNo) @! ()
reportPhoneCallEnd (Right externalRef) reportPhoneCallEnd (Right externalRef)
= traceValue ("Call ended: " +++ externalRef) = traceValue ("Call ended: " +++ externalRef)
>>| updateCommunicationByCallReference externalRef updateFun >-| updateCommunicationByCallReference externalRef updateFun
where where
updateFun c=:{Communication|status=Just Connected} = {Communication|c & status = Just Answered} updateFun c=:{Communication|status=Just Connected} = {Communication|c & status = Just Answered}
updateFun c = {Communication|c & status = Just Missed} updateFun c = {Communication|c & status = Just Missed}
......
...@@ -128,10 +128,10 @@ where ...@@ -128,10 +128,10 @@ where
editContactBasics contactNo editContactBasics contactNo
= (get (contactBasics contactNo) = (get (contactBasics contactNo)
>>= \old -> >>- \old ->
updateInformation [] old updateInformation [] old
>>? \new -> set new (contactBasics contactNo) >?? \new -> set new (contactBasics contactNo)
>>| logContactBasicsUpdated contactNo old new >-| logContactBasicsUpdated contactNo old new
) @! () ) @! ()
shareContact contactNo shareContact contactNo
...@@ -157,8 +157,8 @@ where ...@@ -157,8 +157,8 @@ where
editDetails share log editDetails share log
= get share = get share
>>- \old -> Icon "details" @>> Title "Details (editing)" @>> updateInformation [] old >>- \old -> Icon "details" @>> Title "Details (editing)" @>> updateInformation [] old
>>? \new -> set new share >?? \new -> set new share
>>| log old new >-| log old new
manageContactPhotos :: ContactNo -> Task () manageContactPhotos :: ContactNo -> Task ()
manageContactPhotos contactNo manageContactPhotos contactNo
...@@ -174,11 +174,11 @@ where ...@@ -174,11 +174,11 @@ where
addPhoto addPhoto
= Title "Add photo" @>> Hint "Please select a photo to upload" @>> enterInformation [] = Title "Add photo" @>> Hint "Please select a photo to upload" @>> enterInformation []
>>? addContactPhoto contactNo >?? addContactPhoto contactNo
delPhoto photo delPhoto photo
= Title "Delete photo" @>> Hint "Do you want to delete this photo?" @>> viewInformation [ViewAs (\{original} ->original.Document.name)] 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 -> Task ()
manageContactCommunication contactNo manageContactCommunication contactNo
...@@ -221,7 +221,7 @@ where ...@@ -221,7 +221,7 @@ where
addMean contactNo addMean contactNo
= Title "Add communication mean" @>> enterInformation [EnterAs toNewCommunicationMean] = Title "Add communication mean" @>> enterInformation [EnterAs toNewCommunicationMean]
>>? createCommunicationMean contactNo >?? createCommunicationMean contactNo
editMean id editMean id
= get (sdsFocus id communicationMeanById) = get (sdsFocus id communicationMeanById)
...@@ -234,7 +234,7 @@ where ...@@ -234,7 +234,7 @@ where
@ \{EmailAccountDetails|emailAddress} -> {CommunicationMean|c & emailAddress = emailAddress} @ \{EmailAccountDetails|emailAddress} -> {CommunicationMean|c & emailAddress = emailAddress}
CMP2000 -> (Title "Edit P2000 details") @>> updateInformation [] {P2000ReceiverDetails|capCode = capCode} CMP2000 -> (Title "Edit P2000 details") @>> updateInformation [] {P2000ReceiverDetails|capCode = capCode}
@ \{P2000ReceiverDetails|capCode} -> {CommunicationMean|c & capCode = capCode} @ \{P2000ReceiverDetails|capCode} -> {CommunicationMean|c & capCode = capCode}
>>? \new -> >?? \new ->
set new (sdsFocus id communicationMeanById) set new (sdsFocus id communicationMeanById)
removeMean id = deleteCommunicationMean id removeMean id = deleteCommunicationMean id
...@@ -278,13 +278,13 @@ where ...@@ -278,13 +278,13 @@ where
open sel = manageIncidentInformation ws sel open sel = manageIncidentInformation ws sel
add = Title "Add contact to incident" @>> Hint "Select an incident to add this contact to" @>> add = Title "Add contact to incident" @>> Hint "Select an incident to add this contact to" @>>
enterChoiceWithSharedAs [] allIncidentsShort incidentShortIdentity enterChoiceWithSharedAs [] allIncidentsShort incidentShortIdentity
>>? \i -> >?? \i ->
upd (\is -> [incidentNo \\{IncidentDetails|incidentNo} <-is] ++ [i]) incidents 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?" @>> 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) viewSharedInformation [] (sdsFocus sel incidentTitleByNo)
>>* [OnAction ActionNo (always (return ())) >>* [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 viewNoSelection = return () //FIXME
...@@ -320,7 +320,7 @@ where ...@@ -320,7 +320,7 @@ where
-&&- -&&-
(Label "Access level" @>> updateChoice [ChooseFromCheckGroup viewLevel] [PartnerAccess,WOAccess] (fromMaybe PartnerAccess original.ContactAccess.access)) (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 set {ContactAccess|account=updatedAccount,access=Just updatedAccess} access
viewLevel WOAccess = "Watch Officer access" viewLevel WOAccess = "Watch Officer access"
...@@ -403,9 +403,9 @@ updateContactPosition contactNo ...@@ -403,9 +403,9 @@ updateContactPosition contactNo
-||- -||-
(Hint "Search the web" @>> viewSharedInformation [ViewAs (toSearchURLs o fst)] tmpInfo) (Hint "Search the web" @>> viewSharedInformation [ViewAs (toSearchURLs o fst)] tmpInfo)
) @ fst ) @ fst
>>? \newPosition -> >?? \newPosition ->
upd (\c -> {Contact|c&position=newPosition}) (sdsFocus contactNo contactByNo) upd (\c -> {Contact|c&position=newPosition}) (sdsFocus contactNo contactByNo)
>>| logContactPositionUpdated contactNo position newPosition >-| logContactPositionUpdated contactNo position newPosition
@! newPosition @! newPosition
where where
initPerspective position = {ContactMapPerspective|defaultValue & center = fromMaybe defaultValue.ContactMapPerspective.center contactPos, zoom = 7, cursor = contactPos} initPerspective position = {ContactMapPerspective|defaultValue & center = fromMaybe defaultValue.ContactMapPerspective.center contactPos, zoom = 7, cursor = contactPos}
...@@ -435,9 +435,9 @@ updateContactStatus contactNo ...@@ -435,9 +435,9 @@ updateContactStatus contactNo
= get (sdsFocus contactNo contactByNo) = get (sdsFocus contactNo contactByNo)
>>- \{Contact|status} -> >>- \{Contact|status} ->
Title "Status" @>> updateInformation [] status Title "Status" @>> updateInformation [] status
>>? \newStatus -> >?? \newStatus ->
upd (\c -> {Contact|c&status = newStatus}) (sdsFocus contactNo contactByNo) upd (\c -> {Contact|c&status = newStatus}) (sdsFocus contactNo contactByNo)
>>| logContactStatusUpdated contactNo status newStatus >-| logContactStatusUpdated contactNo status newStatus
@! newStatus @! newStatus
updateSharedContactRefList :: (Shared sds [ContactNo]) -> Task [ContactNo] | RWShared sds updateSharedContactRefList :: (Shared sds [ContactNo]) -> Task [ContactNo] | RWShared sds
...@@ -454,7 +454,7 @@ where ...@@ -454,7 +454,7 @@ where
addItem addItem
= selectKnownOrDefineNewContact = 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 :: Task (Either ContactNo NewContact)
selectKnownOrDefineNewContact selectKnownOrDefineNewContact
...@@ -493,7 +493,7 @@ where ...@@ -493,7 +493,7 @@ where
delete :: ContactNo -> Task () delete :: ContactNo -> Task ()
delete contactNo delete contactNo
= get databaseDef = 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 Document -> Task ContactPhoto
addContactPhoto contactNo original addContactPhoto contactNo original
......
...@@ -79,11 +79,11 @@ where ...@@ -79,11 +79,11 @@ where
add = Title "Add contact..." @>> oneOrAnother add = Title "Add contact..." @>> oneOrAnother
("Known contact",enterChoiceWithSharedAs [ChooseFromDropdown id] allContactsShort contactNo)