mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add results for part categories and stock locations
This commit is contained in:
parent
a551bf1e81
commit
1f003b3f54
@ -1044,4 +1044,5 @@ a {
|
|||||||
border-top: 1px solid var(--border-color);
|
border-top: 1px solid var(--border-color);
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
margin-top: 3px;
|
margin-top: 3px;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
@ -10,7 +10,9 @@
|
|||||||
renderCompany,
|
renderCompany,
|
||||||
renderManufacturerPart,
|
renderManufacturerPart,
|
||||||
renderOwner,
|
renderOwner,
|
||||||
|
renderPart,
|
||||||
renderPartCategory,
|
renderPartCategory,
|
||||||
|
renderStockItem,
|
||||||
renderStockLocation,
|
renderStockLocation,
|
||||||
renderSupplierPart,
|
renderSupplierPart,
|
||||||
*/
|
*/
|
||||||
|
@ -78,6 +78,7 @@ function updateSearch() {
|
|||||||
// Show the "searching" text
|
// Show the "searching" text
|
||||||
$('#offcanvas-search').find('#search-pending').show();
|
$('#offcanvas-search').find('#search-pending').show();
|
||||||
|
|
||||||
|
if (user_settings.SEARCH_PREVIEW_SHOW_PARTS) {
|
||||||
// Search for matching parts
|
// Search for matching parts
|
||||||
addSearchQuery(
|
addSearchQuery(
|
||||||
'part',
|
'part',
|
||||||
@ -89,7 +90,23 @@ function updateSearch() {
|
|||||||
url: '/part',
|
url: '/part',
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (user_settings.SEARCH_PREVIEW_SHOW_CATEGORIES) {
|
||||||
|
// Search for matching part categories
|
||||||
|
addSearchQuery(
|
||||||
|
'category',
|
||||||
|
'{% trans "Part Categories" %}',
|
||||||
|
'{% url "api-part-category-list" %}',
|
||||||
|
{},
|
||||||
|
renderPartCategory,
|
||||||
|
{
|
||||||
|
url: '/part/category',
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (user_settings.SEARCH_PREVIEW_SHOW_STOCK) {
|
||||||
// Search for matching stock items
|
// Search for matching stock items
|
||||||
addSearchQuery(
|
addSearchQuery(
|
||||||
'stock',
|
'stock',
|
||||||
@ -104,6 +121,21 @@ function updateSearch() {
|
|||||||
url: '/stock/item',
|
url: '/stock/item',
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (user_settings.SEARCH_PREVIEW_SHOW_LOCATIONS) {
|
||||||
|
// Search for matching stock locations
|
||||||
|
addSearchQuery(
|
||||||
|
'location',
|
||||||
|
'{% trans "Stock Locations" %}',
|
||||||
|
'{% url "api-location-list" %}',
|
||||||
|
{},
|
||||||
|
renderStockLocation,
|
||||||
|
{
|
||||||
|
url: '/stock/location',
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Wait until all the pending queries are completed
|
// Wait until all the pending queries are completed
|
||||||
$.when.apply($, searchQueries).done(function() {
|
$.when.apply($, searchQueries).done(function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user