Skip to content

Commit b8e9a4d

Browse files
committedMay 10, 2017
Merge branch 'develop'
2 parents 2241ee3 + e71da73 commit b8e9a4d

File tree

16 files changed

+275
-347
lines changed

16 files changed

+275
-347
lines changed
 

‎.env.example

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ S3_BUCKET_NAME=
1515
S3_PROTOCOL=
1616
S3_REGION=
1717

18+
#
19+
# Monitoring
20+
#
21+
NEW_RELIC_LICENSE_KEY=
22+
SENTRY_RAVEN_DSN=
23+
1824
#
1925
# Email Configuration
2026
#

‎Gemfile

+25-24
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ ruby '2.4.0'
55
gem 'bower-rails', '~> 0.11.0'
66

77
# Server
8-
gem 'puma', '< 3.7' # Puma 3.7.0 breaks options passed in via `rails s` - will be fixed in 3.7.1
8+
gem 'puma', '~> 3.8.2'
99

1010
# Rails
11-
gem 'rails', '~> 5.0.1'
11+
gem 'rails', '~> 5.0.2'
1212

1313
# Cortex-specific
1414
gem 'cortex-exceptions', '= 0.0.4'
@@ -17,12 +17,12 @@ gem 'cortex-plugins-core', '= 0.12.3'
1717
# API
1818
gem 'grape', '~> 0.17'
1919
gem 'grape-entity', '~> 0.6.0'
20-
gem 'grape-swagger', '~> 0.25.3'
20+
gem 'grape-swagger', '~> 0.27.1'
2121

2222
# Authorization
2323
gem 'six', '~> 0.2.0'
24-
gem 'devise', '~> 4.2.0'
25-
gem 'rack-oauth2', '~> 1.5.1'
24+
gem 'devise', '~> 4.2.1'
25+
gem 'rack-oauth2', '~> 1.6.1'
2626
gem 'doorkeeper', '~> 4.2'
2727
gem 'rolify', '~> 5.1'
2828
gem 'pundit', '~> 1.1'
@@ -32,54 +32,54 @@ gem 'rails-observers', git: 'https://github.com/triloch/rails-observers.git'
3232
gem 'awesome_nested_set', git: 'https://github.com/cortex-cms/awesome_nested_set.git'
3333
gem 'paperclip', '~> 5.1.0'
3434
gem 'paperclip-optimizer', '~> 2.0'
35-
gem 'image_optim_pack', '~> 0.3.1'
35+
gem 'image_optim_pack', '~> 0.4.0'
3636
gem 'acts-as-taggable-on', '~> 4.0'
3737
gem 'bcrypt', '~> 3.1.11'
3838
gem 'kaminari', '~> 0.17.0'
3939
gem 'grape-kaminari', git: 'https://github.com/toastercup/grape-kaminari.git', branch: 'set-paginate-headers-extraction'
4040
gem 'elasticsearch-model', '~> 0.1'
4141
gem 'elasticsearch-rails', '~> 0.1'
42-
gem 'paranoia', '~> 2.2'
43-
gem 'pg', '~> 0.19.0'
42+
gem 'paranoia', '~> 2.3'
43+
gem 'pg', '~> 0.20.0'
4444
gem 'hashie-forbidden_attributes', '~> 0.1.1'
4545
gem 'redis-rails', '~> 5.0'
4646
gem 'pomona', '~> 0.7'
47-
gem 'transitions', '~> 1.2', :require => ['transitions', 'active_model/transitions']
47+
gem 'transitions', '~> 1.2', require: %w(transitions active_model/transitions)
4848
gem 'deep_cloneable', '~> 2.2.2'
4949

5050
# Middleware
5151
gem 'rack-cors', '~> 0.4.1', require: 'rack/cors'
5252

5353
# Utility
5454
gem 'excon', '~> 0.55.0'
55-
gem 'hashie', '~> 3.5.3'
56-
gem 'hashr', '~> 2.0.0'
55+
gem 'hashie', '~> 3.5.5'
56+
gem 'hashr', '~> 2.0.1'
5757
gem 'mime-types', '~> 3.1.0'
5858
gem 'interactor-rails', '~> 2.0'
5959
gem 'virtus', '~> 1.0.5'
6060
gem 'rubyzip', '~> 1.2.1'
61-
gem 'addressable', '~> 2.5.0'
61+
gem 'addressable', '~> 2.5.1'
6262
gem 'json'
6363

6464
# External Services
65-
gem 'yt', '~> 0.28.5'
66-
gem 'aws-sdk', '~> 2.7' # Used by Paperclip
65+
gem 'yt', '~> 0.30.1'
66+
gem 'aws-sdk', '~> 2.9'
6767

6868
# Jobs
69-
gem 'sidekiq', '~> 4.2.9'
70-
gem 'sidekiq-failures', '~> 0.4.5'
71-
gem 'sinatra', '~> 2.0.0.beta', require: false
69+
gem 'sidekiq', '~> 5.0.0'
70+
#gem 'sidekiq-failures', '~> 0.4.5' # Disabled until it supports sidekiq 5.x
71+
gem 'sinatra', '~> 2.0.0.rc', require: false
7272

7373
# Pipeline
7474
gem 'sprockets-rails', '3.2.0', require: 'sprockets/railtie'
7575
gem 'sprockets', '3.7.1'
76-
gem 'uglifier', '~> 3.0.4'
76+
gem 'uglifier', '~> 3.2.0'
7777
gem 'non-stupid-digest-assets', '~> 1.0.9'
7878
gem 'angular-rails-templates', '~> 1.0.2'
7979
gem 'ngannotate-rails', '~> 1.2.2'
8080

8181
# View
82-
gem 'haml', '~> 4.1.0.beta'
82+
gem 'haml', '~> 5.0'
8383
gem 'cells', '~> 4.1.6'
8484
gem 'cells-rails', '~> 0.0.7'
8585
gem 'cells-haml', '~> 0.0.10'
@@ -96,7 +96,7 @@ gem 'react_on_rails', '< 6.6'
9696
gem 'mini_racer', platforms: :ruby
9797
gem 'gon', '~> 6.1.0'
9898
gem 'turbolinks', '~> 5.0.1'
99-
gem 'jquery-rails', '~> 4.2.2'
99+
gem 'jquery-rails', '~> 4.3.1'
100100
gem 'jquery-turbolinks', '~> 2.1'
101101
gem 'jquery-ui-rails', '~> 6.0.1'
102102
gem 'ng-rails-csrf', '~> 0.1.0'
@@ -138,11 +138,11 @@ group :test do
138138
# Rspec
139139
gem 'rspec-rails', '~> 3.5'
140140
gem 'json_spec', '~> 1.1'
141-
gem 'rspec-sidekiq', '~> 2.2'
141+
gem 'rspec-sidekiq', '~> 3.0'
142142
gem 'shoulda-matchers', '~> 3.1'
143143

144144
# Coverage
145-
gem 'simplecov', '~> 0.13', require: false
145+
gem 'simplecov', '~> 0.14', require: false
146146
gem 'codeclimate-test-reporter', '~> 0.6', require: false
147147

148148
# Capybara for feature testing, Poltergeist for PhantomJS
@@ -169,14 +169,15 @@ end
169169
group :test, :development do
170170
gem 'factory_girl_rails', '~> 4.8'
171171
gem 'faker', '~> 1.7'
172-
gem 'fog', '~> 1.38.0'
172+
gem 'fog-local', '~> 0.3.1'
173173
gem 'phantomjs', '~> 2.1.1'
174174
gem 'jasmine-rails', '~> 0.14'
175175
end
176176

177177
group :staging, :production do
178178
# Monitoring
179-
gem 'newrelic_rpm', '~> 3.18'
179+
gem 'newrelic_rpm'
180+
gem 'sentry-raven'
180181

181182
# Performance
182183
gem 'bootscale', require: false

‎Gemfile.lock

+155-281
Large diffs are not rendered by default.

‎app/assets/stylesheets/authentication.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ form.new_user .mdl-button {
2929
}
3030

3131
.authentication__header-text {
32-
@extend %display-text;
32+
@include display-text;
3333
color: $color-white;
3434
}

‎app/assets/stylesheets/components/sidebar.scss

+44-29
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ $sidebar-link-width: $sidebar-width-expanded - 60px; // link padding = 60px
44
$sidebar-collapse-transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
55
$sidebar-toggle-button-transition: transform 500ms linear;
66

7-
.tenant__item {
7+
.nav__item {
88
position: relative;
99
}
1010

11-
.tenant__item .material-icons {
11+
.nav__item .material-icons {
1212
position: absolute;
1313
right: 10px;
1414
}
@@ -21,7 +21,7 @@ $sidebar-toggle-button-transition: transform 500ms linear;
2121
flex-grow: 0;
2222
flex-shrink: 0;
2323
flex-basis: auto;
24-
box-shadow: 1px 0px 5px 1px rgba(0,0,0,.5);
24+
box-shadow: 1px 0px 5px 1px rgba(0, 0, 0, .5);
2525
overflow-y: hidden;
2626
}
2727

@@ -42,7 +42,7 @@ $sidebar-toggle-button-transition: transform 500ms linear;
4242
}
4343

4444
.sidebar__brand-name {
45-
@extend %display-text;
45+
@include display-text;
4646
color: $color-white;
4747
margin: 0 15px;
4848
text-decoration: none;
@@ -80,7 +80,7 @@ $sidebar-toggle-button-transition: transform 500ms linear;
8080
color: $color-grey-dark;
8181
}
8282

83-
.mdl-layout__drawer .mdl-navigation .mdl-navigation__link.tenant__item {
83+
.mdl-layout__drawer .mdl-navigation .mdl-navigation__link.nav__item {
8484
background-color: $employer-color;
8585
color: $color-white;
8686
}
@@ -103,35 +103,50 @@ $sidebar-toggle-button-transition: transform 500ms linear;
103103
}
104104
}
105105

106-
// Collapsing
107-
108-
@media only screen and (min-width: 1024px) {
109-
.sidebar--collapsed {
110-
111-
.nav__item-name,
112-
.sidebar__brand-name {
113-
display: none;
114-
}
115-
116-
.mdl-layout__drawer .mdl-navigation .mdl-navigation__link {
117-
padding-left: 30px;
118-
}
106+
.environment {
107+
background-color: $flash-error-background !important;
108+
}
119109

120-
.tenant__item .material-icons {
121-
position: static;
122-
}
110+
.environment__abbreviated {
111+
display: none;
112+
}
123113

124-
.sidebar__toggle-button:after {
125-
transform: rotate(-540deg);
126-
transition: $sidebar-toggle-button-transition;
127-
}
114+
// Collapsing
128115

129-
.layout__sidebar {
130-
width: $sidebar-width-collapsed;
131-
transition: $sidebar-collapse-transition;
116+
@media only screen and (min-width: 1024px) {
117+
.sidebar--collapsed {
118+
.environment__full {
119+
display: none;
120+
}
121+
122+
.environment__abbreviated {
123+
display: block;
124+
}
125+
126+
.nav__item-name,
127+
.sidebar__brand-name {
128+
display: none;
129+
}
130+
131+
.mdl-layout__drawer .mdl-navigation .mdl-navigation__link {
132+
padding-left: 30px;
133+
}
134+
135+
.nav__item .material-icons {
136+
position: static;
137+
}
138+
139+
.sidebar__toggle-button:after {
140+
transform: rotate(-540deg);
141+
transition: $sidebar-toggle-button-transition;
142+
}
143+
144+
.layout__sidebar {
145+
width: $sidebar-width-collapsed;
146+
transition: $sidebar-collapse-transition;
147+
}
132148
}
133149
}
134-
}
135150

136151
@media only screen and (max-width: 1024px) {
137152
.layout__sidebar,

‎app/assets/stylesheets/variables/_typography.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
$cortex-font-stack: Montserrat, sans-serif;
3030
$base-font-size: 1rem;
3131

32-
%display-text { // Cortex Logo
32+
@mixin display-text { // Cortex Logo
3333
color: $color-grey-dark;
3434
font-family: $cortex-font-stack;
3535
font-weight: normal;

‎app/helpers/application_helper.rb

+18-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,27 @@ def extra_config
1010
end
1111

1212
def qualtrics_domain
13-
extra_config.qualtrics_id.delete('_').downcase
13+
extra_config.qualtrics_id.delete('_').downcase
1414
end
1515

1616
def flag_enabled?(flag_name)
1717
Cortex.flipper[flag_name].enabled?(current_user, request)
1818
end
19+
20+
def environment
21+
request.local? ? :local : Rails.env
22+
end
23+
24+
def environment_abbreviated
25+
case environment
26+
when 'production'
27+
:prd
28+
when 'staging'
29+
:stg
30+
when 'development'
31+
:dev
32+
else
33+
:loc
34+
end
35+
end
1936
end

‎app/services/content_item_service.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def update
3333
@content_item = ContentItem.find(id)
3434

3535
transact_and_refresh do
36-
@content_item.update(content_item_attributes)
36+
@content_item.assign_attributes(content_item_attributes)
3737
end
3838
end
3939

‎app/views/layouts/application.html.haml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
%main.mdl-layout__content.layout__main-content
1919
= yield
2020
= render 'partials/flash'
21-
21+
2222
%script{src: '//cdn.ckeditor.com/4.6.2/standard-all/ckeditor.js', type: 'text/javascript'}
2323
= javascript_include_tag :application, {'data-turbolinks-eval': false}
2424
= render 'layouts/google_analytics' if extra_config.google_analytics_id?
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.mdl-navigation__link.nav__item.environment{class: "environment--#{environment}"}
2+
.environment__full
3+
= environment
4+
.environment__abbreviated
5+
= environment_abbreviated

‎app/views/partials/_sidebar.html.haml

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,9 @@
44
= image_tag 'logo.svg', class: 'sidebar__brand-logo'
55
%h1.sidebar__brand-name Cortex
66
= render 'partials/navigation'
7-
= render 'partials/tenant_display'
7+
%footer
8+
%nav.demo-navigation.mdl-navigation
9+
- unless environment == :production
10+
= render 'partials/environment_display'
11+
= render 'partials/tenant_display'
812
.sidebar__toggle-button#sidebar__toggle-button
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
%footer
2-
%nav.demo-navigation.mdl-navigation
3-
%div{class: 'mdl-navigation__link tenant__item'}
4-
= cell(:tenant, Tenant.find_by_name('Corporate') || current_user.tenant).(:current)
1+
.mdl-navigation__link.nav__item
2+
= cell(:tenant, Tenant.find_by_name('Corporate') || current_user.tenant).(:current)

‎app/views/rss/v2/rss/index.rss.builder

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ if Rails.cache.fetch("rss-v2-#{content_type.name}")
22
xml << Rails.cache.fetch("rss-v2-#{content_type.name}")
33
end
44

5-
Rails.cache.fetch("rss-v2-#{content_type.name}", expires_in: 30.minutes, race_condition_ttl: 10) do
5+
Rails.cache.fetch("rss-v2-#{content_type.name}", expires_in: 1.minute, race_condition_ttl: 10) do
66
xml.instruct! :xml, version: '1.0', encoding: 'UTF-8'
77
xml.rss version: '2.0',
88
'xmlns:content': 'http://purl.org/rss/1.0/modules/content/',

‎config/initializers/sentry.rb

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
if defined? Raven
2+
Raven.configure do |config|
3+
config.dsn = ENV['SENTRY_RAVEN_DSN']
4+
config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s)
5+
end
6+
end

‎config/routes.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require 'sidekiq/web'
2+
13
Cortex::Application.routes.draw do
24
get 'hello_world', to: 'hello_world#index'
35
mount JasmineRails::Engine => '/specs' if defined?(JasmineRails)

‎lib/tasks/employer/blog.rake

+2-2
Original file line numberDiff line numberDiff line change
@@ -379,12 +379,12 @@ namespace :employer do
379379
"args": [blog.fields.find_by_name('Categories').id]
380380
}, "multiple": ","
381381
},
382-
"content": { "field": blog.fields.find_by_name('Body').id, "encode": true },
383382
"media:content": { "media":
384383
{ "field": blog.fields.find_by_name('Featured Image').id,
385384
"medium": "image"
386385
}
387-
}
386+
},
387+
"content": { "field": blog.fields.find_by_name('Body').id, "encode": true }
388388
}
389389
}
390390

0 commit comments

Comments
 (0)
Please sign in to comment.