mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-09 07:00:56 +00:00
Link changes and in-table clipboards (#4697)
* Add clipboard to tables and external link changes * Clipboard icon added to tables for screens >1200px wide. Enables copying of SKU/MPN/IPN from table cells where these otherwise are hyperlinks * External links now open in new tabs with noreferrer * Move external links into separate template * All statically rendered external links have been moved out to a new template.
This commit is contained in:
@ -954,7 +954,7 @@ function loadManufacturerPartTable(table, url, options) {
|
||||
field: 'MPN',
|
||||
title: '{% trans "MPN" %}',
|
||||
formatter: function(value, row) {
|
||||
return renderLink(value, `/manufacturer-part/${row.pk}/`);
|
||||
return renderClipboard(renderLink(value, `/manufacturer-part/${row.pk}/`));
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -962,7 +962,7 @@ function loadManufacturerPartTable(table, url, options) {
|
||||
title: '{% trans "Link" %}',
|
||||
formatter: function(value) {
|
||||
if (value) {
|
||||
return renderLink(value, value);
|
||||
return renderLink(value, value, {external: true});
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
@ -1194,7 +1194,7 @@ function loadSupplierPartTable(table, url, options) {
|
||||
field: 'SKU',
|
||||
title: '{% trans "Supplier Part" %}',
|
||||
formatter: function(value, row) {
|
||||
return renderLink(value, `/supplier-part/${row.pk}/`);
|
||||
return renderClipboard(renderLink(value, `/supplier-part/${row.pk}/`));
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -1225,7 +1225,7 @@ function loadSupplierPartTable(table, url, options) {
|
||||
title: '{% trans "MPN" %}',
|
||||
formatter: function(value, row) {
|
||||
if (value && row.manufacturer_part) {
|
||||
return renderLink(value, `/manufacturer-part/${row.manufacturer_part}/`);
|
||||
return renderClipboard(renderLink(value, `/manufacturer-part/${row.manufacturer_part}/`));
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
@ -1261,7 +1261,7 @@ function loadSupplierPartTable(table, url, options) {
|
||||
title: '{% trans "Link" %}',
|
||||
formatter: function(value) {
|
||||
if (value) {
|
||||
return renderLink(value, value);
|
||||
return renderLink(value, value, {external: true});
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
|
Reference in New Issue
Block a user