Skip to content

Commit

Permalink
Merge branch 'release/14.3' into implementation/55163-build-sharing-m…
Browse files Browse the repository at this point in the history
…odal
  • Loading branch information
klaustopher committed Jul 4, 2024
2 parents c600054 + 52cff64 commit dee8171
Show file tree
Hide file tree
Showing 142 changed files with 2,641 additions and 439 deletions.
18 changes: 9 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -342,19 +342,19 @@ GEM
activerecord (>= 4.0.0, < 7.2)
awrence (1.2.1)
aws-eventstream (1.3.0)
aws-partitions (1.949.0)
aws-sdk-core (3.200.0)
aws-partitions (1.950.0)
aws-sdk-core (3.201.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.87.0)
aws-sdk-core (~> 3, >= 3.199.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.155.0)
aws-sdk-core (~> 3, >= 3.199.0)
aws-sdk-kms (1.88.0)
aws-sdk-core (~> 3, >= 3.201.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.156.0)
aws-sdk-core (~> 3, >= 3.201.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.8)
aws-sigv4 (~> 1.5)
aws-sdk-sns (1.77.0)
aws-sdk-core (~> 3, >= 3.197.0)
aws-sigv4 (~> 1.1)
Expand Down Expand Up @@ -994,7 +994,7 @@ GEM
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rspec (3.0.1)
rubocop-rspec (3.0.2)
rubocop (~> 1.61)
rubocop-rspec_rails (2.30.0)
rubocop (~> 1.61)
Expand Down
51 changes: 51 additions & 0 deletions app/components/my/access_token/new_access_token_component.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<%#-- 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::Alpha::Dialog.new(
id: "new-access-token-dialog",
title: I18n.t("my.access_token.new_access_token_dialog_title"),
test_selector: "new-access-token-dialog",
size: :large
)
) do |dialog|
dialog.with_show_button(scheme: :primary, mt: 3, test_selector: "api-token-add") do |button|
button.with_leading_visual_icon(icon: :plus)
I18n.t("my.access_token.new_access_token_dialog_show_button_text")
end

dialog.with_header(
show_divider: false,
visually_hide_title: false
)

render(My::AccessToken::NewAccessTokenFormComponent.new(token: Token::API.new))
end
%>
36 changes: 36 additions & 0 deletions app/components/my/access_token/new_access_token_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# frozen_string_literal: true

#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2023 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 My
module AccessToken
class NewAccessTokenComponent < ApplicationComponent
end
end
end
45 changes: 45 additions & 0 deletions app/components/my/access_token/new_access_token_form.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-2023 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 My
module AccessToken
class NewAccessTokenForm < ApplicationForm
form do |new_access_token_form|
new_access_token_form.text_field(
name: :token_name,
label: I18n.t("my.access_token.new_access_token_dialog_text_field_label"),
placeholder: I18n.t("my.access_token.new_access_token_dialog_text_field_placeholder_text"),
visually_hide_label: false,
required: true
)
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<%#-- 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.
++#%>

<%=
component_wrapper do
primer_form_with(
model: @token,
url: my_generate_api_key_path,
data: { turbo: true },
method: :post
) do |form|
component_collection do |collection|
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|
body.with_row do
render(Primer::Alpha::Banner.new(scheme: :warning)) do
I18n.t("my.access_token.new_access_token_dialog_attention_text")
end
end

body.with_row(mt: 3) do
render(Primer::Beta::Text.new(tag: :p)) do
I18n.t("my.access_token.new_access_token_dialog_text")
end
end

body.with_row do
render(My::AccessToken::NewAccessTokenForm.new(form))
end
end
end

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
I18n.t("button_cancel")
end

footer.with_component(Primer::ButtonComponent.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
end
end
end
end
%>
44 changes: 44 additions & 0 deletions app/components/my/access_token/new_access_token_form_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# frozen_string_literal: true

#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2023 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 My
module AccessToken
class NewAccessTokenFormComponent < ApplicationComponent
include OpTurbo::Streamable
include OpPrimer::ComponentHelpers

def initialize(token:)
super

@token = token
end
end
end
end
3 changes: 3 additions & 0 deletions app/components/open_project/common/submenu_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
<% selected = child_item.selected ? 'selected' : '' %>
<a class="op-sidemenu--item-action <%= selected %>" href="<%= child_item.href %>" data-test-selector="op-sidemenu--item-action">
<span class="op-sidemenu--item-title"><%= child_item.title %></span>
<% if child_item.favored %>
<%= render Primer::Beta::Octicon.new(icon: "star-fill", "aria-label": I18n.t(:label_favorite), classes: %w[op-sidemenu--item-mark op-primer--star-icon]) %>
<% end %>
</a>
</li>
<% end %>
Expand Down
43 changes: 34 additions & 9 deletions app/components/projects/index_page_header_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
)
end

if show_toggle_share_dialog_button?
if can_access_shares?
header.with_action_icon_button(
tag: :a,
href: dialog_project_query_members_path(query),
Expand All @@ -32,14 +32,39 @@
)
end

header.with_action_menu(menu_arguments: {
anchor_align: :end
},
button_arguments: {
icon: "op-kebab-vertical",
"aria-label": t(:label_more),
data: { "test-selector": "project-more-dropdown-menu" }
}) do |menu|
if can_toggle_favor?
if currently_favored?
header.with_action_icon_button(
icon: "star-fill",
mobile_icon: "star-fill",
label: t(:button_unfavorite),
classes: "op-primer--star-icon",
tag: :a,
href: helpers.build_favorite_path(query, format: :html),
data: { method: :delete, "test-selector": "project-query-unfavorite" },
)
else
header.with_action_icon_button(
icon: "star",
mobile_icon: "star",
label: t(:button_favorite),
tag: :a,
href: helpers.build_favorite_path(query, format: :html),
data: { method: :post, "test-selector": "project-query-favorite" },
)
end
end

header.with_action_menu(
menu_arguments: {
anchor_align: :end
},
button_arguments: {
icon: "op-kebab-vertical",
"aria-label": t(:label_more),
data: { "test-selector": "project-more-dropdown-menu" }
}
) do |menu|
if can_rename?
menu.with_item(
label: t('button_rename'),
Expand Down
6 changes: 5 additions & 1 deletion app/components/projects/index_page_header_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,14 @@ def show_state?
state == :show
end

def show_toggle_share_dialog_button?
def can_access_shares?
query.persisted? && OpenProject::FeatureDecisions.project_list_sharing_active?
end

def can_toggle_favor? = query.persisted?

def currently_favored? = query.favored_by?(current_user)

def breadcrumb_items
[
{ href: projects_path, text: t(:label_project_plural) },
Expand Down
Loading

0 comments on commit dee8171

Please sign in to comment.