Add filter so we do not show labelled hr's if there is no detail that is really going to be displayed
@@ -134,8 +134,8 @@ function genComponentConf() {
//TODO it will be possible to have more than one seeks
const seeks = get(post, "seeks");
- const hasContent = content && content.size > 0;
- const hasSeeksBranch = seeks && seeks.size > 0;
+ const hasContent = this.hasVisibleDetails(content);
+ const hasSeeksBranch = this.hasVisibleDetails(seeks);
const groupMembers = get(post, "groupMembers");
@@ -183,6 +183,21 @@ function genComponentConf() {
toggleShowGeneral() {
this.needs__toggleGeneralInfo(this.postUri);
}
+
+ /**
+ * This function checks if there is at least one detail present that is displayable
+ */
+ hasVisibleDetails(contentBranchImm) {
+ return (
+ contentBranchImm &&
+ contentBranchImm.find(
+ (detailValue, detailKey) =>
+ detailKey != "type" &&
+ detailKey != "facets" &&
+ detailKey != "defaultFacet"
+ )
+ );
+ }
}
Controller.$inject = serviceDependencies;
