Merge pull request #2657 from urbanrotnik/ai-sci-4765-v2

Fix smart annotation in inventory on edit [SCI-4765] (HotFix branch)
This commit is contained in:
Urban Rotnik 2020-06-12 11:41:02 +02:00 committed by GitHub
commit ec14cf9fef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View file

@ -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(`
<div class="sci-input-container text-field error-icon">

View file

@ -26,7 +26,8 @@ $.fn.dataTable.render.defaultRepositoryAssetValue = function() {
};
$.fn.dataTable.render.RepositoryTextValue = function(data) {
return data.value;
var text = $(`<span class="text-value" data-edit-value="${data.value.edit}">${data.value.view}</span>`);
return text.prop('outerHTML');
};
$.fn.dataTable.render.defaultRepositoryTextValue = function() {

View file

@ -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