diff --git a/backend/VERSION b/backend/VERSION index 4404a17ba..6cedcff63 100644 --- a/backend/VERSION +++ b/backend/VERSION @@ -1 +1 @@ -4.5.1 +4.5.2 diff --git a/backend/fms_core/filters.py b/backend/fms_core/filters.py index 9de0d1744..f6277d613 100644 --- a/backend/fms_core/filters.py +++ b/backend/fms_core/filters.py @@ -189,6 +189,8 @@ class Meta: fields = _pooled_sample_filterset_fields class SampleNextStepFilter(GenericFilter): + sample__container__barcode = django_filters.CharFilter(field_name="sample__container__barcode", method="batch_filter") + sample__container__location__barcode = django_filters.CharFilter(field_name="sample__container__location__barcode", method="batch_filter") qc_flag__in = django_filters.CharFilter(method="qc_flag_filter") quantity_ng__lte = django_filters.NumberFilter(method="quantity_ng_lte_filter") diff --git a/backend/fms_core/viewsets/sample_next_step.py b/backend/fms_core/viewsets/sample_next_step.py index 052a30d96..0376b3311 100644 --- a/backend/fms_core/viewsets/sample_next_step.py +++ b/backend/fms_core/viewsets/sample_next_step.py @@ -35,9 +35,9 @@ class SampleNextStepViewSet(viewsets.ModelViewSet, TemplateActionsMixin, Templat ) queryset = queryset.annotate( - ordering_container_barcode=Case( - When(Q(sample__coordinate__isnull=True), then=F('sample__container__location__barcode')), - default=F('sample__container__barcode'), + ordering_container_name=Case( + When(Q(sample__coordinate__isnull=True), then=F('sample__container__location__name')), + default=F('sample__container__name'), output_field=CharField() ) ) @@ -66,7 +66,7 @@ class SampleNextStepViewSet(viewsets.ModelViewSet, TemplateActionsMixin, Templat } ordering_fields = { *_list_keys(_sample_next_step_filterset_fields), - 'ordering_container_barcode', + 'ordering_container_name', 'ordering_container_coordinate_column', 'ordering_container_coordinate_row', } diff --git a/frontend/src/components/labwork/step/LabworkStep.tsx b/frontend/src/components/labwork/step/LabworkStep.tsx index 7ce0b045a..7945ed30e 100644 --- a/frontend/src/components/labwork/step/LabworkStep.tsx +++ b/frontend/src/components/labwork/step/LabworkStep.tsx @@ -408,7 +408,7 @@ const LabworkStep = ({ protocol, step, stepSamples }: LabworkStepPageProps) => { selection={selectionProps} setSortBy={handleSelectionTableSortChange} /> - Samples are automatically sorted by container barcode and then by coordinate. + Samples are automatically sorted by container name and then by coordinate. diff --git a/frontend/src/components/samples/SampleTableColumns.tsx b/frontend/src/components/samples/SampleTableColumns.tsx index 6057df38f..a062b01de 100644 --- a/frontend/src/components/samples/SampleTableColumns.tsx +++ b/frontend/src/components/samples/SampleTableColumns.tsx @@ -353,12 +353,12 @@ export const SAMPLE_COLUMN_FILTERS: { [key in SampleColumnID]: FilterDescription key: UNDEFINED_FILTER_KEY, label: 'Parent Container Barcode', recursive: true, + batch: true, }, [SampleColumnID.PARENT_COORDINATES]: { type: FILTER_TYPE.INPUT, key: UNDEFINED_FILTER_KEY, label: 'Parent Coords', - recursive: true, }, [SampleColumnID.CONTAINER_NAME]: { type: FILTER_TYPE.INPUT, diff --git a/frontend/src/modules/labworkSteps/services.ts b/frontend/src/modules/labworkSteps/services.ts index 4e91ef409..eb24c414b 100644 --- a/frontend/src/modules/labworkSteps/services.ts +++ b/frontend/src/modules/labworkSteps/services.ts @@ -8,14 +8,14 @@ import { CoordinateSortDirection } from "./models" export function getCoordinateOrderingParams(sort: CoordinateSortDirection) { if (sort.orientation === 'column') { return sort.order === 'descend' ? - 'ordering_container_barcode,-ordering_container_coordinate_column,-ordering_container_coordinate_row' + 'ordering_container_name,-ordering_container_coordinate_column,-ordering_container_coordinate_row' : - 'ordering_container_barcode,ordering_container_coordinate_column,ordering_container_coordinate_row' + 'ordering_container_name,ordering_container_coordinate_column,ordering_container_coordinate_row' } else { return sort.order === 'descend' ? - 'ordering_container_barcode,-ordering_container_coordinate_row,-ordering_container_coordinate_column' + 'ordering_container_name,-ordering_container_coordinate_row,-ordering_container_coordinate_column' : - 'ordering_container_barcode,ordering_container_coordinate_row,ordering_container_coordinate_column' + 'ordering_container_name,ordering_container_coordinate_row,ordering_container_coordinate_column' } }