-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: sample types extension - mixtures #2311
base: main
Are you sure you want to change the base?
Conversation
# frozen_string_literal: true | ||
|
||
class Micromolecule < ApplicationRecord | ||
has_many :samples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rails/HasManyOrHasOneDependent: Specify a :dependent
option.
@@ -620,7 +623,7 @@ def set_elem_composition_data d_type, d_values, loading = nil | |||
end | |||
|
|||
def check_molfile_polymer_section | |||
return if decoupled | |||
return if decoupled || sample_type == 'Mixture' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/AbcSize: Assignment Branch Condition size for check_molfile_polymer_section is too high. [<9, 40, 12> 42.72/25]
@@ -620,7 +623,7 @@ def set_elem_composition_data d_type, d_values, loading = nil | |||
end | |||
|
|||
def check_molfile_polymer_section | |||
return if decoupled | |||
return if decoupled || sample_type == 'Mixture' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/PerceivedComplexity: Perceived complexity for check_molfile_polymer_section
is too high. [12/8]
@@ -72,6 +72,10 @@ def execute! | |||
modified_sample = update_existing_sample(sample, fixed_label) | |||
end | |||
|
|||
if sample.components.present? && sample.sample_type == 'Mixture' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/AbcSize: Assignment Branch Condition size for execute! is too high. [<12, 31, 18> 37.8/25]
@@ -72,6 +72,10 @@ def execute! | |||
modified_sample = update_existing_sample(sample, fixed_label) | |||
end | |||
|
|||
if sample.components.present? && sample.sample_type == 'Mixture' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/CyclomaticComplexity: Cyclomatic complexity for execute!
is too high. [13/7]
@@ -72,6 +72,10 @@ def execute! | |||
modified_sample = update_existing_sample(sample, fixed_label) | |||
end | |||
|
|||
if sample.components.present? && sample.sample_type == 'Mixture' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/PerceivedComplexity: Perceived complexity for execute!
is too high. [15/8]
components.each do |component_params| | ||
molecule_id = component_params[:component_properties][:molecule_id] | ||
|
||
component = Component.where("sample_id = ? AND CAST(component_properties ->> 'molecule_id' AS INTEGER) = ?", sample_id, molecule_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/LineLength: Line is too long. [142/120]
3a5e038
to
3680474
Compare
- set env variables in the docker-compose.dev.yml to allow using - prebuild images for the app and skip the building process - distinct postgres images - distinct named volume for the db and homedir(asdf, gems, etc) - add .dockerenv.example file to help settings those variables example ``` docker compose -f docker-compose.dev.yml --env-file .dockerenv.example up ``` - rework the preparation scripts to better separate node packages installation from ruby env installation. so that `yarn install` is only run by the js container - introduce FULL_BUILD BRANCH args for preparing the dev docker image with preinstalled gems and nodejs packages for a given branch from complat/chemotion_ELN - add optional var RAKE_DB_MIGRATE to run db:migrate instead of db:setup (see .dockerenv.example)
- add micromolecules table - add components table - modify samples table
- add micromolecules model - add components model - modify samples model feat: add/modify required APIs - add components APIs - modify samples APIs
- add ComponentsFetcher - add Component model - modify Sample model - add ComponentActions - modify ElementActions - add ComponentStore - modify ElementStore test: add test codes for Component model
3680474
to
227cfb5
Compare
} | ||
end | ||
|
||
it 'updates an existing component' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RSpec/MultipleExpectations: Example has too many expectations [4/3].
0188cbb
to
84dce94
Compare
- add select sample type dropdown - add component table header - add liquid components section - add liquid components calculations - add solid components section - add solid components calculations - drag and drop samples in mixture comps table - do not render structure editor & cas fast input for mixtures - move component between tables - option to merge components - calculate total MW for mixtures & use in reaction table - mixture samples in reactions scheme - solvent volume column only for mixture samples - add the preview image to component in mixtures - modified the calculations related to various fields - added the field for required total volume - modified the structure of the solid components table - import the molarity value from sample in drag-n-drop into component - when Target Concentration is updated, then Amount and Volume gets recalculated - re-calculate amount_mol and related attributes, when Purity is updated - add the functionality to lock concentration for multiple components - when there is Total Conc. and amount, then the total volume is calculated - fix the amount_mol calculations to use the density or stock - disable the lock concentration button, if it is 0 - lock the Ratio when total conc. is locked - fix the tooltip buttons - show indication in the sample list if the sample is a mixture - split sample with components - though a field is locked it should be possible to change the unit multiplier fix (UI): cannot create a single molecule fix: issue with the Amount field not being set for mixture components fix: fetching of components after fetching the sample causing the sample appear as edited fix: input fields CSS fix: sample type selection input field test: added test codes refactor: code refactor: eslint warnings refactor: moved packs/src files to javascript directory
84dce94
to
e6e1fef
Compare
feat: add/modify required database tables
feat: add/modify required models
feat: Add/modify fetcher, actions, stores, and model
feat (UI): add mixture components table with calculations
Documentation: here
mixture_demo-1.mp4
mixture_demo-2.mp4