summaryrefslogtreecommitdiff
path: root/Assistant/Alert.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Assistant/Alert.hs')
-rw-r--r--Assistant/Alert.hs20
1 files changed, 19 insertions, 1 deletions
diff --git a/Assistant/Alert.hs b/Assistant/Alert.hs
index 296f992bd..cb2366f44 100644
--- a/Assistant/Alert.hs
+++ b/Assistant/Alert.hs
@@ -27,7 +27,11 @@ data AlertPriority = Filler | Low | Medium | High | Pinned
{- An alert can have an name, which is used to combine it with other similar
- alerts. -}
-data AlertName = FileAlert TenseChunk | SanityCheckFixAlert | WarningAlert String
+data AlertName
+ = FileAlert TenseChunk
+ | SanityCheckFixAlert
+ | WarningAlert String
+ | PairRequestAlert String
deriving (Eq)
{- The first alert is the new alert, the second is an old alert.
@@ -259,6 +263,20 @@ sanityCheckFixAlert msg = Alert
alerthead = "The daily sanity check found and fixed a problem:"
alertfoot = "If these problems persist, consider filing a bug report."
+pairRequestAlert :: String -> String -> Alert
+pairRequestAlert repo msg = Alert
+ { alertClass = Message
+ , alertHeader = Just $ tenseWords ["Pair request"]
+ , alertMessageRender = tenseWords
+ , alertData = [UnTensed $ T.pack msg]
+ , alertBlockDisplay = True
+ , alertPriority = High
+ , alertClosable = True
+ , alertIcon = Just "info-sign"
+ , alertName = Just $ PairRequestAlert repo
+ , alertCombiner = Just $ dataCombiner $ const id
+ }
+
fileAlert :: TenseChunk -> FilePath -> Alert
fileAlert msg file = (activityAlert Nothing [f])
{ alertName = Just $ FileAlert msg