Skip to content

Commit

Permalink
fix(element-templates): do not render empty descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Niklas Kiefer authored and fake-join[bot] committed Jan 21, 2022
1 parent 475d6fc commit 656f801
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function PropertyDescription(props) {
description
} = props;

return (
return description && (
<Markup
markup={ sanitizeHTML(description) }
trim={ false } />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,21 @@
}
},
{
"label": "string",
"label": "withHTML",
"description": "By the way, you can use <a target='_blank' href=\"https://freemarker.apache.org/\">freemarker templates</a> here",
"type": "String",
"binding": {
"type": "property",
"name": "string"
}
},
{
"label": "empty",
"type": "String",
"binding": {
"type": "property",
"name": "string"
}
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1392,6 +1392,19 @@ describe('provider/element-templates - CustomProperties', function() {
'</div>'
);
});


it('should NOT display empty descriptions', async function() {

// when
await expectSelected('Task');

// then
const entry = findEntry('custom-entry-com.camunda.example.description-5', container);
const description = domQuery('.bio-properties-panel-description', entry);

expect(description).to.not.exist;
});
});


Expand Down

0 comments on commit 656f801

Please sign in to comment.