diff --git a/app/assets/javascripts/repositories/renderers/edit_renderers.js b/app/assets/javascripts/repositories/renderers/edit_renderers.js index 3bb608bbe..067499ff5 100644 --- a/app/assets/javascripts/repositories/renderers/edit_renderers.js +++ b/app/assets/javascripts/repositories/renderers/edit_renderers.js @@ -27,7 +27,7 @@ $.fn.dataTable.render.editRepositoryAssetValue = function(formId, columnId, cell $.fn.dataTable.render.editRepositoryTextValue = function(formId, columnId, cell) { let $cell = $(cell.node()); - let text = $cell.text(); + let text = $cell.find('.text-value').data('edit-value'); $cell.html(`
diff --git a/app/assets/javascripts/repositories/renderers/view_renderers.js b/app/assets/javascripts/repositories/renderers/view_renderers.js index cfca42aeb..8d23fce1f 100644 --- a/app/assets/javascripts/repositories/renderers/view_renderers.js +++ b/app/assets/javascripts/repositories/renderers/view_renderers.js @@ -26,7 +26,8 @@ $.fn.dataTable.render.defaultRepositoryAssetValue = function() { }; $.fn.dataTable.render.RepositoryTextValue = function(data) { - return data.value; + var text = $(`${data.value.view}`); + return text.prop('outerHTML'); }; $.fn.dataTable.render.defaultRepositoryTextValue = function() { diff --git a/app/serializers/repository_datatable/repository_text_value_serializer.rb b/app/serializers/repository_datatable/repository_text_value_serializer.rb index 60a788f97..c505abbc2 100644 --- a/app/serializers/repository_datatable/repository_text_value_serializer.rb +++ b/app/serializers/repository_datatable/repository_text_value_serializer.rb @@ -8,9 +8,10 @@ module RepositoryDatatable def value @user = scope[:user] - custom_auto_link(object.data, - simple_format: true, - team: scope[:team]) + { + view: custom_auto_link(object.data, simple_format: true, team: scope[:team]), + edit: sanitize_input(object.data) + } end end end