devguard icon indicating copy to clipboard operation
devguard copied to clipboard

Subprojects are returned from the API without being able to distingush those from assets

Open timbastin opened this issue 8 months ago • 1 comments

Description:
Projects can have subprojects (identified by the parent_id column). The current contenttree function returns a flat list of subprojects and assets mixed together, with no way to distinguish between them.

org_repository.go@ContentTree

Problem:

  • Subprojects and assets are returned at the same level.
  • No clear structure or type indication for items.
  • Difficult to handle or visualize nested project hierarchies.

Proposed Solution:
Refactor the contenttree function to return a proper hierarchical tree structure as JSON, e.g.:

[{
  "id": 1,
  "name": "Main Project",
  "type": "project",
  "children": [
    {
      "id": 2,
      "name": "Subproject A",
      "type": "subproject",
      "children": [ ... ]
    },
    {
      "id": 10,
      "name": "Asset X",
      "type": "asset"
    }
  ]
}]

timbastin avatar Apr 23 '25 06:04 timbastin

We need to make corresponding changes to the frontend as well.

timbastin avatar Apr 23 '25 06:04 timbastin

this is not needed anymore

timbastin avatar Jun 13 '25 10:06 timbastin