Skip to content

Commit

Permalink
feat: change the position of the lock button
Browse files Browse the repository at this point in the history
fix: total conc. changes related fields
  • Loading branch information
Tasnim Mehzabin committed Aug 28, 2024
1 parent 97192d3 commit 9812ef1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const SampleComponentsGroup = ({
<col style={{ width: '4%' }} />
<col style={{ width: '7%' }} />
<col style={{ width: '4%' }} />
<col style={{ width: '14%' }} />
<col style={{ width: '17%' }} />
<col style={{ width: '14%' }} />
<col style={{ width: '14%' }} />
<col style={{ width: '8%' }} />
Expand All @@ -119,15 +119,15 @@ const SampleComponentsGroup = ({

{materialGroup === 'liquid' && (
<th>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div style={{ display: 'flex', alignItems: 'center' }}>
{SwitchAmountButton(lockAmountColumn, switchAmount, materialGroup)}
<Tabs
onSelect={handleTabSelect}
id="material-tabs"
>
<Tab eventKey="concentration" title="Stock" />
<Tab eventKey="density" title="Density" />
</Tabs>
{SwitchAmountButton(lockAmountColumn, switchAmount, materialGroup)}
</div>
</th>
)}
Expand Down
11 changes: 11 additions & 0 deletions app/packs/src/models/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,17 @@ export default class Component extends Sample {
}
}

setMolarityDensity(amount, totalVolume) {
const purity = this.purity || 1.0;
this.molarity_value = this.concn = amount.value;
this.molarity_unit = amount.unit;
this.starting_molarity_value = 0;

this.amount_mol = this.molarity_value * totalVolume * purity;
this.amount_g = (this.molecule_molecular_weight * this.amount_mol) / purity;
this.amount_l = (this.amount_g / this.density) / 1000;
}

handleStockChange(amount, totalVolume, concType, lockColumn) {
this.setConcentration(amount, concType, lockColumn);

Expand Down

0 comments on commit 9812ef1

Please sign in to comment.