Skip to content

Commit

Permalink
feat(api): Add API version details to the metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-nfc committed Nov 30, 2024
1 parent deb9337 commit 6ed4db0
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions app/api/react_ui_metadata.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from django.conf import settings
from django.utils.encoding import force_str

from rest_framework import serializers
Expand Down Expand Up @@ -139,6 +140,32 @@ def determine_metadata(self, request, view):
metadata['layout'] = view.get_page_layout()


build_repo: str = None

if settings.BUILD_REPO:

build_repo = settings.BUILD_REPO

build_sha: str = None

if settings.BUILD_SHA:

build_sha = settings.BUILD_SHA

build_version: str = 'development'

if settings.BUILD_VERSION:

build_version = settings.BUILD_VERSION


metadata['version']: dict = {
'project_url': build_repo,
'sha': build_sha,
'version': build_version,
}


metadata['navigation'] = [
{
"display_name": "Access",
Expand Down

0 comments on commit 6ed4db0

Please sign in to comment.