Skip to content

Commit

Permalink
Merge branch 'release/14.4' into task/56644-144-documentation-update-…
Browse files Browse the repository at this point in the history
…pageheaders-and-subheaders-in-the-admin-pages
  • Loading branch information
MayaBerd authored Aug 1, 2024
2 parents add21ab + 407877c commit bed85dd
Show file tree
Hide file tree
Showing 467 changed files with 8,692 additions and 2,694 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Naming/VariableNumber:
AllowedPatterns:
- '\w_20\d\d' # allow dates like christmas_2022 or date_2034_04_12
- '\w\d++(_\d++)+' # allow hierarchical data like child1_2_5 (second + in regex is possessive qualifier)

- 'custom_field_\d+' # allow custom field method names to be called with send :custom_field_1001
# There are valid cases in which to use methods like:
# * update_all
# * touch_all
Expand Down
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ gem "mini_magick", "~> 4.13.0", require: false
gem "validate_url"

# Storages support code
gem "dry-auto_inject"
gem "dry-container"
gem "dry-monads"

Expand All @@ -227,6 +228,7 @@ gem "factory_bot", "~> 6.4.0", require: false
# require factory_bot_rails for convenience in core development
gem "factory_bot_rails", "~> 6.4.0", require: false

gem "turbo_power", "~> 0.6.2"
gem "turbo-rails", "~> 2.0.0"

gem "httpx"
Expand Down Expand Up @@ -392,4 +394,4 @@ end

gem "openproject-octicons", "~>19.17.0"
gem "openproject-octicons_helper", "~>19.17.0"
gem "openproject-primer_view_components", "~>0.39.1"
gem "openproject-primer_view_components", "~>0.40.0"
21 changes: 14 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ GEM
activerecord (>= 4.0.0, < 7.2)
awrence (1.2.1)
aws-eventstream (1.3.0)
aws-partitions (1.957.0)
aws-sdk-core (3.201.2)
aws-partitions (1.958.0)
aws-sdk-core (3.201.3)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
Expand All @@ -358,7 +358,7 @@ GEM
aws-sdk-sns (1.80.0)
aws-sdk-core (~> 3, >= 3.201.0)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.8.0)
aws-sigv4 (1.9.0)
aws-eventstream (~> 1, >= 1.0.2)
axe-core-api (4.9.1)
dumb_delegator
Expand Down Expand Up @@ -466,6 +466,9 @@ GEM
dotenv (= 3.1.2)
railties (>= 6.1)
drb (2.2.1)
dry-auto_inject (1.0.1)
dry-core (~> 1.0)
zeitwerk (~> 2.6)
dry-container (0.11.0)
concurrent-ruby (~> 1.0)
dry-core (1.0.1)
Expand Down Expand Up @@ -777,7 +780,7 @@ GEM
actionview
openproject-octicons (= 19.17.0)
railties
openproject-primer_view_components (0.39.1)
openproject-primer_view_components (0.40.0)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
openproject-octicons (>= 19.17.0)
Expand Down Expand Up @@ -807,7 +810,7 @@ GEM
hashery (~> 2.0)
ruby-rc4
ttfunk
pg (1.5.6)
pg (1.5.7)
plaintext (0.3.4)
activesupport (> 2.2.1)
nokogiri (~> 1.10, >= 1.10.4)
Expand Down Expand Up @@ -1019,7 +1022,7 @@ GEM
rubyzip (2.3.2)
safety_net_attestation (0.4.0)
jwt (~> 2.0)
sanitize (6.1.1)
sanitize (6.1.2)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
secure_headers (6.5.0)
Expand Down Expand Up @@ -1093,6 +1096,8 @@ GEM
actionpack (>= 6.0.0)
activejob (>= 6.0.0)
railties (>= 6.0.0)
turbo_power (0.6.2)
turbo-rails (>= 1.3.0)
typed_dag (2.0.2)
rails (>= 5.0.4)
tzinfo (2.0.6)
Expand Down Expand Up @@ -1198,6 +1203,7 @@ DEPENDENCIES
disposable (~> 0.6.2)
doorkeeper (~> 5.7.0)
dotenv-rails
dry-auto_inject
dry-container
dry-monads
email_validator (~> 2.2.3)
Expand Down Expand Up @@ -1267,7 +1273,7 @@ DEPENDENCIES
openproject-octicons (~> 19.17.0)
openproject-octicons_helper (~> 19.17.0)
openproject-openid_connect!
openproject-primer_view_components (~> 0.39.1)
openproject-primer_view_components (~> 0.40.0)
openproject-recaptcha!
openproject-reporting!
openproject-storages!
Expand Down Expand Up @@ -1347,6 +1353,7 @@ DEPENDENCIES
timecop (~> 0.9.0)
ttfunk (~> 1.7.0)
turbo-rails (~> 2.0.0)
turbo_power (~> 0.6.2)
turbo_tests!
typed_dag (~> 2.0.2)
tzinfo-data (~> 1.2024.1)
Expand Down
1 change: 1 addition & 0 deletions app/components/_index.sass
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
@import "filter/filters_component"
@import "projects/row_component"
@import "settings/project_custom_fields/project_custom_field_mapping/new_project_mapping_component"
@import "op_primer/border_box_table_component"
62 changes: 62 additions & 0 deletions app/components/oauth/show_page_header_component.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<%#-- copyright
OpenProject is an open source project management software.
Copyright (C) 2012-2024 the OpenProject GmbH
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 3.
OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
Copyright (C) 2006-2013 Jean-Philippe Lang
Copyright (C) 2010-2013 the ChiliProject Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See COPYRIGHT and LICENSE files for more details.
++#%>

<%=
render Primer::OpenProject::PageHeader.new do |header|
header.with_title { h(@application.name) }
header.with_breadcrumbs(breadcrumb_items)

header.with_action_button(tag: :a,
mobile_icon: :pencil,
mobile_label: t(:button_edit),
size: :medium,
href: edit_oauth_application_path(@application),
aria: { label: I18n.t(:button_edit) },
title: I18n.t(:button_edit)) do |button|
button.with_leading_visual_icon(icon: :pencil)
t(:button_edit)
end

header.with_action_button(tag: :a,
scheme: :danger,
mobile_icon: :trash,
mobile_label: t(:button_delete),
size: :medium,
href: oauth_application_path(@application),
aria: { label: I18n.t(:button_delete) },
data: {
confirm: I18n.t(:text_are_you_sure),
method: :delete
},
title: I18n.t(:button_delete)) do |button|
button.with_leading_visual_icon(icon: :trash)
t(:button_delete)
end
end
%>
46 changes: 46 additions & 0 deletions app/components/oauth/show_page_header_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# frozen_string_literal: true

# -- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2010-2024 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See COPYRIGHT and LICENSE files for more details.
# ++

class OAuth::ShowPageHeaderComponent < ApplicationComponent
include OpPrimer::ComponentHelpers
include ApplicationHelper

def initialize(application:)
super
@application = application
end

def breadcrumb_items
[{ href: admin_index_path, text: t(:label_administration) },
{ href: admin_settings_authentication_path, text: t(:label_authentication) },
{ href: oauth_applications_path, text: t("oauth.application.plural") },
h(@application.name)]
end
end
48 changes: 48 additions & 0 deletions app/components/op_primer/border_box_row_component.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<%#-- copyright
OpenProject is an open source project management software.
Copyright (C) 2012-2024 the OpenProject GmbH
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 3.
OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
Copyright (C) 2006-2013 Jean-Philippe Lang
Copyright (C) 2010-2013 the ChiliProject Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See COPYRIGHT and LICENSE files for more details.
++#%>

<%=
render Primer::BaseComponent.new(
tag: :div,
id: row_css_id,
classes: "#{table.grid_class} #{row_css_class}",
) do %>
<% columns.each do |column| %>
<%= render(Primer::BaseComponent.new(tag: :div, classes: column_css_class(column), **column_args(column))) { column_value(column) } %>
<% end %>

<% if table.has_actions? %>
<%= flex_layout(align_items: :center, justify_content: :flex_end) do |flex| %>
<% button_links.each_with_index do |link, i| %>
<% args = i == (button_links.count - 1) ? {} : { mr: 1 } %>
<% flex.with_column(**args) { link } %>
<% end %>
<% end %>
<% end %>
<% end %>
45 changes: 45 additions & 0 deletions app/components/op_primer/border_box_row_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# frozen_string_literal: true

#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2024 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See COPYRIGHT and LICENSE files for more details.
#++

module OpPrimer
class BorderBoxRowComponent < RowComponent # rubocop:disable OpenProject/AddPreviewForViewComponent
include ComponentHelpers

def column_args(_column)
{}
end

def checkmark(condition)
if condition
render(Primer::Beta::Octicon.new(icon: :check))
end
end
end
end
53 changes: 53 additions & 0 deletions app/components/op_primer/border_box_table_component.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<%#-- copyright
OpenProject is an open source project management software.
Copyright (C) 2012-2024 the OpenProject GmbH
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 3.
OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
Copyright (C) 2006-2013 Jean-Philippe Lang
Copyright (C) 2010-2013 the ChiliProject Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See COPYRIGHT and LICENSE files for more details.
++#%>

<%=
render(
border_box_container(
classes: container_class,
test_selector:,
)) do |component|
component.with_header(classes: grid_class, color: :muted) do
headers.each do |name, args|
caption = args.delete(:caption)
concat render(Primer::Beta::Text.new(font_weight: :semibold, **header_args(name))) { caption }
end

if has_actions?
concat render(Primer::BaseComponent.new(tag: :div))
end
end

rows.each do |row|
component.with_row(scheme: :default) do
render(row_class.new(row:, table: self))
end
end
end
%>
Loading

0 comments on commit bed85dd

Please sign in to comment.