Skip to content

Commit ccdca85

Browse files
Updated shakacode#416 to shakacode#426, without Heroku breaking changes.
1 parent 00a1b4c commit ccdca85

28 files changed

+140
-66
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ install:
2626
- bundle install
2727
- chromedriver-update
2828
- nvm install stable && nvm alias default stable
29-
- npm install npm@latest -g
29+
- npm install -g [email protected]
3030
- npm install -g yarn
3131
- npm --version
3232
- yarn install

Gemfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
source "https://rubygems.org"
22
ruby "2.4.1"
33

4-
gem "react_on_rails", "9.0.0.rc.0"
4+
gem "react_on_rails", "9.0.3"
55
gem "webpacker"
66

77
# Bundle edge Rails instead: gem "rails", github: "rails/rails"
@@ -29,7 +29,7 @@ gem "coffee-rails"
2929

3030
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
3131
gem "jbuilder"
32-
gem "redis"
32+
gem "redis", "3.3.3"
3333

3434
# bundle exec rake doc:rails generates the API under doc/api.
3535
gem "sdoc", group: :doc
@@ -65,7 +65,7 @@ group :development, :test do
6565

6666
################################################################################
6767
# Manage application processes
68-
gem "factory_girl_rails"
68+
gem "factory_bot_rails"
6969
gem "foreman"
7070

7171
################################################################################
@@ -92,16 +92,17 @@ group :development, :test do
9292
end
9393

9494
group :test do
95-
gem "capybara"
95+
gem "capybara", "2.13.0"
9696
gem "capybara-screenshot"
97-
gem "capybara-webkit"
97+
gem "capybara-webkit", "1.14.0"
9898
gem "chromedriver-helper"
9999
gem "coveralls", require: false
100100
gem "database_cleaner"
101101
gem "generator_spec"
102102
gem "launchy"
103103
gem "poltergeist"
104-
gem "rspec-rails", "~> 3.6"
104+
gem "rails_best_practices"
105+
gem "rspec-rails", "3.6.1"
105106
gem "rspec-retry"
106-
gem "selenium-webdriver", "<3.0.0"
107+
gem "selenium-webdriver"
107108
end

Gemfile.lock

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ GEM
3838
i18n (~> 0.7)
3939
minitest (~> 5.1)
4040
tzinfo (~> 1.1)
41-
addressable (2.5.1)
42-
public_suffix (~> 2.0, >= 2.0.2)
41+
addressable (2.5.2)
42+
public_suffix (>= 2.0.2, < 4.0)
4343
archive-zip (0.7.0)
4444
io-like (~> 0.3.0)
4545
arel (8.0.0)
@@ -56,7 +56,7 @@ GEM
5656
bundler (~> 1.2)
5757
thor (~> 0.18)
5858
byebug (9.0.6)
59-
capybara (2.14.0)
59+
capybara (2.13.0)
6060
addressable
6161
mime-types (>= 1.16)
6262
nokogiri (>= 1.3.3)
@@ -66,15 +66,17 @@ GEM
6666
capybara-screenshot (1.0.14)
6767
capybara (>= 1.0, < 3)
6868
launchy
69-
capybara-webkit (1.1.0)
70-
capybara (~> 2.0, >= 2.0.2)
69+
capybara-webkit (1.14.0)
70+
capybara (>= 2.3.0, < 2.14.0)
7171
json
7272
childprocess (0.6.3)
7373
ffi (~> 1.0, >= 1.0.11)
7474
chromedriver-helper (1.1.0)
7575
archive-zip (~> 0.7.0)
7676
nokogiri (~> 1.6)
7777
cliver (0.3.2)
78+
code_analyzer (0.4.8)
79+
sexp_processor
7880
coderay (1.1.1)
7981
coffee-rails (4.2.1)
8082
coffee-script (>= 2.2.0)
@@ -96,11 +98,12 @@ GEM
9698
diff-lcs (1.3)
9799
docile (1.1.5)
98100
erubi (1.6.1)
101+
erubis (2.7.0)
99102
execjs (2.7.0)
100-
factory_girl (4.8.0)
103+
factory_bot (4.8.2)
101104
activesupport (>= 3.0.0)
102-
factory_girl_rails (4.8.0)
103-
factory_girl (~> 4.8.0)
105+
factory_bot_rails (4.8.2)
106+
factory_bot (~> 4.8.2)
104107
railties (>= 3.0.0)
105108
ffi (1.9.18)
106109
foreman (0.84.0)
@@ -132,14 +135,14 @@ GEM
132135
mime-types (3.1)
133136
mime-types-data (~> 3.2015)
134137
mime-types-data (3.2016.0521)
135-
mini_portile2 (2.2.0)
138+
mini_portile2 (2.3.0)
136139
mini_racer (0.1.9)
137140
libv8 (~> 5.3)
138141
minitest (5.10.3)
139142
multi_json (1.12.1)
140143
nio4r (2.1.0)
141-
nokogiri (1.8.0)
142-
mini_portile2 (~> 2.2.0)
144+
nokogiri (1.8.1)
145+
mini_portile2 (~> 2.3.0)
143146
parser (2.4.0.0)
144147
ast (~> 2.2)
145148
pg (0.20.0)
@@ -166,7 +169,7 @@ GEM
166169
pry-stack_explorer (0.4.9.2)
167170
binding_of_caller (>= 0.7)
168171
pry (>= 0.9.11)
169-
public_suffix (2.0.5)
172+
public_suffix (3.0.1)
170173
puma (3.8.2)
171174
rack (2.0.3)
172175
rack-proxy (0.6.2)
@@ -190,6 +193,14 @@ GEM
190193
nokogiri (>= 1.6)
191194
rails-html-sanitizer (1.0.3)
192195
loofah (~> 2.0)
196+
rails_best_practices (1.19.0)
197+
activesupport
198+
code_analyzer (>= 0.4.8)
199+
erubis
200+
i18n
201+
json
202+
require_all
203+
ruby-progressbar
193204
railties (5.1.3)
194205
actionpack (= 5.1.3)
195206
activesupport (= 5.1.3)
@@ -203,13 +214,14 @@ GEM
203214
rb-inotify (0.9.8)
204215
ffi (>= 0.5.0)
205216
rdoc (4.3.0)
206-
react_on_rails (9.0.0.rc.0)
217+
react_on_rails (9.0.3)
207218
addressable
208219
connection_pool
209220
execjs (~> 2.5)
210221
rails (>= 3.2)
211222
rainbow (~> 2.2)
212223
redis (3.3.3)
224+
require_all (1.4.0)
213225
rspec-core (3.6.0)
214226
rspec-support (~> 3.6.0)
215227
rspec-expectations (3.6.0)
@@ -218,7 +230,7 @@ GEM
218230
rspec-mocks (3.6.0)
219231
diff-lcs (>= 1.2.0, < 2.0)
220232
rspec-support (~> 3.6.0)
221-
rspec-rails (3.6.0)
233+
rspec-rails (3.6.1)
222234
actionpack (>= 3.0)
223235
activesupport (>= 3.0)
224236
railties (>= 3.0)
@@ -258,6 +270,7 @@ GEM
258270
childprocess (~> 0.5)
259271
rubyzip (~> 1.0)
260272
websocket (~> 1.0)
273+
sexp_processor (4.10.0)
261274
simplecov (0.14.1)
262275
docile (~> 1.1.0)
263276
json (>= 1.8, < 3)
@@ -311,14 +324,14 @@ DEPENDENCIES
311324
awesome_print
312325
brakeman
313326
bundler-audit
314-
capybara
327+
capybara (= 2.13.0)
315328
capybara-screenshot
316-
capybara-webkit
329+
capybara-webkit (= 1.14.0)
317330
chromedriver-helper
318331
coffee-rails
319332
coveralls
320333
database_cleaner
321-
factory_girl_rails
334+
factory_bot_rails
322335
foreman
323336
generator_spec
324337
jbuilder
@@ -336,17 +349,18 @@ DEPENDENCIES
336349
puma
337350
rails (~> 5)
338351
rails-html-sanitizer
352+
rails_best_practices
339353
rainbow
340-
react_on_rails (= 9.0.0.rc.0)
341-
redis
342-
rspec-rails (~> 3.6)
354+
react_on_rails (= 9.0.3)
355+
redis (= 3.3.3)
356+
rspec-rails (= 3.6.1)
343357
rspec-retry
344358
rubocop
345359
ruby-lint
346360
sass-rails
347361
scss_lint
348362
sdoc
349-
selenium-webdriver (< 3.0.0)
363+
selenium-webdriver
350364
spring
351365
spring-commands-rspec
352366
uglifier
@@ -357,4 +371,4 @@ RUBY VERSION
357371
ruby 2.4.1p111
358372

359373
BUNDLED WITH
360-
1.15.4
374+
1.16.0

app/controllers/comments_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def update
5252
# DELETE /comments/1
5353
# DELETE /comments/1.json
5454
def destroy
55-
@comment.destroy
55+
@comment.destroy!
5656
respond_to do |format|
5757
format.html { redirect_to comments_url, notice: "Comment was successfully destroyed." }
5858
format.json { head :no_content }

app/views/comments/_form.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<%= form_for(@comment) do |f| %>
2-
<% if @comment.errors.any? %>
1+
<%= form_for(comment) do |f| %>
2+
<% if comment.errors.any? %>
33
<div id="error_explanation">
4-
<h2><%= pluralize(@comment.errors.count, "error") %> prohibited this comment from being saved:</h2>
4+
<h2><%= pluralize(comment.errors.count, "error") %> prohibited this comment from being saved:</h2>
55

66
<ul>
7-
<% @comment.errors.full_messages.each do |message| %>
7+
<% comment.errors.full_messages.each do |message| %>
88
<li><%= message %></li>
99
<% end %>
1010
</ul>

app/views/comments/edit.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<h1>Editing Comment</h1>
22

3-
<%= render 'form' %>
3+
<%= render 'form', comment: @comment %>
44

55
<%= link_to 'Show', @comment %> |
66
<%= link_to 'Back', comments_path %>

app/views/comments/new.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h1>New Comment</h1>
22

3-
<%= render 'form' %>
3+
<%= render 'form', comment: @comment %>
44

55
<%= link_to 'Back', comments_path %>

client/.eslintrc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@ env:
1717

1818
rules:
1919
import/extensions: [2, { js: "never", jsx: "never" }]
20+
function-paren-newline: ["error", "consistent"]
2021

2122
# Good idea, but let's go to flow before fixing all these
2223
react/forbid-prop-types: 0
24+
jsx-a11y/href-no-hash: 0
25+
26+
jsx-a11y/anchor-is-valid: off
2327

2428
# arrow-parens:
2529
# - 0

client/app/bundles/comments/components/CommentBox/CommentBox.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ class CommentBox extends BaseComponent {
9292
<ul>
9393
<li>
9494
{ (data.get('isFetching') && <br />) ||
95-
<a href="javascript:void(0)" onClick={this.refreshComments}>
95+
<button className={css.anchorButton} onClick={this.refreshComments} >
9696
{formatMessage(defaultMessages.descriptionForceRefrech)}
97-
</a>
97+
</button>
9898
}
9999
</li>
100100
<li>{formatMessage(defaultMessages.descriptionSupportMarkdown)}</li>

client/app/bundles/comments/components/CommentBox/CommentBox.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,15 @@
1515
transition: opacity 0.5s ease-in;
1616
}
1717
}
18+
19+
.anchorButton {
20+
background-color: transparent;
21+
border: 0;
22+
color: #337AB7;
23+
cursor: pointer;
24+
padding: 0;
25+
}
26+
27+
.anchorButton:hover {
28+
text-decoration: underline;
29+
}

client/app/bundles/comments/components/CommentBox/CommentForm/CommentForm.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ class CommentForm extends BaseComponent {
283283
}
284284

285285
errorWarning() {
286-
const error = this.props.error;
286+
const { error } = this.props;
287287

288288
// If there is no error, there is nothing to add to the DOM
289289
if (!error) return null;

client/app/bundles/comments/components/CommentBox/CommentList/CommentList.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,11 @@ export default class CommentList extends BaseComponent {
4141
// `key` is a React-specific concept and is not mandatory for the
4242
// purpose of this tutorial. if you're curious, see more here:
4343
// http://facebook.github.io/react/docs/multiple-components.html#dynamic-children
44-
<Comment
44+
(<Comment
4545
key={$$comment.get('id') || index}
4646
author={$$comment.get('author')}
4747
text={$$comment.get('text')}
48-
/>,
49-
);
48+
/>));
5049

5150
// For animation with ReactCSSTransitionGroup
5251
// https://facebook.github.io/react/docs/animation.html

client/app/bundles/comments/components/CommentBox/CommentList/CommentList.spec.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ describe('CommentList', () => {
4747
it('renders an alert if errors', () => {
4848
const component = renderIntoDocument(
4949
<CommentList
50-
$$comments={comments} error="zomg"
50+
$$comments={comments}
51+
error="zomg"
5152
cssTransitionGroupClassNames={cssTransitionGroupClassNames}
5253
/>,
5354
);

client/app/bundles/comments/components/CommentScreen/CommentScreen.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import CommentBox from '../CommentBox/CommentBox';
77
import css from './CommentScreen.scss';
88

99
export default class CommentScreen extends BaseComponent {
10-
1110
static propTypes = {
1211
actions: PropTypes.object.isRequired,
1312
data: PropTypes.object.isRequired,

client/app/bundles/comments/components/NavigationBar/NavigationBar.jsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const NavigationBar = (props) => {
1414

1515
/* eslint-disable new-cap */
1616
return (
17-
<nav className="navbar navbar-default" role="navigation">
17+
<nav className="navbar navbar-default">
1818
<div className="container">
1919
<div className="navbar-header">
2020
<button
@@ -49,17 +49,13 @@ const NavigationBar = (props) => {
4949
href={
5050
'https://github.com/' +
5151
'shakacode/react-webpack-rails-tutorial'
52-
}
52+
}
5353
>
5454
Source
5555
</a>
5656
</li>
5757
<li>
58-
<a
59-
href={
60-
'https://forum.shakacode.com/c/reactjs'
61-
}
62-
>Forum</a>
58+
<a href="https://forum.shakacode.com/c/reactjs">Forum</a>
6359
</li>
6460
{_.isNumber(commentsCount) && CommentsCount({ commentsCount })}
6561
</ul>

client/app/bundles/comments/components/TestReactRouter/TestReactRouter.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ export default class TestReactRouter extends BaseComponent {
1313
</div>
1414
);
1515
}
16-
1716
}

0 commit comments

Comments
 (0)