Skip to content

Commit

Permalink
Merge branch 'dev' into feature/50954-record-progress-in-multiple-units
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-contreras committed May 31, 2024
2 parents deb542e + 7df5839 commit df0eff7
Show file tree
Hide file tree
Showing 524 changed files with 6,299 additions and 3,997 deletions.
3 changes: 2 additions & 1 deletion .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
21a696ef9b170e14ad2daf53364a4c2113822c2f
# Update copyright information for 2024
c795874f7f281297bbd3bad2fdb58b24cb4ce624
# switch to double quotes
# rubocop autocorrections
f3c99ee5dded81ad55f2b6f3706216d5fa765677
5c72ea0046a6b5230bf456f55a296ed6fd579535
9e4934cd0a468f46d8f0fc0f11ebc2d4216f789c
6678cab48d443b5782fa93b171d62093819ee4fc
fa5d03eae00bc8931f99598a74ffd76e0cbca3da
10 changes: 2 additions & 8 deletions .github/workflows/rubocop-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Fetch all commits for PR branch plus head commit of base branch
run: |
# fetch all commits of the PR branch
git fetch --shallow-exclude "${{ github.base_ref }}" origin "${{ github.ref }}"
# fix for "fatal: error in object: unshallow"
git repack -d
# fetch head commit of base branch
git fetch --deepen 1 origin "${{ github.ref }}"
with:
fetch-depth: 2 # we are comparing PR merge head with base
- uses: ruby/setup-ruby@v1
- uses: opf/action-rubocop@master
with:
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,6 @@ gemfiles.each do |file|
send(:eval_gemfile, file) if File.readable?(file)
end

gem "openproject-octicons", "~>19.12.0"
gem "openproject-octicons_helper", "~>19.12.0"
gem "openproject-primer_view_components", "~>0.31.0"
gem "openproject-octicons", "~>19.13.0"
gem "openproject-octicons_helper", "~>19.13.0"
gem "openproject-primer_view_components", "~>0.32.1"
26 changes: 13 additions & 13 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -581,8 +581,8 @@ GEM
representable (~> 3.0)
retriable (>= 2.0, < 4.a)
rexml
google-apis-gmail_v1 (0.40.0)
google-apis-core (>= 0.14.0, < 2.a)
google-apis-gmail_v1 (0.41.0)
google-apis-core (>= 0.15.0, < 2.a)
google-cloud-env (2.1.1)
faraday (>= 1.0, < 3.a)
googleauth (1.11.0)
Expand Down Expand Up @@ -672,7 +672,7 @@ GEM
launchy (3.0.1)
addressable (~> 2.8)
childprocess (~> 5.0)
lefthook (1.6.12)
lefthook (1.6.14)
letter_opener (1.10.0)
launchy (>= 2.2, < 4)
letter_opener_web (3.0.0)
Expand Down Expand Up @@ -770,12 +770,12 @@ GEM
validate_email
validate_url
webfinger (~> 2.0)
openproject-octicons (19.12.0)
openproject-octicons_helper (19.12.0)
openproject-octicons (19.13.0)
openproject-octicons_helper (19.13.0)
actionview
openproject-octicons (= 19.12.0)
openproject-octicons (= 19.13.0)
railties
openproject-primer_view_components (0.31.0)
openproject-primer_view_components (0.32.1)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
openproject-octicons (>= 19.12.0)
Expand All @@ -793,7 +793,7 @@ GEM
parallel (1.24.0)
parallel_tests (4.7.1)
parallel
parser (3.3.1.0)
parser (3.3.2.0)
ast (~> 2.4.1)
racc
pdf-core (0.9.0)
Expand Down Expand Up @@ -970,7 +970,7 @@ GEM
rspec-retry (0.6.2)
rspec-core (> 3.3)
rspec-support (3.13.1)
rubocop (1.64.0)
rubocop (1.64.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand Down Expand Up @@ -1137,7 +1137,7 @@ GEM
activesupport
faraday (~> 2.0)
faraday-follow_redirects
webmock (3.23.0)
webmock (3.23.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
Expand Down Expand Up @@ -1266,10 +1266,10 @@ DEPENDENCIES
openproject-job_status!
openproject-ldap_groups!
openproject-meeting!
openproject-octicons (~> 19.12.0)
openproject-octicons_helper (~> 19.12.0)
openproject-octicons (~> 19.13.0)
openproject-octicons_helper (~> 19.13.0)
openproject-openid_connect!
openproject-primer_view_components (~> 0.31.0)
openproject-primer_view_components (~> 0.32.1)
openproject-recaptcha!
openproject-reporting!
openproject-storages!
Expand Down
38 changes: 18 additions & 20 deletions app/components/admin/attachments_settings_header_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,23 @@ See COPYRIGHT and LICENSE files for more details.
<% helpers.html_title t(:label_administration), @title %>
<%= render(Primer::OpenProject::PageHeader.new(border_bottom: 0)) do |header| %>
<% header.with_title { t(:"attributes.attachments") } %>
<% header.with_breadcrumbs([{ href: admin_index_path, text: t("label_administration") },
{ href: admin_settings_storages_path, text: t("project_module_storages") },
t(:"attributes.attachments")]) %>
<% end %>
<%= render(Primer::Alpha::TabNav.new(label: "label")) do |component|
component.with_tab(selected: @selected == 1, href: admin_settings_attachments_path) do |tab|
tab.with_text { t("settings.general") }
end
component.with_tab(selected: @selected == 2, href: admin_settings_virus_scanning_path) do |tab|
tab.with_icon(icon: :"op-enterprise-addons") unless EnterpriseToken.allows_to?("virus_scanning")
tab.with_text { t(:"settings.antivirus.title") }
end
if User.current.admin? && (EnterpriseToken.allows_to?(:virus_scanning) || Attachment.status_quarantined.any?)
component.with_tab(selected: @selected == 3, href: admin_quarantined_attachments_path) do |tab|
tab.with_text { t(:"antivirus_scan.quarantined_attachments.title") }
<%= render(Primer::OpenProject::PageHeader.new(border_bottom: 0)) do |header|
header.with_title { t(:"attributes.attachments") }
header.with_breadcrumbs([{ href: admin_index_path, text: t("label_administration") },
{ href: admin_settings_storages_path, text: t("project_module_storages") },
t(:"attributes.attachments")])
header.with_tab_nav(label: nil) do |tab_nav|
tab_nav.with_tab(selected: @selected == 1, href: admin_settings_attachments_path) do |tab|
tab.with_text { t("settings.general") }
end
tab_nav.with_tab(selected: @selected == 2, href: admin_settings_virus_scanning_path) do |tab|
tab.with_icon(icon: :"op-enterprise-addons") unless EnterpriseToken.allows_to?("virus_scanning")
tab.with_text { t(:"settings.antivirus.title") }
end
if User.current.admin? && (EnterpriseToken.allows_to?(:virus_scanning) || Attachment.status_quarantined.any?)
tab_nav.with_tab(selected: @selected == 3, href: admin_quarantined_attachments_path) do |tab|
tab.with_text { t(:"antivirus_scan.quarantined_attachments.title") }
end
end
end
end
%>
end %>

This file was deleted.

2 changes: 1 addition & 1 deletion app/components/members/table_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class TableComponent < ::TableComponent # rubocop:disable OpenProject/AddPreview
sortable_columns :name, :mail, :status

def apply_sort(model)
apply_member_scopes super(model)
apply_member_scopes super
end

def apply_member_scopes(model)
Expand Down
2 changes: 1 addition & 1 deletion app/components/members/user_filter_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def filter_shares(query, role_id)
end

def apply_filters(params, query)
super(params, query)
super
filter_shares(query, params[:shared_role_id]) if params.key?(:shared_role_id)

query
Expand Down
11 changes: 5 additions & 6 deletions app/components/projects/configure_view_modal_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
<%= primer_form_with(
url: projects_path,
id: QUERY_FORM_ID,
method: :get,
data: {
controller: "params-from-query",
'application-target': "dynamic",
'params-from-query-allowed-value': '["filters", "query_id", "page", "per_page"]'
}) do |form| %>
method: :get
) do |form| %>
<% helpers.projects_query_params.except(:columns, :sortBy).each do |name, value| %>
<%= hidden_field_tag name, value %>
<% end %>
<%= render(Primer::Alpha::TabPanels.new(label: "label")) do |tab_panel| %>
<% tab_panel.with_tab(selected: true, id: "tab-selects") do |tab| %>
<% tab.with_text { I18n.t("label_columns") } %>
Expand Down
8 changes: 2 additions & 6 deletions app/components/projects/export_list_modal_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@
id: MODAL_ID)) do |d| %>
<% d.with_header(variant: :large) %>
<% d.with_body do %>
<ul class="op-export-options"
data-controller="params-from-query"
data-application-target="dynamic"
data-params-from-query-all-anchors-value="true"
data-params-from-query-allowed-value='["query_id", "filters", "sortBy", "columns"]'>
<ul class="op-export-options">
<% helpers.supported_export_formats.each do |key| %>
<li class="op-export-options--option">
<%= link_to url_for(action: 'index', format: key),
<%= link_to projects_path(format: key, **helpers.projects_query_params.except(:page, :per_page)),
class: 'op-export-options--option-link' do %>
<%= helpers.op_icon("icon-big icon-export-#{key}") %>
<span class="op-export-options--option-label"><%= t("export.format.#{key}") %></span>
Expand Down
55 changes: 43 additions & 12 deletions app/components/projects/index_page_header_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
header:,
message: t("lists.can_be_saved"),
label: t("button_save"),
href: projects_query_path(query),
href: projects_query_path(query, projects_query_params),
method: :patch
)
elsif can_save_as?
header_save_action(
header:,
message: t("lists.can_be_saved_as"),
label: t("button_save_as"),
href: new_projects_query_path
href: new_projects_query_path(projects_query_params)
)
end

Expand Down Expand Up @@ -59,11 +59,20 @@
end

if can_save?
menu_save_item(menu:, label: t('button_save'), href: projects_query_path(query), method: :patch)
menu_save_item(
menu:,
label: t('button_save'),
href: projects_query_path(query, projects_query_params),
method: :patch
)
end

if may_save_as?
menu_save_item(menu:, label: t('button_save_as'), href: new_projects_query_path)
menu_save_item(
menu:,
label: t('button_save_as'),
href: new_projects_query_path(projects_query_params)
)
end

menu.with_item(
Expand All @@ -81,6 +90,29 @@
end

if query.persisted?
# TODO: Remove section when the sharing modal is implemented (https://community.openproject.org/projects/openproject/work_packages/55163)
if can_publish?
if query.public?
menu.with_item(
label: t(:button_unpublish),
scheme: :danger,
href: unpublish_projects_query_path(query),
content_arguments: { data: { method: :post } }
) do |item|
item.with_leading_visual_icon(icon: 'eye-closed')
end
else
menu.with_item(
label: t(:button_publish),
scheme: :default,
href: publish_projects_query_path(query),
content_arguments: { data: { method: :post } }
) do |item|
item.with_leading_visual_icon(icon: 'eye')
end
end
end

menu.with_item(
label: t(:button_delete),
scheme: :danger,
Expand All @@ -92,7 +124,6 @@
end
end
%>
<%= render(Projects::ConfigureViewModalComponent.new(query:)) %>
<%= render(Projects::DeleteListModalComponent.new(query:)) if query.persisted? %>
<%= render(Projects::ExportListModalComponent.new(query:)) %>
Expand All @@ -101,15 +132,15 @@
render(Primer::OpenProject::PageHeader.new) do |header|
header.with_title(data: { 'test-selector': 'project-query-name'}) do
primer_form_with(model: query,
url: @query.new_record? ? projects_queries_path : projects_query_path(@query),
url: @query.new_record? ? projects_queries_path(projects_query_params) : projects_query_path(@query, projects_query_params),
scope: 'query',
data: {
controller: "params-from-query",
'application-target': "dynamic",
'params-from-query-allowed-value': '["filters", "columns", "query_id", "sortBy"]'
},
id: 'project-save-form') do |f|
render(Queries::Projects::Form.new(f, query:))
render(
Queries::Projects::Form.new(
f,
cancel_url: projects_path(**projects_query_params, **{ query_id: query.id }.compact)
)
)
end
end
header.with_breadcrumbs(breadcrumb_items)
Expand Down
Loading

0 comments on commit df0eff7

Please sign in to comment.