Skip to content

Commit

Permalink
Merge pull request #345 from ComPlat/development
Browse files Browse the repository at this point in the history
Development
 prepare v0.3.0
  • Loading branch information
PiTrem authored Nov 17, 2017
2 parents 6acac1f + dfc4b29 commit 64deda9
Show file tree
Hide file tree
Showing 23 changed files with 690 additions and 127 deletions.
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,41 @@

# Chemotion_ELN Changelog

## [v0.3.0]
> 2017-11-15
* Features
* Export reaction smiles
* reporting: revamp of UI
* reporting: analysis metadata formating
* user affiliations management
* revamp of sample/reaction detail UI
* select the sample molecule_name to display
* fetch CAS from pubchem
* uuid (qr code) for each element (sample, reaction, analyse)
* export samples as sdf
* adv search
* Docker install
* ....
* Fixes
* search result element ordering
* dependent destroy of collections-elements
* sample density default set to 0
* react production build
* ....

## [v0.2.1]
> 2016-11-02
* Features
* Temperature Chart with unit converter (°C, °F , K) for reaction
* Import molecules and create samples from a sd file
(R group and polymer support are not supported)
* Images in report doc are from eps files
* rearrange the reaction list for a report by Drag-and-drop -ing
* Text editing and formating tool bar for the reaction description
* Fixes
* upgrade to Ruby 2.3.1
* The Upload of analyses files does not fail if the thumbnail creation does

## [v0.2.0]

> 2016-10-17
Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ gem 'roo', '>2.5.0'

gem 'faraday', '~> 0.11.0'
gem 'httparty'
gem 'ketcherails', git: 'https://github.com/ComPlat/ketcher-rails',
ref: 'aae1ba59e96ac5604449cf260a347a65e4bdb637'
gem 'ketcherails', git: 'https://github.com/ComPlat/ketcher-rails',
ref: 'bbc54084cd6365bcc9229dfe43f8e7dc8c16a845'
# Ketcher editor

# Free font icons
Expand Down
31 changes: 17 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GIT
remote: https://github.com/ComPlat/ketcher-rails
revision: aae1ba59e96ac5604449cf260a347a65e4bdb637
ref: aae1ba59e96ac5604449cf260a347a65e4bdb637
revision: bbc54084cd6365bcc9229dfe43f8e7dc8c16a845
ref: bbc54084cd6365bcc9229dfe43f8e7dc8c16a845
specs:
ketcherails (0.1.3)
bootstrap-kaminari-views (= 0.0.5)
Expand Down Expand Up @@ -174,7 +174,7 @@ GEM
nokogiri (~> 1.6)
chronic (0.10.2)
chunky_png (1.3.8)
climate_control (0.1.0)
climate_control (0.2.0)
closure_tree (6.2.0)
activerecord (>= 4.1.0)
with_advisory_lock (>= 3.0.0)
Expand All @@ -184,7 +184,7 @@ GEM
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
colored (1.2)
concurrent-ruby (1.0.2)
concurrent-ruby (1.0.5)
countries (2.0.8)
i18n_data (~> 0.7.0)
money (~> 6.7)
Expand All @@ -198,6 +198,7 @@ GEM
tins (>= 1.6.0, < 2)
crack (0.4.3)
safe_yaml (~> 1.0.0)
crass (1.0.3)
css_parser (1.4.7)
addressable
daemons (1.2.3)
Expand Down Expand Up @@ -247,8 +248,8 @@ GEM
json (~> 1.4)
listen (>= 1.0, < 4.0)
thor (~> 0.14)
globalid (0.3.7)
activesupport (>= 4.1.0)
globalid (0.4.1)
activesupport (>= 4.2.0)
gman (7.0.2)
colored (~> 1.2)
iso_country_codes (~> 0.6)
Expand Down Expand Up @@ -316,10 +317,11 @@ GEM
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
loofah (2.0.3)
loofah (2.1.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.6.4)
mime-types (>= 1.16, < 4)
mail (2.7.0)
mini_mime (>= 0.1.1)
mailcatcher (0.6.4)
activesupport (~> 4.0)
eventmachine (= 1.0.9.1)
Expand All @@ -338,8 +340,9 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mimemagic (0.3.2)
mini_mime (1.0.0)
mini_portile2 (2.0.0)
minitest (5.10.1)
minitest (5.10.3)
money (6.9.0)
i18n (>= 0.6.4, < 0.9)
multi_json (1.12.0)
Expand Down Expand Up @@ -388,7 +391,7 @@ GEM
activesupport (>= 3.0.0)
quiet_assets (1.1.0)
railties (>= 3.1, < 5.0)
rack (1.6.5)
rack (1.6.8)
rack-accept (0.4.5)
rack (>= 0.4)
rack-contrib (1.5.0)
Expand Down Expand Up @@ -423,7 +426,7 @@ GEM
thor (>= 0.18.1, < 2.0)
rainbow (2.2.2)
rake
rake (12.1.0)
rake (12.3.0)
rb-fsevent (0.10.2)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
Expand Down Expand Up @@ -506,7 +509,7 @@ GEM
sprockets (3.7.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.0)
sprockets-rails (3.2.1)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
Expand All @@ -529,7 +532,7 @@ GEM
tilt (2.0.7)
tins (1.11.0)
ttfunk (1.4.0)
tzinfo (1.2.2)
tzinfo (1.2.4)
thread_safe (~> 0.1)
uglifier (3.0.0)
execjs (>= 0.3.0, < 3)
Expand Down
10 changes: 9 additions & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,18 @@ This is a setup for a 'pseudo' production stage using passenger and aimed for us
(For the development environment, change 'RAILS_ENV' to 'development' in docker-compose.yml)

1. Build the image from Dockerfile `docker-compose build` or pull the image: `docker-compose pull`
2. Initialize database FIRST: `docker-compose run app bundle exec rake db:create db:migrate`
2. Initialize database FIRST:
* `docker-compose run app bundle exec rake db:create`
* `docker-compose run app bundle exec rake db:migrate`
* `docker-compose run app bundle exec rake db:seed` (optional). A "seed"
user will be inserted into the db with the information as below: [email protected] - password: "@eln.edu"
* `docker-compose run app rake ketcherails:import:common_templates` (optional)
3. Precompile assets: `docker-compose run app bundle exec rake assets:precompile`
4. To start the server: `docker-compose up` or start server and detach: `docker-compose up -d`

* Start interactive shell with docker: `docker-compose run app /bin/bash`
* NOTE: In this Docker image, we disabled the email verification progress

* To enable email confirmation, uncomment ":confirmable" at line 5 of `app/models/user.rb`, stop the `docker-compose` by `docker-compose stop` and start `docker-compose`.


48 changes: 26 additions & 22 deletions app/api/chemotion/report_api.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module Chemotion
class ReportAPI < Grape::API
helpers ReportHelpers
helpers SyncHelpers
helpers do
def hashize(inputs)
output = {}
Expand Down Expand Up @@ -64,28 +66,7 @@ def time_now
end

params do
requires :columns, type: Array[String]
requires :exportType, type: Integer
requires :uiState, type: Hash do
requires :sample, type: Hash do
requires :checkedIds, type: Array
requires :uncheckedIds, type: Array
requires :checkedAll, type: Boolean
end
requires :reaction, type: Hash do
requires :checkedIds, type: Array
requires :uncheckedIds, type: Array
requires :checkedAll, type: Boolean
end
requires :wellplate, type: Hash do
requires :checkedIds, type: Array
requires :uncheckedIds, type: Array
requires :checkedAll, type: Boolean
end
requires :currentCollection, type: Integer
requires :isSync, type: Boolean
end
requires :columns, type: Array
use :export_params
end
post :export_samples_from_selections do
env['api.format'] = :binary
Expand Down Expand Up @@ -129,6 +110,29 @@ def time_now
export.generate_file(excluded_field, included_field, removed_field)
end

params do
use :export_params
end
post :export_reactions_from_selections do
env['api.format'] = :binary
params[:exportType]
content_type('text/csv')
fileName = 'reaction_smiles_' + time_now + '.csv'
fileURI = URI.escape(fileName)
header 'Content-Disposition', "attachment; filename=\"#{fileURI}\""
real_coll_id = fetch_collection_id_w_current_user(
params[:uiState][:currentCollection], params[:uiState][:isSync]
)
return unless (p_t = params[:uiState][:reaction])
results = reaction_smiles_hash(
real_coll_id,
p_t[:checkedAll] && p_t[:uncheckedIds] || p_t[:checkedIds],
p_t[:checkedAll]
) || {}
smiles_construct = "r_smiles_#{params[:exportType]}"
results.map { |_, v| send(smiles_construct, v) }.join("\r\n")
end

params do
requires :id, type: String
end
Expand Down
Loading

0 comments on commit 64deda9

Please sign in to comment.