Merge pull request #2178 from fsteeg/2177-links

Prefer view.url pattern for data extension preview links
This commit is contained in:
Antonin Delpeuch 2019-10-04 16:49:20 +01:00 committed by GitHub
commit 25313e0882
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -283,9 +283,11 @@ ExtendReconciledDataPreviewDialog.prototype._renderPreview = function(data) {
var cell = row[c]; var cell = row[c];
if (cell !== null) { if (cell !== null) {
if ($.isPlainObject(cell)) { if ($.isPlainObject(cell)) {
$('<a>').attr("href", var service = self._serviceMetadata;
this._serviceMetadata.identifierSpace + cell.id var href = (service.view && service.view.url) ?
).attr("target", "_blank").text(cell.name).appendTo(td); encodeURI(service.view.url.replace("{{id}}", cell.id)) :
service.identifierSpace + cell.id;
$('<a>').attr("href", href).attr("target", "_blank").text(cell.name).appendTo(td);
} else { } else {
$('<span>').text(cell).appendTo(td); $('<span>').text(cell).appendTo(td);
} }