From cc5c1e5febf588183145e30dc7e98e5ea33cd398 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 26 Jan 2017 14:52:07 +0100 Subject: [PATCH] Removed accidental n+1 query from notifications, updated some deps, improved how "show more" link looks --- Gemfile | 4 ++-- Gemfile.lock | 14 +++++------ .../components/components/status_content.jsx | 23 ++++++++++--------- app/assets/stylesheets/components.scss | 9 ++++++++ app/models/notification.rb | 2 ++ config/environments/development.rb | 2 +- db/seeds.rb | 7 +++--- 7 files changed, 36 insertions(+), 25 deletions(-) diff --git a/Gemfile b/Gemfile index 7fb3ab91de..77f4658160 100644 --- a/Gemfile +++ b/Gemfile @@ -79,7 +79,7 @@ end group :production do gem 'rails_12factor' - gem 'lograge' gem 'redis-rails' - gem 'rack-timeout-puma' + gem 'lograge' + gem 'rack-timeout' end diff --git a/Gemfile.lock b/Gemfile.lock index 12f6679c7f..a37a06b011 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -72,7 +72,7 @@ GEM browserify-rails (3.1.0) railties (>= 4.0.0, < 5.1) sprockets (>= 3.5.2) - builder (3.2.2) + builder (3.2.3) bullet (5.3.0) activesupport (>= 3.0.0) uniform_notifier (~> 1.10.0) @@ -198,7 +198,7 @@ GEM minitest (5.10.1) multi_json (1.12.1) nio4r (1.2.1) - nokogiri (1.6.8.1) + nokogiri (1.7.0.1) mini_portile2 (~> 2.1.0) oj (2.17.3) orm_adapter (0.5.0) @@ -244,8 +244,6 @@ GEM rack-test (0.6.3) rack (>= 1.0) rack-timeout (0.4.2) - rack-timeout-puma (0.0.1) - rack-timeout (~> 0.2, >= 0.2.0) rails (5.0.1) actioncable (= 5.0.1) actionmailer (= 5.0.1) @@ -258,9 +256,9 @@ GEM bundler (>= 1.3.0, < 2.0) railties (= 5.0.1) sprockets-rails (>= 2.0.0) - rails-dom-testing (2.0.1) + rails-dom-testing (2.0.2) activesupport (>= 4.2.0, < 6.0) - nokogiri (~> 1.6.0) + nokogiri (~> 1.6) rails-html-sanitizer (1.0.3) loofah (~> 2.0) rails-settings-cached (0.6.5) @@ -450,7 +448,7 @@ DEPENDENCIES rabl rack-attack rack-cors - rack-timeout-puma + rack-timeout rails (~> 5.0.1.0) rails-settings-cached rails_12factor @@ -476,4 +474,4 @@ RUBY VERSION ruby 2.3.1p112 BUNDLED WITH - 1.13.7 + 1.14.3 diff --git a/app/assets/javascripts/components/components/status_content.jsx b/app/assets/javascripts/components/components/status_content.jsx index ded98c1cd3..d6d7a57212 100644 --- a/app/assets/javascripts/components/components/status_content.jsx +++ b/app/assets/javascripts/components/components/status_content.jsx @@ -3,6 +3,17 @@ import PureRenderMixin from 'react-addons-pure-render-mixin'; import emojify from '../emoji'; import { FormattedMessage } from 'react-intl'; +const spoilerStyle = { + display: 'inline-block', + borderRadius: '2px', + color: '#363c4b', + fontWeight: '500', + fontSize: '11px', + padding: '0px 6px', + textTransform: 'uppercase', + lineHeight: 'inherit' +}; + const StatusContent = React.createClass({ contextTypes: { @@ -86,16 +97,6 @@ const StatusContent = React.createClass({ const content = { __html: emojify(status.get('content')) }; const spoilerContent = { __html: emojify(status.get('spoiler_text', '')) }; - const spoilerStyle = { - backgroundColor: '#616b86', - borderRadius: '4px', - color: '#363c4b', - fontWeight: '500', - fontSize: '12px', - padding: '0 4px', - textTransform: 'uppercase' - }; - if (status.get('spoiler_text').length > 0) { const toggleText = hidden ? : ; @@ -103,7 +104,7 @@ const StatusContent = React.createClass({ return (