mirror of
https://code.sup39.dev/repos/Wqawg
synced 2024-12-27 02:04:52 +09:00
UI: If MR is applied, don't do the canApply check and display "RESOLVED"
This commit is contained in:
parent
ceee428450
commit
84b70aa7b3
2 changed files with 23 additions and 17 deletions
|
@ -317,8 +317,11 @@ getClothR loomHash clothHash = do
|
|||
let patchIDs = NE.map entityKey patches
|
||||
diffs = NE.map (patchContent . entityVal) $ NE.reverse patches
|
||||
(repoID, _, _, maybeBranch) = targetRepo
|
||||
errorOrCanApply <- runExceptT $ canApplyPatches repoID maybeBranch diffs
|
||||
return (bundleID, patchIDs, errorOrCanApply)
|
||||
maybeErrorOrCanApply <-
|
||||
case ticketStatus ticket of
|
||||
TSClosed -> pure Nothing
|
||||
_ -> Just <$> runExceptT (canApplyPatches repoID maybeBranch diffs)
|
||||
return (bundleID, patchIDs, maybeErrorOrCanApply)
|
||||
hashMessageKey <- handlerToWidget getEncodeKeyHashid
|
||||
let desc :: Widget
|
||||
desc = toWidget $ markupHTML $ ticketDescription ticket
|
||||
|
|
|
@ -54,7 +54,7 @@ $with (_repoID, repoHash, name, maybeBranch) <- targetRepo
|
|||
<a href=@{RepoBranchSourceR repoHash branch []}>
|
||||
#{branch}
|
||||
|
||||
$maybe (bundleID, patchIDs, errorOrCanApply) <- mbundle'
|
||||
$maybe (bundleID, patchIDs, maybeErrorOrCanApply) <- mbundle'
|
||||
<div>
|
||||
Bundle
|
||||
<a href=@{BundleR loomHash clothHash (hashBundle bundleID)}>
|
||||
|
@ -66,20 +66,23 @@ $maybe (bundleID, patchIDs, errorOrCanApply) <- mbundle'
|
|||
<a href=@{PatchR loomHash clothHash (hashBundle bundleID) (hashPatch patchID)}>
|
||||
#{keyHashidText $ hashPatch patchID}
|
||||
<div>
|
||||
Status:
|
||||
$case errorOrCanApply
|
||||
$of Left e
|
||||
<span .apply-error>
|
||||
[Error! #{e}]
|
||||
^{applyButton "Try applying anyway"}
|
||||
$of Right False
|
||||
<span .apply-no>
|
||||
[Apply check failed! Possibly conflicts exist]
|
||||
^{applyButton "Try applying anyway"}
|
||||
$of Right True
|
||||
<span .apply-yes>
|
||||
[Can apply!]
|
||||
^{applyButton "Apply"}
|
||||
Status: #
|
||||
$maybe errorOrCanApply <- maybeErrorOrCanApply
|
||||
$case errorOrCanApply
|
||||
$of Left e
|
||||
<span .apply-error>
|
||||
[Error! #{e}]
|
||||
^{applyButton "Try applying anyway"}
|
||||
$of Right False
|
||||
<span .apply-no>
|
||||
[Apply check failed! Possibly conflicts exist]
|
||||
^{applyButton "Try applying anyway"}
|
||||
$of Right True
|
||||
<span .apply-yes>
|
||||
[Can apply!]
|
||||
^{applyButton "Apply"}
|
||||
$nothing
|
||||
RESOLVED
|
||||
|
||||
<div>
|
||||
<span>
|
||||
|
|
Loading…
Reference in a new issue