Skip to content

Commit

Permalink
Updated shakacode#416 to shakacode#426, without Heroku breaking changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
reconstructions committed Dec 20, 2017
1 parent 00a1b4c commit ccdca85
Show file tree
Hide file tree
Showing 28 changed files with 140 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ install:
- bundle install
- chromedriver-update
- nvm install stable && nvm alias default stable
- npm install npm@latest -g
- npm install -g npm@5.3.x
- npm install -g yarn
- npm --version
- yarn install
Expand Down
15 changes: 8 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source "https://rubygems.org"
ruby "2.4.1"

gem "react_on_rails", "9.0.0.rc.0"
gem "react_on_rails", "9.0.3"
gem "webpacker"

# Bundle edge Rails instead: gem "rails", github: "rails/rails"
Expand Down Expand Up @@ -29,7 +29,7 @@ gem "coffee-rails"

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem "jbuilder"
gem "redis"
gem "redis", "3.3.3"

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

################################################################################
# Manage application processes
gem "factory_girl_rails"
gem "factory_bot_rails"
gem "foreman"

################################################################################
Expand All @@ -92,16 +92,17 @@ group :development, :test do
end

group :test do
gem "capybara"
gem "capybara", "2.13.0"
gem "capybara-screenshot"
gem "capybara-webkit"
gem "capybara-webkit", "1.14.0"
gem "chromedriver-helper"
gem "coveralls", require: false
gem "database_cleaner"
gem "generator_spec"
gem "launchy"
gem "poltergeist"
gem "rspec-rails", "~> 3.6"
gem "rails_best_practices"
gem "rspec-rails", "3.6.1"
gem "rspec-retry"
gem "selenium-webdriver", "<3.0.0"
gem "selenium-webdriver"
end
58 changes: 36 additions & 22 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ GEM
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.5.1)
public_suffix (~> 2.0, >= 2.0.2)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
archive-zip (0.7.0)
io-like (~> 0.3.0)
arel (8.0.0)
Expand All @@ -56,7 +56,7 @@ GEM
bundler (~> 1.2)
thor (~> 0.18)
byebug (9.0.6)
capybara (2.14.0)
capybara (2.13.0)
addressable
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
Expand All @@ -66,15 +66,17 @@ GEM
capybara-screenshot (1.0.14)
capybara (>= 1.0, < 3)
launchy
capybara-webkit (1.1.0)
capybara (~> 2.0, >= 2.0.2)
capybara-webkit (1.14.0)
capybara (>= 2.3.0, < 2.14.0)
json
childprocess (0.6.3)
ffi (~> 1.0, >= 1.0.11)
chromedriver-helper (1.1.0)
archive-zip (~> 0.7.0)
nokogiri (~> 1.6)
cliver (0.3.2)
code_analyzer (0.4.8)
sexp_processor
coderay (1.1.1)
coffee-rails (4.2.1)
coffee-script (>= 2.2.0)
Expand All @@ -96,11 +98,12 @@ GEM
diff-lcs (1.3)
docile (1.1.5)
erubi (1.6.1)
erubis (2.7.0)
execjs (2.7.0)
factory_girl (4.8.0)
factory_bot (4.8.2)
activesupport (>= 3.0.0)
factory_girl_rails (4.8.0)
factory_girl (~> 4.8.0)
factory_bot_rails (4.8.2)
factory_bot (~> 4.8.2)
railties (>= 3.0.0)
ffi (1.9.18)
foreman (0.84.0)
Expand Down Expand Up @@ -132,14 +135,14 @@ GEM
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.2.0)
mini_portile2 (2.3.0)
mini_racer (0.1.9)
libv8 (~> 5.3)
minitest (5.10.3)
multi_json (1.12.1)
nio4r (2.1.0)
nokogiri (1.8.0)
mini_portile2 (~> 2.2.0)
nokogiri (1.8.1)
mini_portile2 (~> 2.3.0)
parser (2.4.0.0)
ast (~> 2.2)
pg (0.20.0)
Expand All @@ -166,7 +169,7 @@ GEM
pry-stack_explorer (0.4.9.2)
binding_of_caller (>= 0.7)
pry (>= 0.9.11)
public_suffix (2.0.5)
public_suffix (3.0.1)
puma (3.8.2)
rack (2.0.3)
rack-proxy (0.6.2)
Expand All @@ -190,6 +193,14 @@ GEM
nokogiri (>= 1.6)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
rails_best_practices (1.19.0)
activesupport
code_analyzer (>= 0.4.8)
erubis
i18n
json
require_all
ruby-progressbar
railties (5.1.3)
actionpack (= 5.1.3)
activesupport (= 5.1.3)
Expand All @@ -203,13 +214,14 @@ GEM
rb-inotify (0.9.8)
ffi (>= 0.5.0)
rdoc (4.3.0)
react_on_rails (9.0.0.rc.0)
react_on_rails (9.0.3)
addressable
connection_pool
execjs (~> 2.5)
rails (>= 3.2)
rainbow (~> 2.2)
redis (3.3.3)
require_all (1.4.0)
rspec-core (3.6.0)
rspec-support (~> 3.6.0)
rspec-expectations (3.6.0)
Expand All @@ -218,7 +230,7 @@ GEM
rspec-mocks (3.6.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.6.0)
rspec-rails (3.6.0)
rspec-rails (3.6.1)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
Expand Down Expand Up @@ -258,6 +270,7 @@ GEM
childprocess (~> 0.5)
rubyzip (~> 1.0)
websocket (~> 1.0)
sexp_processor (4.10.0)
simplecov (0.14.1)
docile (~> 1.1.0)
json (>= 1.8, < 3)
Expand Down Expand Up @@ -311,14 +324,14 @@ DEPENDENCIES
awesome_print
brakeman
bundler-audit
capybara
capybara (= 2.13.0)
capybara-screenshot
capybara-webkit
capybara-webkit (= 1.14.0)
chromedriver-helper
coffee-rails
coveralls
database_cleaner
factory_girl_rails
factory_bot_rails
foreman
generator_spec
jbuilder
Expand All @@ -336,17 +349,18 @@ DEPENDENCIES
puma
rails (~> 5)
rails-html-sanitizer
rails_best_practices
rainbow
react_on_rails (= 9.0.0.rc.0)
redis
rspec-rails (~> 3.6)
react_on_rails (= 9.0.3)
redis (= 3.3.3)
rspec-rails (= 3.6.1)
rspec-retry
rubocop
ruby-lint
sass-rails
scss_lint
sdoc
selenium-webdriver (< 3.0.0)
selenium-webdriver
spring
spring-commands-rspec
uglifier
Expand All @@ -357,4 +371,4 @@ RUBY VERSION
ruby 2.4.1p111

BUNDLED WITH
1.15.4
1.16.0
2 changes: 1 addition & 1 deletion app/controllers/comments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def update
# DELETE /comments/1
# DELETE /comments/1.json
def destroy
@comment.destroy
@comment.destroy!
respond_to do |format|
format.html { redirect_to comments_url, notice: "Comment was successfully destroyed." }
format.json { head :no_content }
Expand Down
8 changes: 4 additions & 4 deletions app/views/comments/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<%= form_for(@comment) do |f| %>
<% if @comment.errors.any? %>
<%= form_for(comment) do |f| %>
<% if comment.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@comment.errors.count, "error") %> prohibited this comment from being saved:</h2>
<h2><%= pluralize(comment.errors.count, "error") %> prohibited this comment from being saved:</h2>

<ul>
<% @comment.errors.full_messages.each do |message| %>
<% comment.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion app/views/comments/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h1>Editing Comment</h1>

<%= render 'form' %>
<%= render 'form', comment: @comment %>

<%= link_to 'Show', @comment %> |
<%= link_to 'Back', comments_path %>
2 changes: 1 addition & 1 deletion app/views/comments/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1>New Comment</h1>

<%= render 'form' %>
<%= render 'form', comment: @comment %>

<%= link_to 'Back', comments_path %>
4 changes: 4 additions & 0 deletions client/.eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ env:

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

# Good idea, but let's go to flow before fixing all these
react/forbid-prop-types: 0
jsx-a11y/href-no-hash: 0

jsx-a11y/anchor-is-valid: off

# arrow-parens:
# - 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ class CommentBox extends BaseComponent {
<ul>
<li>
{ (data.get('isFetching') && <br />) ||
<a href="javascript:void(0)" onClick={this.refreshComments}>
<button className={css.anchorButton} onClick={this.refreshComments} >
{formatMessage(defaultMessages.descriptionForceRefrech)}
</a>
</button>
}
</li>
<li>{formatMessage(defaultMessages.descriptionSupportMarkdown)}</li>
Expand Down
12 changes: 12 additions & 0 deletions client/app/bundles/comments/components/CommentBox/CommentBox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,15 @@
transition: opacity 0.5s ease-in;
}
}

.anchorButton {
background-color: transparent;
border: 0;
color: #337AB7;
cursor: pointer;
padding: 0;
}

.anchorButton:hover {
text-decoration: underline;
}
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class CommentForm extends BaseComponent {
}

errorWarning() {
const error = this.props.error;
const { error } = this.props;

// If there is no error, there is nothing to add to the DOM
if (!error) return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@ export default class CommentList extends BaseComponent {
// `key` is a React-specific concept and is not mandatory for the
// purpose of this tutorial. if you're curious, see more here:
// http://facebook.github.io/react/docs/multiple-components.html#dynamic-children
<Comment
(<Comment
key={$$comment.get('id') || index}
author={$$comment.get('author')}
text={$$comment.get('text')}
/>,
);
/>));

// For animation with ReactCSSTransitionGroup
// https://facebook.github.io/react/docs/animation.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ describe('CommentList', () => {
it('renders an alert if errors', () => {
const component = renderIntoDocument(
<CommentList
$$comments={comments} error="zomg"
$$comments={comments}
error="zomg"
cssTransitionGroupClassNames={cssTransitionGroupClassNames}
/>,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import CommentBox from '../CommentBox/CommentBox';
import css from './CommentScreen.scss';

export default class CommentScreen extends BaseComponent {

static propTypes = {
actions: PropTypes.object.isRequired,
data: PropTypes.object.isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const NavigationBar = (props) => {

/* eslint-disable new-cap */
return (
<nav className="navbar navbar-default" role="navigation">
<nav className="navbar navbar-default">
<div className="container">
<div className="navbar-header">
<button
Expand Down Expand Up @@ -49,17 +49,13 @@ const NavigationBar = (props) => {
href={
'https://github.com/' +
'shakacode/react-webpack-rails-tutorial'
}
}
>
Source
</a>
</li>
<li>
<a
href={
'https://forum.shakacode.com/c/reactjs'
}
>Forum</a>
<a href="https://forum.shakacode.com/c/reactjs">Forum</a>
</li>
{_.isNumber(commentsCount) && CommentsCount({ commentsCount })}
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ export default class TestReactRouter extends BaseComponent {
</div>
);
}

}
Loading

0 comments on commit ccdca85

Please sign in to comment.