diff --git a/.fontcustom-manifest.json b/.fontcustom-manifest.json index f83f4d1af3..52ec5bef01 100644 --- a/.fontcustom-manifest.json +++ b/.fontcustom-manifest.json @@ -1,13 +1,14 @@ { "checksum": { - "previous": "ebea6970ab34b700768ce8bafe0ee0ca02daf2bf9277ec0e6b7ac5d7bbcb09c0", - "current": "ebea6970ab34b700768ce8bafe0ee0ca02daf2bf9277ec0e6b7ac5d7bbcb09c0" + "previous": "dd832ad0716db3e5d9d4471567047066742da49b6953efd5ce967167d6c61529", + "current": "dd832ad0716db3e5d9d4471567047066742da49b6953efd5ce967167d6c61529" }, "fonts": [ "app/assets/fonts/icons.ttf", "app/assets/fonts/icons.svg", "app/assets/fonts/icons.woff", - "app/assets/fonts/icons.eot" + "app/assets/fonts/icons.eot", + "app/assets/fonts/icons.woff2" ], "glyphs": { "acidified-hcl": { @@ -50,6 +51,14 @@ "codepoint": 61722, "source": "app/assets/images/svg_icons/hr.svg" }, + "hr1": { + "codepoint": 61726, + "source": "app/assets/images/svg_icons/hr1.svg" + }, + "hr2": { + "codepoint": 61727, + "source": "app/assets/images/svg_icons/hr2.svg" + }, "ir": { "codepoint": 61723, "source": "app/assets/images/svg_icons/ir.svg" @@ -124,10 +133,12 @@ } }, "options": { - "autowidth": false, + "autowidth": true, "config": "fontcustom.yml", + "copyright": "", + "css3": false, "css_selector": ".icon-{{glyph}}", - "debug": true, + "debug": false, "font_ascent": 448, "font_descent": 64, "font_design_size": 16, diff --git a/.gitignore b/.gitignore index 578f887f30..e9708e368e 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ /log/* !/log/.keep /tmp +/tmp/* .ruby-gemset .ruby-version @@ -22,6 +23,7 @@ .env /config/mailcollector.yml /config/datamailcollector.yml +/config/datacollectors.yml /config/database.yml /config/storage.yml /node_modules diff --git a/Gemfile b/Gemfile index 723568b2b4..9f017a4f9d 100644 --- a/Gemfile +++ b/Gemfile @@ -35,7 +35,7 @@ group :development do gem 'web-console', '~> 2.0' end -gem 'pg' +gem 'pg', '~> 0.20.0' gem 'pg_search' gem 'devise' diff --git a/Gemfile.lock b/Gemfile.lock index 0093be426d..dcc227b612 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -22,7 +22,7 @@ GIT GIT remote: https://github.com/ComPlat/sablon - revision: b2d1ff682c4b4d984b91cf410043e42bdc5c25fc + revision: 7b688bfd5f7459ca49e786ea9908996d44c2f825 specs: sablon (0.0.19) nokogiri (>= 1.6.0) @@ -167,8 +167,6 @@ GEM rack (>= 1.0.0) rack-test (>= 0.5.4) xpath (~> 2.0) - celluloid (0.16.0) - timers (~> 4.0.0) childprocess (0.5.9) ffi (~> 1.0, >= 1.0.11) chromedriver-helper (1.0.0) @@ -241,13 +239,13 @@ GEM faraday (0.11.0) multipart-post (>= 1.2, < 3) fast_stack (0.2.0) - ffi (1.9.10) + ffi (1.9.18) flamegraph (0.9.5) font-awesome-rails (4.6.2.0) railties (>= 3.2, < 5.1) - fontcustom (1.3.8) + fontcustom (2.0.0) json (~> 1.4) - listen (>= 1.0, < 3.0) + listen (>= 1.0, < 4.0) thor (~> 0.14) globalid (0.3.7) activesupport (>= 4.1.0) @@ -285,7 +283,6 @@ GEM hashie-forbidden_attributes (0.1.1) hashie (>= 3.0) headless (2.0.0) - hitimes (1.2.4) html2haml (2.1.0) erubis (~> 2.7.0) haml (~> 4.0) @@ -315,10 +312,10 @@ GEM activesupport (>= 3.0.0) launchy (2.4.3) addressable (~> 2.3) - listen (2.10.1) - celluloid (~> 0.16.0) - rb-fsevent (>= 0.9.3) - rb-inotify (>= 0.9) + listen (3.1.5) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + ruby_dep (~> 1.2) loofah (2.0.3) nokogiri (>= 1.5.9) mail (2.6.4) @@ -374,7 +371,7 @@ GEM parser (2.4.0.0) ast (~> 2.2) pdf-core (0.6.1) - pg (0.18.4) + pg (0.20.0) pg_search (1.0.5) activerecord (>= 3.1) activesupport (>= 3.1) @@ -427,9 +424,9 @@ GEM rainbow (2.2.2) rake rake (12.1.0) - rb-fsevent (0.9.7) - rb-inotify (0.9.7) - ffi (>= 0.5.0) + rb-fsevent (0.10.2) + rb-inotify (0.9.10) + ffi (>= 0.5.0, < 2) rdoc (4.2.2) json (~> 1.4) redcarpet (3.4.0) @@ -469,6 +466,7 @@ GEM ruby-mailchecker (3.0.27) ruby-ole (1.2.12) ruby-progressbar (1.8.1) + ruby_dep (1.5.0) ruby_parser (3.8.4) sexp_processor (~> 4.1) rubyzip (1.1.7) @@ -529,8 +527,6 @@ GEM thor (0.19.1) thread_safe (0.3.6) tilt (2.0.7) - timers (4.0.4) - hitimes tins (1.11.0) ttfunk (1.4.0) tzinfo (1.2.2) @@ -629,7 +625,7 @@ DEPENDENCIES nokogiri openbabel (= 2.4.0.1)! paranoia (~> 2.0) - pg + pg (~> 0.20.0) pg_search prawn prawn-svg diff --git a/INSTALL.md b/INSTALL.md index e38bd1bfce..6c329e375b 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -9,8 +9,13 @@ if there are errors with nokogiri compilation with new xcode7: `gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2 --use-system-libraries` ## openbabel -* `brew install cmake` for OSX -* install openbabel as described in its [documentation](https://github.com/cubuslab/openbabel/blob/master/INSTALL) +* Require + 1. CMake (the `cmake` package in Ubuntu) + 2. Eigen (the `libeigen2-dev` or `libeigen3-dev` package in Ubuntu) + 3. Swig (the `swig`package in Ubuntu) + 4. libxml2 (the `libxml2-dev` package in Ubuntu) + +* openbabel will be automatically installed through `bundle install` ## rmagick * `brew install imagemagick gs` for OSX @@ -73,12 +78,12 @@ Icons are now available as css classes: '.icon- - + -Created by FontForge 20120731 at Tue Mar 7 09:21:42 2017 - By PiTrem,,, -Created by PiTrem,,, with FontForge 2.0 (http://fontforge.sf.net) +Created by FontForge 20170805 at Wed Oct 25 09:04:00 2017 + By annguyen + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/assets/fonts/icons.ttf b/app/assets/fonts/icons.ttf index e3c96a3a66..e5391900ee 100644 Binary files a/app/assets/fonts/icons.ttf and b/app/assets/fonts/icons.ttf differ diff --git a/app/assets/fonts/icons.woff b/app/assets/fonts/icons.woff index 34355c82e6..11a6f41cfe 100644 Binary files a/app/assets/fonts/icons.woff and b/app/assets/fonts/icons.woff differ diff --git a/app/assets/fonts/icons.woff2 b/app/assets/fonts/icons.woff2 new file mode 100644 index 0000000000..5d573cc892 Binary files /dev/null and b/app/assets/fonts/icons.woff2 differ diff --git a/app/assets/images/svg_icons/acidified-hcl.svg b/app/assets/images/svg_icons/acidified-hcl.svg index 2ad2ef29ee..4f69e68058 100644 --- a/app/assets/images/svg_icons/acidified-hcl.svg +++ b/app/assets/images/svg_icons/acidified-hcl.svg @@ -13,7 +13,7 @@ viewBox="0 0 1000 1000" preserveAspectRatio="xMidYMid meet" id="svg163924" - inkscape:version="0.91 r13725" + inkscape:version="0.92.2 5c3e80d, 2017-08-06" sodipodi:docname="acidified-hcl.svg"> @@ -24,7 +24,7 @@ id="title170427">filter @@ -36,7 +36,7 @@ @@ -49,17 +49,18 @@ guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" - inkscape:window-width="1276" - inkscape:window-height="1560" + inkscape:window-width="2556" + inkscape:window-height="1552" id="namedview163934" showgrid="false" inkscape:zoom="0.69157509" - inkscape:cx="758.24347" + inkscape:cx="226.12483" inkscape:cy="609.92828" - inkscape:window-x="1280" - inkscape:window-y="38" + inkscape:window-x="0" + inkscape:window-y="22" inkscape:window-maximized="0" - inkscape:current-layer="g163928" /> + inkscape:current-layer="g163928" + inkscape:lockguides="true" /> Created by potrace 1.13, written by Peter Selinger 2001-2015 @@ -69,7 +70,7 @@ Created by potrace 1.13, written by Peter Selinger 2001-2015 image/svg+xml - + @@ -79,16 +80,16 @@ Created by potrace 1.13, written by Peter Selinger 2001-2015 style="fill:#000000;stroke:none"> + transform="matrix(33.894111,0,0,-21.229759,-1329.4452,9969.6563)"> + transform="matrix(1.3016213,0,0,1.3016213,-3911.1004,-2558.7059)"> diff --git a/app/assets/images/svg_icons/c-nmr.svg b/app/assets/images/svg_icons/c-nmr.svg index 4879fc619f..7315548f6d 100644 --- a/app/assets/images/svg_icons/c-nmr.svg +++ b/app/assets/images/svg_icons/c-nmr.svg @@ -1,16 +1,61 @@ - - - - - - - + + + + + + image/svg+xml + + + + + + + + + + diff --git a/app/assets/images/svg_icons/dried.svg b/app/assets/images/svg_icons/dried.svg index f1a3ddc9a6..cc9794d3f3 100644 --- a/app/assets/images/svg_icons/dried.svg +++ b/app/assets/images/svg_icons/dried.svg @@ -13,7 +13,7 @@ viewBox="0 0 283.000000 273.000000" preserveAspectRatio="xMidYMid meet" id="svg163924" - inkscape:version="0.91 r13725" + inkscape:version="0.92.2 5c3e80d, 2017-08-06" sodipodi:docname="dried.svg"> @@ -38,14 +38,14 @@ inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="2556" - inkscape:window-height="1560" + inkscape:window-height="1552" id="namedview163934" showgrid="false" - inkscape:zoom="0.97803487" - inkscape:cx="-265.86466" - inkscape:cy="395.18549" + inkscape:zoom="2.7663004" + inkscape:cx="228.40968" + inkscape:cy="183.14854" inkscape:window-x="0" - inkscape:window-y="38" + inkscape:window-y="22" inkscape:window-maximized="0" inkscape:current-layer="g163928" /> + inkscape:connector-curvature="0" + style="stroke-width:1.3518939" /> + d="m 3346.8954,2647.0339 q 34.8502,-79.0425 -28.7001,-134.9504 L 2307.5403,1561.6469 V 131.17244 q 0,-80.970305 -79.9505,-113.743961 -26.6501,-9.6393038 -51.2503,-9.6393038 -55.3503,0 -92.2505,36.6293638 L 1559.2864,537.95158 q -38.9501,36.62937 -38.9501,86.75376 V 1561.6469 L 509.68117,2512.0835 q -63.55032,55.9079 -28.70021,134.9504 34.85016,75.1866 120.9506,75.1866 H 3225.9448 q 86.1006,0 120.9506,-75.1866 z" + inkscape:connector-curvature="0" + style="stroke-width:1.43612993" /> diff --git a/app/assets/images/svg_icons/ea.svg b/app/assets/images/svg_icons/ea.svg index d11954dfa3..9ada769fa6 100644 --- a/app/assets/images/svg_icons/ea.svg +++ b/app/assets/images/svg_icons/ea.svg @@ -1,20 +1,65 @@ - - - - - - - - + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/app/assets/images/svg_icons/ei.svg b/app/assets/images/svg_icons/ei.svg index 96bcc00406..19dcf05799 100644 --- a/app/assets/images/svg_icons/ei.svg +++ b/app/assets/images/svg_icons/ei.svg @@ -1,17 +1,65 @@ - - - - - - - - + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/app/assets/images/svg_icons/gpx-a.svg b/app/assets/images/svg_icons/gpx-a.svg index c85b9fa1dd..ff55fc0023 100644 --- a/app/assets/images/svg_icons/gpx-a.svg +++ b/app/assets/images/svg_icons/gpx-a.svg @@ -14,7 +14,7 @@ viewBox="0 0 3543.3071 3543.3071" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.2 5c3e80d, 2017-08-06" sodipodi:docname="gpx-a.svg"> @@ -40,16 +40,16 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="0.35" - inkscape:cx="2779.5765" - inkscape:cy="1906.4584" + inkscape:zoom="0.24748737" + inkscape:cx="2146.7806" + inkscape:cy="1647.5873" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" inkscape:window-width="2556" - inkscape:window-height="1560" + inkscape:window-height="1552" inkscape:window-x="0" - inkscape:window-y="38" + inkscape:window-y="22" inkscape:window-maximized="0" inkscape:snap-center="false" inkscape:snap-grids="true" @@ -66,7 +66,7 @@ image/svg+xml - + @@ -77,12 +77,13 @@ transform="translate(0,2490.9449)"> + style="opacity:1;fill:#000000;fill-opacity:1;stroke-width:1.38216352" /> + d="m 942.79008,-1924.8839 -221.1488,585.3939 q 42.9289,0 177.5695,2.6018 134.64062,2.6017 208.79052,2.6017 24.7167,0 74.1499,-2.6017 -113.1761,-329.1215 -239.36112,-587.9957 z M -0.34461799,-487.41645 2.257132,-590.18562 q 29.92014,-9.10612 72.84903,-16.26094 42.928888,-7.15481 74.149898,-13.65919 31.22102,-6.50438 64.39334,-18.8627 33.17233,-12.35831 57.88896,-37.72539 24.71664,-25.36707 40.32714,-65.69421 l 308.3075,-801.33935 364.2452,-941.8339 h 166.512 q 10.407,18.2123 14.3097,27.3184 l 266.6794,624.4202 q 42.9289,101.4683 137.8928,334.9755 94.9639,233.5071 148.2998,357.0903 19.5132,44.2298 75.4508,187.97658 55.9377,143.74674 93.6631,219.19752 26.0175,58.5394 45.5306,74.14991 24.7166,19.51313 114.477,38.37583 89.7605,18.86269 109.2736,26.66794 7.8052,49.43327 7.8052,74.14991 0,5.2035 -0.6504,16.91138 -0.6504,11.70788 -0.6504,16.91138 -81.9552,0 -247.1664,-10.407 -165.2112,-10.40701 -248.4672,-10.40701 -98.8665,0 -279.6882,9.10613 -180.8217,9.10613 -231.5559,10.407 0,-55.93764 5.2035,-101.46829 l 170.4147,-36.42451 q 1.3009,0 16.261,-3.25219 14.96,-3.25219 20.1635,-4.55306 5.2035,-1.30088 18.8627,-5.85394 13.6592,-4.55307 19.5132,-8.45569 5.8539,-3.90263 14.3096,-10.40701 8.4557,-6.50437 11.7079,-14.30963 3.2522,-7.80525 3.2522,-18.21225 0,-20.81401 -40.3272,-125.53449 -40.3271,-104.72048 -93.663,-230.90541 -53.3359,-126.185 -54.6368,-130.0876 l -585.39399,-2.6018 q -33.82276,75.4509 -99.51697,254.32127 -65.69422,178.87038 -65.69422,211.39227 0,28.61926 18.21226,48.78283 18.21226,20.16357 56.58809,31.87145 38.37582,11.70788 63.09246,17.56182 24.71663,5.85394 74.14995,11.05744 49.4332,5.2035 53.3358,5.2035 1.3009,24.71664 1.3009,75.45078 0,11.70788 -2.6017,35.12364 -75.45081,0 -227.0028,-13.00876 -151.552,-13.00875 -227.00278,-13.00875 -10.407,0 -34.4732,5.2035 -24.0662,5.2035 -27.96882,5.2035 -104.07005,18.21226 -244.56459799,18.21226 z" + inkscape:connector-curvature="0" + style="stroke-width:1.30087554" /> diff --git a/app/assets/images/svg_icons/gpx-b.svg b/app/assets/images/svg_icons/gpx-b.svg index f6d318a8fb..36af901f43 100644 --- a/app/assets/images/svg_icons/gpx-b.svg +++ b/app/assets/images/svg_icons/gpx-b.svg @@ -14,7 +14,7 @@ viewBox="0 0 3543.3071 3543.3071" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.2 5c3e80d, 2017-08-06" sodipodi:docname="gpx-b.svg"> @@ -40,16 +40,16 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="0.35" - inkscape:cx="2779.5765" - inkscape:cy="1906.4584" + inkscape:zoom="0.24748737" + inkscape:cx="2660.7996" + inkscape:cy="1439.297" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" inkscape:window-width="2556" - inkscape:window-height="1560" + inkscape:window-height="1552" inkscape:window-x="0" - inkscape:window-y="38" + inkscape:window-y="22" inkscape:window-maximized="0" inkscape:snap-center="false" inkscape:snap-grids="true" @@ -66,7 +66,7 @@ image/svg+xml - + @@ -77,12 +77,13 @@ transform="translate(0,2490.9449)"> + style="opacity:1;stroke-width:1.38365066" /> + d="m 710.66083,-615.57708 q 94.4725,42.69479 178.73178,42.69479 480.02279,0 480.02279,-446.96131 0,-152.1 -52.3429,-240.1582 -34.4697,-58.7052 -78.5144,-98.7316 -44.0447,-40.0264 -86.1743,-62.041 -42.1296,-22.0144 -102.7708,-33.3552 -60.64119,-11.3408 -107.23919,-14.0092 -46.5978,-2.6685 -120.644,-2.6685 -93.19573,0 -128.94212,13.3422 0,70.7132 -0.63833,212.1397 -0.63833,141.4265 -0.63833,210.8055 0,10.6738 -1.27665,90.05944 -1.27666,79.38564 -0.63833,128.75151 0.63833,49.36585 5.74495,111.40672 5.10663,62.0409 15.31983,88.72515 z m -17.87314,-995.32252 q 53.61945,9.3395 139.15542,9.3395 104.6858,0 182.56189,-17.3447 77.876,-17.3449 140.4321,-59.3726 62.5562,-42.0276 95.111,-119.4119 32.5547,-77.3843 32.5547,-189.4582 0,-93.3948 -37.0231,-163.441 -37.023,-70.0462 -100.8558,-109.4054 -63.8329,-39.3592 -137.8789,-58.0383 -74.04599,-18.6789 -158.30529,-18.6789 -63.83288,0 -165.96527,17.3446 0,66.7107 5.10663,201.4662 5.10662,134.7554 5.10662,202.8003 0,36.0236 -0.63833,106.737 -0.63833,70.7133 -0.63833,105.4028 0,61.3738 1.27666,92.0606 z M 2.1166448,-424.7847 l 2.55331,-125.41596 q 19.1498502,-5.33685 108.5157752,-21.34741 89.36595,-16.01055 135.32558,-36.02373 8.93659,-16.01055 15.95821,-36.02374 7.0216,-20.01319 10.85157,-44.69612 3.82997,-24.68294 7.0216,-43.36191 3.19165,-18.67898 3.82998,-50.03297 0.63832,-31.35399 0.63832,-45.36323 v -87.39092 q 0,-1310.19661 -28.08644,-1367.56771 -5.10662,-10.6738 -28.08642,-19.3461 -22.97983,-8.6723 -56.81121,-14.6764 -33.83139,-6.0038 -63.19449,-9.3394 -29.363085,-3.3356 -61.917835,-6.004 -32.55472,-2.6685 -38.9380102,-4.0026 l -5.10663,-110.7397 Q 129.78227,-2448.785 438.7331,-2461.46 q 308.95071,-12.675 476.19281,-12.675 29.3629,0 87.45069,0.6671 58.0879,0.6671 86.1745,0.6671 89.3658,0 174.2635,17.3447 84.8977,17.3448 164.0504,56.0369 79.1526,38.6921 137.8788,94.7291 58.7263,56.037 94.4725,139.4253 35.7464,83.3882 35.7464,183.4542 0,69.379 -21.0648,127.4173 -21.0648,58.0381 -49.7895,96.0632 -28.7248,38.0251 -82.3444,76.7173 -53.6196,38.6921 -93.196,60.0395 -39.5763,21.3474 -107.2391,53.3685 196.6051,46.6975 327.4623,178.7845 130.8574,132.087 130.8574,330.8846 0,133.42131 -44.683,239.49121 -44.683,106.06989 -119.3673,174.11474 -74.6845,68.04483 -176.1787,114.07516 -101.4941,46.03034 -208.7333,64.70931 -107.239,18.67898 -224.6915,18.67898 -56.17279,0 -168.51859,-4.00264 -112.34573,-4.00264 -168.51849,-4.00264 -135.32557,0 -391.93348,14.67634 -256.607895,14.67632 -294.9075952,16.01054 z" + inkscape:connector-curvature="0" + style="stroke-width:1.19426012" /> diff --git a/app/assets/images/svg_icons/h-nmr.svg b/app/assets/images/svg_icons/h-nmr.svg index 7a0d0d21c3..6aa34a3849 100644 --- a/app/assets/images/svg_icons/h-nmr.svg +++ b/app/assets/images/svg_icons/h-nmr.svg @@ -1,14 +1,61 @@ - - - - - - - + + + + + + image/svg+xml + + + + + + + + + + diff --git a/app/assets/images/svg_icons/hr.svg b/app/assets/images/svg_icons/hr.svg index 3582227cf4..7855e0b860 100644 --- a/app/assets/images/svg_icons/hr.svg +++ b/app/assets/images/svg_icons/hr.svg @@ -1,20 +1,65 @@ - - - - - - - - + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/app/assets/images/svg_icons/hr1.svg b/app/assets/images/svg_icons/hr1.svg new file mode 100644 index 0000000000..4a522297dc --- /dev/null +++ b/app/assets/images/svg_icons/hr1.svg @@ -0,0 +1,69 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/app/assets/images/svg_icons/hr2.svg b/app/assets/images/svg_icons/hr2.svg new file mode 100644 index 0000000000..66d4556af1 --- /dev/null +++ b/app/assets/images/svg_icons/hr2.svg @@ -0,0 +1,69 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/app/assets/images/svg_icons/ir.svg b/app/assets/images/svg_icons/ir.svg index d39194dfef..d7d85c8647 100644 --- a/app/assets/images/svg_icons/ir.svg +++ b/app/assets/images/svg_icons/ir.svg @@ -1,19 +1,65 @@ - - - - - - - - + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/app/assets/images/svg_icons/isolated.svg b/app/assets/images/svg_icons/isolated.svg index 3714e89fb1..9cacfbdda0 100644 --- a/app/assets/images/svg_icons/isolated.svg +++ b/app/assets/images/svg_icons/isolated.svg @@ -13,7 +13,7 @@ viewBox="0 0 283.000000 273.000000" preserveAspectRatio="xMidYMid meet" id="svg163924" - inkscape:version="0.91 r13725" + inkscape:version="0.92.2 5c3e80d, 2017-08-06" sodipodi:docname="isolated.svg"> @@ -38,14 +38,14 @@ inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="2556" - inkscape:window-height="1560" + inkscape:window-height="1552" id="namedview163934" showgrid="false" inkscape:zoom="2.7663004" - inkscape:cx="172.90866" + inkscape:cx="106.39383" inkscape:cy="163.25726" inkscape:window-x="0" - inkscape:window-y="38" + inkscape:window-y="22" inkscape:window-maximized="0" inkscape:current-layer="g163928" /> image/svg+xml - + @@ -67,12 +67,14 @@ Created by potrace 1.13, written by Peter Selinger 2001-2015 stroke="none" id="g163928"> + inkscape:connector-curvature="0" + style="stroke-width:1.3252281" /> + d="m 3292.7615,2648.4252 q 34.9454,-79.2586 -28.7788,-135.3195 L 2250.5643,1560.0704 V 125.68458 q 0,-81.191691 -80.1691,-114.054966 -26.723,-9.6656525 -51.3905,-9.6656525 -55.5015,0 -92.5026,36.7295125 L 1500.2644,533.57599 q -39.0565,36.72954 -39.0565,86.99093 V 1560.0704 L 447.7893,2513.1057 q -63.72411,56.0609 -28.77869,135.3195 34.94544,75.3921 121.28132,75.3921 H 3171.4801 q 86.336,0 121.2814,-75.3921 z" + inkscape:connector-curvature="0" + style="stroke-width:1.44005692" /> diff --git a/app/assets/images/svg_icons/reaction-procedure.svg b/app/assets/images/svg_icons/reaction-procedure.svg index 98f27196b7..a93cd3a102 100644 --- a/app/assets/images/svg_icons/reaction-procedure.svg +++ b/app/assets/images/svg_icons/reaction-procedure.svg @@ -14,7 +14,7 @@ viewBox="0 0 3543.3071 3543.3071" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.2 5c3e80d, 2017-08-06" sodipodi:docname="reaction-procedure.svg"> @@ -40,16 +40,16 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="0.35" - inkscape:cx="2779.5765" - inkscape:cy="1906.4584" + inkscape:zoom="0.24748737" + inkscape:cx="1472.5984" + inkscape:cy="1627.4683" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" inkscape:window-width="2556" - inkscape:window-height="1560" + inkscape:window-height="1552" inkscape:window-x="0" - inkscape:window-y="38" + inkscape:window-y="22" inkscape:window-maximized="0" inkscape:snap-center="false" inkscape:snap-grids="true" @@ -77,14 +77,14 @@ transform="translate(0,2490.9449)"> + style="opacity:1;stroke-width:1.18441033" /> + style="opacity:1;stroke-width:1.23518586" /> diff --git a/app/assets/images/svg_icons/residue-adsorbed.svg b/app/assets/images/svg_icons/residue-adsorbed.svg index 9f1de05155..f1ca98982a 100644 --- a/app/assets/images/svg_icons/residue-adsorbed.svg +++ b/app/assets/images/svg_icons/residue-adsorbed.svg @@ -13,7 +13,7 @@ viewBox="0 0 1000 1000" preserveAspectRatio="xMidYMid meet" id="svg163924" - inkscape:version="0.91 r13725" + inkscape:version="0.92.2 5c3e80d, 2017-08-06" sodipodi:docname="residue-adsorbed.svg"> @@ -39,14 +39,14 @@ inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="2556" - inkscape:window-height="1560" + inkscape:window-height="1552" id="namedview163934" showgrid="false" - inkscape:zoom="0.97803487" - inkscape:cx="663.72374" - inkscape:cy="706.4984" + inkscape:zoom="0.69157509" + inkscape:cx="202.48487" + inkscape:cy="618.58133" inkscape:window-x="0" - inkscape:window-y="38" + inkscape:window-y="22" inkscape:window-maximized="0" inkscape:current-layer="g163928" /> + transform="matrix(19.740425,0,0,-19.448439,-46.181039,9974.6782)"> @@ -120,7 +120,8 @@ Created by potrace 1.13, written by Peter Selinger 2001-2015 + d="m 2342.7823,456.27105 q 181.9127,-72.10941 344.159,-72.10941 924.3125,0 924.3125,754.89616 0,256.8899 -100.7895,405.6157 -66.3735,99.1506 -151.184,166.7533 -84.8106,67.6025 -165.9338,104.7839 -81.1232,37.1814 -197.8914,56.3356 -116.7682,19.154 -206.4952,23.6608 -89.7272,4.507 -232.3073,4.507 -179.4543,0 -248.286,-22.5342 0,-119.4314 -1.2293,-358.294 -1.229,-238.8626 -1.229,-356.0406 0,-18.0273 -2.4583,-152.1058 -2.4583,-134.07869 -1.2291,-217.4552 1.2291,-83.37662 11.0622,-188.16067 9.8332,-104.78416 29.4992,-149.85258 z m -34.4157,1681.05225 q 103.2476,-15.7739 267.9523,-15.7739 201.5787,0 351.5336,29.2943 149.9549,29.2946 270.4105,100.2774 120.4558,70.9828 183.1417,201.6811 62.6861,130.6985 62.6861,319.9859 0,157.7395 -71.29,276.0441 -71.29,118.3046 -194.2039,184.7806 -122.914,66.4759 -265.494,98.0238 -142.5802,31.5479 -304.8265,31.5479 -122.9138,0 -319.5761,-29.2945 0,-112.6711 9.8331,-340.2666 9.8332,-227.5956 9.8332,-342.52 0,-60.8424 -1.2293,-180.2737 -1.229,-119.4314 -1.229,-178.0204 0,-103.6574 2.4583,-155.486 z M 978.43816,134.03179 l 4.9166,211.82165 q 36.87424,9.01367 208.95354,36.05465 172.0794,27.0411 260.5776,60.84241 17.208,27.0411 30.7284,60.84241 13.5206,33.80131 20.8953,75.48962 7.3748,41.68831 13.5207,73.23618 6.1456,31.54788 7.3748,84.50329 1.229,52.95541 1.229,76.61629 v 147.59914 q 0,2212.85977 -54.0821,2309.75677 -9.833,18.0274 -54.0822,32.6747 -44.2489,14.6472 -109.3933,24.7875 -65.1443,10.1405 -121.6846,15.7741 -56.5405,5.6334 -119.2265,10.1403 -62.6861,4.5069 -74.97754,6.7602 l -9.8331,187.0341 q 240.91124,4.5068 835.81444,25.9143 594.9033,21.4076 916.9376,21.4076 56.5405,0 168.3921,-1.1268 111.8516,-1.1266 165.9337,-1.1266 172.0795,0 335.555,-29.2946 163.4754,-29.2945 315.8887,-94.6438 152.4131,-65.3492 265.4939,-159.9928 113.0809,-94.6437 181.9127,-235.4825 68.8318,-140.8388 68.8318,-309.8454 0,-117.1779 -40.5617,-215.2018 -40.5615,-98.0238 -95.8728,-162.2463 -55.3113,-64.2225 -158.5589,-129.5717 -103.2477,-65.3492 -179.4543,-101.404 -76.2067,-36.0548 -206.4953,-90.1369 378.5748,-78.8697 630.5482,-301.9584 251.9735,-223.0887 251.9735,-558.8485 0,-225.34204 -86.0398,-404.48905 -86.0397,-179.14701 -229.8489,-294.0715 -143.8093,-114.92459 -339.2423,-192.66755 -195.4331,-77.74307 -401.9285,-109.29094 -206.4953,-31.54787 -432.6568,-31.54787 -108.1643,0 -324.4927,6.76032 -216.3285,6.76012 -324.4927,6.76012 -260.5776,0 -754.6913,-24.78755 -494.1139,-24.78754 -567.86224,-27.04109 z" + inkscape:connector-curvature="0" + style="stroke-width:1.30712056" /> diff --git a/app/assets/images/svg_icons/residue-dissolved.svg b/app/assets/images/svg_icons/residue-dissolved.svg index d77e108655..dbd26be5eb 100644 --- a/app/assets/images/svg_icons/residue-dissolved.svg +++ b/app/assets/images/svg_icons/residue-dissolved.svg @@ -13,7 +13,7 @@ viewBox="0 0 1000 1000" preserveAspectRatio="xMidYMid meet" id="svg163924" - inkscape:version="0.91 r13725" + inkscape:version="0.92.2 5c3e80d, 2017-08-06" sodipodi:docname="residue-dissolved.svg"> @@ -39,14 +39,14 @@ inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="2556" - inkscape:window-height="1560" + inkscape:window-height="1552" id="namedview163934" showgrid="false" - inkscape:zoom="0.97803487" - inkscape:cx="663.72374" - inkscape:cy="706.4984" + inkscape:zoom="0.69157509" + inkscape:cx="303.70523" + inkscape:cy="573.08237" inkscape:window-x="0" - inkscape:window-y="38" + inkscape:window-y="22" inkscape:window-maximized="0" inkscape:current-layer="g163928" /> + transform="matrix(19.799671,0,0,-19.506808,-121.26818,9992.5231)"> @@ -120,8 +120,9 @@ Created by potrace 1.13, written by Peter Selinger 2001-2015 + sodipodi:nodetypes="ssssssssssssssssssssssssssssssssss" + style="stroke-width:1.3110435" /> diff --git a/app/assets/images/svg_icons/residue-purified.svg b/app/assets/images/svg_icons/residue-purified.svg index 3497318ad1..49e1056ca1 100644 --- a/app/assets/images/svg_icons/residue-purified.svg +++ b/app/assets/images/svg_icons/residue-purified.svg @@ -13,7 +13,7 @@ viewBox="0 0 1000 1000" preserveAspectRatio="xMidYMid meet" id="svg163924" - inkscape:version="0.91 r13725" + inkscape:version="0.92.2 5c3e80d, 2017-08-06" sodipodi:docname="residue-purified.svg"> @@ -39,14 +39,14 @@ inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="2556" - inkscape:window-height="1560" + inkscape:window-height="1552" id="namedview163934" showgrid="false" - inkscape:zoom="0.97803487" - inkscape:cx="663.72374" - inkscape:cy="706.4984" + inkscape:zoom="0.69157509" + inkscape:cx="582.37885" + inkscape:cy="458.73301" inkscape:window-x="0" - inkscape:window-y="38" + inkscape:window-y="22" inkscape:window-maximized="0" inkscape:current-layer="g163928" /> image/svg+xml - + @@ -68,7 +68,7 @@ Created by potrace 1.13, written by Peter Selinger 2001-2015 style="fill:#000000;stroke:none"> + transform="matrix(19.746064,0,0,-19.453995,-60.09795,9981.6782)"> @@ -120,7 +120,8 @@ Created by potrace 1.13, written by Peter Selinger 2001-2015 + d="M 2281.1488,2711.6079 1926.9047,1651.8951 q 68.765,0 284.4372,-4.7098 215.6721,-4.7098 334.448,-4.7098 39.5921,0 118.776,4.7098 -181.2896,595.794 -383.4171,1064.4226 z M 770.40177,109.42439 l 4.16773,186.0385 q 47.92705,16.4845 116.69226,29.43634 68.76485,12.95207 118.77584,24.72675 50.0108,11.77456 103.1476,34.14616 53.1365,22.37184 92.7285,68.29268 39.592,45.92096 64.5975,118.92322 l 493.8579,1450.62916 583.461,1704.9599 h 266.7249 q 16.6703,-32.9688 22.9216,-49.4531 l 427.1768,-1130.3604 q 68.7651,-183.6834 220.8816,-606.3911 152.1166,-422.7077 237.552,-646.4248 31.2567,-80.0672 120.8596,-340.28537 89.6029,-260.2184 150.0328,-396.80364 41.6759,-105.97138 72.9326,-134.23044 39.5921,-35.32356 183.3735,-69.46996 143.7814,-34.14628 175.0383,-48.27575 12.5027,-89.48689 12.5027,-134.23033 0,-9.41964 -1.0419,-30.61385 -1.042,-21.19432 -1.042,-30.61397 -131.2785,0 -395.9197,18.83941 -264.6413,18.83918 -398.0038,18.83918 -158.3679,0 -448.0146,-16.48439 -289.6465,-16.48438 -370.9144,-18.83929 0,101.26156 8.3352,183.68359 l 272.9764,65.93765 q 2.0838,0 26.0474,5.88734 23.9634,5.88722 32.2986,8.24213 8.3351,2.35491 30.2151,10.59728 21.8798,8.24201 31.2566,15.30675 9.3772,7.06485 22.9219,18.83941 13.5446,11.77468 18.7539,25.90415 5.2095,14.12959 5.2095,32.96865 0,37.67894 -64.5973,227.24975 -64.5975,189.57069 -150.0329,417.9978 -85.4353,228.4268 -87.5191,235.4917 l -937.7049,4.7098 q -54.1787,-136.5852 -159.41,-460.38636 -105.2313,-323.80102 -105.2313,-382.67405 0,-51.80817 29.1731,-88.30948 29.173,-36.50108 90.6448,-57.6954 61.4717,-21.19421 101.0638,-31.79137 39.592,-10.59704 118.776,-20.01681 79.1839,-9.41964 85.4352,-9.41964 2.0838,-44.74333 2.0838,-136.58512 0,-21.19421 -4.1676,-63.58286 -120.8596,0 -363.6211,23.54924 -242.7614,23.54912 -363.6211,23.54912 -16.6704,0 -55.2205,-9.41965 -38.5501,-9.41965 -44.8013,-9.41965 -166.70322,-32.96888 -391.75253,-32.96888 z" + inkscape:connector-curvature="0" + style="stroke-width:1.30749393" /> diff --git a/app/assets/images/svg_icons/resin-solvent.svg b/app/assets/images/svg_icons/resin-solvent.svg index 141a7b6e68..0623b2d91c 100644 --- a/app/assets/images/svg_icons/resin-solvent.svg +++ b/app/assets/images/svg_icons/resin-solvent.svg @@ -13,7 +13,7 @@ viewBox="0 0 512.000000 512.000000" preserveAspectRatio="xMidYMid meet" id="svg3418" - inkscape:version="0.91 r13725" + inkscape:version="0.92.2 5c3e80d, 2017-08-06" sodipodi:docname="resin-solvent.svg"> @@ -26,8 +26,8 @@ guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" - inkscape:window-width="1276" - inkscape:window-height="1560" + inkscape:window-width="2556" + inkscape:window-height="1552" id="namedview3428" showgrid="true" inkscape:snap-others="false" @@ -35,10 +35,10 @@ inkscape:snap-global="false" showguides="false" inkscape:zoom="1.0640625" - inkscape:cx="341.64068" + inkscape:cx="168.71851" inkscape:cy="352.66233" - inkscape:window-x="1280" - inkscape:window-y="38" + inkscape:window-x="0" + inkscape:window-y="22" inkscape:window-maximized="0" inkscape:current-layer="g3422"> + d="m 2478.2345,4989.026 c -450.2618,-549.1532 -743.6008,-1029.7709 -796.2056,-1307.3838 -7.1328,-39.0394 -9.8077,-94.5619 -6.2413,-160.4949 16.9406,-331.4006 238.951,-632.4371 560.8214,-759.9657 221.1186,-87.6217 474.3352,-85.8866 699.9118,5.2053 141.7656,58.1252 311.1711,195.1967 397.6571,322.725 135.5243,199.5343 184.5628,446.7834 127.4999,652.3905 -74.8951,275.8779 -370.0171,746.085 -778.3735,1243.1859 -56.1712,67.6681 -103.4265,123.1907 -104.3181,123.1907 -1.7831,0 -47.2552,-53.7875 -100.7517,-118.853 z m -448.4786,-999.4068 c -42.7971,-161.3625 -46.3636,-373.0424 -9.8076,-508.3789 23.1817,-85.0188 77.5698,-197.7993 129.2831,-268.07 51.7132,-69.4034 156.0313,-167.4354 227.3597,-212.5476 l 57.063,-35.569 h -35.6643 c -54.388,0 -163.1642,30.3639 -233.6012,64.1979 -79.353,39.0394 -172.9719,124.0584 -217.5523,196.9318 -108.7761,178.7133 -107.8844,452.8562 2.6748,681.8868 31.2063,65.0656 88.2691,153.5548 94.5105,147.4821 1.7831,-0.8677 -4.458,-31.2318 -14.2657,-65.9331 z" + id="path3426" + style="stroke-width:1.05772579" /> + style="stroke:#803300;stroke-width:0.50430834" /> diff --git a/app/assets/images/svg_icons/tlc-control.svg b/app/assets/images/svg_icons/tlc-control.svg index 686e62dcbb..2d08bfa7e7 100644 --- a/app/assets/images/svg_icons/tlc-control.svg +++ b/app/assets/images/svg_icons/tlc-control.svg @@ -13,8 +13,8 @@ viewBox="0 0 1000 1000" preserveAspectRatio="xMidYMid meet" id="svg163924" - inkscape:version="0.91 r13725" - sodipodi:docname="isolated.svg"> + inkscape:version="0.92.2 5c3e80d, 2017-08-06" + sodipodi:docname="tlc-control.svg"> + sodipodi:nodetypes="sssssssssssssssssssssssssssssssssssssssssssssssssssss" + style="stroke-width:1.13754272" /> diff --git a/app/assets/images/svg_icons/uv.svg b/app/assets/images/svg_icons/uv.svg index 8b0a95078c..7b47fd7315 100644 --- a/app/assets/images/svg_icons/uv.svg +++ b/app/assets/images/svg_icons/uv.svg @@ -1,19 +1,65 @@ - - - - - - - - + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/app/assets/images/svg_icons/washed-nahco3.svg b/app/assets/images/svg_icons/washed-nahco3.svg index 2628dc2f79..2e4f67ee13 100644 --- a/app/assets/images/svg_icons/washed-nahco3.svg +++ b/app/assets/images/svg_icons/washed-nahco3.svg @@ -13,7 +13,7 @@ viewBox="0 0 1000 1000" preserveAspectRatio="xMidYMid meet" id="svg163924" - inkscape:version="0.91 r13725" + inkscape:version="0.92.2 5c3e80d, 2017-08-06" sodipodi:docname="washed-nahco3.svg"> @@ -38,15 +38,15 @@ guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" - inkscape:window-width="1276" - inkscape:window-height="1560" + inkscape:window-width="2556" + inkscape:window-height="1552" id="namedview163934" showgrid="false" inkscape:zoom="0.69157509" - inkscape:cx="638.28022" + inkscape:cx="372.2209" inkscape:cy="628.9865" - inkscape:window-x="1280" - inkscape:window-y="38" + inkscape:window-x="0" + inkscape:window-y="22" inkscape:window-maximized="0" inkscape:current-layer="g163928" /> + d="M 2148.1227,4007.5405 1775.3058,2938.4329 q 72.3702,0 299.35,-4.7514 226.9798,-4.7517 351.9832,-4.7517 41.6676,0 125.0032,4.7517 -190.7945,601.076 -403.5195,1073.859 z M 558.16793,1382.2876 l 4.386,187.6877 q 50.43996,16.6305 122.81027,29.6974 72.37052,13.0669 125.00343,24.9459 52.63301,11.8789 108.55556,34.4489 55.92251,22.5702 97.59031,68.8982 41.6678,46.328 67.9843,119.9776 L 1604.2486,3311.4328 2218.3,5031.508 h 280.7093 q 17.5442,-33.2611 24.1234,-49.8917 l 449.5734,-1140.3814 q 72.3703,-185.3119 232.4624,-611.767 160.092,-426.4552 250.0067,-652.1557 32.8956,-80.777 127.1964,-343.3023 94.3007,-262.5254 157.8989,-400.3214 43.8609,-106.9108 76.7565,-135.4203 41.6678,-35.6369 192.9877,-70.0859 151.3197,-34.4491 184.2155,-48.7038 13.1581,-90.2802 13.1581,-135.4203 0,-9.5032 -1.0965,-30.8854 -1.0966,-21.3821 -1.0966,-30.8852 -138.1615,0 -416.6778,19.0062 -278.5162,19.0064 -418.8708,19.0064 -166.6711,0 -471.5038,-16.6305 -304.8327,-16.6306 -390.3614,-19.0064 0,102.1592 8.7721,185.312 l 287.2885,66.5222 q 2.1931,0 27.413,5.9395 25.2199,5.9395 33.992,8.3153 8.7723,2.3758 31.7992,10.6911 23.027,8.3153 32.8956,15.4426 9.8687,7.1274 24.1234,19.0064 14.2548,11.8789 19.7374,26.1337 5.4826,14.2547 5.4826,33.2611 0,38.0128 -67.9843,229.2643 -67.9841,191.2514 -157.8988,421.7034 -89.9147,230.4522 -92.1077,237.5796 l -986.8686,4.7516 q -57.019,-137.7961 -167.7675,-464.4678 -110.7486,-326.6719 -110.7486,-386.0667 0,-52.2675 30.7024,-89.0923 30.7027,-36.8249 95.3975,-58.207 64.6946,-21.3822 106.3624,-32.0733 41.6678,-10.691 125.0034,-20.1942 83.3355,-9.5031 89.9145,-9.5031 2.1931,-45.1401 2.1931,-137.7961 0,-21.3822 -4.3861,-64.1465 -127.1963,0 -382.6855,23.758 -255.4894,23.7579 -382.6858,23.7579 -17.5443,0 -58.1155,-9.5031 -40.5713,-9.5033 -47.1505,-9.5033 -175.44326,-33.261 -412.29167,-33.261 z" + inkscape:connector-curvature="0" + style="stroke-width:1.14038134" /> + transform="matrix(34.093625,0,0,-21.180833,-1993.0423,9970.8075)"> : null; return (
{this.takeOwnershipButton()} +
{this.expandButton()} {this.synchronizedIcon()} + {gated} {label}
    diff --git a/app/assets/javascripts/components/CollectionTree.js b/app/assets/javascripts/components/CollectionTree.js index 9b9c63a105..e0dbf5790f 100644 --- a/app/assets/javascripts/components/CollectionTree.js +++ b/app/assets/javascripts/components/CollectionTree.js @@ -105,7 +105,7 @@ export default class CollectionTree extends React.Component {
    this.setState({sharedToCollectionVisible: !sharedToCollectionVisible})}>    - My shared collections + My shared collections
) diff --git a/app/assets/javascripts/components/ContainerComponent.js b/app/assets/javascripts/components/ContainerComponent.js index 1e95daef5f..b95417aacb 100644 --- a/app/assets/javascripts/components/ContainerComponent.js +++ b/app/assets/javascripts/components/ContainerComponent.js @@ -1,13 +1,21 @@ import React, { Component } from 'react'; -import { Button, Col, FormControl, FormGroup, ControlLabel } from 'react-bootstrap'; +import { + Button, Col, FormControl, FormGroup, ControlLabel +} from 'react-bootstrap'; import Select from 'react-select'; +import Delta from 'quill-delta'; import ContainerDatasets from './ContainerDatasets'; import QuillEditor from './QuillEditor'; import QuillViewer from './QuillViewer'; import { sampleAnalysesContentSymbol } from './utils/quillToolbarSymbol'; -import { sampleAnalysesFormatPattern } from './utils/ElementUtils'; -import { searchAndReplace } from './utils/quillFormat'; +import { + sampleAnalysesFormatPattern, commonFormatPattern +} from './utils/ElementUtils'; +import { + deltaToMarkdown, markdownToDelta +} from './utils/deltaMarkdownConverter'; +import { searchAndReplace } from './utils/markdownUtils'; import { confirmOptions, kindOptions } from './staticDropdownOptions/options'; export default class ContainerComponent extends Component { @@ -68,12 +76,16 @@ export default class ContainerComponent extends Component { reformatContent() { const { container } = this.state; const kind = container.extended_metadata.kind || ''; - let content = { ...container.extended_metadata.content }; + let content = new Delta({ ...container.extended_metadata.content }); const type = `_${kind.toLowerCase().replace(/ /g, '')}`; - sampleAnalysesFormatPattern[type].forEach((patt) => { - content = searchAndReplace(content, patt.pattern, patt.replace); + let md = deltaToMarkdown(content); + let formatPattern = (sampleAnalysesFormatPattern[type] || []); + formatPattern = formatPattern.concat(commonFormatPattern); + formatPattern.forEach((patt) => { + md = searchAndReplace(md, patt.pattern, patt.replace); }); + content = markdownToDelta(md); container.extended_metadata.content = content; this.onChange(container); @@ -93,7 +105,7 @@ export default class ContainerComponent extends Component { if (readOnly || disabled) { quill = ( - ) + ); } else { quill = ( - ) + ); } return ( diff --git a/app/assets/javascripts/components/DragDropItemTypes.js b/app/assets/javascripts/components/DragDropItemTypes.js index 396d377552..6fe786873e 100644 --- a/app/assets/javascripts/components/DragDropItemTypes.js +++ b/app/assets/javascripts/components/DragDropItemTypes.js @@ -10,4 +10,5 @@ export default { UNLINKED_DATA: 'unlinked_data', DATASET: 'dataset', CONTAINER: 'container', + GENERALPROCEDURE: 'generalProcedure', }; diff --git a/app/assets/javascripts/components/ElementCollectionLabels.js b/app/assets/javascripts/components/ElementCollectionLabels.js index 412c5d74cc..24df6d7b05 100644 --- a/app/assets/javascripts/components/ElementCollectionLabels.js +++ b/app/assets/javascripts/components/ElementCollectionLabels.js @@ -77,14 +77,15 @@ export default class ElementCollectionLabels extends React.Component { let shared_labels = [] let labels = [] let sync_labels = [] - - collection_labels.map((label, index) => { - if (label.is_shared == false && label.user_id == currentUser.id) { - labels.push(label) - } else if (label.is_shared == true && label.shared_by_id == currentUser.id) { - shared_labels.push(label) - } else if (label.is_synchronized == true) { - sync_labels.push(label) + collection_labels.map((label) => { + if (label) { + if (label.is_shared == false && label.user_id == currentUser.id) { + labels.push(label) + } else if (label.is_shared == true && label.shared_by_id == currentUser.id) { + shared_labels.push(label) + } else if (label.is_synchronized == true) { + sync_labels.push(label) + } } }) diff --git a/app/assets/javascripts/components/ElementContainer.js b/app/assets/javascripts/components/ElementContainer.js index f62aa195e0..8dda266dd1 100644 --- a/app/assets/javascripts/components/ElementContainer.js +++ b/app/assets/javascripts/components/ElementContainer.js @@ -1,42 +1,36 @@ -import React, {Component, PropTypes} from 'react'; -import {DragSource} from 'react-dnd'; +import React, { PropTypes } from 'react'; +import { DragSource } from 'react-dnd'; +import DragDropItemTypes from './DragDropItemTypes'; -const sampleSource = { +const listSource = { beginDrag(props) { return props; - } + }, }; const collectSource = (connect, monitor) => ({ connectDragSource: connect.dragSource(), - isDragging: monitor.isDragging() + isDragging: monitor.isDragging(), }); -class ElementContainer extends Component { - constructor(props) { - super(props); - } - - render() { - const {connectDragSource, sourceType} = this.props; - if(sourceType == "") { - return ; - } else { - return connectDragSource( - , - {dropEffect: 'copy'} - ); - } +const ElementContainer = ({ connectDragSource, sourceType }) => { + if (sourceType === DragDropItemTypes.SAMPLE) { + return connectDragSource( + , + { dropEffect: 'copy' }, + ); + } else if (sourceType === DragDropItemTypes.GENERALPROCEDURE) { + return connectDragSource( + , + ); } -} + return ; +}; -export default DragSource(props => props.sourceType, sampleSource, +export default DragSource(props => props.sourceType, listSource, collectSource)(ElementContainer); ElementContainer.propTypes = { connectDragSource: PropTypes.func.isRequired, - isDragging: PropTypes.bool.isRequired + sourceType: PropTypes.string.isRequired, }; diff --git a/app/assets/javascripts/components/ElementsTableEntries.js b/app/assets/javascripts/components/ElementsTableEntries.js index c8bea6f6b6..d216e3852f 100644 --- a/app/assets/javascripts/components/ElementsTableEntries.js +++ b/app/assets/javascripts/components/ElementsTableEntries.js @@ -81,11 +81,12 @@ export default class ElementsTableEntries extends Component { return (currentElement && currentElement.id == element.id); } - isCurrentElementDropTargetForType(type) { + isCurrEleDropType(type) { const {currentElement} = ElementStore.getState(); const targets = { sample: ['reaction', 'wellplate'], - wellplate: ['screen'] + wellplate: ['screen'], + generalProcedure: ['reaction'], }; return type && currentElement && targets[type].includes(currentElement.type) } @@ -99,13 +100,32 @@ export default class ElementsTableEntries extends Component { } dragHandle(element) { - let sourceType = ""; - if (element.type == 'sample' && this.isCurrentElementDropTargetForType('sample')) { + const sourceType = this.dropSourceType(element); + return ( + + ); + } + + dropSourceType(el) { + let sourceType = ''; + const isDropForSample = + el.type === 'sample' && this.isCurrEleDropType('sample'); + const isDropForWellPlate = + el.type === 'wellplate' && this.isCurrEleDropType('wellplate'); + const isDropForGP = el.type === 'reaction' && el.role === 'gp' && + this.isCurrEleDropType('generalProcedure'); + if (isDropForSample) { sourceType = DragDropItemTypes.SAMPLE; - } else if (element.type == 'wellplate' && this.isCurrentElementDropTargetForType('wellplate')) { + } else if (isDropForWellPlate) { sourceType = DragDropItemTypes.WELLPLATE; + } else if (isDropForGP) { + sourceType = DragDropItemTypes.GENERALPROCEDURE; } - return ; + return sourceType; } topSecretIcon(element) { diff --git a/app/assets/javascripts/components/ElementsTableSampleEntries.js b/app/assets/javascripts/components/ElementsTableSampleEntries.js index a630b600e1..2780b36a8d 100644 --- a/app/assets/javascripts/components/ElementsTableSampleEntries.js +++ b/app/assets/javascripts/components/ElementsTableSampleEntries.js @@ -299,18 +299,32 @@ export default class ElementsTableSampleEntries extends Component { } dragHandle(element) { - let sourceType = this.isCurrentElementDropTargetForType('sample') - ? sourceType = DragDropItemTypes.SAMPLE - : "" - return + const sourceType = this.dropSourceType(); + return ( + + ); + } + + dropSourceType() { + const isDropForSpl = this.isCurrEleDropType('sample'); + let sourceType = ''; + if (isDropForSpl) { + sourceType = DragDropItemTypes.SAMPLE; + } + return sourceType; } - isCurrentElementDropTargetForType(type) { - const {currentElement} = ElementStore.getState() + isCurrEleDropType(type) { + const { currentElement } = ElementStore.getState(); const targets = { - sample: ['reaction', 'wellplate', 'device'] + sample: ['reaction', 'wellplate', 'device'], }; - return type && currentElement && targets[type].includes(currentElement.type) + return type && currentElement && + targets[type].includes(currentElement.type); } showDetails(id) { diff --git a/app/assets/javascripts/components/GeneralProcedureDnD.js b/app/assets/javascripts/components/GeneralProcedureDnD.js new file mode 100644 index 0000000000..008085ed33 --- /dev/null +++ b/app/assets/javascripts/components/GeneralProcedureDnD.js @@ -0,0 +1,76 @@ +import React from 'react'; +import { DropTarget } from 'react-dnd'; +import { compose } from 'redux'; +import { Tooltip, OverlayTrigger } from 'react-bootstrap'; +import DragDropItemTypes from './DragDropItemTypes'; +import DetailActions from './actions/DetailActions'; + +const updRxnOriName = (oriRxn, sourceTag) => { + const nextRxn = oriRxn; + nextRxn.origin = sourceTag; + nextRxn.name = nextRxn.extractNameFromOri(sourceTag); + nextRxn.changed = true; + return nextRxn; +}; + +const gpTarget = { + drop(targetProps, monitor) { + const sourceProps = monitor.getItem(); + const source = sourceProps.element; + const sourceTag = { id: source.id, short_label: source.short_label }; + const oriRxn = targetProps.reaction; + const nextRxn = updRxnOriName(oriRxn, sourceTag); + DetailActions.changeCurrentElement(oriRxn, nextRxn); + }, +}; + +const gpDropCollect = (connect, monitor) => ( + { + connectDropTarget: connect.dropTarget(), + isOver: monitor.isOver(), + canDrop: monitor.canDrop(), + } +); + +const dndStyle = (canDrop, isOver) => { + const style = {}; + if (canDrop) { + style.borderStyle = 'dashed'; + style.borderWidth = 2; + style.opacity = 0.5; + } + if (isOver) { + style.borderColor = '#337ab7'; + style.opacity = 0.2; + } + return style; +}; + +const GpContent = ({ reaction }) => ( + reaction.origin && reaction.origin.short_label + ? + + {reaction.origin.short_label} + + : null +); + +const GeneralProcedureDnd = ({ connectDropTarget, isOver, canDrop, + reaction }) => { + const style = dndStyle(canDrop, isOver); + + return ( + reaction.role === 'parts' + ? compose(connectDropTarget)( +
+ + +
, + ) + : null + ); +}; + +export default compose( + DropTarget(DragDropItemTypes.GENERALPROCEDURE, gpTarget, gpDropCollect), +)(GeneralProcedureDnd); diff --git a/app/assets/javascripts/components/QuillEditor.js b/app/assets/javascripts/components/QuillEditor.js index 71e6747d45..76576268f9 100644 --- a/app/assets/javascripts/components/QuillEditor.js +++ b/app/assets/javascripts/components/QuillEditor.js @@ -12,7 +12,6 @@ const toolbarOptions = [ [{ list: 'ordered' }, { list: 'bullet' }], [{ script: 'sub' }, { script: 'super' }], [{ header: [1, 2, 3, 4, 5, 6, false] }], - [{ color: [] }, { background: [] }], // [{ 'font': [] }], // ['blockquote', 'code-block'], // [{ 'header': 1 }, { 'header': 2 }], @@ -41,7 +40,12 @@ export default class QuillEditor extends React.Component { this.height = props.height; if (!props.height || props.height === '') this.height = '230px'; - this.toolbar = (props.toolbarSymbol || []).map(x => x.name); + this.toolbar = (props.toolbarSymbol || []).map(x => { + return { + name: x.name, + render: x.render, + } + }); this.editor = false; this.id = _.uniqueId('quill-editor-'); @@ -138,7 +142,7 @@ export default class QuillEditor extends React.Component { const toolbarSymbol = this.props.toolbarSymbol; this.toolbar.forEach((element) => { - const selector = `#toolbar-${id} #${element}_id`; + const selector = `#toolbar-${id} #${element.name}_id`; const btn = document.querySelector(selector); btn.addEventListener('click', () => { @@ -146,9 +150,11 @@ export default class QuillEditor extends React.Component { if (range) { let contents = editor.getContents(); - let elementOps = toolbarSymbol.find(x => x.name === element).ops; + let elementOps = toolbarSymbol.find(x => x.name === element.name).ops; const insertDelta = new Delta(elementOps); - elementOps = [{ retain: range.index }].concat(elementOps); + if (range.index > 0) { + elementOps = [{ retain: range.index }].concat(elementOps); + } const elementDelta = new Delta(elementOps); contents = contents.compose(elementDelta); @@ -199,7 +205,7 @@ export default class QuillEditor extends React.Component { } } - return (); + return (); }); return ( @@ -217,21 +223,24 @@ export default class QuillEditor extends React.Component { return (); } - const customToolbarElement = this.toolbar.map(element => ( - - - - )); + const customToolbarElement = this.toolbar.map(element => { + if (element.render) { + return element.render(element.name); + } + + return ( + + + + ) + }); return ( - + { customToolbarElement } ); diff --git a/app/assets/javascripts/components/ReactionDetailsScheme.js b/app/assets/javascripts/components/ReactionDetailsScheme.js index 38dc7e4557..ee2404553b 100644 --- a/app/assets/javascripts/components/ReactionDetailsScheme.js +++ b/app/assets/javascripts/components/ReactionDetailsScheme.js @@ -1,8 +1,9 @@ -import React, {Component} from 'react'; +import React, { Component } from 'react'; import { ListGroup, ListGroupItem, FormGroup, ControlLabel, - Row, Col, Collapse, Button, ButtonGroup, Checkbox, + Row, Col, Collapse, Button, ButtonGroup, } from 'react-bootstrap'; +import Select from 'react-select'; import MaterialGroupContainer from './MaterialGroupContainer'; import Sample from './models/Sample'; import Molecule from './models/Molecule'; @@ -11,6 +12,8 @@ import QuillEditor from './QuillEditor'; import NotificationActions from './actions/NotificationActions'; import { reactionToolbarSymbol } from './utils/quillToolbarSymbol'; +import GeneralProcedureDnd from './GeneralProcedureDnD'; +import { rolesOptions } from './staticDropdownOptions/options'; export default class ReactionDetailsScheme extends Component { constructor(props) { @@ -18,7 +21,8 @@ export default class ReactionDetailsScheme extends Component { let { reaction } = props; this.state = { reaction }; - this.onClickRoleRadio = this.onClickRoleRadio.bind(this); + this.onChangeRole = this.onChangeRole.bind(this); + this.renderRole = this.renderRole.bind(this); } componentWillReceiveProps(nextProps) { @@ -65,39 +69,65 @@ export default class ReactionDetailsScheme extends Component { } } - onClickRoleRadio(e) { - const { onInputChange, reaction } = this.props; - const value = e.target.value; - if (reaction.role === value) { - onInputChange('role', null); - } else { - onInputChange('role', value); - } + onChangeRole(e) { + const { onInputChange } = this.props; + const value = e && e.value; + onInputChange('role', value); + } + + renderGPDnD() { + const { reaction } = this.props; + return ( + + ); + } + + renderRolesOptions(opt) { + const className = `fa ${opt.icon} ${opt.bsStyle}`; + return ( + + + + {opt.label} + + ); + } + + renderRoleSelect() { + const { role } = this.props.reaction; + return ( +