diff --git a/app/inventory/views.py b/app/inventory/views.py index c91f8d883d196dbf3d6b38cc466be8e53a12add3..20a9a36d17064722be9d7ff04b1236778fd722da 100644 --- a/app/inventory/views.py +++ b/app/inventory/views.py @@ -35,6 +35,7 @@ def retrieve_items(): utils.format_field(item.location), utils.format_field(item.status), utils.format_field(item.parent), + '\n'.join([comment.body for comment in item.comments]), ] for item in items] return jsonify(data=data) diff --git a/app/static/js/items.js b/app/static/js/items.js index e32d90a6f3eddddebe63e9e893e03d88784fabd9..d9ecbd2136d4cc7eadb103a7afb738bcc46c4aa7 100644 --- a/app/static/js/items.js +++ b/app/static/js/items.js @@ -74,7 +74,12 @@ $(document).ready(function() { var url = $SCRIPT_ROOT + "/inventory/items/view/" + data; return '<a href="'+ url + '">' + data + '</a>'; } - } + }, + { + "targets": [10], + "visible": false, + "searchable": true + }, ] }); diff --git a/app/templates/inventory/items.html b/app/templates/inventory/items.html index 9e4edba5c4a0c32aad7a028688ac81f12fdb6111..c566b5046b18aae052953a516fc4911510cc4867 100644 --- a/app/templates/inventory/items.html +++ b/app/templates/inventory/items.html @@ -31,6 +31,7 @@ <th>Location</th> <th>Status</th> <th>Parent</th> + <th>Comments</th> </tr> </thead> </table> diff --git a/tests/functional/test_web.py b/tests/functional/test_web.py index 1d8dac33c9ceffec0bbddebcd782ffe2d7a63f78..644b41d6627b102a46f24b2e75a29c63e189cc43 100644 --- a/tests/functional/test_web.py +++ b/tests/functional/test_web.py @@ -80,4 +80,4 @@ def test_retrieve_items(logged_client, item_factory): response = get(logged_client, '/inventory/_retrieve_items') items = response.json['data'] assert set(serial_numbers) == set(item[4] for item in items) - assert len(items[0]) == 10 + assert len(items[0]) == 11