Skip to content

Commit

Permalink
Bump primer to 0.52.1 and get rid of some custom code that is not nee…
Browse files Browse the repository at this point in the history
…ded any more
  • Loading branch information
HDinger committed Jan 16, 2025
1 parent 2960bc5 commit d7c3c5a
Show file tree
Hide file tree
Showing 19 changed files with 39 additions and 38 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -408,4 +408,4 @@ end

gem "openproject-octicons", "~>19.20.0 "
gem "openproject-octicons_helper", "~>19.20.0 "
gem "openproject-primer_view_components", "~>0.52.0"
gem "openproject-primer_view_components", "~>0.52.1"
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ GEM
actionview
openproject-octicons (= 19.20.0)
railties
openproject-primer_view_components (0.52.0)
openproject-primer_view_components (0.52.1)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
openproject-octicons (>= 19.20.0)
Expand Down Expand Up @@ -1324,7 +1324,7 @@ DEPENDENCIES
openproject-octicons (~> 19.20.0)
openproject-octicons_helper (~> 19.20.0)
openproject-openid_connect!
openproject-primer_view_components (~> 0.52.0)
openproject-primer_view_components (~> 0.52.1)
openproject-recaptcha!
openproject-reporting!
openproject-storages!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ See COPYRIGHT and LICENSE files for more details.
collection.with_component(Primer::Alpha::Dialog::Body.new(
aria: { label: I18n.t("my.access_token.new_access_token_dialog_title") }
)) do
flex_layout(my: 3) do |body|
flex_layout(mb: 3) do |body|
body.with_row do
render(Primer::Alpha::Banner.new(scheme: :warning)) do
I18n.t("my.access_token.new_access_token_dialog_attention_text")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
title: name,
size: :large)) do |component|
component.with_body(mt: 2) { full_text }
component.with_body { full_text }
component.with_header(variant: :large)
end
%>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# enough height to display all options.
# This is necessary as long as ng-select does not support popovers.
style: "min-height: 480px")) do |d| %>
<% d.with_header(variant: :large, mb: 3) %>
<% d.with_header(variant: :large) %>
<%= render(Primer::Alpha::Dialog::Body.new) do %>
<%= primer_form_with(
url: projects_path,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
size: :large,
id: MODAL_ID,
data: { 'test-selector': MODAL_ID })) do |d| %>
<% d.with_header(variant: :large, mb: 2) %>
<% d.with_header(variant: :large) %>
<% d.with_body { t(:'projects.lists.delete_modal.text') } %>
<% d.with_footer do %>
<%= render(Primer::Beta::Button.new(data: { "close-dialog-id": MODAL_ID })) { I18n.t(:button_cancel) } %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
primer_form_with(**form_config) do |f|
component_collection do |collection|
collection.with_component(Primer::BaseComponent.new(tag: :div)) do
flex_layout(my: 3) do |modal_body|
flex_layout(mb: 3) do |modal_body|
modal_body.with_row do
render(ProjectCustomFieldSections::NameForm.new(f))
end
Expand Down
2 changes: 1 addition & 1 deletion app/components/shares/share_dialog_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%=
render(Primer::Alpha::Dialog.new(title: strategy.title, id: 'sharing-modal', data: { 'keep-open-on-submit': true }, size: :xlarge, open: open)) do |d|
d.with_header(variant: :large, mb: 3)
d.with_header(variant: :large)
d.with_body do
render(strategy.modal_body_component(errors))
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
) do |f| %>
<%# Form fields section %>
<%= flex_layout(my: 3) do |flex|
<%= flex_layout(mb: 3) do |flex|
flex.with_row do
if @base_errors&.any?
render(Primer::Alpha::Banner.new(mb: 3, icon: :stop, scheme: :danger)) { @base_errors.join("\n") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
) do |f| %>
<%# Form fields section %>
<%= flex_layout(my: 2) do |flex|
<%= flex_layout(mb: 3) do |flex|
flex.with_row do
if @base_errors&.any?
render(Primer::Alpha::Banner.new(mb: 3, icon: :stop, scheme: :danger)) { @base_errors.join("\n") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
end
end

modal_body.with_row(mt: 3) do
modal_body.with_row do
render(WorkPackages::Dialogs::CreateForm.new(f, work_package:, wrapper_id: "#create-work-package-dialog"))
end
end
Expand Down
28 changes: 14 additions & 14 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@
"@ngneat/content-loader": "^7.0.0",
"@ngx-formly/core": "^6.1.4",
"@openproject/octicons-angular": "^19.20.0",
"@openproject/primer-view-components": "^0.52.0",
"@openproject/primer-view-components": "^0.52.1",
"@openproject/reactivestates": "^3.0.1",
"@primer/css": "^21.5.0",
"@primer/primitives": "^9.1.2",
"@primer/view-components": "npm:@openproject/primer-view-components@^0.52.0",
"@primer/view-components": "npm:@openproject/primer-view-components@^0.52.1",
"@types/hotwired__turbo": "^8.0.1",
"@uirouter/angular": "^13.0.0",
"@uirouter/core": "^6.1.0",
Expand Down
5 changes: 3 additions & 2 deletions modules/meeting/app/components/base_errors_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,20 @@ class BaseErrorsComponent < ApplicationComponent
include OpTurbo::Streamable
include OpPrimer::ComponentHelpers

def initialize(object, keys: %w[base])
def initialize(object, keys: %w[base], **system_arguments)
super

@errors = object.errors
@keys = keys
@system_arguments = system_arguments
end

def render?
@keys.any? { |key| @errors[key].present? }
end

def call
render(Primer::Alpha::Banner.new(scheme: :danger, icon: :stop, spacious: true)) do
render(Primer::Alpha::Banner.new(scheme: :danger, icon: :stop, spacious: true, **@system_arguments)) do
joined_messages
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
end

if @project.nil?
modal_body.with_row(mt: 3) do
modal_body.with_row(mb: 3) do
render(Meeting::ProjectAutocompleter.new(f))
end
end

modal_body.with_row(mt: 3) do
modal_body.with_row do
render(Meeting::Title.new(f))
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
collection.with_component(Primer::Alpha::Dialog::Body.new) do
flex_layout(mb: 3) do |modal_body|
modal_body.with_row do
render(BaseErrorsComponent.new(@meeting))
render(BaseErrorsComponent.new(@meeting, mb: 3))
end

modal_body.with_row(mt: 3) do
modal_body.with_row(mb: 3) do
render(Meeting::TimeGroup.new(f, meeting: @meeting))
end

modal_body.with_row(mt: 3) do
modal_body.with_row do
render(Meeting::Location.new(f, meeting: @meeting))
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
data: { turbo: true, turbo_stream: true },
class: 'Overlay-form'
) do |f|
flex_layout(mt: 3) do |form_container|
flex_layout do |form_container|

form_container.with_row do
flex_layout(justify_content: :flex_end) do |header|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
method: :post,
url: work_package_meeting_agenda_items_path(@work_package),
) do |f|
flex_layout(my: 3) do |flex|
flex_layout(mb: 3) do |flex|
flex.with_row do
if @base_errors&.any?
render(Primer::Alpha::Banner.new(mb: 3, icon: :stop, scheme: :danger)) { @base_errors.join("\n") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
data:)
) do |dialog| %>
<% dialog.with_header(display: :none) %>
<% dialog.with_body(id: self.class.dialog_body_id, p: 2) do %>
<% dialog.with_body(id: self.class.dialog_body_id) do %>
<%= render(self.class::Body.new(@state)) %>
<% end %>
<% dialog.with_footer do %>
Expand Down

0 comments on commit d7c3c5a

Please sign in to comment.