Skip to content

Commit

Permalink
Merge branch 'dev' into feature/48274-work-packages-export-modal-with…
Browse files Browse the repository at this point in the history
…-settings
  • Loading branch information
as-op authored Aug 20, 2024
2 parents 2d1e11e + 6fe005d commit 6483cce
Show file tree
Hide file tree
Showing 842 changed files with 4,306 additions and 2,692 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ browserslist
!/docs/api/apiv3/tags
!/docs/api/apiv3/components

# Allow factories in case we use lookbook
!/spec/factories

extra
features
help
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/i18n-tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: i18n-inconsistency-check

on:
push:
branches:
- dev
- release/*
paths-ignore:
- 'docs/**'
- 'help/**'
pull_request:
types: [opened, reopened, synchronize]
paths-ignore:
- 'docs/**'
- 'help/**'
- 'packaging/**'
- '.pkgr.yml'

permissions:
contents: read

jobs:
i18n-tasks:
permissions:
contents: read
if: github.repository == 'opf/openproject'
name: I18n inconsistency check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Ruby
uses: ruby/setup-ruby@v1

- name: Setup i18n-tasks
run: |
gem install i18n-tasks
- name: Run inconsistent translations check
run: |
i18n-tasks \
check-consistent-interpolations \
--config config/i18n-tasks-all-files.yml
9 changes: 9 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,15 @@ Rails/DynamicFindBy:
Whitelist:
- find_by_login

# Allow reorder to prevent find each cop triggering
Rails/FindEach:
AllowedMethods:
- order
- reorder
- limit
- select
- lock

# We have config.active_record.belongs_to_required_by_default = false ,
# which means, we do have to declare presence validators on belongs_to relations.
Rails/RedundantPresenceValidationOnBelongsTo:
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ gem "validate_url"
gem "dry-auto_inject"
gem "dry-container"
gem "dry-monads"
gem "dry-validation"

# ActiveRecord extension which adds typecasting to store accessors
gem "store_attribute", "~> 1.0"
Expand Down
32 changes: 26 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -470,12 +470,16 @@ GEM
dry-auto_inject (1.0.1)
dry-core (~> 1.0)
zeitwerk (~> 2.6)
dry-configurable (1.2.0)
dry-core (~> 1.0, < 2)
zeitwerk (~> 2.6)
dry-container (0.11.0)
concurrent-ruby (~> 1.0)
dry-core (1.0.1)
concurrent-ruby (~> 1.0)
zeitwerk (~> 2.6)
dry-inflector (1.1.0)
dry-initializer (3.1.1)
dry-logic (1.5.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0, < 2)
Expand All @@ -484,13 +488,27 @@ GEM
concurrent-ruby (~> 1.0)
dry-core (~> 1.0, < 2)
zeitwerk (~> 2.6)
dry-schema (1.13.4)
concurrent-ruby (~> 1.0)
dry-configurable (~> 1.0, >= 1.0.1)
dry-core (~> 1.0, < 2)
dry-initializer (~> 3.0)
dry-logic (>= 1.4, < 2)
dry-types (>= 1.7, < 2)
zeitwerk (~> 2.6)
dry-types (1.7.2)
bigdecimal (~> 3.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0)
dry-inflector (~> 1.0)
dry-logic (~> 1.4)
zeitwerk (~> 2.6)
dry-validation (1.10.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0, < 2)
dry-initializer (~> 3.0)
dry-schema (>= 1.12, < 2)
zeitwerk (~> 2.6)
dumb_delegator (1.0.0)
em-http-request (1.1.7)
addressable (>= 2.3.4)
Expand Down Expand Up @@ -561,7 +579,7 @@ GEM
friendly_id (5.5.1)
activerecord (>= 4.0.0)
front_matter_parser (1.0.1)
fugit (1.11.0)
fugit (1.11.1)
et-orbi (~> 1, >= 1.2.11)
raabro (~> 1.4)
fuubar (2.5.1)
Expand Down Expand Up @@ -680,7 +698,7 @@ GEM
launchy (3.0.1)
addressable (~> 2.8)
childprocess (~> 5.0)
lefthook (1.7.12)
lefthook (1.7.14)
letter_opener (1.10.0)
launchy (>= 2.2, < 4)
letter_opener_web (3.0.0)
Expand Down Expand Up @@ -722,7 +740,7 @@ GEM
net-pop
net-smtp
marcel (1.0.4)
markly (0.10.0)
markly (0.12.1)
matrix (0.4.2)
messagebird-rest (1.4.2)
meta-tags (2.22.0)
Expand All @@ -734,7 +752,7 @@ GEM
mini_magick (5.0.1)
mini_mime (1.1.5)
mini_portile2 (2.8.7)
minitest (5.25.0)
minitest (5.25.1)
msgpack (1.7.2)
multi_json (1.15.0)
mustermann (3.0.2)
Expand Down Expand Up @@ -1046,7 +1064,7 @@ GEM
websocket (~> 1.0)
semantic (1.6.1)
shoulda-context (2.0.0)
shoulda-matchers (6.3.1)
shoulda-matchers (6.4.0)
activesupport (>= 5.2.0)
signet (0.19.0)
addressable (~> 2.8)
Expand Down Expand Up @@ -1123,7 +1141,8 @@ GEM
validate_url (1.0.15)
activemodel (>= 3.0.0)
public_suffix
vcr (6.2.0)
vcr (6.3.0)
base64
view_component (3.13.0)
activesupport (>= 5.2.0, < 8.0)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -1216,6 +1235,7 @@ DEPENDENCIES
dry-auto_inject
dry-container
dry-monads
dry-validation
email_validator (~> 2.2.3)
equivalent-xml (~> 0.6)
erb_lint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ 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|
<%= render(Primer::OpenProject::PageHeader.new) 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") },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# 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-2017 Jean-Philippe Lang
# 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%#-- copyright
OpenProject is an open source project management software.
Copyright (C) 2012-2024 the OpenProject GmbH
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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2024 the OpenProject GmbH
# 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.
Expand Down
2 changes: 1 addition & 1 deletion app/components/my/access_token/api/row_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2023 the OpenProject GmbH
# 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.
Expand Down
2 changes: 1 addition & 1 deletion app/components/my/access_token/api/table_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2023 the OpenProject GmbH
# 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%#-- copyright
OpenProject is an open source project management software.
Copyright (C) 2012-2024 the OpenProject GmbH
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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2024 the OpenProject GmbH
# 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# 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-2017 Jean-Philippe Lang
# 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
Expand Down
2 changes: 1 addition & 1 deletion app/components/placeholder_users/row_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# 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-2017 Jean-Philippe Lang
# 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
Expand Down
2 changes: 1 addition & 1 deletion app/components/placeholder_users/table_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# 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-2017 Jean-Philippe Lang
# 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
Expand Down
6 changes: 3 additions & 3 deletions app/components/projects/table_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ See COPYRIGHT and LICENSE files for more details.
<div class="generic-table--flex-container">
<div class="generic-table--container <%= container_class %>">
<div class="generic-table--results-container">
<table class="generic-table" <%= table_id ? "id=\"#{table_id}\"".html_safe : '' %>>
<table class="generic-table" data-controller="table-highlighting" <%= table_id ? "id=\"#{table_id}\"".html_safe : '' %>>
<colgroup>
<% columns.each do |column| %>
<col <%= "opHighlightCol" unless column.attribute == :hierarchy %> >
<%= tag :col, data: { highlight: column.attribute != :hierarchy } %>
<% end %>
<col>
<col data-highlight="false">
</colgroup>
<thead class="-sticky">
<tr>
Expand Down
6 changes: 3 additions & 3 deletions app/components/table_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ See COPYRIGHT and LICENSE files for more details.

<div class="generic-table--container <%= container_class %>" data-test-selector="<%= test_selector %>">
<div class="generic-table--results-container">
<table class="generic-table">
<table class="generic-table" data-controller="table-highlighting">
<colgroup>
<% headers.each do |_name, _options| %>
<col opHighlightCol>
<col>
<% end %>
<col>
<col data-highlight="false">
</colgroup>
<thead>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion app/components/user_filter_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# 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-2017 Jean-Philippe Lang
# 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
Expand Down
2 changes: 1 addition & 1 deletion app/components/users/delete_page_header_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%#-- copyright
OpenProject is an open source project management software.
Copyright (C) 2012-2024 the OpenProject GmbH
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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
) do |c|
c.with_text { t("js.work_packages.tabs.#{node.name}") }
count = node.badge(work_package:).to_i
c.with_counter(count:, test_selector: "wp-details-tab-component--tab-counter") if count > 0
c.with_counter(count:, hide_if_zero: true, id: "wp-details-tab-#{node.name}-counter", test_selector: "wp-details-tab-component--#{node.name}-counter")
end
end
end
Expand Down
50 changes: 50 additions & 0 deletions app/components/work_packages/details/update_counter_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# frozen_string_literal: true

class WorkPackages::Details::UpdateCounterComponent < ApplicationComponent
include OpPrimer::ComponentHelpers
include OpTurbo::Streamable

attr_reader :work_package, :menu_name

def initialize(work_package:, menu_name:)
super

@work_package = work_package
@menu = find_menu_item(menu_name)
end

def call
render Primer::Beta::Counter
.new(count:,
hide_if_zero: true,
id: wrapper_key,
test_selector: "wp-details-tab-component--#{@menu.name}-counter")
end

# We don't need a wrapper component, but wrap on the counter id
def wrapped?
true
end

def wrapper_key
"wp-details-tab-#{@menu.name}-counter"
end

def render?
@menu.present?
end

def count
@menu
.badge(work_package:)
.to_i
end

def find_menu_item(menu_name)
Redmine::MenuManager
.items(:work_package_split_view, nil)
.root
.children
.detect { |node| node.name.to_s == menu_name }
end
end
2 changes: 1 addition & 1 deletion app/controllers/concerns/work_packages/with_split_view.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2024 the OpenProject GmbH
# 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.
Expand Down
Loading

0 comments on commit 6483cce

Please sign in to comment.