Skip to content

Commit

Permalink
merge: resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
adambasha0 committed Oct 21, 2024
1 parent 44556cd commit a95b4a0
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
10 changes: 9 additions & 1 deletion app/assets/stylesheets/components/ElementsTable.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,15 @@
}

.sample-entries > tbody > tr > td {
border-top: 0
border-top: 0;

.sample-entries-inventory-label-icon {
margin-top: 3px;
padding: 4px 4px 4px 4px;
border-radius: 4px;
background-color: #96c7e7;
color: black;
}
}

@media only screen and (max-width: 1500px) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -951,13 +951,15 @@ export default class SampleDetails extends React.Component {
/>
) : null;

const inventoryLabel = sample.inventory_sample && sample.xref.inventory_label ? sample.xref.inventory_label : null;

return (
<div className="d-flex align-items-center justify-content-between">
<div className="d-flex align-items-center gap-2">
<OverlayTrigger placement="bottom" overlay={<Tooltip id="sampleDates">{titleTooltip}</Tooltip>}>
<span className="flex-shrink-0">
<i className="icon-sample me-1" />
{sample.title()}
{inventoryLabel || sample.title()}
</span>
</OverlayTrigger>
<ShowUserLabels element={sample} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import React, { Component } from 'react';
import {
<<<<<<< HEAD
Table, Button, Tooltip, OverlayTrigger
=======
Table, Button, Tooltip, OverlayTrigger, Label, Badge,
>>>>>>> 74d5cb020 (feat: add sample inventory label tag in sample entries list)
} from 'react-bootstrap';
import classnames from 'classnames';
import PropTypes from 'prop-types';
Expand Down Expand Up @@ -107,6 +111,22 @@ const showDecoupledIcon = (sample) => (sample.decoupled ? (
</OverlayTrigger>
) : null);

const showInventoryLabelIcon = (sample) => (sample.inventory_sample && sample.xref.inventory_label ? (
<div>
<OverlayTrigger
placement="top"
overlay={<Tooltip id="sample_inventory_label">Inventory Label</Tooltip>}
>
<Badge
className="sample-entries-inventory-label-icon"
key={`inventory_label_${sample.xref.inventory_label}`}
>
{sample.xref.inventory_label}
</Badge>
</OverlayTrigger>
</div>
) : null);

const overlayToggle = <Tooltip id="toggle_molecule">Toggle Molecule</Tooltip>;

const svgPreview = (sample) => (
Expand Down Expand Up @@ -346,6 +366,7 @@ export default class ElementsTableSampleEntries extends Component {
{sample.title(selected)}

<div className="d-flex align-items-center gap-1">
{showInventoryLabelIcon(sample)}
<CommentIcon commentCount={sample.comment_count} />
<ShowUserLabels element={sample} />
<XvialIcon label={sample.external_label} />
Expand Down

0 comments on commit a95b4a0

Please sign in to comment.