feat(api): Add API version details to the metadata
ref: #411 nofusscomputing/centurion_erp_ui#29
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
from django.conf import settings
|
||||
from django.utils.encoding import force_str
|
||||
|
||||
from rest_framework import serializers
|
||||
@ -139,6 +140,32 @@ class ReactUIMetadata(OverRideJSONAPIMetadata):
|
||||
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",
|
||||
|
Reference in New Issue
Block a user