plutonium 0.33.0 → 0.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/plutonium/resource/controllers/crud_actions.rb +21 -18
- data/lib/plutonium/resource/controllers/interactive_actions.rb +21 -25
- data/lib/plutonium/version.rb +1 -1
- data/package.json +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '09404b41e07186fad2cd1b8cac7d13dcf24365020bd421fbe1f2991a9368ac73'
|
|
4
|
+
data.tar.gz: dfc8ca35be7e90674dd76b0a2bef5f3815adb01c36dd0bc287fe29707710f576
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5732daa2516ac0120f244649d78a62a5824dc7ec976783cfc0b806b27a424372021935b099602f36348dd72a0825c994e579dbbccaae08f4e8241861bee3816c
|
|
7
|
+
data.tar.gz: 95a474cc9f548b10c929ce170de2fc9e39886fe5f579620aa5748a2d62927c663ba270689d87345b9c75df1dd43f440ceebc61b0f840bd1d1e80d4fdb27083bb
|
data/CHANGELOG.md
CHANGED
|
@@ -16,7 +16,10 @@ module Plutonium
|
|
|
16
16
|
|
|
17
17
|
setup_index_action!
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
respond_to do |format|
|
|
20
|
+
format.any(:html, :turbo_stream) { render :index, formats: [:html] }
|
|
21
|
+
format.any { render :index }
|
|
22
|
+
end
|
|
20
23
|
end
|
|
21
24
|
|
|
22
25
|
# GET /resources/1(.{format})
|
|
@@ -24,7 +27,10 @@ module Plutonium
|
|
|
24
27
|
authorize_current! resource_record!
|
|
25
28
|
set_page_title resource_record!.to_label.titleize
|
|
26
29
|
|
|
27
|
-
|
|
30
|
+
respond_to do |format|
|
|
31
|
+
format.any(:html, :turbo_stream) { render :show, formats: [:html] }
|
|
32
|
+
format.any { render :show }
|
|
33
|
+
end
|
|
28
34
|
end
|
|
29
35
|
|
|
30
36
|
# GET /resources/new
|
|
@@ -35,7 +41,7 @@ module Plutonium
|
|
|
35
41
|
@resource_record = resource_class.new
|
|
36
42
|
maybe_apply_submitted_resource_params!
|
|
37
43
|
|
|
38
|
-
render :new
|
|
44
|
+
render :new, formats: [:html]
|
|
39
45
|
end
|
|
40
46
|
|
|
41
47
|
# POST /resources(.{format})
|
|
@@ -47,9 +53,9 @@ module Plutonium
|
|
|
47
53
|
|
|
48
54
|
respond_to do |format|
|
|
49
55
|
if params[:pre_submit]
|
|
50
|
-
format.html { render :new, status: :unprocessable_content }
|
|
56
|
+
format.any(:html, :turbo_stream) { render :new, formats: [:html], status: :unprocessable_content }
|
|
51
57
|
elsif resource_record!.save
|
|
52
|
-
format.html do
|
|
58
|
+
format.any(:html, :turbo_stream) do
|
|
53
59
|
redirect_to redirect_url_after_submit,
|
|
54
60
|
notice: "#{resource_class.model_name.human} was successfully created."
|
|
55
61
|
end
|
|
@@ -60,7 +66,7 @@ module Plutonium
|
|
|
60
66
|
location: redirect_url_after_submit
|
|
61
67
|
end
|
|
62
68
|
else
|
|
63
|
-
format.html { render :new, status: :unprocessable_content }
|
|
69
|
+
format.any(:html, :turbo_stream) { render :new, formats: [:html], status: :unprocessable_content }
|
|
64
70
|
format.any do
|
|
65
71
|
@errors = resource_record!.errors
|
|
66
72
|
render "errors", status: :unprocessable_content
|
|
@@ -76,7 +82,7 @@ module Plutonium
|
|
|
76
82
|
|
|
77
83
|
maybe_apply_submitted_resource_params!
|
|
78
84
|
|
|
79
|
-
render :edit
|
|
85
|
+
render :edit, formats: [:html]
|
|
80
86
|
end
|
|
81
87
|
|
|
82
88
|
# PATCH/PUT /resources/1(.{format})
|
|
@@ -88,19 +94,18 @@ module Plutonium
|
|
|
88
94
|
|
|
89
95
|
respond_to do |format|
|
|
90
96
|
if params[:pre_submit]
|
|
91
|
-
format.html { render :edit, status: :unprocessable_content }
|
|
97
|
+
format.any(:html, :turbo_stream) { render :edit, formats: [:html], status: :unprocessable_content }
|
|
92
98
|
elsif resource_record!.save
|
|
93
|
-
format.html do
|
|
99
|
+
format.any(:html, :turbo_stream) do
|
|
94
100
|
redirect_to redirect_url_after_submit,
|
|
95
|
-
notice:
|
|
96
|
-
"#{resource_class.model_name.human} was successfully updated.",
|
|
101
|
+
notice: "#{resource_class.model_name.human} was successfully updated.",
|
|
97
102
|
status: :see_other
|
|
98
103
|
end
|
|
99
104
|
format.any do
|
|
100
105
|
render :show, status: :ok, location: redirect_url_after_submit
|
|
101
106
|
end
|
|
102
107
|
else
|
|
103
|
-
format.html { render :edit, status: :unprocessable_content }
|
|
108
|
+
format.any(:html, :turbo_stream) { render :edit, formats: [:html], status: :unprocessable_content }
|
|
104
109
|
format.any do
|
|
105
110
|
@errors = resource_record!.errors
|
|
106
111
|
render "errors", status: :unprocessable_content
|
|
@@ -116,17 +121,15 @@ module Plutonium
|
|
|
116
121
|
respond_to do |format|
|
|
117
122
|
resource_record!.destroy
|
|
118
123
|
|
|
119
|
-
format.html do
|
|
124
|
+
format.any(:html, :turbo_stream) do
|
|
120
125
|
redirect_to redirect_url_after_destroy,
|
|
121
|
-
notice:
|
|
122
|
-
"#{resource_class.model_name.human} was successfully deleted."
|
|
126
|
+
notice: "#{resource_class.model_name.human} was successfully deleted."
|
|
123
127
|
end
|
|
124
128
|
format.json { head :no_content }
|
|
125
129
|
rescue ActiveRecord::InvalidForeignKey
|
|
126
|
-
format.html do
|
|
130
|
+
format.any(:html, :turbo_stream) do
|
|
127
131
|
redirect_to resource_url_for(resource_record!),
|
|
128
|
-
alert:
|
|
129
|
-
"#{resource_class.model_name.human} is referenced by other records."
|
|
132
|
+
alert: "#{resource_class.model_name.human} is referenced by other records."
|
|
130
133
|
end
|
|
131
134
|
format.any do
|
|
132
135
|
@errors = ActiveModel::Errors.new resource_record!
|
|
@@ -28,9 +28,9 @@ module Plutonium
|
|
|
28
28
|
build_interactive_record_action_interaction
|
|
29
29
|
|
|
30
30
|
if helpers.current_turbo_frame == "remote_modal"
|
|
31
|
-
render layout: false
|
|
31
|
+
render layout: false, formats: [:html]
|
|
32
32
|
else
|
|
33
|
-
render :interactive_record_action
|
|
33
|
+
render :interactive_record_action, formats: [:html]
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
36
|
|
|
@@ -39,11 +39,7 @@ module Plutonium
|
|
|
39
39
|
build_interactive_record_action_interaction
|
|
40
40
|
|
|
41
41
|
if params[:pre_submit]
|
|
42
|
-
|
|
43
|
-
format.html do
|
|
44
|
-
render :interactive_record_action, status: :unprocessable_content
|
|
45
|
-
end
|
|
46
|
-
end
|
|
42
|
+
render :interactive_record_action, formats: [:html], status: :unprocessable_content
|
|
47
43
|
return
|
|
48
44
|
end
|
|
49
45
|
|
|
@@ -54,8 +50,6 @@ module Plutonium
|
|
|
54
50
|
if outcome.success?
|
|
55
51
|
return_url = redirect_url_after_action_on(resource_record!)
|
|
56
52
|
|
|
57
|
-
format.any { redirect_to return_url, status: :see_other }
|
|
58
|
-
|
|
59
53
|
if helpers.current_turbo_frame == "remote_modal"
|
|
60
54
|
format.turbo_stream do
|
|
61
55
|
render turbo_stream: [
|
|
@@ -63,16 +57,16 @@ module Plutonium
|
|
|
63
57
|
]
|
|
64
58
|
end
|
|
65
59
|
end
|
|
60
|
+
|
|
61
|
+
format.any { redirect_to return_url, status: :see_other }
|
|
66
62
|
else
|
|
67
|
-
format.html do
|
|
68
|
-
render :interactive_record_action, status: :unprocessable_content
|
|
63
|
+
format.any(:html, :turbo_stream) do
|
|
64
|
+
render :interactive_record_action, formats: [:html], status: :unprocessable_content
|
|
69
65
|
end
|
|
70
|
-
|
|
71
66
|
format.any do
|
|
72
67
|
@errors = @interaction.errors
|
|
73
68
|
render "errors", status: :unprocessable_content
|
|
74
69
|
end
|
|
75
|
-
|
|
76
70
|
end
|
|
77
71
|
end
|
|
78
72
|
end
|
|
@@ -83,10 +77,14 @@ module Plutonium
|
|
|
83
77
|
skip_verify_current_authorized_scope!
|
|
84
78
|
build_interactive_resource_action_interaction
|
|
85
79
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
80
|
+
respond_to do |format|
|
|
81
|
+
format.any(:html, :turbo_stream) do
|
|
82
|
+
if helpers.current_turbo_frame == "remote_modal"
|
|
83
|
+
render layout: false, formats: [:html]
|
|
84
|
+
else
|
|
85
|
+
render :interactive_resource_action, formats: [:html]
|
|
86
|
+
end
|
|
87
|
+
end
|
|
90
88
|
end
|
|
91
89
|
end
|
|
92
90
|
|
|
@@ -97,8 +95,8 @@ module Plutonium
|
|
|
97
95
|
|
|
98
96
|
if params[:pre_submit]
|
|
99
97
|
respond_to do |format|
|
|
100
|
-
format.html do
|
|
101
|
-
render :interactive_resource_action, status: :unprocessable_content
|
|
98
|
+
format.any(:html, :turbo_stream) do
|
|
99
|
+
render :interactive_resource_action, formats: [:html], status: :unprocessable_content
|
|
102
100
|
end
|
|
103
101
|
end
|
|
104
102
|
return
|
|
@@ -111,8 +109,6 @@ module Plutonium
|
|
|
111
109
|
if outcome.success?
|
|
112
110
|
return_url = redirect_url_after_action_on(resource_class)
|
|
113
111
|
|
|
114
|
-
format.any { redirect_to return_url, status: :see_other }
|
|
115
|
-
|
|
116
112
|
if helpers.current_turbo_frame == "remote_modal"
|
|
117
113
|
format.turbo_stream do
|
|
118
114
|
render turbo_stream: [
|
|
@@ -120,16 +116,16 @@ module Plutonium
|
|
|
120
116
|
]
|
|
121
117
|
end
|
|
122
118
|
end
|
|
119
|
+
|
|
120
|
+
format.any { redirect_to return_url, status: :see_other }
|
|
123
121
|
else
|
|
124
|
-
format.html do
|
|
125
|
-
render :interactive_resource_action, status: :unprocessable_content
|
|
122
|
+
format.any(:html, :turbo_stream) do
|
|
123
|
+
render :interactive_resource_action, formats: [:html], status: :unprocessable_content
|
|
126
124
|
end
|
|
127
|
-
|
|
128
125
|
format.any do
|
|
129
126
|
@errors = @interaction.errors
|
|
130
127
|
render "errors", status: :unprocessable_content
|
|
131
128
|
end
|
|
132
|
-
|
|
133
129
|
end
|
|
134
130
|
end
|
|
135
131
|
end
|
data/lib/plutonium/version.rb
CHANGED
data/package.json
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: plutonium
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.33.
|
|
4
|
+
version: 0.33.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stefan Froelich
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-01-
|
|
11
|
+
date: 2026-01-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: zeitwerk
|