Fully implemented Repo setting to enable/disable Issue Dependencies
Signed-off-by: Konrad <konrad@kola-entertainments.de>
This commit is contained in:
parent
c0d03825d1
commit
6e5c686457
|
|
@ -714,6 +714,7 @@ func ViewIssue(ctx *context.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get Dependencies
|
// Get Dependencies
|
||||||
|
ctx.Data["IssueDependenciesEnabled"] = repo.UnitEnabled(models.UnitTypeIssueDependencies)
|
||||||
ctx.Data["BlockedByDependencies"], err = repo.BlockedByDependencies(issue.ID)
|
ctx.Data["BlockedByDependencies"], err = repo.BlockedByDependencies(issue.ID)
|
||||||
ctx.Data["BlockingDependencies"], err = repo.BlockingDependencies(issue.ID)
|
ctx.Data["BlockingDependencies"], err = repo.BlockingDependencies(issue.ID)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,9 @@ import (
|
||||||
|
|
||||||
// Adds new dependencies
|
// Adds new dependencies
|
||||||
func AddDependency(c *context.Context) {
|
func AddDependency(c *context.Context) {
|
||||||
|
|
||||||
|
// TODO: should should an issue only have dependencies in it's own repo?
|
||||||
|
|
||||||
depID, err := strconv.ParseInt(c.Req.PostForm.Get("newDependency"), 10, 64)
|
depID, err := strconv.ParseInt(c.Req.PostForm.Get("newDependency"), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.Handle(http.StatusBadRequest, "issue ID is not int", err)
|
c.Handle(http.StatusBadRequest, "issue ID is not int", err)
|
||||||
|
|
@ -28,6 +31,12 @@ func AddDependency(c *context.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if the Repo is allowed to have dependencies
|
||||||
|
if !c.Repo.Repository.UnitEnabled(models.UnitTypeIssueDependencies) {
|
||||||
|
c.Handle(404, "MustEnableIssueDependencies", nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Dependency
|
// Dependency
|
||||||
dep, err := models.GetIssueByID(depID)
|
dep, err := models.GetIssueByID(depID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -191,6 +191,7 @@
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
|
{{if .IssueDependenciesEnabled}}
|
||||||
<div class="ui divider"></div>
|
<div class="ui divider"></div>
|
||||||
|
|
||||||
<div class="ui depending">
|
<div class="ui depending">
|
||||||
|
|
@ -309,3 +310,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{end}}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user