mirror of
https://github.com/inventree/InvenTree.git
synced 2026-10-07 02:41:21 +00:00
Catch unhandled javascript errors
This commit is contained in:
1 parent
ff71fe6e93
commit
a2c3c1086c
2 files changed
+9
-5
No files matched your search
@@ -18,14 +18,18 @@ function {{ label }}StatusDisplay(key) {
|
||||
|
||||
key = String(key);
|
||||
|
||||
var value = {{ label }}Codes[key].value;
|
||||
var value = null;
|
||||
var label = null;
|
||||
|
||||
if (key in {{ label }}Codes) {
|
||||
value = {{ label }}Codes[key].value;
|
||||
label = {{ label }}Codes[key].label;
|
||||
}
|
||||
|
||||
if (value == null || value.length == 0) {
|
||||
value = key;
|
||||
label = '';
|
||||
}
|
||||
|
||||
// Select the label color
|
||||
var label = {{ label }}Codes[key].label ?? '';
|
||||
|
||||
return `<span class='label ${label}'>${value}</span>`;
|
||||
}
|
||||
Reference in new issue
Block a user