Skip to content

Commit

Permalink
#1637 Add a renderer to custom fields in list views
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani authored and To-om committed Nov 13, 2020
1 parent 3fe80ee commit 601f138
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
1 change: 1 addition & 0 deletions frontend/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@
<script src="scripts/directives/user.js"></script>
<script src="scripts/directives/userinfo.js"></script>
<script src="scripts/directives/utils/autofocus.js"></script>
<script src="scripts/filters/custom-field-value.js"></script>
<script src="scripts/filters/duration.js"></script>
<script src="scripts/filters/ellipsis.js"></script>
<script src="scripts/filters/fang.js"></script>
Expand Down
17 changes: 17 additions & 0 deletions frontend/app/scripts/filters/custom-field-value.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(function() {
'use strict';
angular.module('theHiveFilters').filter('customFieldValue', function() {
return function(customField) {
if(!customField) {
return '';
}

switch(customField.type) {
case 'date':
return moment(customField.value).format('MM/DD/YY H:mm');
default:
return customField.value;
}
};
});
})();
18 changes: 0 additions & 18 deletions frontend/app/styles/label.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
.double-val-label {
display: table;
/* margin: .2em .6em .3em; */
margin-top: 0;
margin-left: 0;
}
.double-val-label>span {
color: #ffffff;
display: table-cell;
/* font-size: 0.9em; */
font-weight: 400;
line-height: 1;
padding: .3em .6em;
Expand All @@ -25,10 +23,7 @@
.double-val-label>span:last-child {
border-bottom-right-radius: 0.25em;
border-top-right-radius: .25em;
/* border-left: 1px dashed #777; */
border-left: 1px dashed #3c8dbc;
/* background-color: #d2d6de;
color: #444; */
}
.double-val-label>span.primary {
background-color: #3c8dbc;
Expand All @@ -38,16 +33,3 @@
background-color: #d2d6de;
color: #444;
}
/*
.double-val-label>span.success {
background-color: #5cb85c;
}
.double-val-label>span.info {
background-color: #5bc0de;
}
.double-val-label>span.warning {
background-color: #f0ad4e;
}
.double-val-label>span.danger {
background-color: #d9534f;
} */
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
ng-if="cf.value !== undefined && cf.value !== null">

<span class="default" uib-tooltip="{{cf.description}}" tooltip-placement="top">{{$cmp.fieldsCache[cf.name].name || cf.name}}</span>
<span class="default">{{cf.value}}</span>
<span class="default">{{cf | customFieldValue}}</span>
</span>
</div>

0 comments on commit 601f138

Please sign in to comment.