Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Replace deprecated Primer::ButtonComponent with Primer::Beta::Button

Henriette Dargef5890999f54b
diff --git a/app/components/add_button_component.html.erb b/app/components/add_button_component.html.erb
index 88aec27eada..b4903d3eb93 100644
--- a/app/components/add_button_component.html.erb
+++ b/app/components/add_button_component.html.erb
@@ -1,5 +1,5 @@
<%= render(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
scheme: :primary,
aria: { label: aria_label },
title:,
diff --git a/app/components/admin/custom_fields/custom_field_projects/new_custom_field_projects_form_modal_component.html.erb b/app/components/admin/custom_fields/custom_field_projects/new_custom_field_projects_form_modal_component.html.erb
index f23190f45cd..2b78a95d1af 100644
--- a/app/components/admin/custom_fields/custom_field_projects/new_custom_field_projects_form_modal_component.html.erb
+++ b/app/components/admin/custom_fields/custom_field_projects/new_custom_field_projects_form_modal_component.html.erb
@@ -48,8 +48,8 @@ See COPYRIGHT and LICENSE files for more details.
concat(
render(Primer::Alpha::Dialog::Footer.new(show_divider: false)) do
- concat(render(Primer::ButtonComponent.new(data: { "close-dialog-id": dialog_id })) { cancel_button_text })
- concat(render(Primer::ButtonComponent.new(scheme: :primary, type: :submit)) { submit_button_text })
+ concat(render(Primer::Beta::Button.new(data: { "close-dialog-id": dialog_id })) { cancel_button_text })
+ concat(render(Primer::Beta::Button.new(scheme: :primary, type: :submit)) { submit_button_text })
end
)
end
diff --git a/app/components/my/access_token/new_access_token_form_component.html.erb b/app/components/my/access_token/new_access_token_form_component.html.erb
index 2079647d98d..06ad515f16b 100644
--- a/app/components/my/access_token/new_access_token_form_component.html.erb
+++ b/app/components/my/access_token/new_access_token_form_component.html.erb
@@ -62,11 +62,11 @@ See COPYRIGHT and LICENSE files for more details.
collection.with_component(Primer::Alpha::Dialog::Footer.new) do
component_collection do |footer|
- footer.with_component(Primer::ButtonComponent.new(data: { "close-dialog-id": "new-access-token-dialog" })) do
+ footer.with_component(Primer::Beta::Button.new(data: { "close-dialog-id": "new-access-token-dialog" })) do
I18n.t("button_cancel")
end
- footer.with_component(Primer::ButtonComponent.new(scheme: :primary, type: :submit, test_selector: "create-api-token-button")) do
+ footer.with_component(Primer::Beta::Button.new(scheme: :primary, type: :submit, test_selector: "create-api-token-button")) do
I18n.t("my.access_token.new_access_token_dialog_submit_button_text")
end
end
diff --git a/app/components/projects/configure_view_modal_component.html.erb b/app/components/projects/configure_view_modal_component.html.erb
index 05c7ac98765..7cb21a99360 100644
--- a/app/components/projects/configure_view_modal_component.html.erb
+++ b/app/components/projects/configure_view_modal_component.html.erb
@@ -50,9 +50,9 @@
<% end %>
<% end %>
<%= render(Primer::Alpha::Dialog::Footer.new) do %>
- <%= render(Primer::ButtonComponent.new(data: { "close-dialog-id": MODAL_ID })) { I18n.t(:button_cancel) } %>
+ <%= render(Primer::Beta::Button.new(data: { "close-dialog-id": MODAL_ID })) { I18n.t(:button_cancel) } %>
<%= render(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
scheme: :primary,
type: :submit,
data: { "test-selector": "#{MODAL_ID}-submit" },
diff --git a/app/components/settings/project_custom_field_sections/dialog_body_form_component.html.erb b/app/components/settings/project_custom_field_sections/dialog_body_form_component.html.erb
index 084fbf2ddff..6acb53d204a 100644
--- a/app/components/settings/project_custom_field_sections/dialog_body_form_component.html.erb
+++ b/app/components/settings/project_custom_field_sections/dialog_body_form_component.html.erb
@@ -12,11 +12,11 @@
collection.with_component(Primer::Alpha::Dialog::Footer.new) do
component_collection do |modal_footer|
- modal_footer.with_component(Primer::ButtonComponent.new(data: { "close-dialog-id": "project-custom-field-section-dialog#{@project_custom_field_section.id}" })) do
+ modal_footer.with_component(Primer::Beta::Button.new(data: { "close-dialog-id": "project-custom-field-section-dialog#{@project_custom_field_section.id}" })) do
t("button_cancel")
end
- modal_footer.with_component(Primer::ButtonComponent.new(scheme: :primary, type: :submit)) do
+ modal_footer.with_component(Primer::Beta::Button.new(scheme: :primary, type: :submit)) do
t("button_save")
end
end
diff --git a/app/components/work_package_relations_tab/add_work_package_child_dialog_component.html.erb b/app/components/work_package_relations_tab/add_work_package_child_dialog_component.html.erb
index 4522ef9f5fc..50d11aaecdc 100644
--- a/app/components/work_package_relations_tab/add_work_package_child_dialog_component.html.erb
+++ b/app/components/work_package_relations_tab/add_work_package_child_dialog_component.html.erb
@@ -17,7 +17,7 @@
d.with_footer do
component_collection do |buttons|
buttons.with_component(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
data: {
"close-dialog-id": DIALOG_ID
}
@@ -26,7 +26,7 @@
t("button_cancel")
end
buttons.with_component(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
scheme: :primary,
form: FORM_ID,
data: { turbo: true },
diff --git a/app/components/work_package_relations_tab/work_package_relation_dialog_component.html.erb b/app/components/work_package_relations_tab/work_package_relation_dialog_component.html.erb
index 34b0f36f814..e36a5106b07 100644
--- a/app/components/work_package_relations_tab/work_package_relation_dialog_component.html.erb
+++ b/app/components/work_package_relations_tab/work_package_relation_dialog_component.html.erb
@@ -18,14 +18,14 @@
d.with_footer do
component_collection do |buttons|
buttons.with_component(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
data: { "close-dialog-id": DIALOG_ID }
)
) do
t(:button_cancel)
end
buttons.with_component(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
scheme: :primary,
form: FORM_ID,
data: { turbo: true },
diff --git a/app/components/work_packages/date_picker/date_form_component.html.erb b/app/components/work_packages/date_picker/date_form_component.html.erb
index 5eaa34764b2..e47c67aa808 100644
--- a/app/components/work_packages/date_picker/date_form_component.html.erb
+++ b/app/components/work_packages/date_picker/date_form_component.html.erb
@@ -4,7 +4,7 @@
flex_layout do |start_date|
start_date.with_row(classes: container_classes(:start_date)) do
render(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
tag: :a,
href: single_date_field_button_link("start_date"),
data: { turbo_frame: "wp-datepicker-dialog--content", morph: true },
@@ -31,7 +31,7 @@
flex_layout do |due_date|
due_date.with_row(classes: container_classes(:due_date), data: { skip_morphing: true }) do
render(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
tag: :a,
href: single_date_field_button_link("due_date"),
data: { turbo_frame: "wp-datepicker-dialog--content", morph: true },
diff --git a/app/components/work_packages/date_picker/dialog_content_component.html.erb b/app/components/work_packages/date_picker/dialog_content_component.html.erb
index 52138d01df6..43bbbfb747d 100644
--- a/app/components/work_packages/date_picker/dialog_content_component.html.erb
+++ b/app/components/work_packages/date_picker/dialog_content_component.html.erb
@@ -76,7 +76,7 @@
collection.with_component(Primer::Alpha::Dialog::Footer.new) do
component_collection do |footer|
footer.with_component(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
data: { action: "work-packages--date-picker--preview#cancel" },
test_selector: "op-datepicker-modal--action"
)
@@ -85,7 +85,7 @@
end
footer.with_component(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
scheme: :primary,
type: :submit,
form: DIALOG_FORM_ID,
diff --git a/app/components/work_packages/dialogs/create_dialog_component.html.erb b/app/components/work_packages/dialogs/create_dialog_component.html.erb
index b4643d2d510..d23259f7409 100644
--- a/app/components/work_packages/dialogs/create_dialog_component.html.erb
+++ b/app/components/work_packages/dialogs/create_dialog_component.html.erb
@@ -1,12 +1,14 @@
<%=
- render(Primer::Alpha::Dialog.new(
- id: "create-work-package-dialog",
- title: I18n.t(:label_work_package_new),
- size: :xlarge,
- data: {
- 'keep-open-on-submit': true,
- }
- )) do |dialog|
+ render(
+ Primer::Alpha::Dialog.new(
+ id: "create-work-package-dialog",
+ title: I18n.t(:label_work_package_new),
+ size: :xlarge,
+ data: {
+ "keep-open-on-submit": true
+ }
+ )
+ ) do |dialog|
dialog.with_header(variant: :large)
dialog.with_body do
render(WorkPackages::Dialogs::CreateFormComponent.new(work_package:, project:))
@@ -15,18 +17,20 @@
dialog.with_footer do
component_collection do |modal_footer|
modal_footer.with_component(
- Primer::ButtonComponent.new(
- data: { 'close-dialog-id': "create-work-package-dialog" }
- )) do
+ Primer::Beta::Button.new(
+ data: { "close-dialog-id": "create-work-package-dialog" }
+ )
+ ) do
I18n.t(:button_cancel)
end
modal_footer.with_component(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
scheme: :primary,
form: "create-work-package-form",
type: :submit
- )) do
+ )
+ ) do
if @work_package.persisted?
I18n.t(:button_save)
else
diff --git a/app/components/work_packages/exports/generate/modal_dialog_component.html.erb b/app/components/work_packages/exports/generate/modal_dialog_component.html.erb
index 746f9f13084..25757428b8a 100644
--- a/app/components/work_packages/exports/generate/modal_dialog_component.html.erb
+++ b/app/components/work_packages/exports/generate/modal_dialog_component.html.erb
@@ -130,9 +130,9 @@
end %>
<% end %>
<% dialog.with_footer do %>
- <%= render(Primer::ButtonComponent.new(data: { "close-dialog-id": MODAL_ID })) { I18n.t(:button_cancel) } %>
+ <%= render(Primer::Beta::Button.new(data: { "close-dialog-id": MODAL_ID })) { I18n.t(:button_cancel) } %>
<%= render(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
scheme: :primary,
type: :submit,
form: GENERATE_PDF_FORM_ID,
diff --git a/app/components/work_packages/exports/modal_dialog_component.html.erb b/app/components/work_packages/exports/modal_dialog_component.html.erb
index e4ad7a825e1..6c95eec0deb 100644
--- a/app/components/work_packages/exports/modal_dialog_component.html.erb
+++ b/app/components/work_packages/exports/modal_dialog_component.html.erb
@@ -69,9 +69,9 @@
) %>
<% end %>
<% end %>
- <%= render(Primer::ButtonComponent.new(data: { "close-dialog-id": MODAL_ID })) { I18n.t(:button_cancel) } %>
+ <%= render(Primer::Beta::Button.new(data: { "close-dialog-id": MODAL_ID })) { I18n.t(:button_cancel) } %>
<%= render(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
data: {
"work-packages--export--dialog-target": "submit"
},
diff --git a/modules/costs/app/components/time_entries/entry_dialog_component.html.erb b/modules/costs/app/components/time_entries/entry_dialog_component.html.erb
index 836bbdb7192..6dbcc8c26b9 100644
--- a/modules/costs/app/components/time_entries/entry_dialog_component.html.erb
+++ b/modules/costs/app/components/time_entries/entry_dialog_component.html.erb
@@ -15,7 +15,7 @@
<% if time_entry.persisted? %>
<% flex.with_column do %>
<%= render(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
scheme: :danger,
test_selector: "destroy-time-entry-button",
data: {
@@ -32,10 +32,10 @@
<% flex.with_column(classes: "time-entry-button-push") %>
<% flex.with_column do %>
<%= render(
- Primer::ButtonComponent.new(data: { "close-dialog-id": "time-entry-dialog" })
+ Primer::Beta::Button.new(data: { "close-dialog-id": "time-entry-dialog" })
) { I18n.t("button_cancel") } %>
<%= render(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
scheme: :primary,
type: :submit,
test_selector: "create-time-entry-button",
diff --git a/modules/meeting/app/components/meetings/index/dialog_component.html.erb b/modules/meeting/app/components/meetings/index/dialog_component.html.erb
index 6513667bd61..703820c53c2 100644
--- a/modules/meeting/app/components/meetings/index/dialog_component.html.erb
+++ b/modules/meeting/app/components/meetings/index/dialog_component.html.erb
@@ -21,7 +21,7 @@
dialog.with_footer do
component_collection do |modal_footer|
modal_footer.with_component(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
data: { "close-dialog-id": "new-meeting-dialog" }
)
) do
@@ -29,7 +29,7 @@
end
modal_footer.with_component(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
scheme: :primary,
form: "meeting-form",
type: :submit
diff --git a/modules/meeting/app/components/meetings/side_panel/details_form_component.html.erb b/modules/meeting/app/components/meetings/side_panel/details_form_component.html.erb
index 567773ead27..12cc5313487 100644
--- a/modules/meeting/app/components/meetings/side_panel/details_form_component.html.erb
+++ b/modules/meeting/app/components/meetings/side_panel/details_form_component.html.erb
@@ -33,11 +33,11 @@
collection.with_component(Primer::Alpha::Dialog::Footer.new) do
component_collection do |modal_footer|
- modal_footer.with_component(Primer::ButtonComponent.new(data: { "close-dialog-id": "edit-meeting-details-dialog" })) do
+ modal_footer.with_component(Primer::Beta::Button.new(data: { "close-dialog-id": "edit-meeting-details-dialog" })) do
t("button_cancel")
end
- modal_footer.with_component(Primer::ButtonComponent.new(scheme: :primary, type: :submit)) do
+ modal_footer.with_component(Primer::Beta::Button.new(scheme: :primary, type: :submit)) do
t("button_save")
end
end
diff --git a/modules/meeting/app/components/meetings/side_panel/participants_dialog.html.erb b/modules/meeting/app/components/meetings/side_panel/participants_dialog.html.erb
index 18922ae2ba3..343d37ce3a7 100644
--- a/modules/meeting/app/components/meetings/side_panel/participants_dialog.html.erb
+++ b/modules/meeting/app/components/meetings/side_panel/participants_dialog.html.erb
@@ -135,11 +135,11 @@
if @meeting.editable?
d.with_footer do
component_collection do |footer|
- footer.with_component(Primer::ButtonComponent.new(data: { "close-dialog-id": "edit-participants-dialog" })) do
+ footer.with_component(Primer::Beta::Button.new(data: { "close-dialog-id": "edit-participants-dialog" })) do
t("button_cancel")
end
footer.with_component(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
scheme: :primary,
form: "edit_participants_form",
data: { turbo: true },
diff --git a/modules/meeting/app/components/work_package_meetings_tab/add_work_package_to_meeting_dialog_component.html.erb b/modules/meeting/app/components/work_package_meetings_tab/add_work_package_to_meeting_dialog_component.html.erb
index c11239c337c..6b03a774dd9 100644
--- a/modules/meeting/app/components/work_package_meetings_tab/add_work_package_to_meeting_dialog_component.html.erb
+++ b/modules/meeting/app/components/work_package_meetings_tab/add_work_package_to_meeting_dialog_component.html.erb
@@ -18,7 +18,7 @@
d.with_footer do
component_collection do |buttons|
buttons.with_component(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
data: {
"close-dialog-id": "add-work-package-to-meeting-dialog"
}
@@ -27,7 +27,7 @@
t("button_cancel")
end
buttons.with_component(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
scheme: :primary,
form: "add-work-package-to-meeting-form",
data: { turbo: true },
diff --git a/modules/overviews/app/components/project_custom_fields/sections/edit_dialog_component.html.erb b/modules/overviews/app/components/project_custom_fields/sections/edit_dialog_component.html.erb
index 1c4859b33cb..f91bbdc89b2 100644
--- a/modules/overviews/app/components/project_custom_fields/sections/edit_dialog_component.html.erb
+++ b/modules/overviews/app/components/project_custom_fields/sections/edit_dialog_component.html.erb
@@ -13,7 +13,7 @@
d.with_footer do
component_collection do |footer_collection|
footer_collection.with_component(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
data: {
"close-dialog-id": "edit-project-custom-fields-dialog-#{@project_custom_field_section.id}"
}
@@ -22,7 +22,7 @@
t("button_cancel")
end
footer_collection.with_component(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
scheme: :primary,
type: :submit,
form: "project-section-edit-form",
diff --git a/modules/overviews/app/components/project_life_cycles/sections/edit_dialog_component.html.erb b/modules/overviews/app/components/project_life_cycles/sections/edit_dialog_component.html.erb
index 1a027271f46..ef4016a23f5 100644
--- a/modules/overviews/app/components/project_life_cycles/sections/edit_dialog_component.html.erb
+++ b/modules/overviews/app/components/project_life_cycles/sections/edit_dialog_component.html.erb
@@ -13,7 +13,7 @@
d.with_footer do
component_collection do |footer_collection|
footer_collection.with_component(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
data: {
"close-dialog-id": DIALOG_ID
}
@@ -22,7 +22,7 @@
t("button_cancel")
end
footer_collection.with_component(
- Primer::ButtonComponent.new(
+ Primer::Beta::Button.new(
scheme: :primary,
type: :submit,
form: "project-life-cycles-edit-form",
diff --git a/modules/storages/app/components/storages/admin/storages/projects_storage_form_modal_component.html.erb b/modules/storages/app/components/storages/admin/storages/projects_storage_form_modal_component.html.erb
index fd3e5c3201e..5c14bfa3dde 100644
--- a/modules/storages/app/components/storages/admin/storages/projects_storage_form_modal_component.html.erb
+++ b/modules/storages/app/components/storages/admin/storages/projects_storage_form_modal_component.html.erb
@@ -85,8 +85,8 @@ See COPYRIGHT and LICENSE files for more details.
concat(
render(Primer::Alpha::Dialog::Footer.new(show_divider: false)) do
- concat(render(Primer::ButtonComponent.new(data: { "close-dialog-id": dialog_id })) { cancel_button_text })
- concat(render(Primer::ButtonComponent.new(scheme: :primary, type: :submit)) { submit_button_text })
+ concat(render(Primer::Beta::Button.new(data: { "close-dialog-id": dialog_id })) { cancel_button_text })
+ concat(render(Primer::Beta::Button.new(scheme: :primary, type: :submit)) { submit_button_text })
end
)
end
diff --git a/modules/storages/app/components/storages/open_project_storage_modal_component.html.erb b/modules/storages/app/components/storages/open_project_storage_modal_component.html.erb
index 51001781bd3..6ca4884f067 100644
--- a/modules/storages/app/components/storages/open_project_storage_modal_component.html.erb
+++ b/modules/storages/app/components/storages/open_project_storage_modal_component.html.erb
@@ -10,6 +10,6 @@
<%= render(self.class::Body.new(@state)) %>
<% end %>
<% dialog.with_footer do %>
- <%= render(Primer::ButtonComponent.new(data: { "close-dialog-id": self.class.dialog_id })) { I18n.t("button_close") } %>
+ <%= render(Primer::Beta::Button.new(data: { "close-dialog-id": self.class.dialog_id })) { I18n.t("button_close") } %>
<% end %>
<% end %>