SHA display touchups (#8614)

* Only showing last 8 chars of SHA

* visual touchups

* Grabbing first 8 rather than last 8

* 10 char SHA rather than 8

* atting config var for SHA length
This commit is contained in:
Evan Rusackas 2019-12-04 13:13:51 -08:00 committed by Maxime Beauchemin
parent e55001b88f
commit b107cc03bf
3 changed files with 7 additions and 5 deletions

View File

@ -138,7 +138,8 @@ span.title-block {
div.navbar {
z-index: 999;
.dropdown-menu .fineprint {
padding: 10px 20px 0 20px;
line-height: 1.5rem;
padding: 10px 20px 5px 20px;
color: @gray-light;
font-size: @font-size-m;
div {

View File

@ -67,10 +67,10 @@ def _try_json_readversion(filepath):
return None
def _try_json_readsha(filepath):
def _try_json_readsha(filepath, length):
try:
with open(filepath, "r") as f:
return json.load(f).get("GIT_SHA")
return json.load(f).get("GIT_SHA")[:length]
except Exception:
return None
@ -84,7 +84,8 @@ VERSION_STRING = _try_json_readversion(VERSION_INFO_FILE) or _try_json_readversi
PACKAGE_JSON_FILE
)
VERSION_SHA = _try_json_readsha(VERSION_INFO_FILE)
VERSION_SHA_LENGTH = 8
VERSION_SHA = _try_json_readsha(VERSION_INFO_FILE, VERSION_SHA_LENGTH)
ROW_LIMIT = 50000
VIZ_ROW_LIMIT = 10000

View File

@ -111,7 +111,7 @@
{% if version_string or version_sha %}
<li class="fineprint">
{% if version_string %}
<div>Version {{version_string}}</div>
<div>Version: {{version_string}}</div>
{% endif %}
{% if version_sha %}
<div>SHA: {{version_sha}}</div>