Skip to content

Commit

Permalink
Merge pull request #832 from sanger/x1262-section-thikness
Browse files Browse the repository at this point in the history
section thickness to a precision of 0.5
  • Loading branch information
khelwood authored Dec 5, 2024
2 parents d47732d + 10efd05 commit d2b57e2
Show file tree
Hide file tree
Showing 6 changed files with 2,664 additions and 2,664 deletions.
2 changes: 1 addition & 1 deletion src/components/planning/LabwarePlan.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ function buildValidationSchema(labwareType: LabwareType): Yup.AnyObjectSchema {
.matches(/^\d{7}$/, 'Xenium barcode should be a 7-digit number');
}
if (labwareType.name !== LabwareTypeName.FETAL_WASTE_CONTAINER) {
formShape.sectionThickness = Yup.number().required().integer().min(1);
formShape.sectionThickness = Yup.number().required().min(0.5);
}
if (
labwareType.name === LabwareTypeName.VISIUM_LP ||
Expand Down
2 changes: 1 addition & 1 deletion src/components/planning/labwarePlan.machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ function buildPlanRequestLabware({
const sources = layoutPlan.plannedActions.get(address)!;
return sources.map((source) => ({
address,
sampleThickness,
sampleThickness: sampleThickness?.toString(),
sampleId: source.sampleId,
source: {
barcode: source.labware.barcode,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/SectionRegistration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function buildSectionRegisterRequest(values: SectionRegistrationFormValues): Sec
medium: labware.medium.trim(),
replicateNumber: sample.replicateNumber,
sectionNumber: sample.sectionNumber,
sectionThickness: sample.sectionThickness,
sectionThickness: sample.sectionThickness.toString(),
spatialLocation: sample.spatialLocation,
species: sample.species.trim(),
tissueType: sample.tissueType.trim(),
Expand Down
1 change: 1 addition & 0 deletions src/pages/registration/SectionForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ export default function SectionForm({
label="Section Thickness"
type="number"
name={`labwares.${currentIndex}.slots.${slotAddress}.${sectionIndex}.sectionThickness`}
step="0.5"
/>

<div className="flex flex-row justify-between">
Expand Down
5 changes: 3 additions & 2 deletions src/pages/sectioning/Plan.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function Plan() {

const [numLabware, setNumLabware] = React.useState<number>(1);

const [sectionThickness, setSectionThickness] = React.useState<number>(1);
const [sectionThickness, setSectionThickness] = React.useState<number>(0.5);

const sectioningInfo = useLoaderData() as GetSectioningInfoQuery;
/**
Expand Down Expand Up @@ -127,7 +127,8 @@ function Plan() {
onChange={(e) => setSectionThickness(Number(e.currentTarget.value))}
value={sectionThickness}
data-testid={'sectionThickness'}
min={1}
min={0.5}
step={0.5}
/>
</div>
);
Expand Down
Loading

0 comments on commit d2b57e2

Please sign in to comment.