Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/api/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def to_json_camel_case(val)
],
'reactions' => %w[
name short_label status conditions rxno content temperature duration
role purification tlc_solvents tlc_description rf_value dangerous_products
role reaction_type purification tlc_solvents tlc_description rf_value dangerous_products
plain_text_description plain_text_observation
],
'wellplates' => %w[name short_label readout_titles content plain_text_description],
Expand Down
6 changes: 6 additions & 0 deletions app/api/chemotion/reaction_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,15 @@ class ReactionAPI < Grape::API
optional :purification, type: [String]
optional :dangerous_products, type: [String]
optional :conditions, type: String
optional :ph_operator, type: String
optional :ph_value, type: String
optional :tlc_solvents, type: String
optional :solvent, type: String
optional :tlc_description, type: String
optional :rf_value, type: String
optional :temperature, type: Hash
optional :status, type: String
optional :reaction_type, type: String, values: Reaction.reaction_types.keys
optional :role, type: String
optional :origin, type: Hash
optional :reaction_svg_file, type: String
Expand Down Expand Up @@ -233,12 +236,15 @@ class ReactionAPI < Grape::API
optional :purification, type: [String]
optional :dangerous_products, type: [String]
optional :conditions, type: String
optional :ph_operator, type: String
optional :ph_value, type: String
optional :tlc_solvents, type: String
optional :solvent, type: String
optional :tlc_description, type: String
optional :rf_value, type: String
optional :temperature, type: Hash
optional :status, type: String
optional :reaction_type, type: String, values: Reaction.reaction_types.keys
optional :role, type: String
optional :origin, type: Hash
optional :reaction_svg_file, type: String
Expand Down
19 changes: 13 additions & 6 deletions app/api/chemotion/reaction_svg_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,22 @@ class ReactionSvgAPI < Grape::API
optional :duration, type: String, desc: 'duration which is placed under the reaction-arrow'
requires :solvents, type: Array, desc: 'solvents which is placed under the reaction-arrow'
optional :conditions, type: String, desc: 'conditions which is placed under the reaction-arrow'
optional :products_only, type: Boolean, default: false
optional :show_yield, type: Boolean, default: true
end
post do
paths = params[:materials_svg_paths]
composer = SVG::ReactionComposer.new(paths, temperature: params[:temperature],
solvents: params[:solvents],
duration: params[:duration],
conditions: params[:conditions],
show_yield: true)
{ reaction_svg: composer.compose_reaction_svg }
composer_class = params[:products_only] ? SVG::ProductsComposer : SVG::ReactionComposer
composer_options = {
temperature: params[:temperature],
solvents: params[:solvents],
duration: params[:duration],
conditions: params[:conditions],
show_yield: params[:show_yield],
}

composer = composer_class.new(paths, composer_options)
{ reaction_svg: composer.compose_svg }
end
end
end
Expand Down
3 changes: 3 additions & 0 deletions app/api/entities/reaction_entity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class ReactionEntity < ApplicationEntity
with_options(anonymize_below: 10) do
expose! :code_log, anonymize_with: nil, using: 'Entities::CodeLogEntity'
expose! :conditions, unless: :displayed_in_list
expose! :ph_operator, unless: :displayed_in_list
expose! :ph_value, unless: :displayed_in_list
expose! :container, anonymize_with: nil, using: 'Entities::ContainerEntity'
expose! :dangerous_products, anonymize_with: [], unless: :displayed_in_list
expose! :duration, unless: :displayed_in_list
Expand All @@ -37,6 +39,7 @@ class ReactionEntity < ApplicationEntity
expose! :rinchi_short_key
expose! :rinchi_web_key
expose! :rxno
expose! :reaction_type
expose! :segments, anonymize_with: [], using: 'Labimotion::SegmentEntity'
expose! :short_label
expose! :solvent, unless: :displayed_in_list
Expand Down
83 changes: 83 additions & 0 deletions app/assets/stylesheets/legacy/reaction.scss
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,89 @@ table.reaction-scheme-solvent {
}
}

.reaction-details-toolbar {
width: 100%;

&__left {
flex: 1 1 auto;
min-width: 0;
}

&__right {
margin-left: auto;
flex: 0 0 auto;
}

&__group {
.form-label {
font-weight: 600;
}
}

&__group--status {
min-width: 220px;
}
}

.reaction-details-header {
&__left {
display: flex;
align-items: center;
gap: 0.5rem;
min-width: 0;
flex-wrap: nowrap;
overflow: hidden;
}

&__title {
display: flex;
align-items: center;
gap: 0.5rem;
min-width: 0;
flex-wrap: nowrap;
flex: 0 1 auto;
}

&__title-prefix {
flex: 0 0 auto;
white-space: nowrap;
}

&__title-meta {
display: inline-flex;
align-items: center;
flex: 0 0 auto;
white-space: nowrap;
}

&__title-text {
min-width: 0;
font-weight: 400;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;

&--empty {
color: #6c757d;
}
}

&__title-input {
width: clamp(120px, 16vw, 220px);
min-width: 0;
flex: 0 1 clamp(120px, 16vw, 220px);

&:focus,
&:focus-visible {
border-color: $input-border-color;
box-shadow: none;
outline: 0;
}
}
}

/* Safari 4.0 - 8.0 */
@-webkit-keyframes reaction-status-color-change {
from {
Expand Down
Loading
Loading