diff --git a/.dockerignore b/.dockerignore index a8ba0c44986d..9847bf73b04e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -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 diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 176773af552c..e945cf1b8c7b 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,6 +1,9 @@ - +# Ticket + + + - + # What are you trying to accomplish? @@ -13,9 +16,6 @@ List any tradeoffs you made to take on or pay down tech debt. Describe any alternative approaches you considered and why you discarded them. --> -# Ticket - - # Merge checklist - [ ] Added/updated tests diff --git a/.github/workflows/i18n-tasks.yml b/.github/workflows/i18n-tasks.yml new file mode 100644 index 000000000000..fdc79ac23248 --- /dev/null +++ b/.github/workflows/i18n-tasks.yml @@ -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 diff --git a/.rubocop.yml b/.rubocop.yml index addb52904d6b..821c3902e520 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -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: diff --git a/Gemfile b/Gemfile index fd7e92c9d1d1..82afc46d7b9c 100644 --- a/Gemfile +++ b/Gemfile @@ -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" diff --git a/Gemfile.lock b/Gemfile.lock index 19afc7293201..a6b1b118f404 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -342,16 +342,16 @@ GEM activerecord (>= 4.0.0, < 7.2) awrence (1.2.1) aws-eventstream (1.3.0) - aws-partitions (1.963.0) - aws-sdk-core (3.201.4) + aws-partitions (1.964.0) + aws-sdk-core (3.201.5) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) - aws-sigv4 (~> 1.8) + aws-sigv4 (~> 1.9) jmespath (~> 1, >= 1.6.1) aws-sdk-kms (1.88.0) aws-sdk-core (~> 3, >= 3.201.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.157.0) + aws-sdk-s3 (1.158.0) aws-sdk-core (~> 3, >= 3.201.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) @@ -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) @@ -484,6 +488,14 @@ 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) @@ -491,6 +503,12 @@ GEM 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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -972,7 +990,7 @@ GEM rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-rails (6.1.3) + rspec-rails (6.1.4) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) @@ -1032,7 +1050,7 @@ GEM rubyzip (2.3.2) safety_net_attestation (0.4.0) jwt (~> 2.0) - sanitize (6.1.2) + sanitize (6.1.3) crass (~> 1.0.2) nokogiri (>= 1.12.0) secure_headers (6.5.0) @@ -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) @@ -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) @@ -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 diff --git a/app/components/_index.sass b/app/components/_index.sass index 2f1db2aa1ed7..bf0cfde03645 100644 --- a/app/components/_index.sass +++ b/app/components/_index.sass @@ -7,5 +7,4 @@ @import "open_project/common/submenu_component" @import "filter/filters_component" @import "projects/row_component" -@import "settings/project_custom_fields/project_custom_field_mapping/new_project_mapping_component" @import "op_primer/border_box_table_component" diff --git a/app/components/admin/attachments_settings_header_component.html.erb b/app/components/admin/attachments_settings_header_component.html.erb index a4d5767fed9a..a264231f9aaa 100644 --- a/app/components/admin/attachments_settings_header_component.html.erb +++ b/app/components/admin/attachments_settings_header_component.html.erb @@ -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") }, diff --git a/app/components/filter/filter_component.html.erb b/app/components/filter/filter_component.html.erb index 0d4759bebca9..43901b555bc9 100644 --- a/app/components/filter/filter_component.html.erb +++ b/app/components/filter/filter_component.html.erb @@ -113,15 +113,5 @@ <%= submit_tag t('button_apply'), class: 'button -small -primary', name: nil %> - <% unless EnterpriseToken.allows_to?(:custom_fields_in_projects_list)%> - <%= - helpers.angular_component_tag 'op-enterprise-banner', - inputs: { - collapsible: true, - textMessage: t('ee.upsale.project_filters.description_html'), - moreInfoLink: OpenProject::Static::Links.links[:enterprise_docs][:custom_field_projects][:href], - } - %> - <% end %> <% end %> diff --git a/app/components/individual_principal_base_filter_component.rb b/app/components/individual_principal_base_filter_component.rb index c8dc7d32d949..7e1291b6cfe9 100644 --- a/app/components/individual_principal_base_filter_component.rb +++ b/app/components/individual_principal_base_filter_component.rb @@ -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 diff --git a/app/components/my/access_token/access_token_created_dialog_component.html.erb b/app/components/my/access_token/access_token_created_dialog_component.html.erb index 366a3b613888..bdc7c01fa5d0 100644 --- a/app/components/my/access_token/access_token_created_dialog_component.html.erb +++ b/app/components/my/access_token/access_token_created_dialog_component.html.erb @@ -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. diff --git a/app/components/my/access_token/access_token_created_dialog_component.rb b/app/components/my/access_token/access_token_created_dialog_component.rb index b9c4924c79ae..4dce63aade45 100644 --- a/app/components/my/access_token/access_token_created_dialog_component.rb +++ b/app/components/my/access_token/access_token_created_dialog_component.rb @@ -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. diff --git a/app/components/my/access_token/api/row_component.rb b/app/components/my/access_token/api/row_component.rb index 6e89dd97804d..70641421e9c6 100644 --- a/app/components/my/access_token/api/row_component.rb +++ b/app/components/my/access_token/api/row_component.rb @@ -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. diff --git a/app/components/my/access_token/api/table_component.rb b/app/components/my/access_token/api/table_component.rb index 69d4d9fe5b77..dc0cd690e538 100644 --- a/app/components/my/access_token/api/table_component.rb +++ b/app/components/my/access_token/api/table_component.rb @@ -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. diff --git a/app/components/my/access_token/api_tokens_section_component.html.erb b/app/components/my/access_token/api_tokens_section_component.html.erb index 0e89fa591810..cd6206d5638d 100644 --- a/app/components/my/access_token/api_tokens_section_component.html.erb +++ b/app/components/my/access_token/api_tokens_section_component.html.erb @@ -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. diff --git a/app/components/my/access_token/api_tokens_section_component.rb b/app/components/my/access_token/api_tokens_section_component.rb index b5faee9bd59b..e6aa64c28352 100644 --- a/app/components/my/access_token/api_tokens_section_component.rb +++ b/app/components/my/access_token/api_tokens_section_component.rb @@ -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. diff --git a/app/components/placeholder_users/placeholder_user_filter_component.rb b/app/components/placeholder_users/placeholder_user_filter_component.rb index 5afa134f538c..7188d1b20d83 100644 --- a/app/components/placeholder_users/placeholder_user_filter_component.rb +++ b/app/components/placeholder_users/placeholder_user_filter_component.rb @@ -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 diff --git a/app/components/placeholder_users/row_component.rb b/app/components/placeholder_users/row_component.rb index 29556731ffa0..a3521b287f53 100644 --- a/app/components/placeholder_users/row_component.rb +++ b/app/components/placeholder_users/row_component.rb @@ -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 diff --git a/app/components/placeholder_users/table_component.rb b/app/components/placeholder_users/table_component.rb index 450a7f50e3f1..d43d368a3c3e 100644 --- a/app/components/placeholder_users/table_component.rb +++ b/app/components/placeholder_users/table_component.rb @@ -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 diff --git a/app/components/projects/index_page_header_component.rb b/app/components/projects/index_page_header_component.rb index ee0bdbe3f0d5..eb8aefb86aed 100644 --- a/app/components/projects/index_page_header_component.rb +++ b/app/components/projects/index_page_header_component.rb @@ -65,9 +65,8 @@ def gantt_portfolio_project_ids @gantt_portfolio_project_ids ||= @query .results .where(active: true) - .select(:id) - .uniq .pluck(:id) + .uniq end def page_title diff --git a/app/components/projects/projects_filters_component.rb b/app/components/projects/projects_filters_component.rb index 058bb1cd7ad2..998369b943f8 100644 --- a/app/components/projects/projects_filters_component.rb +++ b/app/components/projects/projects_filters_component.rb @@ -41,20 +41,20 @@ def allowed_filters def allowed_filter?(filter) allowlist = [ + Queries::Filters::Shared::CustomFields::Base, Queries::Projects::Filters::ActiveFilter, - Queries::Projects::Filters::TemplatedFilter, - Queries::Projects::Filters::PublicFilter, - Queries::Projects::Filters::ProjectStatusFilter, - Queries::Projects::Filters::MemberOfFilter, Queries::Projects::Filters::CreatedAtFilter, + Queries::Projects::Filters::FavoredFilter, + Queries::Projects::Filters::IdFilter, Queries::Projects::Filters::LatestActivityAtFilter, + Queries::Projects::Filters::MemberOfFilter, Queries::Projects::Filters::NameAndIdentifierFilter, - Queries::Projects::Filters::TypeFilter, - Queries::Projects::Filters::FavoredFilter, - Queries::Projects::Filters::IdFilter + Queries::Projects::Filters::ProjectStatusFilter, + Queries::Projects::Filters::PublicFilter, + Queries::Projects::Filters::TemplatedFilter, + Queries::Projects::Filters::TypeFilter ] - allowlist << Queries::Filters::Shared::CustomFields::Base if EnterpriseToken.allows_to?(:custom_fields_in_projects_list) - allowlist.detect { |clazz| filter.is_a? clazz } + allowlist.any? { |clazz| filter.is_a? clazz } end end diff --git a/app/components/projects/table_component.html.erb b/app/components/projects/table_component.html.erb index 75c710351551..cb6fc2afc953 100644 --- a/app/components/projects/table_component.html.erb +++ b/app/components/projects/table_component.html.erb @@ -31,12 +31,12 @@ See COPYRIGHT and LICENSE files for more details.
- > +
> <% columns.each do |column| %> - > + <%= tag :col, data: { highlight: column.attribute != :hierarchy } %> <% end %> - + diff --git a/app/components/settings/project_custom_fields/project_custom_field_mapping/new_project_mapping_component.sass b/app/components/settings/project_custom_fields/project_custom_field_mapping/new_project_mapping_component.sass deleted file mode 100644 index 76511b9c5b3e..000000000000 --- a/app/components/settings/project_custom_fields/project_custom_field_mapping/new_project_mapping_component.sass +++ /dev/null @@ -1,8 +0,0 @@ -@import 'helpers' - -.op-new-project-mapping-form - .ng-placeholder - @extend .icon-search - &:before - @include icon-font-common - margin-right: 10px diff --git a/app/components/table_component.html.erb b/app/components/table_component.html.erb index eb7b80bec8db..9449d5dc4894 100644 --- a/app/components/table_component.html.erb +++ b/app/components/table_component.html.erb @@ -29,12 +29,12 @@ See COPYRIGHT and LICENSE files for more details.
-
+
<% headers.each do |_name, _options| %> - + <% end %> - + diff --git a/app/components/user_filter_component.rb b/app/components/user_filter_component.rb index 009df75a4095..42c49f8d8cb6 100644 --- a/app/components/user_filter_component.rb +++ b/app/components/user_filter_component.rb @@ -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 diff --git a/app/components/users/delete_page_header_component.html.erb b/app/components/users/delete_page_header_component.html.erb index a732ba75b105..c96a1e014b73 100644 --- a/app/components/users/delete_page_header_component.html.erb +++ b/app/components/users/delete_page_header_component.html.erb @@ -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. diff --git a/app/components/work_packages/details/tab_component.html.erb b/app/components/work_packages/details/tab_component.html.erb index 5c88f03c2f16..1561aa56938e 100644 --- a/app/components/work_packages/details/tab_component.html.erb +++ b/app/components/work_packages/details/tab_component.html.erb @@ -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 diff --git a/app/components/work_packages/details/update_counter_component.rb b/app/components/work_packages/details/update_counter_component.rb new file mode 100644 index 000000000000..48d0c64f4ce8 --- /dev/null +++ b/app/components/work_packages/details/update_counter_component.rb @@ -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 diff --git a/app/components/work_packages/split_view_component.html.erb b/app/components/work_packages/split_view_component.html.erb index 48b1549e621b..acc03f9bbe2d 100644 --- a/app/components/work_packages/split_view_component.html.erb +++ b/app/components/work_packages/split_view_component.html.erb @@ -18,6 +18,8 @@ helpers.angular_component_tag "opce-wp-split-view", inputs: { work_package_id: params[:work_package_id] || @work_package.id, + resizerClass: "op-work-package-split-view", + resizeStyle: "width", activeTab: @tab } end diff --git a/app/controllers/concerns/work_packages/with_split_view.rb b/app/controllers/concerns/work_packages/with_split_view.rb index 0f9cfe748960..73df17bedf52 100644 --- a/app/controllers/concerns/work_packages/with_split_view.rb +++ b/app/controllers/concerns/work_packages/with_split_view.rb @@ -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. diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 2db952aeb488..123c55e92940 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -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. @@ -31,7 +31,7 @@ class NotificationsController < ApplicationController before_action :require_login before_action :filtered_query, only: :mark_all_read - no_authorization_required! :index, :split_view, :close_split_view, :mark_all_read, :date_alerts, :share_upsale + no_authorization_required! :index, :split_view, :update_counter, :close_split_view, :mark_all_read, :date_alerts, :share_upsale def index render_notifications_layout diff --git a/app/controllers/placeholder_users/memberships_controller.rb b/app/controllers/placeholder_users/memberships_controller.rb index 43997df5d8f1..7b164709921f 100644 --- a/app/controllers/placeholder_users/memberships_controller.rb +++ b/app/controllers/placeholder_users/memberships_controller.rb @@ -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 diff --git a/app/controllers/placeholder_users_controller.rb b/app/controllers/placeholder_users_controller.rb index 15caa91125c9..82d6660e274c 100644 --- a/app/controllers/placeholder_users_controller.rb +++ b/app/controllers/placeholder_users_controller.rb @@ -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 diff --git a/app/controllers/work_packages/split_view_controller.rb b/app/controllers/work_packages/split_view_controller.rb new file mode 100644 index 000000000000..4a5a9057d95a --- /dev/null +++ b/app/controllers/work_packages/split_view_controller.rb @@ -0,0 +1,55 @@ +#-- 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. +#++ + +require "rack/utils" + +class WorkPackages::SplitViewController < ApplicationController + # Authorization is checked in the find_work_package action + no_authorization_required! :update_counter + before_action :find_work_package, only: %i[update_counter] + + def update_counter + respond_to do |format| + format.turbo_stream do + render turbo_stream: [ + WorkPackages::Details::UpdateCounterComponent + .new(work_package: @work_package, menu_name: params[:counter]) + .render_as_turbo_stream(action: :replace, view_context:) + ] + end + end + end + + private + + def find_work_package + @work_package = WorkPackage.visible.find(params[:id]) + rescue ActiveRecord::RecordNotFound + render_404 message: I18n.t(:error_work_package_id_not_found) + end +end diff --git a/app/forms/projects/custom_fields/custom_field_mapping_form.rb b/app/forms/projects/custom_fields/custom_field_mapping_form.rb index a6076e7d59a1..cda7e1c10e42 100644 --- a/app/forms/projects/custom_fields/custom_field_mapping_form.rb +++ b/app/forms/projects/custom_fields/custom_field_mapping_form.rb @@ -38,6 +38,7 @@ class CustomFieldMappingForm < ApplicationForm visually_hide_label: true, validation_message: project_ids_error_message, autocomplete_options: { + with_search_icon: true, openDirectly: false, focusDirectly: false, multiple: true, diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e42b67248862..85cea8735937 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -172,9 +172,21 @@ def labeled_check_box_tags(name, collection, options = {}) end def html_hours(text) - text.gsub(%r{(\d+)\.(\d+)}, - '\1.\2') - .html_safe + html_safe_gsub(text, + %r{(\d+)\.(\d+)}, + '\1.\2') + end + + def html_safe_gsub(string, *gsub_args, &) + html_safe = string.html_safe? + string.gsub(*gsub_args, &) + + # We only mark the string as safe if the previous string was already safe + if html_safe + string.html_safe # rubocop:disable Rails/OutputSafety + else + string + end end def authoring(created, author, options = {}) @@ -252,19 +264,18 @@ def accesskey(s) # Same as Rails' simple_format helper without using paragraphs def simple_format_without_paragraph(text) - text.to_s - .gsub(/\r\n?/, "\n") # \r\n and \r -> \n - .gsub(/\n\n+/, "

") # 2+ newline -> 2 br - .gsub(/([^\n]\n)(?=[^\n])/, '\1
') # 1 newline -> br - .html_safe + html_safe_gsub(text.to_s, /\r\n?/, "\n") + .then { |res| html_safe_gsub(res, /\n\n+/, "

") } + .then { |res| html_safe_gsub(res, /([^\n]\n)(?=[^\n])/, '\1
') } end def lang_options_for_select(blank = true) - auto = if blank && (valid_languages - all_languages) == (all_languages - valid_languages) - [["(auto)", ""]] - else - [] - end + auto = + if blank && (valid_languages - all_languages) == (all_languages - valid_languages) + [["(auto)", ""]] + else + [] + end mapped_languages = valid_languages.map { |lang| translate_language(lang) } @@ -344,10 +355,10 @@ def current_layout # A hash containing the following keys: # * width: (default '100px') the css-width for the progress bar # * legend: (default: '') the text displayed alond with the progress bar - def progress_bar(pcts, options = {}) + def progress_bar(pcts, options = {}) # rubocop:disable Metrics/AbcSize pcts = Array(pcts).map(&:round) closed = pcts[0] - done = pcts[1] || 0 + done = pcts[1] || 0 width = options[:width] || "100px;" legend = options[:legend] || "" total_progress = options[:hide_total_progress] ? "" : t(:total_progress) @@ -356,7 +367,7 @@ def progress_bar(pcts, options = {}) content_tag :span do progress = content_tag :span, class: "progress-bar", style: "width: #{width}" do concat content_tag(:span, "", class: "inner-progress closed", style: "width: #{closed}%") - concat content_tag(:span, "", class: "inner-progress done", style: "width: #{done}%") + concat content_tag(:span, "", class: "inner-progress done", style: "width: #{done}%") end progress + content_tag(:span, "#{legend}#{percent_sign} #{total_progress}", class: "progress-bar-legend") end @@ -369,8 +380,10 @@ def checked_image(checked = true) end def calendar_for(*_args) - ActiveSupport::Deprecation.warn "calendar_for has been removed. Please use the op-basic-single-date-picker angular component instead", - caller + ActiveSupport::Deprecation.warn( + "calendar_for has been removed. Please use the opce-basic-single-date-picker angular component instead", + caller + ) end def locale_first_day_of_week @@ -435,7 +448,7 @@ def permitted_params def translate_language(lang_code) # rename in-context translation language name for the language select box if lang_code.to_sym == Redmine::I18n::IN_CONTEXT_TRANSLATION_CODE && - ::I18n.locale != Redmine::I18n::IN_CONTEXT_TRANSLATION_CODE + ::I18n.locale != Redmine::I18n::IN_CONTEXT_TRANSLATION_CODE [Redmine::I18n::IN_CONTEXT_TRANSLATION_NAME, lang_code.to_s] else [I18n.t("cldr.language_name", locale: lang_code), lang_code.to_s] diff --git a/app/helpers/custom_fields_helper.rb b/app/helpers/custom_fields_helper.rb index fa2e4b641e9d..e5c8951c2e2d 100644 --- a/app/helpers/custom_fields_helper.rb +++ b/app/helpers/custom_fields_helper.rb @@ -63,7 +63,7 @@ def custom_fields_tabs end # Return custom field html tag corresponding to its format - def custom_field_tag(name, custom_value) + def custom_field_tag(name, custom_value) # rubocop:disable Metrics/AbcSize,Metrics/PerceivedComplexity custom_field = custom_value.custom_field field_name = "#{name}[custom_field_values][#{custom_field.id}]" field_id = "#{name}_custom_field_values_#{custom_field.id}" @@ -72,7 +72,7 @@ def custom_field_tag(name, custom_value) tag = case field_format.try(:edit_as) when "date" - angular_component_tag "op-basic-single-date-picker", + angular_component_tag "opce-basic-single-date-picker", inputs: { required: custom_field.is_required, value: custom_value.value, @@ -143,14 +143,14 @@ def custom_field_tag_with_label(name, custom_value) custom_field_label_tag(name, custom_value) + custom_field_tag(name, custom_value) end - def custom_field_tag_for_bulk_edit(name, custom_field, project = nil) + def custom_field_tag_for_bulk_edit(name, custom_field, project = nil) # rubocop:disable Metrics/AbcSize field_name = "#{name}[custom_field_values][#{custom_field.id}]" field_id = "#{name}_custom_field_values_#{custom_field.id}" field_format = OpenProject::CustomFieldFormat.find_by_name(custom_field.field_format) case field_format.try(:edit_as) when "date" - angular_component_tag "op-modal-single-date-picker", + angular_component_tag "opce-modal-single-date-picker", inputs: { id: field_id, name: field_name diff --git a/app/helpers/menus/notifications.rb b/app/helpers/menus/notifications.rb index 6921e6922091..fcba2962fa23 100644 --- a/app/helpers/menus/notifications.rb +++ b/app/helpers/menus/notifications.rb @@ -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. diff --git a/app/helpers/sort_helper.rb b/app/helpers/sort_helper.rb index ea2451e9a542..d1fbb2d634a9 100644 --- a/app/helpers/sort_helper.rb +++ b/app/helpers/sort_helper.rb @@ -286,7 +286,7 @@ def sort_link(column, caption, default_order, allowed_params: nil, **html_option allowed_params ||= %w[filters per_page expand columns] # Don't lose other params. - link_to_content_update(h(caption), safe_query_params(allowed_params).merge(sort_options), html_options) + link_to_content_update(h(caption), safe_query_params(allowed_params).merge(sort_options), html_options.merge(rel: :nofollow)) end # Returns a table header
tag with a sort link for the named column diff --git a/app/models/anonymous_user.rb b/app/models/anonymous_user.rb index f6d73f1f30cf..27e4514d6563 100644 --- a/app/models/anonymous_user.rb +++ b/app/models/anonymous_user.rb @@ -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 diff --git a/app/models/auth_provider.rb b/app/models/auth_provider.rb new file mode 100644 index 000000000000..69d724c0faed --- /dev/null +++ b/app/models/auth_provider.rb @@ -0,0 +1,47 @@ +#-- 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 AuthProvider < ApplicationRecord + belongs_to :creator, class_name: "User" + + validates :display_name, presence: true + validates :display_name, uniqueness: true + + def self.slug_fragment + raise NotImplementedError + end + + def auth_url + root_url = OpenProject::StaticRouting::StaticUrlHelpers.new.root_url + URI.join(root_url, "auth/#{slug}/").to_s + end + + def callback_url + URI.join(auth_url, "callback").to_s + end +end diff --git a/app/models/placeholder_user.rb b/app/models/placeholder_user.rb index edb42eec151f..61b3a826cbc8 100644 --- a/app/models/placeholder_user.rb +++ b/app/models/placeholder_user.rb @@ -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 diff --git a/app/models/queries/notifications.rb b/app/models/queries/notifications.rb index ddb7beb0a338..538d3987194c 100644 --- a/app/models/queries/notifications.rb +++ b/app/models/queries/notifications.rb @@ -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 diff --git a/app/models/queries/notifications/notification_query.rb b/app/models/queries/notifications/notification_query.rb index ca941033bcf5..2bb91ec02b68 100644 --- a/app/models/queries/notifications/notification_query.rb +++ b/app/models/queries/notifications/notification_query.rb @@ -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 diff --git a/app/models/queries/placeholder_users.rb b/app/models/queries/placeholder_users.rb index a98c53f8eea7..c2dabcf62664 100644 --- a/app/models/queries/placeholder_users.rb +++ b/app/models/queries/placeholder_users.rb @@ -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 diff --git a/app/models/queries/placeholder_users/placeholder_user_query.rb b/app/models/queries/placeholder_users/placeholder_user_query.rb index ae89cb42944c..ee592f7b7d9f 100644 --- a/app/models/queries/placeholder_users/placeholder_user_query.rb +++ b/app/models/queries/placeholder_users/placeholder_user_query.rb @@ -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 diff --git a/app/models/queries/projects/orders/project_status_order.rb b/app/models/queries/projects/orders/project_status_order.rb index acabb614fcb5..7922a19f3800 100644 --- a/app/models/queries/projects/orders/project_status_order.rb +++ b/app/models/queries/projects/orders/project_status_order.rb @@ -37,7 +37,7 @@ def self.key def order(scope) with_raise_on_invalid do - scope.order(Arel.sql("status_code").send(direction)) + scope.order(status_code: direction) end end end diff --git a/app/models/queries/projects/selects/custom_field.rb b/app/models/queries/projects/selects/custom_field.rb index 97b855e319fa..b1b19f29ee28 100644 --- a/app/models/queries/projects/selects/custom_field.rb +++ b/app/models/queries/projects/selects/custom_field.rb @@ -33,10 +33,6 @@ def self.key /cf_(\d+)/ end - def self.available? - EnterpriseToken.allows_to?(:custom_fields_in_projects_list) - end - def self.all_available return [] unless available? diff --git a/app/models/work_packages/scopes/include_spent_time.rb b/app/models/work_packages/scopes/include_spent_time.rb index 4aa24c1183c7..ac0cfe3ced1d 100644 --- a/app/models/work_packages/scopes/include_spent_time.rb +++ b/app/models/work_packages/scopes/include_spent_time.rb @@ -31,12 +31,11 @@ module WorkPackages::Scopes::IncludeSpentTime class_methods do def include_spent_time(user, work_package = nil) - query = join_time_entries(user) - scope = left_join_self_and_descendants(user, work_package) - .joins(query.join_sources) + .with(visible_time_entries_cte.name => allowed_to_view_time_entries(user)) + .joins(join_visible_time_entries.join_sources) .group(:id) - .select("SUM(time_entries.hours) AS hours") + .select("SUM(#{visible_time_entries_cte.name}.hours) AS hours") if work_package scope.where(id: work_package.id) @@ -47,18 +46,14 @@ def include_spent_time(user, work_package = nil) protected - def join_time_entries(user) - join_condition = time_entries_table[:work_package_id] - .eq(wp_descendants[:id]) - .and(allowed_to_view_time_entries(user)) - + def join_visible_time_entries wp_table - .outer_join(time_entries_table) - .on(join_condition) + .outer_join(visible_time_entries_cte) + .on(visible_time_entries_cte[:work_package_id].eq(wp_descendants[:id])) end def allowed_to_view_time_entries(user) - time_entries_table[:id].in(TimeEntry.not_ongoing.visible(user).select(:id).arel) + TimeEntry.not_ongoing.visible(user).select(:id, :work_package_id, :hours).arel end def wp_table @@ -71,8 +66,8 @@ def wp_descendants @wp_descendants ||= wp_table.alias("descendants") end - def time_entries_table - @time_entries_table ||= TimeEntry.arel_table + def visible_time_entries_cte + @visible_time_entries_cte ||= Arel::Table.new("visible_time_entries") end end end diff --git a/app/services/authorization/enterprise_service.rb b/app/services/authorization/enterprise_service.rb index 5dacadd9c960..f07c857f0dae 100644 --- a/app/services/authorization/enterprise_service.rb +++ b/app/services/authorization/enterprise_service.rb @@ -29,29 +29,28 @@ class Authorization::EnterpriseService attr_accessor :token - GUARDED_ACTIONS = %i( + GUARDED_ACTIONS = %i[ baseline_comparison board_view conditional_highlighting custom_actions - custom_fields_in_projects_list date_alerts define_custom_style edit_attribute_groups + gantt_pdf_export grid_widget_wp_graph ldap_groups + one_drive_sharepoint_file_storage openid_providers placeholder_users + project_list_sharing readonly_work_packages team_planner_view two_factor_authentication + virus_scanning work_package_query_relation_columns work_package_sharing - one_drive_sharepoint_file_storage - virus_scanning - gantt_pdf_export - project_list_sharing - ).freeze + ].freeze def initialize(token) self.token = token diff --git a/app/services/custom_fields/create_service.rb b/app/services/custom_fields/create_service.rb index 3009ecbb377f..4d08c8aaba4a 100644 --- a/app/services/custom_fields/create_service.rb +++ b/app/services/custom_fields/create_service.rb @@ -54,7 +54,7 @@ def instance(params) def after_perform(call) cf = call.result - if cf.is_a?(ProjectCustomField) && EnterpriseToken.allows_to?(:custom_fields_in_projects_list) + if cf.is_a?(ProjectCustomField) add_cf_to_visible_columns(cf) end diff --git a/app/services/work_packages/set_attributes_service/derive_progress_values_base.rb b/app/services/work_packages/set_attributes_service/derive_progress_values_base.rb index 9c637bc96f26..0138952612d1 100644 --- a/app/services/work_packages/set_attributes_service/derive_progress_values_base.rb +++ b/app/services/work_packages/set_attributes_service/derive_progress_values_base.rb @@ -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. diff --git a/app/services/work_packages/set_attributes_service/derive_progress_values_status_based.rb b/app/services/work_packages/set_attributes_service/derive_progress_values_status_based.rb index 5fdc67429e48..b38db2a6744a 100644 --- a/app/services/work_packages/set_attributes_service/derive_progress_values_status_based.rb +++ b/app/services/work_packages/set_attributes_service/derive_progress_values_status_based.rb @@ -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. diff --git a/app/services/work_packages/set_attributes_service/derive_progress_values_work_based.rb b/app/services/work_packages/set_attributes_service/derive_progress_values_work_based.rb index 155e0796c984..c599d8456876 100644 --- a/app/services/work_packages/set_attributes_service/derive_progress_values_work_based.rb +++ b/app/services/work_packages/set_attributes_service/derive_progress_values_work_based.rb @@ -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. diff --git a/app/services/work_packages/set_attributes_service/pre_14_4_derive_progress_values.rb b/app/services/work_packages/set_attributes_service/pre_14_4_derive_progress_values.rb index a1766f16c601..0248a413bf8f 100644 --- a/app/services/work_packages/set_attributes_service/pre_14_4_derive_progress_values.rb +++ b/app/services/work_packages/set_attributes_service/pre_14_4_derive_progress_values.rb @@ -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. diff --git a/app/views/admin/backups/show.html.erb b/app/views/admin/backups/show.html.erb index 4c9d15683957..1b6f6fa64d16 100644 --- a/app/views/admin/backups/show.html.erb +++ b/app/views/admin/backups/show.html.erb @@ -90,7 +90,7 @@ See COPYRIGHT and LICENSE files for more details. <% end %> <% if @backup_token.present? %> -<%= tag :backup, data: { +<%= angular_component_tag "opce-backup", data: { 'job-status-id': @job_status_id, 'last-backup-date': @last_backup_date, 'last-backup-attachment-id': @last_backup_attachment_id, diff --git a/app/views/admin/settings/projects_settings/show.html.erb b/app/views/admin/settings/projects_settings/show.html.erb index c7f40de398af..f8ee4cf5648e 100644 --- a/app/views/admin/settings/projects_settings/show.html.erb +++ b/app/views/admin/settings/projects_settings/show.html.erb @@ -39,20 +39,6 @@ See COPYRIGHT and LICENSE files for more details. <%= styled_form_tag(admin_settings_projects_path, method: :patch) do %>
- <% unless EnterpriseToken.allows_to?(:custom_fields_in_projects_list) %> -
- <%= - angular_component_tag 'op-enterprise-banner', - inputs: { - textMessage: t('text_project_custom_field_html'), - collapsible: true, - moreInfoLink: OpenProject::Static::Links.links[:enterprise_docs][:custom_field_projects][:href], - } - %> -
- <% end %> - -
<%= angular_component_tag 'opce-draggable-autocompleter', @@ -75,14 +61,13 @@ See COPYRIGHT and LICENSE files for more details.
- <%= content_tag 'editable-query-props', - '', - data: { - name: 'settings[project_gantt_query]', - id: 'settings_project_gantt_query', - query: ::Projects::GanttQueryGeneratorService.current_query, - 'url-params': 'true' - } + <%= angular_component_tag 'opce-editable-query-props', + data: { + name: 'settings[project_gantt_query]', + id: 'settings_project_gantt_query', + query: ::Projects::GanttQueryGeneratorService.current_query, + 'url-params': 'true' + } %> diff --git a/app/views/admin/settings/work_packages_settings/_enterprise_feature_hint.html.erb b/app/views/admin/settings/work_packages_settings/_enterprise_feature_hint.html.erb index 88daaf178482..d82dc602b7c1 100644 --- a/app/views/admin/settings/work_packages_settings/_enterprise_feature_hint.html.erb +++ b/app/views/admin/settings/work_packages_settings/_enterprise_feature_hint.html.erb @@ -1,7 +1,7 @@ <% unless EnterpriseToken.allows_to?(ee_feature) %> <%= - angular_component_tag 'op-enterprise-banner', + angular_component_tag 'opce-enterprise-banner', inputs: { collapsible: true, textMessage: explanation, diff --git a/app/views/admin/settings/working_days_and_hours_settings/show.html.erb b/app/views/admin/settings/working_days_and_hours_settings/show.html.erb index 6dd8ceaac2ba..80f82d5479fc 100644 --- a/app/views/admin/settings/working_days_and_hours_settings/show.html.erb +++ b/app/views/admin/settings/working_days_and_hours_settings/show.html.erb @@ -90,7 +90,7 @@ See COPYRIGHT and LICENSE files for more details.

<%= t("working_days.instance_wide_info") %>

- <%= angular_component_tag "op-non-working-days-list", + <%= angular_component_tag "opce-non-working-days-list", data: { modified_non_working_days: @modified_non_working_days } %>
diff --git a/app/views/attribute_help_texts/_tab.html.erb b/app/views/attribute_help_texts/_tab.html.erb index edc64251d148..8b59eed73835 100644 --- a/app/views/attribute_help_texts/_tab.html.erb +++ b/app/views/attribute_help_texts/_tab.html.erb @@ -2,12 +2,12 @@ <% if entries.any? %>
- +
- - - + + + @@ -42,7 +42,7 @@ edit_attribute_help_text_path(attribute_help_text) %>
- <%= angular_component_tag 'attribute-help-text', + <%= angular_component_tag 'opce-attribute-help-text', inputs: { helpTextId: attribute_help_text.id, attribute: attribute_help_text.attribute_name, diff --git a/app/views/augmented/_collapsible_section.html.erb b/app/views/augmented/_collapsible_section.html.erb index b223a5c174aa..4b9986a9ffd9 100644 --- a/app/views/augmented/_collapsible_section.html.erb +++ b/app/views/augmented/_collapsible_section.html.erb @@ -1,6 +1,6 @@ - - - <% end %> @@ -116,8 +117,8 @@ - - + + diff --git a/app/views/custom_fields/_custom_options.html.erb b/app/views/custom_fields/_custom_options.html.erb index 42104014231b..f20f6934f719 100644 --- a/app/views/custom_fields/_custom_options.html.erb +++ b/app/views/custom_fields/_custom_options.html.erb @@ -32,12 +32,12 @@ See COPYRIGHT and LICENSE files for more details.
- +
- - - + + + diff --git a/app/views/custom_fields/_tab.html.erb b/app/views/custom_fields/_tab.html.erb index 1fd4373cdda3..5616d5199745 100644 --- a/app/views/custom_fields/_tab.html.erb +++ b/app/views/custom_fields/_tab.html.erb @@ -27,20 +27,9 @@ See COPYRIGHT and LICENSE files for more details. ++#%> -<% if tab[:name] == 'ProjectCustomField' %> - <% unless EnterpriseToken.allows_to?(:custom_fields_in_projects_list) %> - <%= - angular_component_tag 'op-enterprise-banner', - inputs: { - collapsible: true, - textMessage: t('text_project_custom_field_html'), - moreInfoLink: OpenProject::Static::Links.links[:enterprise_docs][:custom_field_projects][:href], - } - %> - <% end %> -<% end %> - -<% if (@custom_fields_by_type[tab[:name]] || []).any? %> +<% if @custom_fields_by_type[tab[:name]].blank? %> + <%= no_results_box(action_url: new_custom_field_path(type: tab[:name]), display_action: true) %> +<% else %>
<% if tab[:name] == 'WorkPackageCustomField' %> @@ -50,17 +39,17 @@ See COPYRIGHT and LICENSE files for more details.
<% end %> -
+
- - + + <% if tab[:name] == 'WorkPackageCustomField' %> - - + + <% end %> - - + + @@ -177,6 +166,4 @@ See COPYRIGHT and LICENSE files for more details.
-<% else %> - <%= no_results_box(action_url: new_custom_field_path(type: tab[:name]), display_action: true) %> <% end %> diff --git a/app/views/custom_styles/_primer_color_mapping.erb b/app/views/custom_styles/_primer_color_mapping.erb index e45aba87f383..e169a42e33c0 100644 --- a/app/views/custom_styles/_primer_color_mapping.erb +++ b/app/views/custom_styles/_primer_color_mapping.erb @@ -86,5 +86,9 @@ --type-form-conf-attribute--background: var(--overlay-bgColor); --select-arrow-bg-color-url: url("data:image/svg+xml;utf8,"); --ck-color-mention-text: var(--display-red-fgColor); + --ck-color-button-on-background: var(--button-default-bgColor-active); + --ck-color-button-default-active-background: var(--button-default-bgColor-active); + --ck-color-button-on-hover-background: var(--button-default-bgColor-hover); + --ck-color-button-on-disabled-background: var(--button-default-bgColor-disabled); } diff --git a/app/views/custom_styles/show.html.erb b/app/views/custom_styles/show.html.erb index 1368cf54c11d..9ffedb2176f1 100644 --- a/app/views/custom_styles/show.html.erb +++ b/app/views/custom_styles/show.html.erb @@ -156,10 +156,10 @@ See COPYRIGHT and LICENSE files for more details. <% end %> <% custom_export_expanded = @custom_style.id && (@custom_style.export_logo.present? || @custom_style.export_cover.present? || @custom_style.export_cover_text_color.present?) %> - - -