FIX: formats topic report only if we have one (#6231)

This commit is contained in:
Joffrey JAFFEUX 2018-08-02 08:01:17 -04:00 committed by GitHub
parent 14bbd5d167
commit 1ca999fdb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -324,12 +324,16 @@ const Report = Discourse.Model.extend({
_topicLabel(properties, row) {
const topicTitle = row[properties.title];
const topicId = row[properties.id];
const href = `/t/-/${topicId}`;
const formatedValue = () => {
const topicId = row[properties.id];
const href = `/t/-/${topicId}`;
return `<a href='${href}'>${topicTitle}</a>`;
};
return {
value: topicTitle,
formatedValue: `<a href='${href}'>${topicTitle}</a>`
formatedValue: topicTitle ? formatedValue() : "-"
};
},