From 19afcc52e88fc4e86210928b64531e84236f0053 Mon Sep 17 00:00:00 2001 From: Matthias Mair <66015116+matmair@users.noreply.github.com> Date: Wed, 3 Nov 2021 23:00:52 +0100 Subject: [PATCH 1/8] Update bug_report.md fix spelling error --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 1a75b97af0..17a3adeb00 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -28,4 +28,4 @@ Docker Bare Metal **Version Information** -You can get this by going to the "About InvenTree" section in the upper right corner and cicking on to the "copy version information" +You can get this by going to the "About InvenTree" section in the upper right corner and clicking on to the "copy version information" From 717bfde73d0a7aa0038ffc87f89f5a4e6c45afbb Mon Sep 17 00:00:00 2001 From: Matthias Mair <66015116+matmair@users.noreply.github.com> Date: Wed, 3 Nov 2021 23:07:25 +0100 Subject: [PATCH 2/8] bug report simplification Hide descriptions so the reports from inexperienced users get less cluttered --- .github/ISSUE_TEMPLATE/bug_report.md | 30 +++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 17a3adeb00..55585c7670 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,31 +1,47 @@ --- -name: Bug report -about: Create a bug report to help us improve InvenTree +name: Bug +about: Create a bug report to help us improve InvenTree! title: "[BUG] Enter bug description" labels: bug, question assignees: '' --- -**Describe the bug** -A clear and concise description of what the bug is. + + + +**Describe the bug** + + +**Steps to Reproduce** -**To Reproduce** Steps to reproduce the behavior: + **Expected behavior** + + **Deployment Method** -Docker -Bare Metal +- [ ] Docker +- [ ] Bare Metal **Version Information** + From d4a8f5823c602cb144047a8c4c954ffa0b3222b0 Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 4 Nov 2021 09:13:13 +1100 Subject: [PATCH 3/8] Fix for missing template file --- InvenTree/templates/account/base.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/InvenTree/templates/account/base.html b/InvenTree/templates/account/base.html index 048496c4a5..eeaa0c449d 100644 --- a/InvenTree/templates/account/base.html +++ b/InvenTree/templates/account/base.html @@ -53,7 +53,9 @@ {% block extra_body %} {% endblock %} - {% include 'notification.html' %} +
+ +
From 4e7825df135b99700fc87ffdbe7231094a84335d Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 4 Nov 2021 09:26:32 +1100 Subject: [PATCH 4/8] Fix javascript issues on login screens --- .../static/script/inventree}/inventree.js | 112 +++++++++--------- .../static/script/inventree/notification.js | 6 +- InvenTree/InvenTree/urls.py | 1 - InvenTree/templates/account/base.html | 27 +++-- InvenTree/templates/base.html | 2 +- 5 files changed, 81 insertions(+), 67 deletions(-) rename InvenTree/{templates/js/dynamic => InvenTree/static/script/inventree}/inventree.js (74%) diff --git a/InvenTree/templates/js/dynamic/inventree.js b/InvenTree/InvenTree/static/script/inventree/inventree.js similarity index 74% rename from InvenTree/templates/js/dynamic/inventree.js rename to InvenTree/InvenTree/static/script/inventree/inventree.js index 1774ba6f3d..b4f7114448 100644 --- a/InvenTree/templates/js/dynamic/inventree.js +++ b/InvenTree/InvenTree/static/script/inventree/inventree.js @@ -1,5 +1,3 @@ -{% load inventree_extras %} - /* globals ClipboardJS, inventreeFormDataUpload, @@ -130,66 +128,68 @@ function inventreeDocReady() { attachClipboard('.clip-btn-version', 'modal-about', 'about-copy-text'); // Add autocomplete to the search-bar - $('#search-bar').autocomplete({ - source: function(request, response) { - $.ajax({ - url: '/api/part/', - data: { - search: request.term, - limit: user_settings.SEARCH_PREVIEW_RESULTS, - offset: 0 - }, - success: function(data) { + if ($('#search-bar').exists()) { + $('#search-bar').autocomplete({ + source: function(request, response) { + $.ajax({ + url: '/api/part/', + data: { + search: request.term, + limit: user_settings.SEARCH_PREVIEW_RESULTS, + offset: 0 + }, + success: function(data) { - var transformed = $.map(data.results, function(el) { - return { - label: el.full_name, - id: el.pk, - thumbnail: el.thumbnail, - data: el, - }; - }); - response(transformed); - }, - error: function() { - response([]); - } - }); - }, - create: function() { - $(this).data('ui-autocomplete')._renderItem = function(ul, item) { + var transformed = $.map(data.results, function(el) { + return { + label: el.full_name, + id: el.pk, + thumbnail: el.thumbnail, + data: el, + }; + }); + response(transformed); + }, + error: function() { + response([]); + } + }); + }, + create: function() { + $(this).data('ui-autocomplete')._renderItem = function(ul, item) { - var html = ``; + var html = ``; - html += ` `; - html += item.label; + html += ` `; + html += item.label; - html += ''; - - if (user_settings.SEARCH_SHOW_STOCK_LEVELS) { - html += partStockLabel( - item.data, - { - classes: 'badge-right', - } - ); - } + html += ''; + + if (user_settings.SEARCH_SHOW_STOCK_LEVELS) { + html += partStockLabel( + item.data, + { + classes: 'badge-right', + } + ); + } - html += ''; + html += ''; - return $('
  • ').append(html).appendTo(ul); - }; - }, - select: function( event, ui ) { - window.location = '/part/' + ui.item.id + '/'; - }, - minLength: 2, - classes: { - 'ui-autocomplete': 'dropdown-menu search-menu', - }, - }); + return $('
  • ').append(html).appendTo(ul); + }; + }, + select: function( event, ui ) { + window.location = '/part/' + ui.item.id + '/'; + }, + minLength: 2, + classes: { + 'ui-autocomplete': 'dropdown-menu search-menu', + }, + }); + } // Generate brand-icons $('.brand-icon').each(function(i, obj) { diff --git a/InvenTree/InvenTree/static/script/inventree/notification.js b/InvenTree/InvenTree/static/script/inventree/notification.js index 4ed1333ac6..f62226985e 100644 --- a/InvenTree/InvenTree/static/script/inventree/notification.js +++ b/InvenTree/InvenTree/static/script/inventree/notification.js @@ -1,10 +1,12 @@ function showAlertOrCache(alertType, message, cache, timeout=5000) { if (cache) { - sessionStorage.setItem("inventree-" + alertType, message); + sessionStorage.setItem(`inventree-${alertType}`, message); } else { showMessage('#' + alertType, message, timeout); + + sessionStorage.removeItem(`inventree-${alertType}`); } } @@ -82,4 +84,4 @@ function showMessage(message, options={}) { $(`#alert-${id}`).delay(timeout).slideUp(200, function() { $(this).alert(close); }); -} \ No newline at end of file +} diff --git a/InvenTree/InvenTree/urls.py b/InvenTree/InvenTree/urls.py index 77a0e06a0c..053ba05264 100644 --- a/InvenTree/InvenTree/urls.py +++ b/InvenTree/InvenTree/urls.py @@ -94,7 +94,6 @@ settings_urls = [ # These javascript files are served "dynamically" - i.e. rendered on demand dynamic_javascript_urls = [ - url(r'^inventree.js', DynamicJsView.as_view(template_name='js/dynamic/inventree.js'), name='inventree.js'), url(r'^calendar.js', DynamicJsView.as_view(template_name='js/dynamic/calendar.js'), name='calendar.js'), url(r'^nav.js', DynamicJsView.as_view(template_name='js/dynamic/nav.js'), name='nav.js'), url(r'^settings.js', DynamicJsView.as_view(template_name='js/dynamic/settings.js'), name='settings.js'), diff --git a/InvenTree/templates/account/base.html b/InvenTree/templates/account/base.html index eeaa0c449d..4dded57eba 100644 --- a/InvenTree/templates/account/base.html +++ b/InvenTree/templates/account/base.html @@ -33,9 +33,15 @@ +
    +
    + +
    +