Skip to content

Commit

Permalink
Test result table tweaks (#7290)
Browse files Browse the repository at this point in the history
* Update initialData for new build output

* Table updates
  • Loading branch information
SchrodingersGat authored May 21, 2024
1 parent acdf7f5 commit 8df04cb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/backend/InvenTree/part/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@ class Meta:
def filter_part(self, queryset, name, part):
"""Filter by the 'part' field.
Note that for the 'part' field, we also include any parts "above" the specified part.
Note: If the 'include_inherited' query parameter is set,
we also include any parts "above" the specified part.
"""
include_inherited = str2bool(
self.request.query_params.get('include_inherited', True)
Expand Down
3 changes: 2 additions & 1 deletion src/frontend/src/tables/build/BuildOutputTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ export default function BuildOutputTable({ build }: { build: any }) {
title: t`Add Build Output`,
fields: buildOutputFields,
initialData: {
batch_code: build.batch
batch_code: build.batch,
location: build.destination ?? build.part_detail?.default_location
},
table: table
});
Expand Down
8 changes: 3 additions & 5 deletions src/frontend/src/tables/stock/StockItemTestResultTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,14 @@ export default function StockItemTestResultTable({
switchable: false,
sortable: true,
render: (record: any) => {
let required = record.required ?? record.template_detail?.required;
let enabled = record.enabled ?? record.template_detail?.enabled;
let installed =
const enabled = record.enabled ?? record.template_detail?.enabled;
const installed =
record.stock_item != undefined && record.stock_item != itemId;

return (
<Group justify="space-between">
<Group justify="space-between" wrap="nowrap">
<Text
style={{ fontStyle: installed ? 'italic' : undefined }}
fw={required && 700}
c={enabled ? undefined : 'red'}
>
{!record.templateId && '- '}
Expand Down

0 comments on commit 8df04cb

Please sign in to comment.