mirror of
https://code.sup39.dev/repos/Wqawg
synced 2024-12-27 16:54:53 +09:00
Stop assigning ticket numbers, allow them to be NULL
This commit is contained in:
parent
c5996bd226
commit
1a5654f8ae
7 changed files with 21 additions and 11 deletions
|
@ -344,7 +344,7 @@ TicketParamClass
|
||||||
|
|
||||||
Ticket
|
Ticket
|
||||||
project ProjectId
|
project ProjectId
|
||||||
number Int
|
number Int Maybe
|
||||||
created UTCTime
|
created UTCTime
|
||||||
title Text -- HTML
|
title Text -- HTML
|
||||||
source Text -- Pandoc Markdown
|
source Text -- Pandoc Markdown
|
||||||
|
@ -357,7 +357,7 @@ Ticket
|
||||||
followers FollowerSetId
|
followers FollowerSetId
|
||||||
accept OutboxItemId
|
accept OutboxItemId
|
||||||
|
|
||||||
UniqueTicket project number
|
-- UniqueTicket project number
|
||||||
UniqueTicketDiscussion discuss
|
UniqueTicketDiscussion discuss
|
||||||
UniqueTicketFollowers followers
|
UniqueTicketFollowers followers
|
||||||
UniqueTicketAccept accept
|
UniqueTicketAccept accept
|
||||||
|
|
|
@ -763,9 +763,11 @@ offerTicketC shrUser summary audience offer@(Offer ticket uTarget) = runExceptT
|
||||||
prj == prjProject &&
|
prj == prjProject &&
|
||||||
localRecipProject project -> do
|
localRecipProject project -> do
|
||||||
insertToInbox ibid
|
insertToInbox ibid
|
||||||
|
{-
|
||||||
num <-
|
num <-
|
||||||
((subtract 1) . projectNextTicket) <$>
|
((subtract 1) . projectNextTicket) <$>
|
||||||
updateGet jid [ProjectNextTicket +=. 1]
|
updateGet jid [ProjectNextTicket +=. 1]
|
||||||
|
-}
|
||||||
obiidAccept <- do
|
obiidAccept <- do
|
||||||
obidProject <- projectOutbox <$> getJust jid
|
obidProject <- projectOutbox <$> getJust jid
|
||||||
now <- liftIO getCurrentTime
|
now <- liftIO getCurrentTime
|
||||||
|
@ -776,9 +778,9 @@ offerTicketC shrUser summary audience offer@(Offer ticket uTarget) = runExceptT
|
||||||
persistJSONObjectFromDoc $ Doc hLocal emptyActivity
|
persistJSONObjectFromDoc $ Doc hLocal emptyActivity
|
||||||
, outboxItemPublished = now
|
, outboxItemPublished = now
|
||||||
}
|
}
|
||||||
tid <- insertTicket jid {-tids-} num obiidAccept
|
tid <- insertTicket jid {-tids-} {-num-} obiidAccept
|
||||||
docAccept <- insertAccept pidAuthor sid jid fsid luOffer obiidAccept tid
|
docAccept <- insertAccept pidAuthor sid jid fsid luOffer obiidAccept tid
|
||||||
publishAccept pidAuthor sid jid fsid luOffer num obiidAccept docAccept
|
publishAccept pidAuthor sid jid fsid luOffer {-num-} obiidAccept docAccept
|
||||||
(pidsTeam, remotesTeam) <-
|
(pidsTeam, remotesTeam) <-
|
||||||
if localRecipProjectTeam project
|
if localRecipProjectTeam project
|
||||||
then getProjectTeam sid
|
then getProjectTeam sid
|
||||||
|
@ -841,12 +843,12 @@ offerTicketC shrUser summary audience offer@(Offer ticket uTarget) = runExceptT
|
||||||
obiid
|
obiid
|
||||||
[OutboxItemActivity =. persistJSONObjectFromDoc doc]
|
[OutboxItemActivity =. persistJSONObjectFromDoc doc]
|
||||||
return doc
|
return doc
|
||||||
insertTicket jid {-tidsDeps-} next obiidAccept = do
|
insertTicket jid {-tidsDeps-} {-next-} obiidAccept = do
|
||||||
did <- insert Discussion
|
did <- insert Discussion
|
||||||
fsid <- insert FollowerSet
|
fsid <- insert FollowerSet
|
||||||
tid <- insert Ticket
|
tid <- insert Ticket
|
||||||
{ ticketProject = jid
|
{ ticketProject = jid
|
||||||
, ticketNumber = next
|
, ticketNumber = Nothing
|
||||||
, ticketCreated = now
|
, ticketCreated = now
|
||||||
, ticketTitle = unTextHtml $ AP.ticketSummary ticket
|
, ticketTitle = unTextHtml $ AP.ticketSummary ticket
|
||||||
, ticketSource =
|
, ticketSource =
|
||||||
|
@ -868,7 +870,7 @@ offerTicketC shrUser summary audience offer@(Offer ticket uTarget) = runExceptT
|
||||||
--insertMany_ $ map (TicketDependency tid) tidsDeps
|
--insertMany_ $ map (TicketDependency tid) tidsDeps
|
||||||
-- insert_ $ Follow pidAuthor fsid False True
|
-- insert_ $ Follow pidAuthor fsid False True
|
||||||
return tid
|
return tid
|
||||||
publishAccept pidAuthor sid jid fsid luOffer num obiid doc = do
|
publishAccept pidAuthor sid jid fsid luOffer {-num-} obiid doc = do
|
||||||
now <- liftIO getCurrentTime
|
now <- liftIO getCurrentTime
|
||||||
let dont = Authority "dont-do.any-forwarding" Nothing
|
let dont = Authority "dont-do.any-forwarding" Nothing
|
||||||
remotesHttp <- do
|
remotesHttp <- do
|
||||||
|
|
|
@ -240,9 +240,11 @@ projectOfferTicketF
|
||||||
delete ibiid
|
delete ibiid
|
||||||
return Nothing
|
return Nothing
|
||||||
Just _ibirid -> do
|
Just _ibirid -> do
|
||||||
|
{-
|
||||||
next <-
|
next <-
|
||||||
((subtract 1) . projectNextTicket) <$>
|
((subtract 1) . projectNextTicket) <$>
|
||||||
updateGet jid [ProjectNextTicket +=. 1]
|
updateGet jid [ProjectNextTicket +=. 1]
|
||||||
|
-}
|
||||||
did <- insert Discussion
|
did <- insert Discussion
|
||||||
fsid <- insert FollowerSet
|
fsid <- insert FollowerSet
|
||||||
|
|
||||||
|
@ -261,7 +263,7 @@ projectOfferTicketF
|
||||||
|
|
||||||
tid <- insert Ticket
|
tid <- insert Ticket
|
||||||
{ ticketProject = jid
|
{ ticketProject = jid
|
||||||
, ticketNumber = next
|
, ticketNumber = Nothing
|
||||||
, ticketCreated = now
|
, ticketCreated = now
|
||||||
, ticketTitle = unTextHtml $ AP.ticketSummary ticket
|
, ticketTitle = unTextHtml $ AP.ticketSummary ticket
|
||||||
, ticketSource =
|
, ticketSource =
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{- This file is part of Vervis.
|
{- This file is part of Vervis.
|
||||||
-
|
-
|
||||||
- Written in 2016 by fr33domlover <fr33domlover@riseup.net>.
|
- Written in 2016, 2020 by fr33domlover <fr33domlover@riseup.net>.
|
||||||
-
|
-
|
||||||
- ♡ Copying is an act of love. Please copy, reuse and share.
|
- ♡ Copying is an act of love. Please copy, reuse and share.
|
||||||
-
|
-
|
||||||
|
|
|
@ -895,7 +895,7 @@ getTicketDeps forward shr prj tkhid = do
|
||||||
E.on $ E.just (t E.^. TicketId) E.==. tal E.?. TicketAuthorLocalTicket
|
E.on $ E.just (t E.^. TicketId) E.==. tal E.?. TicketAuthorLocalTicket
|
||||||
E.on $ td E.^. to' E.==. t E.^. TicketId
|
E.on $ td E.^. to' E.==. t E.^. TicketId
|
||||||
E.where_ $ td E.^. from' E.==. E.val tid
|
E.where_ $ td E.^. from' E.==. E.val tid
|
||||||
E.orderBy [E.asc $ t E.^. TicketNumber]
|
E.orderBy [E.asc $ t E.^. TicketId]
|
||||||
return
|
return
|
||||||
( td E.^. TicketDependencyId
|
( td E.^. TicketDependencyId
|
||||||
, t E.^. TicketId
|
, t E.^. TicketId
|
||||||
|
|
|
@ -1229,6 +1229,10 @@ changes hLocal ctx =
|
||||||
, addEntities model_2020_01_05
|
, addEntities model_2020_01_05
|
||||||
-- 185
|
-- 185
|
||||||
, addFieldPrimOptional "WorkflowField" (Nothing :: Maybe Int) "color"
|
, addFieldPrimOptional "WorkflowField" (Nothing :: Maybe Int) "color"
|
||||||
|
-- 186
|
||||||
|
, removeUnique "Ticket" "UniqueTicket"
|
||||||
|
-- 187
|
||||||
|
, setFieldMaybe "Ticket" "number"
|
||||||
]
|
]
|
||||||
|
|
||||||
migrateDB
|
migrateDB
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{- This file is part of Vervis.
|
{- This file is part of Vervis.
|
||||||
-
|
-
|
||||||
- Written in 2016, 2018, 2019 by fr33domlover <fr33domlover@riseup.net>.
|
- Written in 2016, 2018, 2019, 2020 by fr33domlover <fr33domlover@riseup.net>.
|
||||||
-
|
-
|
||||||
- ♡ Copying is an act of love. Please copy, reuse and share.
|
- ♡ Copying is an act of love. Please copy, reuse and share.
|
||||||
-
|
-
|
||||||
|
@ -90,7 +90,9 @@ instance PersistEntityGraphSelect Ticket TicketDependency where
|
||||||
selectorParam _ = ticketProject
|
selectorParam _ = ticketProject
|
||||||
selectorField _ = TicketProject
|
selectorField _ = TicketProject
|
||||||
|
|
||||||
|
{-
|
||||||
instance PersistEntityGraphNumbered Ticket TicketDependency where
|
instance PersistEntityGraphNumbered Ticket TicketDependency where
|
||||||
numberParam _ = ticketNumber
|
numberParam _ = ticketNumber
|
||||||
numberField _ = TicketNumber
|
numberField _ = TicketNumber
|
||||||
uniqueNode _ = UniqueTicket
|
uniqueNode _ = UniqueTicket
|
||||||
|
-}
|
||||||
|
|
Loading…
Reference in a new issue