feat: remove namespaces, make projects infinitely nestable #1362

Merged
konrad merged 68 commits from feature/namespaces-be-gone into main 2023-05-24 14:14:03 +00:00
1 changed files with 4 additions and 1 deletions
Showing only changes of commit aafcb0bac4 - Show all commits

View File

@ -220,6 +220,7 @@ func (p *Project) ReadAll(s *xorm.Session, a web.Auth, search string, page int,
////////////////////////// //////////////////////////
// Putting it all together // Putting it all together
projectsResult := []*Project{}
for _, p := range allProjects { for _, p := range allProjects {
if p.ParentProjectID != 0 { if p.ParentProjectID != 0 {
if allProjects[p.ParentProjectID].ChildProjects == nil { if allProjects[p.ParentProjectID].ChildProjects == nil {
@ -229,11 +230,13 @@ func (p *Project) ReadAll(s *xorm.Session, a web.Auth, search string, page int,
continue continue
} }
projectsResult = append(projectsResult, p)
// The projects variable will contain all projects which have no parents // The projects variable will contain all projects which have no parents
// And because we're using the same pointers for everything, those will contain child projects // And because we're using the same pointers for everything, those will contain child projects
} }
return prs, resultCount, totalItems, err return projectsResult, resultCount, totalItems, err
} }
// ReadOne gets one project by its ID // ReadOne gets one project by its ID