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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df17b4a0aff5baa56ac16602fe85779f7693b00331bff301258f084dbd4c15ef
4
- data.tar.gz: a9ba95edf2300f43c70c72e028282a1045d831f76128cc705c1aaf7ab287e6dc
3
+ metadata.gz: d5cd9e0fb40bc07050d68f122c8f99b2769ebc047de756ba4baba2df7eb5a5fd
4
+ data.tar.gz: 4f9ea83a5bd5dc2b6da7a8a7b50321b185a1368abf820ba2c7abaac9e82468ae
5
5
  SHA512:
6
- metadata.gz: 38706fd22c3881826b066a9dd4d1032395d19ce2fe062b0ea64dca1cb974b4de0944bd7ddfc563277495dbdc35cbb0ca4ae83c264ed884515b09dec74c0f9bac
7
- data.tar.gz: bbab74d5607eb57b2eeff685935cd20421170e2ce99c4eee30bf593e2581b4fc97d9c4c86d1e82698d0c1a2b76fd3a6b2a8156a2d4c30d103afcc344c41327cd
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(class: 'error-list') {
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: ["error-section", "fallback-error-section", "wa-callout", "wa-danger"],
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 :bad_request
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 :bad_request
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 :bad_request
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 :bad_request
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 :bad_request
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 :bad_request
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: :bad_request
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: :bad_request
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(:"practical-framework-error-handling") do
21
+ content_tag(:"application-error-handling") do
22
22
  form_with(**args, &block)
23
23
  end
24
24
  ensure
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Practical
4
- VERSION = "3.0.0-alpha1"
4
+ VERSION = "3.0.0-alpha2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: practical
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.pre.alpha1
4
+ version: 3.0.0.pre.alpha2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Cannon