Skip to content

Commit

Permalink
#1637 Fix dispplay of custom fields labels based on defined value
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 879bb1c commit d80612a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
var self = this;

this.fieldsCache = {};
this.definedValues = 0;
this.fieldClicked = function(fieldName, newValue) {
this.onFieldClick({
name: fieldName,
Expand All @@ -18,6 +19,11 @@
CustomFieldsSrv.all().then(function(fields) {
self.fieldsCache = fields;
});

self.definedValues = (_.filter(self.customFields, function(item) {
return item.value !== null && item.value !== undefined;
}) || []).length;

};
},
controllerAs: '$cmp',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="case-tags flexwrap">
<span class="mr-xxxs text-muted"><i class="fa fa-code"></i></span>

<strong class="text-muted mr-xxxs" ng-if="!$cmp.customFields || $cmp.customFields.length === 0">None</strong>
<strong class="text-muted mr-xxxs" ng-if="!$cmp.customFields || $cmp.definedValues === 0 ">None</strong>

<span class="double-val-label mb-xxxs mr-xxxs pointer"
ng-repeat="cf in $cmp.customFields | orderBy:'order' track by $index"
Expand Down

0 comments on commit d80612a

Please sign in to comment.