breezy 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 771f9d31bef6c944ac17451b327c874eeb0d3b84
4
- data.tar.gz: 6d3b19c6baa857e945254e11fc21b9352f78310d
3
+ metadata.gz: 5c554d6df32d5f4ea3094d93864aead03c3a6841
4
+ data.tar.gz: 6cbdf7de0ff0e102ff9ad95d2b668515bf68daf0
5
5
  SHA512:
6
- metadata.gz: 3e64b71d987909c4493fc0d71aba31c7229e149f7dd7d75d56ab49b2b3d87de1be87666ab63ec037fba02fe8292b2d5b700c7a53a1c1a352d4bcd99231058ee2
7
- data.tar.gz: 53cfe54342341a4964ae02dc45c4d440e561a09a3c58dcc329797f1c6f2a2f8e0411e5fe66b49e5c25ad3c71bc3c8ee94de32a7879c4afe3dbe1f60418447c4c
6
+ metadata.gz: a83a6a0113da1138ef09f09713526037147d09fae5cdaaeae99e56faaf20465dbe7b76c530a18b7dec6ce8238717a158b5024e4b88dc4e4227455af6729d3648
7
+ data.tar.gz: bd6609aafc25b4f67745c139ee70f3cabb60e4e30c271324a419f56cee710438fde01b5fe08c9d95c1019aee4ba4e6ab5bfe37459bdbb71fe7ce9f467112888a
@@ -1,10 +1,10 @@
1
+ json.flash flash.to_h
2
+ json.errors @<%= singular_table_name %>.errors.to_h
3
+
1
4
  <%- attributes_list_with_timestamps.each do |attr| -%>
2
5
  json.<%=attr%> @<%= singular_table_name %>.<%=attr%>
3
6
  <%- end -%>
4
7
 
5
- if @<%= singular_table_name %>.errors.any?
6
- json.errors @<%= singular_table_name %>.errors.to_h
7
- end
8
8
 
9
9
  json.attributes_for_form do
10
10
  <%- attributes_list.select{|attr| attr != :id }.each do |attr| -%>
@@ -1,3 +1,5 @@
1
+ json.flash flash.to_h
2
+
1
3
  json.<%= plural_table_name %> do
2
4
  json.array! @<%= plural_table_name %> do |<%= singular_table_name %>|
3
5
  <%- attributes_list_with_timestamps.each do |attr| -%>
@@ -8,8 +10,5 @@ json.<%= plural_table_name %> do
8
10
  end
9
11
  end
10
12
 
11
- if notice
12
- json.notice notice
13
- end
14
13
 
15
14
  json.new_post_path new_<%= singular_table_name %>_path
@@ -1,5 +1,4 @@
1
- if @<%= singular_table_name %>.errors.any?
2
- json.errors @<%= singular_table_name %>.errors.to_h
3
- end
1
+ json.flash flash.to_h
2
+ json.errors @<%= singular_table_name %>.errors.to_h
4
3
 
5
4
  json.<%= plural_table_name %>_path <%= plural_table_name %>_path
@@ -1,10 +1,9 @@
1
+ json.flash flash.to_h
2
+
1
3
  <%- attributes_list_with_timestamps.each do |attr|-%>
2
4
  json.<%=attr%> @<%= singular_table_name %>.<%=attr%>
3
5
  <%- end -%>
4
6
 
5
- if notice
6
- json.notice notice
7
- end
8
7
 
9
8
  json.<%= plural_table_name %>_path <%= plural_table_name %>_path
10
9
  json.edit_<%= singular_table_name %>_path edit_<%= singular_table_name %>_path(@<%= singular_table_name %>)
@@ -24,7 +24,7 @@ class <%= plural_table_name.camelize %>Index extends BaseScreen {
24
24
 
25
25
  return (
26
26
  <div>
27
- <p id="notice">{this.props.notice}</p>
27
+ <p id="notice">{this.props.flash && this.props.flash.notice}</p>
28
28
 
29
29
  <h1><%= plural_table_name.capitalize %></h1>
30
30
 
@@ -7,7 +7,7 @@ class <%= plural_table_name.camelize %>Show extends BaseScreen {
7
7
  render () {
8
8
  return (
9
9
  <div>
10
- <p id="notice">{this.props.notice}</p>
10
+ <p id="notice">{this.props.flash && this.props.flash.notice}</p>
11
11
  <%- attributes_list_with_timestamps.select{|attr| attr != :id }.each do |attr| -%>
12
12
  <p>
13
13
  <strong><%= attr.capitalize %>:</strong>
@@ -5,6 +5,7 @@ import { Provider } from 'react-redux'
5
5
  import { render } from 'react-dom'
6
6
  import createHistory from 'history/createBrowserHistory'
7
7
  import Breezy from '@jho406/breezy'
8
+ import Nav from '@jho406/breezy/dist/NavComponent'
8
9
 
9
10
  // Mapping between your props template to Component
10
11
  // e.g {'posts/new': PostNew}
@@ -17,14 +18,13 @@ const baseUrl = ''
17
18
 
18
19
  //The Nav is pretty bare bones
19
20
  //Feel free to replace the implementation
20
- const {reducer, initialState, Nav, connect} = Breezy.start({
21
+ const {reducer, initialState, initialPageKey, connect} = Breezy.start({
21
22
  window,
22
23
  initialPage,
23
24
  baseUrl,
24
25
  history
25
26
  })
26
27
 
27
-
28
28
  const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
29
29
 
30
30
  const store = createStore(
@@ -40,7 +40,11 @@ connect(store)
40
40
  class App extends React.Component {
41
41
  render() {
42
42
  return <Provider store={store}>
43
- <Nav mapping={this.props.mapping}/>
43
+ <Nav
44
+ mapping={this.props.mapping}
45
+ history={history}
46
+ initialPageKey={initialPageKey}
47
+ />
44
48
  </Provider>
45
49
  }
46
50
  }
data/test/render_test.rb CHANGED
@@ -108,7 +108,7 @@ class RenderTest < ActionController::TestCase
108
108
  rendered = <<~HTML
109
109
  <html>
110
110
  <head>
111
- <script>(function(){var joints={};var cache={};var defers=[];return ({"data":#{content.to_json},"screen":"#{opts[:screen]}","csrf_token":"secret","assets":["/app.js"],"joints":joints,"defers":defers});})();</script>
111
+ <script>(function(){var joints={};var cache={};var defers=[];return ({"data":#{content.to_json},"update_joints":true,"screen":"#{opts[:screen]}","csrf_token":"secret","assets":["/app.js"],"joints":joints,"defers":defers});})();</script>
112
112
  </head>
113
113
  <body></body>
114
114
  </html>
@@ -120,7 +120,7 @@ class RenderTest < ActionController::TestCase
120
120
 
121
121
  def assert_breezy_js(content)
122
122
  assert_response 200
123
- assert_equal '(function(){var joints={};var cache={};var defers=[];return ({"data":' + content.to_json + ',"screen":"render/action","csrf_token":"secret","assets":["/app.js"],"joints":joints,"defers":defers});})()', @response.body
123
+ assert_equal '(function(){var joints={};var cache={};var defers=[];return ({"data":' + content.to_json + ',"update_joints":true,"screen":"render/action","csrf_token":"secret","assets":["/app.js"],"joints":joints,"defers":defers});})()', @response.body
124
124
  assert_equal 'text/javascript', @response.content_type
125
125
  end
126
126
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: breezy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johny Ho
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-12 00:00:00.000000000 Z
11
+ date: 2018-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.7.0
33
+ version: 0.8.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.7.0
40
+ version: 0.8.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: webpacker
43
43
  requirement: !ruby/object:Gem::Requirement