2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 20:16:44 +00:00

Merge pull request #2319 from SchrodingersGat/returned-status

Adds fallback value if status code color is not defined
This commit is contained in:
Oliver 2021-11-17 16:10:57 +11:00 committed by GitHub
commit 8a879832ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,6 +27,9 @@ function {{ label }}StatusDisplay(key, options={}) {
label = {{ label }}Codes[key].label; label = {{ label }}Codes[key].label;
} }
// Fallback option for label
label = label || 'bg-dark';
if (value == null || value.length == 0) { if (value == null || value.length == 0) {
value = key; value = key;
label = ''; label = '';