Skip to content

Commit

Permalink
Merge branch 'dev' into feature/40437-emoji-reactions-to-work-package…
Browse files Browse the repository at this point in the history
…-comments
  • Loading branch information
akabiru authored Oct 25, 2024
2 parents 232df80 + 503b2b1 commit e22d22d
Show file tree
Hide file tree
Showing 328 changed files with 12,186 additions and 2,444 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ RSpec/DescribeMethod:
# to match the exact file name
RSpec/SpecFilePathFormat:
CustomTransform:
OpenIDConnect: openid_connect
OAuthClients: oauth_clients
IgnoreMethods: true

Expand Down
8 changes: 4 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ gem "appsignal", "~> 3.10.0", require: false

gem "view_component"
# Lookbook
gem "lookbook", "~> 2.3.0"
gem "lookbook", "~> 2.3.3"

# Require factory_bot for usage with openproject plugins testing
gem "factory_bot", "~> 6.5.0", require: false
Expand Down Expand Up @@ -397,6 +397,6 @@ gemfiles.each do |file|
send(:eval_gemfile, file) if File.readable?(file)
end

gem "openproject-octicons", "~>19.18.0"
gem "openproject-octicons_helper", "~>19.18.0"
gem "openproject-primer_view_components", "~>0.48.0"
gem "openproject-octicons", "~>19.19.0"
gem "openproject-octicons_helper", "~>19.19.0"
gem "openproject-primer_view_components", "~>0.48.1"
46 changes: 23 additions & 23 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -342,23 +342,23 @@ GEM
activerecord (>= 4.0.0, < 8.0)
awrence (1.2.1)
aws-eventstream (1.3.0)
aws-partitions (1.991.0)
aws-sdk-core (3.209.1)
aws-partitions (1.992.0)
aws-sdk-core (3.211.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.94.0)
aws-sdk-core (~> 3, >= 3.207.0)
aws-sdk-kms (1.95.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.168.0)
aws-sdk-core (~> 3, >= 3.207.0)
aws-sdk-s3 (1.169.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sdk-sns (1.88.0)
aws-sdk-core (~> 3, >= 3.207.0)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.10.0)
aws-sigv4 (1.10.1)
aws-eventstream (~> 1, >= 1.0.2)
axe-core-api (4.10.1)
dumb_delegator
Expand Down Expand Up @@ -386,7 +386,7 @@ GEM
bindata (2.5.0)
bootsnap (1.18.4)
msgpack (~> 1.2)
brakeman (6.2.1)
brakeman (6.2.2)
racc
browser (6.0.0)
builder (3.3.0)
Expand Down Expand Up @@ -703,7 +703,7 @@ GEM
launchy (3.0.1)
addressable (~> 2.8)
childprocess (~> 5.0)
lefthook (1.7.21)
lefthook (1.8.1)
letter_opener (1.10.0)
launchy (>= 2.2, < 4)
letter_opener_web (3.0.0)
Expand All @@ -727,7 +727,7 @@ GEM
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
lookbook (2.3.2)
lookbook (2.3.3)
activemodel
css_parser
htmlbeautifier (~> 1.3)
Expand Down Expand Up @@ -803,12 +803,12 @@ GEM
validate_email
validate_url
webfinger (~> 2.0)
openproject-octicons (19.18.0)
openproject-octicons_helper (19.18.0)
openproject-octicons (19.19.0)
openproject-octicons_helper (19.19.0)
actionview
openproject-octicons (= 19.18.0)
openproject-octicons (= 19.19.0)
railties
openproject-primer_view_components (0.48.0)
openproject-primer_view_components (0.48.1)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
openproject-octicons (>= 19.17.0)
Expand Down Expand Up @@ -1024,7 +1024,7 @@ GEM
rubocop (~> 1.41)
rubocop-factory_bot (2.26.1)
rubocop (~> 1.61)
rubocop-openproject (0.1.0)
rubocop-openproject (0.2.0)
rubocop
rubocop-performance (1.22.1)
rubocop (>= 1.48.1, < 2.0)
Expand All @@ -1044,7 +1044,7 @@ GEM
i18n
iso8601
ruby-ole (1.2.13.1)
ruby-prof (1.7.0)
ruby-prof (1.7.1)
ruby-progressbar (1.13.0)
ruby-rc4 (0.1.5)
ruby-saml (1.17.0)
Expand Down Expand Up @@ -1147,8 +1147,8 @@ GEM
public_suffix
vcr (6.3.1)
base64
view_component (3.17.0)
activesupport (>= 5.2.0, < 8.0)
view_component (3.19.0)
activesupport (>= 5.2.0, < 8.1)
concurrent-ruby (~> 1.0)
method_source (~> 1.0)
virtus (2.0.0)
Expand Down Expand Up @@ -1272,7 +1272,7 @@ DEPENDENCIES
letter_opener_web
listen (~> 3.9.0)
lograge (~> 0.14.0)
lookbook (~> 2.3.0)
lookbook (~> 2.3.3)
mail (= 2.8.1)
markly (~> 0.10)
matrix (~> 0.4.2)
Expand Down Expand Up @@ -1304,10 +1304,10 @@ DEPENDENCIES
openproject-job_status!
openproject-ldap_groups!
openproject-meeting!
openproject-octicons (~> 19.18.0)
openproject-octicons_helper (~> 19.18.0)
openproject-octicons (~> 19.19.0)
openproject-octicons_helper (~> 19.19.0)
openproject-openid_connect!
openproject-primer_view_components (~> 0.48.0)
openproject-primer_view_components (~> 0.48.1)
openproject-recaptcha!
openproject-reporting!
openproject-storages!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ def columns
def sortable?
false
end

def use_quick_action_table_headers?
false
end
end
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%= render(Primer::OpenProject::PageHeader.new) do |header|
header.with_title { page_title }
header.with_breadcrumbs(breadcrumb_items)
header.with_breadcrumbs(breadcrumb_items, selected_item_font_weight: current_breadcrumb_element == page_title ? :bold : :normal)

header.with_action_button(tag: :a,
mobile_icon: :gear,
Expand Down
35 changes: 30 additions & 5 deletions app/components/notifications/index_page_header_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,41 @@ def initialize(project: nil)
end

def page_title
I18n.t("js.notifications.title")
if current_item.present?
current_item.title
else
I18n.t("notifications.menu.inbox")
end
end

def breadcrumb_items
[parent_element,
page_title]
[{ href: home_path, text: helpers.organization_name },
{ href: notifications_path, text: I18n.t("js.notifications.title") },
current_breadcrumb_element]
end

def parent_element
{ href: home_path, text: helpers.organization_name }
def current_breadcrumb_element
if current_section && current_section.header.present?
I18n.t("menus.breadcrumb.nested_element", section_header: current_section.header, title: page_title).html_safe
else
page_title
end
end

def current_section
return @current_section if defined?(@current_section)

@current_section = Notifications::Menu
.new(params:, current_user: User.current)
.selected_menu_group
end

def current_item
return @current_item if defined?(@current_item)

@current_item = Notifications::Menu
.new(params:, current_user: User.current)
.selected_menu_item
end
end
end
10 changes: 5 additions & 5 deletions app/components/op_primer/border_box_table_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ See COPYRIGHT and LICENSE files for more details.

if rows.empty?
component.with_row(scheme: :default) { render_blank_slate }
end

rows.each do |row|
component.with_row(scheme: :default) do
render(row_class.new(row:, table: self))
else
rows.each do |row|
component.with_row(scheme: :default) do
render(row_class.new(row:, table: self))
end
end
end
end
Expand Down
28 changes: 10 additions & 18 deletions app/components/projects/table_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<%= component_wrapper(tag: 'turbo-frame') do %>
<div class="project-list-page--table">
<div class="project-list-page--table" data-controller="table-action-menu" data-application-target="dynamic">
<div class="generic-table--flex-container">
<div class="generic-table--container <%= container_class %>">
<div class="generic-table--results-container">
Expand All @@ -54,28 +54,20 @@ See COPYRIGHT and LICENSE files for more details.
</div>
</div>
</th>
<% elsif sortable_column?(column) %>
<%= build_sort_header column.attribute, order_options(column, turbo: true) %>
<% elsif column.attribute == :favored %>
<th>
<div class="generic-table--header-outer">
<div class="generic-table--header generic-table--header_centered generic-table--header_no-min-width">
<span>
<%= render(Primer::Beta::Octicon.new(icon: "star-fill", color: :subtle, "aria-label": I18n.t(:label_favorite))) %>
</span>
</div>
</div>
</th>
<% else %>
<th>
<div class="generic-table--sort-header-outer">
<div class="generic-table--sort-header">
<% if use_quick_action_table_headers? %>
<%= quick_action_table_header column.attribute, order_options(column, turbo: true) %>
<% else %>
<th>
<div class="generic-table--sort-header-outer">
<div class="generic-table--sort-header">
<span>
<%= column.caption %>
</span>
</div>
</div>
</div>
</th>
</th>
<% end %>
<% end %>
<% end %>
<th>
Expand Down
13 changes: 10 additions & 3 deletions app/components/projects/table_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def container_class

##
# The project sort by is handled differently
def build_sort_header(column, options)
helpers.projects_sort_header_tag(column, **options, param: :json)
def quick_action_table_header(column, options)
helpers.projects_sort_header_tag(column, query.selects.map(&:attribute), **options, param: :json)
end

# We don't return the project row
Expand Down Expand Up @@ -119,7 +119,10 @@ def href_only_when_not_sort_lft
end

def order_options(select, turbo: false)
options = { caption: select.caption }
options = {
caption: select.caption,
sortable: sortable_column?(select)
}

if turbo
options[:data] = { "turbo-stream": true }
Expand All @@ -132,6 +135,10 @@ def sortable_column?(select)
sortable? && query.known_order?(select.attribute)
end

def use_quick_action_table_headers?
true
end

def columns
@columns ||= begin
columns = query.selects.reject { |select| select.is_a?(::Queries::Selects::NotExistingSelect) }
Expand Down
10 changes: 5 additions & 5 deletions app/components/work_packages/highlighted_date_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<%=
if @start_date == @due_date
render(Primer::Beta::Text.new(**text_arguments, classes: date_classes(@start_date))) { parsed_date(@start_date) }
render(Primer::Beta::Text.new(**@text_arguments, classes: date_classes(@start_date))) { parsed_date(@start_date) }
else
component_wrapper do
concat(render(Primer::Beta::Text.new(**text_arguments)) { parsed_date(@start_date) })
concat(render(Primer::Beta::Text.new(**text_arguments)) { " - " }) if @due_date.present?
concat(render(Primer::Beta::Text.new(**text_arguments, classes: date_classes(@due_date))) { parsed_date(@due_date) })
component_collection do |collection|
collection.with_component(Primer::Beta::Text.new(**@text_arguments)) { parsed_date(@start_date) }
collection.with_component(Primer::Beta::Text.new(**@text_arguments)) { " " } if @due_date.present?
collection.with_component(Primer::Beta::Text.new(**@text_arguments, classes: date_classes(@due_date))) { parsed_date(@due_date) }
end
end
%>
12 changes: 3 additions & 9 deletions app/components/work_packages/highlighted_date_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

class WorkPackages::HighlightedDateComponent < ApplicationComponent
include OpPrimer::ComponentHelpers
include OpTurbo::Streamable

def initialize(work_package:)
def initialize(work_package:, text_arguments: {})
super

@work_package = work_package
@start_date = work_package.start_date
@due_date = work_package.due_date

@text_arguments = text_arguments
end

def parsed_date(date)
Expand All @@ -30,11 +31,4 @@ def date_classes(date)

"__hl_date_not_overdue"
end

def text_arguments
{
font_size: :small,
color: :muted
}
end
end
Loading

0 comments on commit e22d22d

Please sign in to comment.