change targetcategories to a tree structure

Issue #289 new
Nando Neck created an issue

For visibility the json doc targetcategories should be modified like this:

current:

....
        {
            "abbreviation": "Nich",
            "id": "nichtlebende",
            "name": "Nicht Lebende",
            "parent": "wesen"
        },
        {
            "abbreviation": "Dämo",
            "id": "daemonen",
            "name": "Dämonen",
            "parent": "nichtlebende"
        },
        {
            "abbreviation": "Elem",
            "id": "elementare",
            "name": "Elementare",
            "parent": "nichtlebende"
        },
        {
            "abbreviation": "EiGe",
            "id": "elementareeisgeist",
            "name": "Elementare (Eisgeist)",
            "parent": "elementare"
        },
        {
            "abbreviation": "ErGe",
            "id": "elementareerzgeist",
            "name": "Elementare (Erzgeist)",
            "parent": "elementare"
        },
...

new:

...
        {
            "abbreviation": "Nich",
            "children": [
                {
                    "abbreviation": "Dämo",
                    "id": "daemonen",
                    "name": "Dämonen"
                },
                {
                    "abbreviation": "Elem",
                    "children": [
                        {
                            "abbreviation": "EiGe",
                            "id": "elementareeisgeist",
                            "name": "Elementare (Eisgeist)"
                        },
                        {
                            "abbreviation": "ErGe",
                            "id": "elementareerzgeist",
                            "name": "Elementare (Erzgeist)"
                        },
                        ...
                    ],
                    "id": "elementare",
                    "name": "Elementare",
                    "parent": "nichtlebende"
                },
                ...
            ],
            "id": "nichtlebende",
            "name": "Nicht Lebende"
        }

This would also require to change the code to load those targetcategories. But basically all id should be unique there still.

Comments (1)

  1. Log in to comment