Skip to content

Commit c99626c

Browse files
rlamacraftrs-nicof
authored andcommitted
Only provide links to the subsamples that are in containers
1 parent 09492d2 commit c99626c

File tree

1 file changed

+8
-5
lines changed
  • src/main/webapp/ui/src/stores/models

1 file changed

+8
-5
lines changed

src/main/webapp/ui/src/stores/models/Search.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,11 @@ export default class Search implements SearchInterface {
436436
record: {
437437
type: string,
438438
canBeDeleted?: boolean,
439-
subSamples: $ReadOnlyArray<
440-
$Diff<SubSampleAttrs, { sample: mixed }>
441-
>,
439+
subSamples: $ReadOnlyArray<{
440+
storedInContainer: boolean,
441+
...$Diff<SubSampleAttrs, { sample: mixed }>,
442+
...
443+
}>,
442444
...
443445
},
444446
}>,
@@ -475,8 +477,9 @@ export default class Search implements SearchInterface {
475477

476478
if (samplesThatCouldNotBeDeleted.length > 0) {
477479
const subsamplesThatPreventedSampleDeletion =
478-
samplesThatCouldNotBeDeleted.flatMap((s) =>
479-
s.subSamples.map((ss) => [s, ss]));
480+
samplesThatCouldNotBeDeleted
481+
.flatMap((s) => s.subSamples.map((ss) => [s, ss]))
482+
.filter(([, ss]) => ss.storedInContainer);
480483
uiStore.addAlert(
481484
mkAlert({
482485
variant: "error",

0 commit comments

Comments
 (0)