openproject-primer_view_components 0.53.0 → 0.53.1

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: 5f312782e514f8c2c795c8391c1a9277a600635907cd9186dd7bed5a6b6542fa
4
- data.tar.gz: 4ef1d554d43cd2b2b08745d09946ca59be58f1b533570afaa68fc71a6652dc68
3
+ metadata.gz: 3a5ebd3e6efce535bd30f0428fd7cdd7771cef126a196dd41ff71519ac80a427
4
+ data.tar.gz: fec7772667aff0aa82f06cc19740eeb121e3228aa3142645e2c86938e58e57f6
5
5
  SHA512:
6
- metadata.gz: fdcea5ccb557949c3b6a12573504752263643166eee41e7d8ba5e49c979272b87f3e7462d1e8aa9197906ccf54b606f5e30a19c22ca0ba1213a870792cf00bc2
7
- data.tar.gz: f6849d0e9fd667bc0f92e713e16ef0cc07c20459f074cf58b945e1471b947e42eccff9bf09bb2ee95aa0b164fdd094fb5ee8e3c98cc213dba0f0a9ead743a2cc
6
+ metadata.gz: cb26f8fa7cf53c73d6560c002e1568b6a217c18e4ad462464ed1f510507c7030b63a2986e84c7a1d8d1c64d952d5166226ae5948839ae418d18a94b7489d331a
7
+ data.tar.gz: ddd1fe830a42b9bfd9fe6918c057d7e90c323e69b68e8233a6555f1732107672d07331358a5519f8d2173e6206e313d37c851bccc12b15b925006f19bf8373c9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.53.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#236](https://github.com/opf/primer_view_components/pull/236) [`de1a205`](https://github.com/opf/primer_view_components/commit/de1a205fc5ddfec39373bf579c2a8b2417ad9ca3) Thanks [@myabc](https://github.com/myabc)! - Fix regression: callers unable to set custom button text
8
+
9
+ - [#237](https://github.com/opf/primer_view_components/pull/237) [`c2c98cf`](https://github.com/opf/primer_view_components/commit/c2c98cfc4bfc6cf62f116016a04015d7404d0a63) Thanks [@myabc](https://github.com/myabc)! - Make DangerDialog title param required: Axe will raise accessibility violations in the absence of a title. We want to ensure best a11y practice, so this change makes it a required param and documents it.
10
+
11
+ This is a BREAKING change.
12
+
13
+ - [#237](https://github.com/opf/primer_view_components/pull/237) [`694bdae`](https://github.com/opf/primer_view_components/commit/694bdae3523774a92632ce7c53c235cdadf29e3f) Thanks [@myabc](https://github.com/myabc)! - Make FeedbackDialog title param required: Axe will raise accessibility violations in the absence of a title. We want to ensure best a11y practice, so this change makes it a required param and documents it.
14
+
15
+ This is a BREAKING change.
16
+
3
17
  ## 0.53.0
4
18
 
5
19
  ### Minor Changes
@@ -63,12 +63,14 @@ module Primer
63
63
 
64
64
  # @param form_arguments [Hash] Allows the dialog to submit a form. Pass EITHER the `builder:` option to this hash to reuse an existing Rails form, or `action:` if you prefer the component to render the form tag itself. `builder:` should be an instance of `ActionView::Helpers::FormBuilder`, which is created by the standard Rails `#form_with` and `#form_for` helpers. The `name:` option is the desired name of the field that will be included in the params sent to the server on form submission.
65
65
  # @param id [String] The id of the dialog.
66
+ # @param title [String] The title of the dialog. Although visually hidden, a label is rendered for assistive technologies.
66
67
  # @param confirm_button_text [String] The text of the confirm button. Will default to `I18n.t("button_delete")`, or `I18n.t("button_delete_permanently")` if `confirmation_check_box` slot has been passed to the component.
67
68
  # @param cancel_button_text [String] The text of the cancel button. Will default to `I18n.t("button_cancel")`.
68
69
  # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
69
70
  def initialize(
70
71
  form_arguments: {},
71
72
  id: self.class.generate_id,
73
+ title:,
72
74
  confirm_button_text: nil,
73
75
  cancel_button_text: nil,
74
76
  **system_arguments
@@ -77,6 +79,9 @@ module Primer
77
79
  @form_wrapper = FormWrapper.new(**form_arguments)
78
80
  @dialog_id = id.to_s
79
81
 
82
+ @confirm_button_text = confirm_button_text
83
+ @cancel_button_text = cancel_button_text
84
+
80
85
  @system_arguments = system_arguments
81
86
  @system_arguments[:id] = @dialog_id
82
87
  @system_arguments[:classes] = class_names(
@@ -84,7 +89,7 @@ module Primer
84
89
  "DangerDialog"
85
90
  )
86
91
 
87
- @dialog = Primer::Alpha::Dialog.new(title: @system_arguments[:title], subtitle: nil, visually_hide_title: true, **@system_arguments)
92
+ @dialog = Primer::Alpha::Dialog.new(title: title, subtitle: nil, visually_hide_title: true, **@system_arguments)
88
93
  end
89
94
 
90
95
  delegate :labelledby, :header?, :header, :with_header, :with_header_content,
@@ -40,8 +40,9 @@ module Primer
40
40
 
41
41
  renders_one :footer
42
42
 
43
+ # @param title [String] The title of the dialog. Although visually hidden, a label is rendered for assistive technologies.
43
44
  # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
44
- def initialize(**system_arguments)
45
+ def initialize(title:, **system_arguments)
45
46
  @system_arguments = system_arguments
46
47
  @system_arguments[:classes] = class_names(
47
48
  system_arguments[:classes],
@@ -49,7 +50,7 @@ module Primer
49
50
  )
50
51
  @system_arguments[:id] ||= self.class.generate_id
51
52
 
52
- @dialog = Primer::Alpha::Dialog.new(title: @system_arguments[:title], subtitle: nil, visually_hide_title: true, **@system_arguments)
53
+ @dialog = Primer::Alpha::Dialog.new(title: title, subtitle: nil, visually_hide_title: true, **@system_arguments)
53
54
  end
54
55
 
55
56
  delegate :header?, :header, :with_header, :with_header_content,
@@ -6,7 +6,7 @@ module Primer
6
6
  module VERSION
7
7
  MAJOR = 0
8
8
  MINOR = 53
9
- PATCH = 0
9
+ PATCH = 1
10
10
 
11
11
  STRING = [MAJOR, MINOR, PATCH].join(".")
12
12
  end
@@ -1,4 +1,5 @@
1
1
  <%= render(Primer::OpenProject::DangerDialog.new(id: "my-dialog",
2
+ title: "My dialog",
2
3
  confirm_button_text: confirm_button_text,
3
4
  cancel_button_text: cancel_button_text)) do |dialog| %>
4
5
  <% dialog.with_show_button { "Click me" } %>
@@ -1,4 +1,4 @@
1
- <%= render(Primer::OpenProject::DangerDialog.new) do |dialog| %>
1
+ <%= render(Primer::OpenProject::DangerDialog.new(title: "Delete work packages")) do |dialog| %>
2
2
  <% dialog.with_show_button { "Click me" } %>
3
3
  <% dialog.with_confirmation_message do |message| %>
4
4
  <% message.with_heading(tag: :h2).with_content("Delete 5 work packages?") %>
@@ -1,4 +1,4 @@
1
- <%= render(Primer::OpenProject::FeedbackDialog.new(id: "my-dialog")) do |dialog| %>
1
+ <%= render(Primer::OpenProject::FeedbackDialog.new(id: "my-dialog", title: "My dialog")) do |dialog| %>
2
2
  <% dialog.with_show_button { "Click me" } %>
3
3
  <% dialog.with_feedback_message(icon_arguments: { icon: icon, color: icon_color }, loading: loading_state) do |message| %>
4
4
  <% message.with_heading(tag: :h2).with_content("Awesome!") %>
@@ -1,4 +1,4 @@
1
- <%= render(Primer::OpenProject::FeedbackDialog.new) do |dialog| %>
1
+ <%= render(Primer::OpenProject::FeedbackDialog.new(title: "Success message")) do |dialog| %>
2
2
  <% dialog.with_show_button { "Click me" } %>
3
3
  <% dialog.with_feedback_message do |message| %>
4
4
  <% message.with_heading(tag: :h2).with_content("Action successful") %>
@@ -1,4 +1,4 @@
1
- <%= render(Primer::OpenProject::FeedbackDialog.new(id: "my-dialog")) do |dialog| %>
1
+ <%= render(Primer::OpenProject::FeedbackDialog.new(id: "my-dialog", title: "Custom footer")) do |dialog| %>
2
2
  <% dialog.with_show_button { "Click me" } %>
3
3
  <% dialog.with_feedback_message do |message| %>
4
4
  <% message.with_heading(tag: :h2).with_content("Action successful") %>
@@ -5131,6 +5131,12 @@
5131
5131
  "default": "`self.class.generate_id`",
5132
5132
  "description": "The id of the dialog."
5133
5133
  },
5134
+ {
5135
+ "name": "title",
5136
+ "type": "String",
5137
+ "default": "N/A",
5138
+ "description": "The title of the dialog. Although visually hidden, a label is rendered for assistive technologies."
5139
+ },
5134
5140
  {
5135
5141
  "name": "confirm_button_text",
5136
5142
  "type": "String",
@@ -5214,6 +5220,12 @@
5214
5220
  "source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/feedback_dialog.rb",
5215
5221
  "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/feedback_dialog/default/",
5216
5222
  "parameters": [
5223
+ {
5224
+ "name": "title",
5225
+ "type": "String",
5226
+ "default": "N/A",
5227
+ "description": "The title of the dialog. Although visually hidden, a label is rendered for assistive technologies."
5228
+ },
5217
5229
  {
5218
5230
  "name": "system_arguments",
5219
5231
  "type": "Hash",
@@ -17532,6 +17532,12 @@
17532
17532
  "default": "`self.class.generate_id`",
17533
17533
  "description": "The id of the dialog."
17534
17534
  },
17535
+ {
17536
+ "name": "title",
17537
+ "type": "String",
17538
+ "default": "N/A",
17539
+ "description": "The title of the dialog. Although visually hidden, a label is rendered for assistive technologies."
17540
+ },
17535
17541
  {
17536
17542
  "name": "confirm_button_text",
17537
17543
  "type": "String",
@@ -17878,6 +17884,12 @@
17878
17884
  "source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/feedback_dialog.rb",
17879
17885
  "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/feedback_dialog/default/",
17880
17886
  "parameters": [
17887
+ {
17888
+ "name": "title",
17889
+ "type": "String",
17890
+ "default": "N/A",
17891
+ "description": "The title of the dialog. Although visually hidden, a label is rendered for assistive technologies."
17892
+ },
17881
17893
  {
17882
17894
  "name": "system_arguments",
17883
17895
  "type": "Hash",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openproject-primer_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.53.0
4
+ version: 0.53.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub Open Source