Skip to content

Commit

Permalink
Merge branch 'dev' into implementation/59721-add-setedit-reminder-but…
Browse files Browse the repository at this point in the history
…tondialog-to-workpackage-page
  • Loading branch information
akabiru authored Dec 9, 2024
2 parents 5dc51a9 + b0be0bd commit d9133a2
Show file tree
Hide file tree
Showing 521 changed files with 13,065 additions and 1,963 deletions.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ gem "paper_trail", "~> 15.2.0"

gem "op-clamav-client", "~> 3.4", require: "clamav"

# Recurring meeting events definition
gem "ice_cube", "~> 0.17.0"

group :production do
# we use dalli as standard memcache client
# requires memcached 1.4+
Expand Down
11 changes: 7 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -620,9 +620,11 @@ GEM
google-apis-core (>= 0.15.0, < 2.a)
google-cloud-env (2.2.1)
faraday (>= 1.0, < 3.a)
googleauth (1.11.2)
google-logging-utils (0.1.0)
googleauth (1.12.0)
faraday (>= 1.0, < 3.a)
google-cloud-env (~> 2.1)
google-cloud-env (~> 2.2)
google-logging-utils (~> 0.1)
jwt (>= 1.4, < 3.0)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
Expand Down Expand Up @@ -707,7 +709,7 @@ GEM
launchy (3.0.1)
addressable (~> 2.8)
childprocess (~> 5.0)
lefthook (1.8.5)
lefthook (1.9.0)
letter_opener (1.10.0)
launchy (>= 2.2, < 4)
letter_opener_web (3.0.0)
Expand Down Expand Up @@ -963,7 +965,7 @@ GEM
rbtree3 (0.7.1)
rdoc (6.8.1)
psych (>= 4.0.0)
recaptcha (5.17.1)
recaptcha (5.18.0)
redcarpet (3.6.0)
redis (5.3.0)
redis-client (>= 0.22.0)
Expand Down Expand Up @@ -1270,6 +1272,7 @@ DEPENDENCIES
httpx
i18n-js (~> 4.2.3)
i18n-tasks (~> 1.0.13)
ice_cube (~> 0.17.0)
json_schemer (~> 2.3.0)
json_spec (~> 1.1.4)
ladle
Expand Down
60 changes: 60 additions & 0 deletions app/components/messages/show_page_header_component.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<%=
render Primer::OpenProject::PageHeader.new do |header|
header.with_title { @topic.subject }
header.with_breadcrumbs(breadcrumb_items)

watcher_button_args = watcher_button_arguments(@topic, User.current)
header.with_action_button(**watcher_button_args) do |button|
button.with_leading_visual_icon(icon: watcher_button_args[:mobile_icon])
watcher_button_args[:mobile_label]
end

if [email protected]? && authorize_for('messages', 'reply')
header.with_action_button(tag: :a,
scheme: :default,
mobile_icon: :quote,
mobile_label: t(:button_quote),
size: :medium,
href: url_for({ action: 'quote', id: @topic }),
aria: { label: I18n.t(:button_delete) },
data: { 'action': 'forum-messages#quote', test_selector: "message-quote-button" },
title: t(:button_quote)) do |button|
button.with_leading_visual_icon(icon: :quote)
t(:button_quote)
end
end

if @message.editable_by?(User.current)
header.with_action_button(tag: :a,
scheme: :default,
mobile_icon: :pencil,
mobile_label: t(:button_edit),
size: :medium,
href: edit_topic_path(@topic),
aria: { label: t(:button_edit) },
data: { test_selector: "message-edit-button" },
title: t(:button_edit)) do |button|
button.with_leading_visual_icon(icon: :pencil)
t(:button_edit)
end
end

if @message.destroyable_by?(User.current)
header.with_action_button(tag: :a,
scheme: :danger,
mobile_icon: :trash,
mobile_label: t(:button_delete),
size: :medium,
href: topic_path(@topic),
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
end
%>
54 changes: 54 additions & 0 deletions app/components/messages/show_page_header_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# frozen_string_literal: true

# -- copyright
# OpenProject is an open source project management software.
# Copyright (C) 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 Messages
class ShowPageHeaderComponent < ApplicationComponent
include OpPrimer::ComponentHelpers
include ApplicationHelper
include WatchersHelper

def initialize(topic:, message:, forum:, project:)
super
@topic = topic
@message = message
@forum = forum
@project = project
end

def breadcrumb_items
[
{ href: project_overview_path(@project.id), text: @project.name },
{ href: project_forums_path(@project), text: t(:label_forum_plural) },
{ href: project_forum_path(@project, @forum), text: @forum.name },
@topic.subject
]
end
end
end
6 changes: 6 additions & 0 deletions app/components/op_primer/border_box_table_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ See COPYRIGHT and LICENSE files for more details.
end
end
end

if has_footer?
component.with_footer(classes: grid_class, color: :muted) do
footer
end
end
end
%>

Expand Down
12 changes: 10 additions & 2 deletions app/components/op_primer/border_box_table_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class << self
#
# This results in the description columns to be hidden on mobile
def mobile_columns(*names)
return @mobile_columns || columns if names.empty?
return Array(@mobile_columns || columns) if names.empty?

@mobile_columns = names.map(&:to_sym)
end
Expand All @@ -54,7 +54,7 @@ def mobile_columns(*names)
#
# This results in the description columns to be hidden on mobile
def mobile_labels(*names)
return @mobile_labels if names.empty?
return Array(@mobile_labels) if names.empty?

@mobile_labels = names.map(&:to_sym)
end
Expand Down Expand Up @@ -106,6 +106,10 @@ def has_actions?
false
end

def has_footer?
false
end

def sortable?
false
end
Expand Down Expand Up @@ -133,5 +137,9 @@ def blank_description
def blank_icon
nil
end

def footer
raise ArgumentError, "Need to provide footer content"
end
end
end
100 changes: 100 additions & 0 deletions app/components/projects/settings/index_page_header_component.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<%=
render Primer::OpenProject::PageHeader.new do |header|
header.with_title { t(:label_information_plural) }
header.with_breadcrumbs( [
{ href: project_overview_path(@project.id), text: @project.name },
{ href: project_settings_general_path(@project.id), text: I18n.t("label_project_settings") },
t(:label_information_plural)
])

if User.current.allowed_in_project?(:add_subprojects, @project)
header.with_action_button(scheme: :primary,
mobile_icon: :plus,
mobile_label: t(:label_subproject_new),
aria: { label: t(:label_subproject_new) },
title: t(:label_subproject_new),
tag: :a,
href: new_project_path(parent_id: @project.id)) do |button|
button.with_leading_visual_icon(icon: :plus)
t(:label_subproject)
end
end

header.with_action_button(tag: :a,
mobile_icon: :pencil,
mobile_label: t('projects.settings.change_identifier'),
size: :medium,
href: project_identifier_path(@project),
aria: { label: t('projects.settings.change_identifier') },
title: t('projects.settings.change_identifier')) do |button|
button.with_leading_visual_icon(icon: :pencil)
t('projects.settings.change_identifier')
end

header.with_action_menu(
menu_arguments: {
anchor_align: :end
},
button_arguments: {
icon: "op-kebab-vertical",
"aria-label": t(:label_more),
test_selector: "project-settings-more-menu"
}
) do |menu|
if @project.copy_allowed?
menu.with_item(
label:t(:button_copy),
href: copy_project_path(@project),
content_arguments: {
data: { turbo: false },
test_selector: "project-settings--copy"
},
accesskey: helpers.accesskey(:copy),
) do |item|
item.with_leading_visual_icon(icon: :copy)
end
end

if User.current.allowed_in_project?(:archive_project, @project)
menu.with_item(
tag: :a,
label: t(:button_archive),
href: project_archive_path(@project, status: '', name: @project.name),
content_arguments: {
data: { confirm: t('project.archive.are_you_sure', name: @project.name), method: :post, },
test_selector: "project-settings--archive"
}
) do |item|
item.with_leading_visual_icon(icon: 'lock')
end
end
if User.current.admin?
label = @project.templated ? 'remove_from_templates' : 'make_template'
menu.with_item(
tag: :a,
label: t("project.template.#{label}"),
href: project_templated_path(@project),
content_arguments: {
data: { method: @project.templated ? :delete : :post },
test_selector: "project-settings--mark-template"
}
) do |item|
item.with_leading_visual_icon(icon: @project.templated ? :"file-removed" : :"file-added")
end

menu.with_item(
tag: :a,
scheme: :danger,
label: t(:button_delete),
href: confirm_destroy_project_path(@project),
content_arguments: {
data: { turbo: false },
test_selector: "project-settings--delete"
}
) do |item|
item.with_leading_visual_icon(icon: :trash)
end
end
end
end
%>
39 changes: 39 additions & 0 deletions app/components/projects/settings/index_page_header_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# frozen_string_literal: true

# -- copyright
# OpenProject is an open source project management software.
# Copyright (C) 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 Projects::Settings::IndexPageHeaderComponent < ApplicationComponent
include OpPrimer::ComponentHelpers

def initialize(project:)
super

@project = project
end
end
2 changes: 1 addition & 1 deletion app/components/users/hover_card_component.sass
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// modal overlay will darken the background while the hover card is active, since its semi-transparent bg shading is
// added on top of the other dialog background shaders. We don't want an additional spot modal background here,
// so we disable it for this edge case.
.controller-projects.action-index
.controller-projects.action-index, .controller-meetings.action-show
.spot-modal-overlay:not(:has(.op-user-hover-card))
background: transparent

Expand Down
4 changes: 3 additions & 1 deletion app/components/users/show_page_header_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<%=
render(Primer::OpenProject::PageHeader.new) do |header|
header.with_title { "#{avatar @user} #{h(@user.name)}".html_safe }
header.with_title do
"#{avatar(@user, hover_card: { active: false })} #{h(@user.name)}".html_safe
end
header.with_breadcrumbs(breadcrumb_items)

if @current_user.allowed_globally?(:manage_user)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
size: :large,
id: DIALOG_ID)) do |d|
d.with_header(variant: :large)
d.with_body(classes: "Overlay-body_autocomplete_height") do
d.with_body(classes: body_classes) do
render(WorkPackageRelationsTab::AddWorkPackageChildFormComponent.new(
work_package: @work_package
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,8 @@ def dialog_title
child_label = t("#{I18N_NAMESPACE}.relations.label_child_singular")
t("#{I18N_NAMESPACE}.label_add_x", x: child_label)
end

def body_classes
"Overlay-body_autocomplete_height"
end
end
Loading

0 comments on commit d9133a2

Please sign in to comment.