mirror of
https://github.com/opf/openproject.git
synced 2026-06-13 19:20:00 +00:00
Merge branch 'release/17.1' into release/17.2
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
|
||||
class Projects::CreationWizardStatusComponent < ApplicationComponent
|
||||
include ApplicationHelper
|
||||
include ProjectHelper
|
||||
include ProjectsHelper
|
||||
|
||||
attr_reader :project, :current_user,
|
||||
:artifact_id, :artifact_work_package
|
||||
|
||||
@@ -34,7 +34,7 @@ module Projects
|
||||
include OpPrimer::ComponentHelpers
|
||||
include OpTurbo::Streamable
|
||||
include ApplicationHelper
|
||||
include ProjectHelper
|
||||
include ProjectsHelper
|
||||
|
||||
def initialize(project:, custom_fields_by_section:, current_section:)
|
||||
super
|
||||
|
||||
@@ -345,13 +345,4 @@ class ProjectsController < ApplicationController
|
||||
def login_back_url_params
|
||||
params.permit(:parent_id, :template_id, :step, :next_section)
|
||||
end
|
||||
|
||||
def portfolio_management_feature_required? = params[:workspace_type].in?(%w[portfolio program])
|
||||
|
||||
def portfolio_management_feature_missing?
|
||||
portfolio_management_feature_required? && !EnterpriseToken.allows_to?(:portfolio_management)
|
||||
end
|
||||
|
||||
helper_method :supported_export_formats,
|
||||
:portfolio_management_feature_missing?
|
||||
end
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) the OpenProject GmbH
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License version 3.
|
||||
#
|
||||
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
|
||||
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# See COPYRIGHT and LICENSE files for more details.
|
||||
#++
|
||||
|
||||
module ProjectHelper
|
||||
def project_creation_wizard_name(project)
|
||||
I18n.t(project.project_creation_wizard_artifact_name,
|
||||
default: :project_initiation_request,
|
||||
scope: "settings.project_initiation_request.name.options")
|
||||
end
|
||||
end
|
||||
@@ -93,4 +93,20 @@ module ProjectsHelper
|
||||
def projects_query_params
|
||||
safe_query_params(PROJECTS_QUERY_PARAM_NAMES)
|
||||
end
|
||||
|
||||
def supported_export_formats
|
||||
::Exports::Register.list_formats(Project).map(&:to_s)
|
||||
end
|
||||
|
||||
def project_creation_wizard_name(project)
|
||||
I18n.t(project.project_creation_wizard_artifact_name,
|
||||
default: :project_initiation_request,
|
||||
scope: "settings.project_initiation_request.name.options")
|
||||
end
|
||||
|
||||
def portfolio_management_feature_required? = params[:workspace_type].in?(%w[portfolio program])
|
||||
|
||||
def portfolio_management_feature_missing?
|
||||
portfolio_management_feature_required? && !EnterpriseToken.allows_to?(:portfolio_management)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#++
|
||||
|
||||
class ProjectArtifactsMailer < ApplicationMailer
|
||||
include ProjectHelper
|
||||
include ProjectsHelper
|
||||
include Exports::PDF::Common::Macro
|
||||
|
||||
def creation_wizard_submitted(user, project, artifact_work_package)
|
||||
|
||||
@@ -39,7 +39,7 @@ class Project::PDFExport::ProjectInitiation < Exports::Exporter
|
||||
include Project::PDFExport::Common::ProjectAttributes
|
||||
include Project::PDFExport::ProjectInitiation::Cover
|
||||
include Project::PDFExport::ProjectInitiation::Styles
|
||||
include ProjectHelper
|
||||
include ProjectsHelper
|
||||
|
||||
attr_accessor :pdf
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
module Projects::CreationWizard
|
||||
class CreateArtifactWorkPackageService < ::BaseServices::BaseContracted
|
||||
include Contracted
|
||||
include ProjectHelper
|
||||
include ProjectsHelper
|
||||
include ArtifactExporter
|
||||
include Rails.application.routes.url_helpers
|
||||
prepend Projects::Concerns::UpdateDemoData
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@
|
||||
module Projects::CreationWizard
|
||||
class ReuploadArtifactOnStatusChangesService
|
||||
include Contracted
|
||||
include ProjectHelper
|
||||
include ProjectsHelper
|
||||
include ArtifactExporter
|
||||
include Rails.application.routes.url_helpers
|
||||
prepend Projects::Concerns::UpdateDemoData
|
||||
|
||||
@@ -33,7 +33,7 @@ module Overviews
|
||||
extend Dry::Initializer
|
||||
|
||||
include ApplicationHelper
|
||||
include ProjectHelper
|
||||
include ProjectsHelper
|
||||
include Redmine::I18n
|
||||
|
||||
option :project
|
||||
|
||||
@@ -32,7 +32,7 @@ require "rails_helper"
|
||||
|
||||
RSpec.describe Projects::CreationWizardStatusComponent, type: :component do
|
||||
include ApplicationHelper
|
||||
include ProjectHelper
|
||||
include ProjectsHelper
|
||||
include Rails.application.routes.url_helpers
|
||||
|
||||
let(:current_user) { build_stubbed(:user) }
|
||||
|
||||
@@ -37,7 +37,9 @@ RSpec.describe "Persisted lists on projects index page",
|
||||
shared_let(:user) { create(:user) }
|
||||
|
||||
shared_let(:manager) { create(:project_role, name: "Manager") }
|
||||
shared_let(:developer) { create(:project_role, name: "Developer") }
|
||||
# The permission is not necessary for any of the tests. But it enables one more code path
|
||||
# where a regression occured before (#72362).
|
||||
shared_let(:developer) { create(:project_role, name: "Developer", permissions: %i(export_projects)) }
|
||||
|
||||
shared_let(:custom_field) { create(:text_project_custom_field) }
|
||||
shared_let(:invisible_custom_field) { create(:project_custom_field, admin_only: true) }
|
||||
|
||||
@@ -99,4 +99,11 @@ RSpec.describe ProjectsHelper do
|
||||
])
|
||||
end
|
||||
end
|
||||
|
||||
describe "#supported_export_formats" do
|
||||
it "returns the supported export formats" do
|
||||
expect(helper.supported_export_formats)
|
||||
.to match_array(%w[xls csv pdf])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -34,7 +34,7 @@ require_relative "../../projects/exporter/exportable_project_context"
|
||||
|
||||
RSpec.describe Project::PDFExport::ProjectInitiation do
|
||||
include PDFExportSpecUtils
|
||||
include ProjectHelper
|
||||
include ProjectsHelper
|
||||
include Redmine::I18n
|
||||
|
||||
include_context "with a project with an arrangement of custom fields"
|
||||
|
||||
Reference in New Issue
Block a user