From 4bc44605fbbbc1a975456db229bcd5557b20d045 Mon Sep 17 00:00:00 2001 From: azivner Date: Mon, 27 Aug 2018 13:35:45 +0200 Subject: [PATCH] don't short child: promoted attributes --- src/public/javascripts/services/note_detail.js | 5 ++++- src/public/javascripts/services/tooltip.js | 11 ++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/public/javascripts/services/note_detail.js b/src/public/javascripts/services/note_detail.js index 5577c7ece..4737b56a7 100644 --- a/src/public/javascripts/services/note_detail.js +++ b/src/public/javascripts/services/note_detail.js @@ -226,7 +226,10 @@ async function loadAttributes() { const attributes = await server.get('notes/' + noteId + '/attributes'); - const promoted = attributes.filter(attr => (attr.type === 'label-definition' || attr.type === 'relation-definition') && attr.value.isPromoted); + const promoted = attributes.filter(attr => + (attr.type === 'label-definition' || attr.type === 'relation-definition') + && !attr.name.startsWith("child:") + && attr.value.isPromoted); let idx = 1; diff --git a/src/public/javascripts/services/tooltip.js b/src/public/javascripts/services/tooltip.js index df4a9431a..7a00981fa 100644 --- a/src/public/javascripts/services/tooltip.js +++ b/src/public/javascripts/services/tooltip.js @@ -44,7 +44,10 @@ function setupTooltip() { async function renderTooltip(callback, note, attributes) { let content = ''; - const promoted = attributes.filter(attr => (attr.type === 'label-definition' || attr.type === 'relation-definition') && attr.value.isPromoted); + const promoted = attributes.filter(attr => + (attr.type === 'label-definition' || attr.type === 'relation-definition') + && !attr.name.startsWith("child:") + && attr.value.isPromoted); if (promoted.length > 0) { const $table = $("").addClass("promoted-attributes-in-tooltip"); @@ -56,6 +59,10 @@ async function renderTooltip(callback, note, attributes) { let valueAttrs = attributes.filter(el => el.name === definitionAttr.name && el.type === valueType); for (const valueAttr of valueAttrs) { + if (!valueAttr.value) { + continue; + } + let $value = ""; if (valueType === 'label') { @@ -84,8 +91,6 @@ async function renderTooltip(callback, note, attributes) { } // other types of notes don't have tooltip preview - console.log(content); - if (!content.trim()) { return; }