jets 3.0.11 → 3.0.12

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
  SHA256:
3
- metadata.gz: be3e6d33ee23f0ba16056fe99edc1327bf678762d47203ec74296280b89be993
4
- data.tar.gz: a0a956dee36f4a82aa2a77d7990bcc2a342708de7b3cfd04670921e843b04e7b
3
+ metadata.gz: df619199e09ad52bd8f622f765867bb6560d3818a3b6297d9f82dd9ed7b4a9a4
4
+ data.tar.gz: d66d07f780595a0075caeadd6869a7e26aa85edb3b5af1c4a9680d2958201dd7
5
5
  SHA512:
6
- metadata.gz: ad3cc2834cea313bb75fe8f7b079e626b67962e9a52dc586895e0147c4ec5bba72015c35e9b7a85258cbc2553edfbdfe7e481395b4c5d52032868742720db19a
7
- data.tar.gz: b091b135234c439e7ed5dcf405770cabf9c14590575582ef1f6329a611e6928a9e734d1f99650c6302e7cd24a69e1f3a055c555153814ed902b104ebfbbe4687
6
+ metadata.gz: a77badece003642190f7f7054d690d1c716d3d74a835275ac639dda48fa4f42fd80158e2559ff7ddfea175cb7e53a5bc353071d11448162c9b919a8a61620a76
7
+ data.tar.gz: b2cc100b93f46fc0625146ef6ac6d5579fb814aa764d30440abda2b5f31e9e236e9eff7a3fc5d159fdf1cb4a992a00429fbe42625e14b7b32da4a28b8b2ad6a7
data/CHANGELOG.md CHANGED
@@ -3,6 +3,11 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/).
5
5
 
6
+ ## [3.0.12] - 2021-08-08
7
+ - [#578](https://github.com/boltops-tools/jets/pull/578) Update "jets delete" documentation to be --yes instead of --skip
8
+ - [#580](https://github.com/boltops-tools/jets/pull/580) Use active support instead of actionview
9
+ - [#581](https://github.com/boltops-tools/jets/pull/581) Csrf csrf-param authenticity_token and use @rails/ujs for crud
10
+
6
11
  ## [3.0.11] - 2021-07-15
7
12
  - update serverlessgems gem
8
13
 
@@ -1,4 +1,4 @@
1
- require 'action_view'
1
+ require "active_support/number_helper"
2
2
 
3
3
  # Examples:
4
4
  #
@@ -10,7 +10,7 @@ require 'action_view'
10
10
  #
11
11
  module Jets::Builders
12
12
  class Md5Zip
13
- include ActionView::Helpers::NumberHelper # number_to_human_size
13
+ include ActiveSupport::NumberHelper # number_to_human_size
14
14
  include Util
15
15
 
16
16
  def initialize(folder)
@@ -17,6 +17,6 @@ This deletes the all the contents in the internal s3 bucket that jets uses and t
17
17
  Project demo-dev deleted!
18
18
  $
19
19
 
20
- You can bypass the are you sure prompt with the `--sure` flag.
20
+ You can bypass the are you sure prompt with the `--yes` flag.
21
21
 
22
- $ jets delete --sure
22
+ $ jets delete --yes
@@ -114,7 +114,7 @@ JS
114
114
  after = "const { environment } = require('@rails/webpacker')\n"
115
115
  insert_into_file("config/webpack/environment.js", jquery, after: after)
116
116
 
117
- run("yarn add bootstrap jquery popper.js postcss-cssnext")
117
+ run("yarn add bootstrap jquery popper.js postcss-cssnext @rails/ujs")
118
118
  end
119
119
 
120
120
  def git_init
@@ -18,5 +18,6 @@
18
18
  <% if @bootstrap -%>
19
19
  import 'bootstrap/dist/js/bootstrap';
20
20
  <% end -%>
21
- import '../src/jets/crud'
22
- console.log('Hello World from Webpacker')
21
+
22
+ import Rails from "@rails/ujs"
23
+ Rails.start()
@@ -77,7 +77,10 @@ module Jets::UrlHelper
77
77
 
78
78
  def csrf_meta_tags
79
79
  if protect_against_forgery?
80
- tag("meta", name: "csrf-token", content: masked_authenticity_token).html_safe
80
+ html = tag("meta", name: "csrf-token", content: masked_authenticity_token).html_safe
81
+ html << "\n"
82
+ html << tag("meta", name: "csrf-param", content: "authenticity_token").html_safe
83
+ html
81
84
  end
82
85
  end
83
86
  end # UrlHelper
data/lib/jets/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "3.0.11"
2
+ VERSION = "3.0.12"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jets
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.11
4
+ version: 3.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-15 00:00:00.000000000 Z
11
+ date: 2021-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer
@@ -776,7 +776,6 @@ files:
776
776
  - lib/jets/commands/templates/skeleton/spec/spec_helper.rb.tt
777
777
  - lib/jets/commands/templates/webpacker/app/javascript/packs/application.js.tt
778
778
  - lib/jets/commands/templates/webpacker/app/javascript/packs/theme.scss.tt
779
- - lib/jets/commands/templates/webpacker/app/javascript/src/jets/crud.js
780
779
  - lib/jets/commands/upgrade.rb
781
780
  - lib/jets/commands/upgrade/templates/bin/webpack
782
781
  - lib/jets/commands/upgrade/templates/bin/webpack-dev-server
@@ -1,90 +0,0 @@
1
- // This file is automatically generated by Jets. It is used by
2
- // app/javascript/packs/application.js.
3
- //
4
- // It handles the delete and update action in an unobstrusive way.
5
- // Code could be improved and is meant to provide only a starting point.
6
-
7
- $(function() {
8
- function handleAll(e) {
9
- var target = $(e.target);
10
- if (target.is('a') && target.data("method") == "delete") {
11
- return handleDelete(e);
12
- } else if (target.attr('type') == "submit") {
13
- return handleUpdate(e);
14
- } else {
15
- return true;
16
- }
17
-
18
- e.preventDefault();
19
- }
20
-
21
- function handleDelete(e) {
22
- event.preventDefault();
23
- var link = $(e.target);
24
- var message = link.data("confirm");
25
- if (message) {
26
- var sure = confirm(message);
27
- if (sure) {
28
- deleteItem(link);
29
- } else {
30
- console.log("Deletion cancelled");
31
- }
32
- }
33
- }
34
-
35
- function handleUpdate(e) {
36
- var submit = $(e.target);
37
- var form = submit.closest('form');
38
- var url = form.attr("action");
39
- var method = $("input[name=_method]");
40
-
41
- if (method.attr("value") != "put") {
42
- return true;
43
- }
44
-
45
- e.preventDefault();
46
- var data = $(form).serialize();
47
- $.ajax({
48
- url: url,
49
- type: 'PUT',
50
- data: data,
51
- dataType: "json",
52
- success: function(response) {
53
- window.location.href = response.location;
54
- },
55
- error: function(xhr, textStatus, errorThrown) {
56
- console.log('Error! Status = ' + xhr.status);
57
- },
58
- complete: function(data) {
59
- console.log("data %o", data);
60
- }
61
- });
62
- }
63
-
64
- function deleteItem(link) {
65
- var node = link.closest('.jets-element-to-delete');
66
- node.hide(); // immediately hide element
67
-
68
- var resource = link.attr("href");
69
- var token = $('meta[name=csrf-token]').attr('content');
70
- var data = { authenticity_token: token };
71
- var request = $.ajax({
72
- url: resource,
73
- method: "DELETE",
74
- data: data,
75
- dataType: "json"
76
- });
77
-
78
- request.done(function(msg) {
79
- console.log("msg %o", msg)
80
- node.remove();
81
- });
82
-
83
- request.fail(function(jqXHR, textStatus) {
84
- console.log("textStatus %o", textStatus)
85
- node.show(); // in the event of a failure re-display the node
86
- });
87
- }
88
-
89
- $('body').click(handleAll)
90
- });