Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown item tag metadata #466

Open
2 tasks done
Tracked by #465
jon-nfc opened this issue Jan 7, 2025 · 0 comments · May be fixed by #467
Open
2 tasks done
Tracked by #465

Markdown item tag metadata #466

jon-nfc opened this issue Jan 7, 2025 · 0 comments · May be fixed by #467
Assignees
Labels
task::feature Adds functionality type::task Issue Type
Milestone

Comments

@jon-nfc
Copy link
Member

jon-nfc commented Jan 7, 2025

For the UI to render valid item tags, it must know what items are valid.

Details

To ensure the UI only renders valid item tags within markdown, provide as part of the markdown fields metadata, the link to the item to be rendered. The UI will then use this data to ensure that prior to rendering the markdown to html that the item exists.

The data to provide as part of the markdown field should be broken down by type, with each valid item being a link to the item in question. As part of the API query/metadata building, a search of the pre-rendered markdown for item tags be done and for each one found, search the database and if the item is found, add it's details to the markdown metadata.

The UI as part of rendering the item link, will then search this data to see if the item is found within the metadata, if so then render the tag as an anchor to the item.

example metadata

The following structure is used for renderable items, and added as metadata to the markdown field:

"render": {
    "models": {
        "software": {
            "2824": {
                "title": "1122",
                "url": "/api/v2/itam/software/2824"
            }
        },
        "device": {
            "24": {
                "title": "a-random-device",
                "url": "/api/v2/itam/device/24"
            }
        },
        "cluster": {
            "1": {
                "title": "cluster one",
                "url": "/api/v2/itim/cluster/1"
            }
        }
    },
    "tickets": {
        "2": {
            "status": "Solved",
            "ticket_type": "Request",
            "title": "a random ticket that should have type set",
            "url": "/api/v2/assistance/ticket/request/2"
        },
        "4": {
            "status": "New",
            "ticket_type": "Incident",
            "title": "an incident",
            "url": "/api/v2/itim/ticket/incident/4"
        },
        "5": {
            "status": "Pending",
            "ticket_type": "Problem",
            "title": "the first problem ticket",
            "url": "/api/v2/itim/ticket/problem/5"
        }
    }
}
  • Each key of the render dictionary is a separate renderable (markdown) item
  • in the cas of models, as there are many different types, the next key in the dictionary is the type, with the next key being numerical within the items URL.
  • in the case of tickets, as this is a single item, the dict key is the item id, with the value being the URL.
  • Each item must have a url key
  • each item must return all data that is required to render the markdown anchor.

Links

Requirements

  • Only items that exist be added to the markdown field metadata
  • Items that dont exist are not added to markdown field metadata
@jon-nfc jon-nfc added type::task Issue Type task::feature Adds functionality labels Jan 7, 2025
@jon-nfc jon-nfc added this to the Next Release milestone Jan 7, 2025
@jon-nfc jon-nfc moved this to Planning in Centurion ERP Jan 7, 2025
@jon-nfc jon-nfc moved this from Planning to Backlog in Centurion ERP Jan 7, 2025
@jon-nfc jon-nfc self-assigned this Jan 7, 2025
@jon-nfc jon-nfc moved this from Backlog to In progress in Centurion ERP Jan 7, 2025
jon-nfc added a commit to nofusscomputing/centurion_erp_ui that referenced this issue Jan 7, 2025
jon-nfc added a commit to nofusscomputing/centurion_erp_ui that referenced this issue Jan 7, 2025
jon-nfc added a commit to nofusscomputing/centurion_erp_ui that referenced this issue Jan 8, 2025
jon-nfc added a commit to nofusscomputing/centurion_erp_ui that referenced this issue Jan 8, 2025
jon-nfc added a commit to nofusscomputing/centurion_erp_ui that referenced this issue Jan 8, 2025
jon-nfc added a commit to nofusscomputing/centurion_erp_ui that referenced this issue Jan 8, 2025
jon-nfc added a commit to nofusscomputing/centurion_erp_ui that referenced this issue Jan 8, 2025
jon-nfc added a commit to nofusscomputing/centurion_erp_ui that referenced this issue Jan 8, 2025
jon-nfc added a commit to nofusscomputing/centurion_erp_ui that referenced this issue Jan 8, 2025
jon-nfc added a commit to nofusscomputing/centurion_erp_ui that referenced this issue Jan 8, 2025
jon-nfc added a commit to nofusscomputing/centurion_erp_ui that referenced this issue Jan 8, 2025
jon-nfc added a commit to nofusscomputing/centurion_erp_ui that referenced this issue Jan 8, 2025
jon-nfc added a commit to nofusscomputing/centurion_erp_ui that referenced this issue Jan 8, 2025
jon-nfc added a commit to nofusscomputing/centurion_erp_ui that referenced this issue Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task::feature Adds functionality type::task Issue Type
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant