Test result table tweaks (#7290)

* Update initialData for new build output

* Table updates
This commit is contained in:
Oliver 2024-05-22 09:30:14 +10:00 committed by GitHub
parent acdf7f5ec0
commit 8df04cb916
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 7 deletions

View File

@ -439,7 +439,8 @@ class PartTestTemplateFilter(rest_filters.FilterSet):
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)

View File

@ -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
});

View File

@ -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 && '- '}