diff options
author | Alexander Foremny <aforemny@posteo.de> | 2023-12-07 03:58:21 +0100 |
---|---|---|
committer | Alexander Foremny <aforemny@posteo.de> | 2023-12-07 04:01:23 +0100 |
commit | c1ff403387064ff0027b9e762cc6f6a8fa20c8d9 (patch) | |
tree | 62b9a4cfccfc4fce42055ef94b9de41d1dfcc0a7 /app/History/IssueEvent.hs | |
parent | 3c6e62b75293b6625509ade3c278fc2d4d147c30 (diff) |
chore: move remaining `History.*` modules outside of `History`
Diffstat (limited to 'app/History/IssueEvent.hs')
-rw-r--r-- | app/History/IssueEvent.hs | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/app/History/IssueEvent.hs b/app/History/IssueEvent.hs deleted file mode 100644 index 932cfd9..0000000 --- a/app/History/IssueEvent.hs +++ /dev/null @@ -1,54 +0,0 @@ -module History.IssueEvent (IssueEvent (..)) where - -import Data.Binary (Binary) -import GHC.Generics (Generic) -import History.CommitHash (CommitHash) -import Issue (Issue) -import Issue.Render qualified as I -import Patch (Patch) -import Render ((<<<)) -import Render qualified as P - -data IssueEvent - = IssueCreated - { hash :: CommitHash, - issue :: Issue, - patch :: Patch - } - | IssueChanged - { hash :: CommitHash, - oldIssue :: Issue, - issue :: Issue, - patch :: Patch - } - | IssueDeleted - { hash :: CommitHash, - issue :: Issue, - patch :: Patch - } - deriving (Show, Generic, Binary) - -instance P.Render IssueEvent where - render = P.render . P.Detailed - -instance P.Render (P.Detailed IssueEvent) where - render (P.Detailed issueEvent) = - P.Summarized issueEvent - <<< P.hardline @P.AnsiStyle - <<< issueEvent.patch - -instance P.Render (P.Summarized IssueEvent) where - render (P.Summarized issueEvent) = - case issueEvent of - IssueCreated {hash, issue} -> - P.Summarized hash - <<< P.styled [P.color P.Green] "created" - <<< I.IssueTitle issue - IssueChanged {hash, issue} -> - P.Summarized hash - <<< P.styled [P.color P.Green] "changed" - <<< I.IssueTitle issue - IssueDeleted {hash, issue} -> - P.Summarized hash - <<< P.styled [P.color P.Green] "deleted" - <<< I.IssueTitle issue |