practical 3.0.0.pre.alpha1 → 3.0.0.pre.alpha2
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/app/components/practical/views/form/error_list_component.rb +1 -1
- data/app/components/practical/views/form/error_list_item_component.rb +2 -2
- data/app/components/practical/views/form/error_list_item_template_component.rb +1 -1
- data/app/components/practical/views/form/fallback_errors_section_component.rb +2 -1
- data/app/lib/practical/test/shared/memberships/controllers/organization/membership.rb +6 -6
- data/app/lib/practical/views/error_response.rb +2 -2
- data/lib/practical/framework/engine.rb +1 -1
- data/lib/practical/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5cd9e0fb40bc07050d68f122c8f99b2769ebc047de756ba4baba2df7eb5a5fd
|
4
|
+
data.tar.gz: 4f9ea83a5bd5dc2b6da7a8a7b50321b185a1368abf820ba2c7abaac9e82468ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 790f33b8ef5decf8588d588f798f2e9ac65cb8b776eb0ca108a124e361bed765ba8230d8637918a3e904db2c497237064421028993b876081130efab9482f3d3
|
7
|
+
data.tar.gz: 0f07a49cd479ce6ff63d3627b1111e0908536e3b81807aec6daae24b913b342ab54d285b3c33e591d08071737a1da6007ced40112f21f62444efab9089aa4cc9
|
@@ -8,7 +8,7 @@ class Practical::Views::Form::ErrorListComponent < Practical::Views::BaseCompone
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def call
|
11
|
-
tag.ul(
|
11
|
+
tag.ul(data: {'data-pf-error-container': true}) {
|
12
12
|
safe_join(errors.map{|error| render Practical::Views::Form::ErrorListItemComponent.new(error: error) })
|
13
13
|
}
|
14
14
|
end
|
@@ -12,9 +12,9 @@ class Practical::Views::Form::ErrorListItemComponent < Practical::Views::BaseCom
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def call
|
15
|
-
tag.li(class: 'wa-flank', data: {"error-type": error.type}) {
|
15
|
+
tag.li(class: 'wa-flank', data: {"pf-error-type": error.type, "pf-error-visible": true}) {
|
16
16
|
render(icon_set.error_list_icon) +
|
17
|
-
tag.span(error.message)
|
17
|
+
tag.span(error.message, data: { "pf-error-message": true })
|
18
18
|
}
|
19
19
|
end
|
20
20
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
class Practical::Views::Form::ErrorListItemTemplateComponent < Practical::Views::BaseComponent
|
4
4
|
def call
|
5
|
-
tag.template(id: 'error-list-item-template') {
|
5
|
+
tag.template(id: 'pf-error-list-item-template') {
|
6
6
|
render Practical::Views::Form::ErrorListItemComponent.new(error: ActiveModel::Error.new(nil, nil, nil))
|
7
7
|
}
|
8
8
|
end
|
@@ -11,7 +11,8 @@ class Practical::Views::Form::FallbackErrorsSectionComponent < Practical::Views:
|
|
11
11
|
|
12
12
|
def finalized_options
|
13
13
|
mix({
|
14
|
-
class: ["
|
14
|
+
class: ["wa-callout", "wa-danger"],
|
15
|
+
data: {"pf-error-container": true, "pf-fallback-error-section": true},
|
15
16
|
id: id
|
16
17
|
}, @options)
|
17
18
|
end
|
@@ -160,7 +160,7 @@ module Practical::Test::Shared::Memberships::Controllers::Organization::Membersh
|
|
160
160
|
end
|
161
161
|
end
|
162
162
|
|
163
|
-
assert_response :
|
163
|
+
assert_response :unprocessable_entity
|
164
164
|
|
165
165
|
assert_error_json_contains(
|
166
166
|
container_id: "organization_new_membership_invitation_form_base_errors",
|
@@ -192,7 +192,7 @@ module Practical::Test::Shared::Memberships::Controllers::Organization::Membersh
|
|
192
192
|
end
|
193
193
|
end
|
194
194
|
|
195
|
-
assert_response :
|
195
|
+
assert_response :unprocessable_entity
|
196
196
|
|
197
197
|
assert_error_json_contains(
|
198
198
|
container_id: "organization_new_membership_invitation_form_base_errors",
|
@@ -224,7 +224,7 @@ module Practical::Test::Shared::Memberships::Controllers::Organization::Membersh
|
|
224
224
|
end
|
225
225
|
end
|
226
226
|
|
227
|
-
assert_response :
|
227
|
+
assert_response :unprocessable_entity
|
228
228
|
|
229
229
|
assert_error_json_contains(
|
230
230
|
container_id: "organization_new_membership_invitation_form_base_errors",
|
@@ -252,7 +252,7 @@ module Practical::Test::Shared::Memberships::Controllers::Organization::Membersh
|
|
252
252
|
post organization_memberships_url(organization), params: params, as: :json
|
253
253
|
end
|
254
254
|
end
|
255
|
-
assert_response :
|
255
|
+
assert_response :unprocessable_entity
|
256
256
|
|
257
257
|
assert_error_json_contains(
|
258
258
|
container_id: "organization_new_membership_invitation_form_email_errors",
|
@@ -280,7 +280,7 @@ module Practical::Test::Shared::Memberships::Controllers::Organization::Membersh
|
|
280
280
|
post organization_memberships_url(organization), params: params
|
281
281
|
end
|
282
282
|
end
|
283
|
-
assert_response :
|
283
|
+
assert_response :unprocessable_entity
|
284
284
|
|
285
285
|
assert_error_dom(
|
286
286
|
container_id: "organization_new_membership_invitation_form_email_errors",
|
@@ -387,7 +387,7 @@ module Practical::Test::Shared::Memberships::Controllers::Organization::Membersh
|
|
387
387
|
}}
|
388
388
|
end
|
389
389
|
|
390
|
-
assert_response :
|
390
|
+
assert_response :unprocessable_entity
|
391
391
|
|
392
392
|
assert_error_dom(
|
393
393
|
container_id: "generic_errors_organization_membership_form",
|
@@ -7,14 +7,14 @@ module Practical::Views::ErrorResponse
|
|
7
7
|
format.json do
|
8
8
|
errors = Practical::Views::ErrorHandling.build_error_json(model: model, helpers: helpers)
|
9
9
|
yield(errors) if block_given?
|
10
|
-
render json: errors, status: :
|
10
|
+
render json: errors, status: :unprocessable_entity
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
14
|
def render_html_error(action:, format:)
|
15
15
|
format.html do
|
16
16
|
yield if block_given?
|
17
|
-
render action, status: :
|
17
|
+
render action, status: :unprocessable_entity
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -18,7 +18,7 @@ module Practical
|
|
18
18
|
def practical_form_with(**args, &block)
|
19
19
|
original_field_error_proc = ::ActionView::Base.field_error_proc
|
20
20
|
::ActionView::Base.field_error_proc = ->(html_tag, instance) { html_tag }
|
21
|
-
content_tag(:"
|
21
|
+
content_tag(:"application-error-handling") do
|
22
22
|
form_with(**args, &block)
|
23
23
|
end
|
24
24
|
ensure
|
data/lib/practical/version.rb
CHANGED