From 8907b9066104ddaa4e681a50b2fdfdf91950b919 Mon Sep 17 00:00:00 2001 From: Adam Basha <55552142+adambasha0@users.noreply.github.com> Date: Thu, 14 Nov 2024 09:35:57 +0100 Subject: [PATCH] feat: display sample inventory label tag in sample header and list (#2222) --- .../stylesheets/components/ElementsTable.scss | 2 +- .../elements/details/samples/SampleDetails.js | 6 ++++-- .../elements/list/ElementsTableSampleEntries.js | 17 ++++++++++++++++- .../searchModal/forms/SearchResultTabContent.js | 2 +- app/packs/src/models/Sample.js | 8 ++++++++ 5 files changed, 30 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/components/ElementsTable.scss b/app/assets/stylesheets/components/ElementsTable.scss index 9276170e6f..593610192e 100644 --- a/app/assets/stylesheets/components/ElementsTable.scss +++ b/app/assets/stylesheets/components/ElementsTable.scss @@ -39,7 +39,7 @@ } .sample-entries > tbody > tr > td { - border-top: 0 + border-top: 0; } @media only screen and (max-width: 1500px) { diff --git a/app/packs/src/apps/mydb/elements/details/samples/SampleDetails.js b/app/packs/src/apps/mydb/elements/details/samples/SampleDetails.js index 35243d2ec1..439e9b538f 100644 --- a/app/packs/src/apps/mydb/elements/details/samples/SampleDetails.js +++ b/app/packs/src/apps/mydb/elements/details/samples/SampleDetails.js @@ -332,7 +332,7 @@ export default class SampleDetails extends React.Component { const { currentCollection } = UIStore.getState(); LoadingActions.start.defer(); const { sample, validCas } = this.state; - if (this.matchSelectedCollection(currentCollection) && sample.xref.inventory_label !== undefined) { + if (this.matchSelectedCollection(currentCollection) && sample.inventory_label !== undefined) { sample.collection_id = currentCollection.id; } this.checkMolfileChange(); @@ -953,13 +953,15 @@ export default class SampleDetails extends React.Component { /> ) : null; + const inventoryLabel = sample.inventory_sample && sample.inventory_label ? sample.inventory_label : null; + return (