Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cypress/e2e/pages/xeniumAnalyser.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe('Xenium Analyser', () => {
cy.findByTestId('STAN-3111-regions-table').get('tbody tr').should('have.length', 4);
});
it('updates the region name accordingly', () => {
cy.findByText('SGP1009_Region1').should('be.visible');
cy.findByText('STAN-3111_Region1').should('be.visible');
});
});

Expand All @@ -133,7 +133,7 @@ describe('Xenium Analyser', () => {
cy.findByTestId('STAN-3111-regions-table').get('tbody tr').should('have.length', 5);
});
it('renames the region of interest with the sample external id', () => {
cy.findByText('SGP1009_Region1').should('not.exist');
cy.findByText('STAN-3111_Region1').should('not.exist');
});
});
});
Expand Down
4 changes: 2 additions & 2 deletions src/components/xeniumAnalyser/RegionDefiner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const RegionDefiner = ({ labwareIndex }: RegionDefinerProps) => {
...labware,
selectedAddresses: undefined,
selectedRegionColorIndex: undefined,
regions: reIndexAndRenameRegions(regions, runName, sgpNumber)
regions: reIndexAndRenameRegions(regions, runName, labware.labware.barcode)
}
: labware
)
Expand Down Expand Up @@ -236,7 +236,7 @@ const RegionDefiner = ({ labwareIndex }: RegionDefinerProps) => {
regions: reIndexAndRenameRegions(
[...remainingRegions, ...splitSectionsIntoRegions],
values.runName,
labware.workNumber
labware.labware.barcode
)
}
: labware
Expand Down
10 changes: 5 additions & 5 deletions src/pages/XeniumAnalyser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ type BarcodeDisplayerProps = {
warningMessage?: string;
};

export const reIndexAndRenameRegions = (regions: Region[], runName: string, sgpNumber: string): Array<Region> => {
export const reIndexAndRenameRegions = (regions: Region[], runName: string, barcode: string): Array<Region> => {
let index = 0;
return regions.map((region) => {
const roi: string =
region.sectionGroups.length === 1 && region.sectionGroups[0].source.tissue?.externalName
? region.sectionGroups[0].source.tissue.externalName
: [sgpNumber, runName, `Region${index++ + 1}`].filter(Boolean).join('_');
: [barcode, runName, `Region${index++ + 1}`].filter(Boolean).join('_');
return {
...region,
roi: roi
Expand Down Expand Up @@ -452,7 +452,7 @@ const XeniumAnalyser = () => {
...lw,
workNumber,
hasSgpNumberLink,
regions: reIndexAndRenameRegions(lw.regions, prev.runName, workNumber)
regions: reIndexAndRenameRegions(lw.regions, prev.runName, lw.labware.barcode)
}))
};
});
Expand All @@ -477,7 +477,7 @@ const XeniumAnalyser = () => {
runName,
labware: prev.labware.map((lw) => ({
...lw,
regions: reIndexAndRenameRegions(lw.regions, runName, lw.workNumber)
regions: reIndexAndRenameRegions(lw.regions, runName, lw.labware.barcode)
}))
}));
}
Expand Down Expand Up @@ -573,7 +573,7 @@ const XeniumAnalyser = () => {
regions: reIndexAndRenameRegions(
lw.regions,
prev.runName,
workNumber
lw.labware.barcode
)
}
)
Expand Down
Loading