OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Fix lookups and namespacing
Oliver Güntherd93fee38a47b
diff --git a/Gemfile.lock b/Gemfile.lockindex a8aaa7e1ac4..f3d945ac967 100644--- a/Gemfile.lock+++ b/Gemfile.lock@@ -102,18 +102,12 @@ PATHopenproject-pdf_exportPATH- remote: modules/bcf+ remote: modules/bimspecs:- openproject-bcf (1.0.0)+ openproject-bim (1.0.0)activerecord-importrubyzip (~> 1.2)-PATH- remote: modules/bim_seeder- specs:- openproject-bim_seeder (1.0.0)- openproject-bcf-PATHremote: modules/boardsspecs:@@ -151,13 +145,6 @@ PATHspecs:grids (1.0.0)-PATH- remote: modules/ifc_models- specs:- openproject-ifc_models (1.0.0)- activerecord-import- rubyzip (~> 1.2)-PATHremote: modules/ldap_groupsspecs:@@ -1046,14 +1033,12 @@ DEPENDENCIESopenproject-auth_saml!openproject-avatars!openproject-backlogs!- openproject-bcf!- openproject-bim_seeder!+ openproject-bim!openproject-boards!openproject-costs!openproject-documents!openproject-github_integration!openproject-global_roles!- openproject-ifc_models!openproject-ldap_groups!openproject-meeting!openproject-openid_connect!diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rbindex 08ef333ed84..df006aba880 100644--- a/config/initializers/inflections.rb+++ b/config/initializers/inflections.rb@@ -43,5 +43,4 @@ActiveSupport::Inflector.inflections(:en) do |inflect|inflect.acronym 'OAuth'inflect.acronym 'OpenID'- inflect.acronym 'IFC'enddiff --git a/modules/bim/app/cells/bim/ifc_models/row_cell.rb b/modules/bim/app/cells/bim/ifc_models/row_cell.rbindex 5a5c58314df..1744777d14b 100644--- a/modules/bim/app/cells/bim/ifc_models/row_cell.rb+++ b/modules/bim/app/cells/bim/ifc_models/row_cell.rb@@ -1,5 +1,5 @@module Bim- module IFCModels+ module IfcModelsclass RowCell < ::RowCellinclude ::IconsHelperinclude ::AvatarHelperdiff --git a/modules/bim/app/cells/bim/ifc_models/table_cell.rb b/modules/bim/app/cells/bim/ifc_models/table_cell.rbindex 279e89c9254..4d52216380c 100644--- a/modules/bim/app/cells/bim/ifc_models/table_cell.rb+++ b/modules/bim/app/cells/bim/ifc_models/table_cell.rb@@ -1,5 +1,5 @@module Bim- module IFCModels+ module IfcModelsclass TableCell < ::TableCellinclude ::IconsHelpercolumns :title, :default?, :created_at, :updated_at, :uploader, :processing@@ -26,11 +26,11 @@ module Bimdef headers[- ['title', caption: IFCModel.human_attribute_name(:title)],- ['is_default', caption: IFCModel.human_attribute_name(:is_default)],- ['created_at', caption: IFCModel.human_attribute_name(:created_at)],- ['updated_at', caption: IFCModel.human_attribute_name(:updated_at)],- ['uploader', caption: IFCModel.human_attribute_name(:uploader)],+ ['title', caption: IfcModel.human_attribute_name(:title)],+ ['is_default', caption: IfcModel.human_attribute_name(:is_default)],+ ['created_at', caption: IfcModel.human_attribute_name(:created_at)],+ ['updated_at', caption: IfcModel.human_attribute_name(:updated_at)],+ ['uploader', caption: IfcModel.human_attribute_name(:uploader)],['processing', caption: I18n.t('ifc_models.processing_state.label')]]enddiff --git a/modules/bim/app/contracts/bim/ifc_models/base_contract.rb b/modules/bim/app/contracts/bim/ifc_models/base_contract.rbindex 2dff8290d5f..f613fc727a3 100644--- a/modules/bim/app/contracts/bim/ifc_models/base_contract.rb+++ b/modules/bim/app/contracts/bim/ifc_models/base_contract.rb@@ -27,7 +27,7 @@#++module Bim- module IFCModels+ module IfcModelsclass BaseContract < ::ModelContractdelegate :project,:new_record?,@@ -38,7 +38,7 @@ module Bimattribute :projectdef self.model- ::IFCModels::IFCModel+ ::Bim::IfcModels::IfcModelenddef validatediff --git a/modules/bim/app/contracts/bim/ifc_models/create_contract.rb b/modules/bim/app/contracts/bim/ifc_models/create_contract.rbindex 2eb016781a2..0062df31778 100644--- a/modules/bim/app/contracts/bim/ifc_models/create_contract.rb+++ b/modules/bim/app/contracts/bim/ifc_models/create_contract.rb@@ -27,7 +27,7 @@#++module Bim- module IFCModels+ module IfcModelsclass CreateContract < BaseContractendenddiff --git a/modules/bim/app/contracts/bim/ifc_models/update_contract.rb b/modules/bim/app/contracts/bim/ifc_models/update_contract.rbindex 6c4e9ac9bce..338982f7422 100644--- a/modules/bim/app/contracts/bim/ifc_models/update_contract.rb+++ b/modules/bim/app/contracts/bim/ifc_models/update_contract.rb@@ -27,7 +27,7 @@#++module Bim- module IFCModels+ module IfcModelsclass UpdateContract < BaseContractendenddiff --git a/modules/bim/app/controllers/bim/bcf/api/root.rb b/modules/bim/app/controllers/bim/bcf/api/root.rbindex 5c7dfee8c72..987a01b840b 100644--- a/modules/bim/app/controllers/bim/bcf/api/root.rb+++ b/modules/bim/app/controllers/bim/bcf/api/root.rb@@ -36,22 +36,22 @@ module Bim::Bcfmodule APIclass Root < ::API::RootAPIformat :json- formatter :json, API::Formatter.new+ formatter :json, ::API::Formatter.newdefault_format :json- error_representer ::Bcf::API::V2_1::Errors::ErrorRepresenter, :json- error_formatter :json, ::Bcf::API::ErrorFormatter::Json+ error_representer ::Bim::Bcf::API::V2_1::Errors::ErrorRepresenter, :json+ error_formatter :json, ::Bim::Bcf::API::ErrorFormatter::Jsonauthentication_scope OpenProject::Authentication::Scope::BCF_V2_1version '2.1', using: :path do# /auth- mount ::Bcf::API::V2_1::AuthAPI+ mount ::Bim::Bcf::API::V2_1::AuthAPI# /current-user- mount ::Bcf::API::V2_1::CurrentUserAPI+ mount ::Bim::Bcf::API::V2_1::CurrentUserAPI# /projects- mount ::Bcf::API::V2_1::ProjectsAPI+ mount ::Bim::Bcf::API::V2_1::ProjectsAPIendendenddiff --git a/modules/bim/app/controllers/bim/bcf/api/v2_1/auth_api.rb b/modules/bim/app/controllers/bim/bcf/api/v2_1/auth_api.rbindex b1e92aabce2..1334e0fcd2d 100644--- a/modules/bim/app/controllers/bim/bcf/api/v2_1/auth_api.rb+++ b/modules/bim/app/controllers/bim/bcf/api/v2_1/auth_api.rb@@ -32,7 +32,7 @@ module Bim::Bcf::API::V2_1class AuthAPI < ::API::OpenProjectAPIresources :auth doget do- ::Bcf::API::V2_1::Auth::SingleRepresenter.new(nil)+ ::Bim::Bcf::API::V2_1::Auth::SingleRepresenter.new(nil)endendenddiff --git a/modules/bim/app/controllers/bim/bcf/api/v2_1/current_user_api.rb b/modules/bim/app/controllers/bim/bcf/api/v2_1/current_user_api.rbindex bae5a03834e..aec0f5b64a9 100644--- a/modules/bim/app/controllers/bim/bcf/api/v2_1/current_user_api.rb+++ b/modules/bim/app/controllers/bim/bcf/api/v2_1/current_user_api.rb@@ -28,10 +28,10 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfAPI::V2_1+module Bim::Bcf::API::V2_1class CurrentUserAPI < ::API::OpenProjectAPIresources :'current-user' do- get &::Bcf::API::V2_1::Endpoints::Show.new(model: User,+ get &::Bim::Bcf::API::V2_1::Endpoints::Show.new(model: User,instance_generator: ->(*) { current_user }).mountendenddiff --git a/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/create.rb b/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/create.rbindex 6c9718423e1..b1e9d2c254a 100644--- a/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/create.rb+++ b/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/create.rb@@ -28,7 +28,7 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfAPI::V2_1::Endpoints+module Bim::Bcf::API::V2_1::Endpointsclass Create < API::Utilities::Endpoints::Createinclude ModifyMixindiff --git a/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/delete.rb b/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/delete.rbindex 9c2f9fc1189..c3ab719391e 100644--- a/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/delete.rb+++ b/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/delete.rb@@ -28,7 +28,7 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfAPI::V2_1::Endpoints+module Bim::Bcf::API::V2_1::Endpointsclass Delete < API::Utilities::Endpoints::Deleteinclude ModifyMixin@@ -40,11 +40,11 @@ module Bim::BcfAPI::V2_1::Endpointsprivatedef render_representer- "::Bcf::API::V2_1::#{deduce_api_namespace}::SingleRepresenter".constantize+ "::Bim::Bcf::API::V2_1::#{deduce_api_namespace}::SingleRepresenter".constantizeenddef deduce_process_service- "::Bcf::#{deduce_backend_namespace}::DeleteService".constantize+ "::Bim::Bcf::#{deduce_backend_namespace}::DeleteService".constantizeendendenddiff --git a/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/index.rb b/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/index.rbindex 97effc91889..15d5e9facba 100644--- a/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/index.rb+++ b/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/index.rb@@ -28,7 +28,7 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfAPI::V2_1::Endpoints+module Bim::Bcf::API::V2_1::Endpointsclass Index < API::Utilities::Endpoints::Indexdef mountindex = self@@ -51,7 +51,7 @@ module Bim::BcfAPI::V2_1::Endpointsprivatedef deduce_render_representer- "::Bcf::API::V2_1::#{deduce_api_namespace}::SingleRepresenter".constantize+ "::Bim::Bcf::API::V2_1::#{deduce_api_namespace}::SingleRepresenter".constantizeendendenddiff --git a/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/modify_mixin.rb b/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/modify_mixin.rbindex 80ee53afa8d..1202ffd7c09 100644--- a/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/modify_mixin.rb+++ b/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/modify_mixin.rb@@ -28,20 +28,20 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfAPI::V2_1::Endpoints+module Bim::Bcf::API::V2_1::Endpointsmodule ModifyMixinprivatedef deduce_parse_service- Bcf::API::V2_1::ParseResourceParamsService+ ::Bim::Bcf::API::V2_1::ParseResourceParamsServiceenddef deduce_process_service- "::Bcf::#{deduce_backend_namespace}::#{update_or_create}Service".constantize+ "::Bim::Bcf::#{deduce_backend_namespace}::#{update_or_create}Service".constantizeenddef deduce_in_and_out_representer- "::Bcf::API::V2_1::#{deduce_api_namespace}::SingleRepresenter".constantize+ "::Bim::Bcf::API::V2_1::#{deduce_api_namespace}::SingleRepresenter".constantizeendalias_method :deduce_parse_representer, :deduce_in_and_out_representerdiff --git a/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/show.rb b/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/show.rbindex 82cf845b46f..0a8f2219671 100644--- a/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/show.rb+++ b/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/show.rb@@ -28,7 +28,7 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfAPI::V2_1::Endpoints+module Bim::Bcf::API::V2_1::Endpointsclass Show < API::Utilities::Endpoints::Showdef render(instance)render_representer@@ -38,7 +38,7 @@ module Bim::BcfAPI::V2_1::Endpointsprivatedef deduce_render_representer- "::Bcf::API::V2_1::#{deduce_api_namespace}::SingleRepresenter".constantize+ "::Bim::Bcf::API::V2_1::#{deduce_api_namespace}::SingleRepresenter".constantizeendendenddiff --git a/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/update.rb b/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/update.rbindex 9578afc0c47..1af7d1c9c83 100644--- a/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/update.rb+++ b/modules/bim/app/controllers/bim/bcf/api/v2_1/endpoints/update.rb@@ -28,7 +28,7 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfAPI::V2_1::Endpoints+module Bim::Bcf::API::V2_1::Endpointsclass Update < API::Utilities::Endpoints::Updateinclude ModifyMixindiff --git a/modules/bim/app/controllers/bim/bcf/api/v2_1/project_extensions/api.rb b/modules/bim/app/controllers/bim/bcf/api/v2_1/project_extensions/api.rbindex d3b931d70de..ab69c2b3938 100644--- a/modules/bim/app/controllers/bim/bcf/api/v2_1/project_extensions/api.rb+++ b/modules/bim/app/controllers/bim/bcf/api/v2_1/project_extensions/api.rb@@ -28,7 +28,7 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfAPI::V2_1+module Bim::Bcf::API::V2_1module ProjectExtensionsclass API < ::API::OpenProjectAPIget :extensions dodiff --git a/modules/bim/app/controllers/bim/bcf/api/v2_1/projects_api.rb b/modules/bim/app/controllers/bim/bcf/api/v2_1/projects_api.rbindex 1c0243d07f2..48f280c14a1 100644--- a/modules/bim/app/controllers/bim/bcf/api/v2_1/projects_api.rb+++ b/modules/bim/app/controllers/bim/bcf/api/v2_1/projects_api.rb@@ -28,7 +28,7 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfAPI::V2_1+module Bim::Bcf::API::V2_1class ProjectsAPI < ::API::OpenProjectAPIresources :projects dohelpers do@@ -39,7 +39,7 @@ module Bim::BcfAPI::V2_1endend- get &::Bcf::API::V2_1::Endpoints::Index.new(model: Project,+ get &::Bim::Bcf::API::V2_1::Endpoints::Index.new(model: Project,scope: -> { visible_projects }).mount@@ -49,14 +49,14 @@ module Bim::BcfAPI::V2_1.find(params[:id])end- get &::Bcf::API::V2_1::Endpoints::Show.new(model: Project).mount- put &::Bcf::API::V2_1::Endpoints::Update+ get &::Bim::Bcf::API::V2_1::Endpoints::Show.new(model: Project).mount+ put &::Bim::Bcf::API::V2_1::Endpoints::Update.new(model: Project,process_service: ::Projects::UpdateService).mount- mount Bcf::API::V2_1::TopicsAPI- mount Bcf::API::V2_1::ProjectExtensions::API+ mount ::Bim::Bcf::API::V2_1::TopicsAPI+ mount ::Bim::Bcf::API::V2_1::ProjectExtensions::APIendendenddiff --git a/modules/bim/app/controllers/bim/bcf/api/v2_1/topics_api.rb b/modules/bim/app/controllers/bim/bcf/api/v2_1/topics_api.rbindex 429d6259dff..58b0bddb196 100644--- a/modules/bim/app/controllers/bim/bcf/api/v2_1/topics_api.rb+++ b/modules/bim/app/controllers/bim/bcf/api/v2_1/topics_api.rb@@ -28,22 +28,22 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfAPI::V2_1+module Bim::Bcf::API::V2_1class TopicsAPI < ::API::OpenProjectAPIresources :topics dohelpers dodef topics- Bcf::Issue.of_project(@project)+ ::Bim::Bcf::Issue.of_project(@project)enddef transform_attributes(attributes)- wp_attributes = Bcf::Issues::TransformAttributesService+ wp_attributes = ::Bim::Bcf::Issues::TransformAttributesService.new(@project).call(attributes).resultattributes- .slice(*Bcf::Issue::SETTABLE_ATTRIBUTES)+ .slice(*::Bim::Bcf::Issue::SETTABLE_ATTRIBUTES).merge(wp_attributes)end@@ -68,14 +68,14 @@ module Bim::BcfAPI::V2_1authorize :view_linked_issues, context: @projectend- get &::Bcf::API::V2_1::Endpoints::Index- .new(model: Bcf::Issue,+ get &::Bim::Bcf::API::V2_1::Endpoints::Index+ .new(model: Bim::Bcf::Issue,api_name: 'Topics',scope: -> { topics }).mount- post &::Bcf::API::V2_1::Endpoints::Create- .new(model: Bcf::Issue,+ post &::Bim::Bcf::API::V2_1::Endpoints::Create+ .new(model: Bim::Bcf::Issue,api_name: 'Topics',params_modifier: ->(attributes) {transform_attributes(attributes)@@ -88,13 +88,13 @@ module Bim::BcfAPI::V2_1@issue = topics.find_by_uuid!(params[:topic_uuid])end- get &::Bcf::API::V2_1::Endpoints::Show- .new(model: Bcf::Issue,+ get &::Bim::Bcf::API::V2_1::Endpoints::Show+ .new(model: Bim::Bcf::Issue,api_name: 'Topics').mount- put &::Bcf::API::V2_1::Endpoints::Update- .new(model: Bcf::Issue,+ put &::Bim::Bcf::API::V2_1::Endpoints::Update+ .new(model: Bim::Bcf::Issue,api_name: 'Topics',params_modifier: ->(attributes) {transform_attributes(attributes)@@ -102,12 +102,12 @@ module Bim::BcfAPI::V2_1}).mount- delete &::Bcf::API::V2_1::Endpoints::Delete- .new(model: Bcf::Issue,+ delete &::Bim::Bcf::API::V2_1::Endpoints::Delete+ .new(model: Bim::Bcf::Issue,api_name: 'Topics').mount- mount Bcf::API::V2_1::Viewpoints::API+ mount ::Bim::Bcf::API::V2_1::Viewpoints::APIendendenddiff --git a/modules/bim/app/controllers/bim/bcf/api/v2_1/viewpoints/api.rb b/modules/bim/app/controllers/bim/bcf/api/v2_1/viewpoints/api.rbindex 878498c8e67..ff9c215862c 100644--- a/modules/bim/app/controllers/bim/bcf/api/v2_1/viewpoints/api.rb+++ b/modules/bim/app/controllers/bim/bcf/api/v2_1/viewpoints/api.rb@@ -28,7 +28,7 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfAPI::V2_1+module Bim::Bcf::API::V2_1module Viewpointsclass API < ::API::OpenProjectAPIresources :viewpoints do@@ -38,8 +38,8 @@ module Bim::BcfAPI::V2_1.pluck(:json_viewpoint)end- post &::Bcf::API::V2_1::Endpoints::Create- .new(model: Bcf::Viewpoint,+ post &::Bim::Bcf::API::V2_1::Endpoints::Create+ .new(model: Bim::Bcf::Viewpoint,params_modifier: ->(attributes) {{json_viewpoint: attributes,@@ -52,16 +52,16 @@ module Bim::BcfAPI::V2_1%i[/ selection coloring visibility].each do |key|namespace = key == :/ ? :Full : key.to_s.camelize- get key, &::Bcf::API::V2_1::Endpoints::Show- .new(model: Bcf::Viewpoint,+ get key, &::Bim::Bcf::API::V2_1::Endpoints::Show+ .new(model: Bim::Bcf::Viewpoint,api_name: 'Viewpoints',- render_representer: "::Bcf::API::V2_1::Viewpoints::#{namespace}Representer".constantize,+ render_representer: "::Bim::Bcf::API::V2_1::Viewpoints::#{namespace}Representer".constantize,instance_generator: ->(*) { @issue.viewpoints.where(uuid: params[:viewpoint_uuid]) }).mountend- delete &::Bcf::API::V2_1::Endpoints::Delete- .new(model: Bcf::Viewpoint,+ delete &::Bim::Bcf::API::V2_1::Endpoints::Delete+ .new(model: Bim::Bcf::Viewpoint,api_name: 'Viewpoints',instance_generator: ->(*) { @issue.viewpoints.find_by!(uuid: params[:viewpoint_uuid]) }).mountdiff --git a/modules/bim/app/controllers/bim/bcf/issues_controller.rb b/modules/bim/app/controllers/bim/bcf/issues_controller.rbindex fcaf4166916..c7bcffb6fff 100644--- a/modules/bim/app/controllers/bim/bcf/issues_controller.rb+++ b/modules/bim/app/controllers/bim/bcf/issues_controller.rb@@ -143,7 +143,7 @@ module Bimraise(StandardError.new(I18n.t('bcf.exceptions.file_invalid')))end- @issues = ::Bcf::Issue+ @issues = ::Bim::Bcf::Issue.includes(work_package: %i[status priority assigned_to]).where(uuid: @listing.map { |e| e[:uuid] }, project: @project)render 'bcf/issues/diff_on_work_packages'@@ -200,7 +200,7 @@ module Bimenddef build_importer- @importer = ::OpenProject::Bcf::BcfXml::Importer.new @bcf_xml_file, @project, current_user: current_user+ @importer = ::OpenProject::Bim::BcfXml::Importer.new @bcf_xml_file, @project, current_user: current_userenddef get_persisted_filediff --git a/modules/bim/app/controllers/bim/ifc_models/base_controller.rb b/modules/bim/app/controllers/bim/ifc_models/base_controller.rbindex 76b13efc6fa..f284840b6a8 100644--- a/modules/bim/app/controllers/bim/ifc_models/base_controller.rb+++ b/modules/bim/app/controllers/bim/ifc_models/base_controller.rb@@ -1,5 +1,5 @@module Bim- module IFCModels+ module IfcModelsclass BaseController < ApplicationControllerendenddiff --git a/modules/bim/app/controllers/bim/ifc_models/ifc_models_controller.rb b/modules/bim/app/controllers/bim/ifc_models/ifc_models_controller.rbindex 4a50f141f08..d31a8b75e2e 100644--- a/modules/bim/app/controllers/bim/ifc_models/ifc_models_controller.rb+++ b/modules/bim/app/controllers/bim/ifc_models/ifc_models_controller.rb@@ -29,8 +29,8 @@#++module Bim- module IFCModels- class IFCModelsController < BaseController+ module IfcModels+ class IfcModelsController < BaseControllerhelper_method :gonbefore_action :find_project_by_project_id, only: %i[index new create show defaults edit update destroy]@@ -69,7 +69,7 @@ module Bim.to_h.reverse_merge(project: @project)- call = ::IFCModels::CreateService+ call = ::Bim::IfcModels::CreateService.new(user: current_user).call(combined_params)@@ -89,7 +89,7 @@ module Bim.to_h.reverse_merge(project: @project)- call = ::IFCModels::UpdateService+ call = ::Bim::IfcModels::UpdateService.new(user: current_user, model: @ifc_model).call(combined_params)@@ -120,12 +120,12 @@ module Bimdef permitted_model_paramsparams- .require(:ifc_models_ifc_model)+ .require(:bim_ifc_models_ifc_model).permit('title', 'ifc_attachment', 'is_default')enddef find_ifc_model_object- @ifc_model = IFCModels::IFCModel.find_by(id: params[:id])+ @ifc_model = Bim::IfcModels::IfcModel.find_by(id: params[:id])endendenddiff --git a/modules/bim/app/formatters/bim/bcf/api/error_formatter/json.rb b/modules/bim/app/formatters/bim/bcf/api/error_formatter/json.rbindex 4afcc011483..691e9d8a666 100644--- a/modules/bim/app/formatters/bim/bcf/api/error_formatter/json.rb+++ b/modules/bim/app/formatters/bim/bcf/api/error_formatter/json.rb@@ -29,7 +29,7 @@#++module Bim::Bcf- module Api+ module APImodule ErrorFormattermodule Jsonextend Grape::ErrorFormatter::Basediff --git a/modules/bim/app/helpers/bim/bcf_application_helper.rb b/modules/bim/app/helpers/bcf_application_helper.rbsimilarity index 85%rename from modules/bim/app/helpers/bim/bcf_application_helper.rbrename to modules/bim/app/helpers/bcf_application_helper.rbindex 45c27c937d4..59e6feb9a85 100644--- a/modules/bim/app/helpers/bim/bcf_application_helper.rb+++ b/modules/bim/app/helpers/bcf_application_helper.rb@@ -26,13 +26,11 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim- module BcfApplicationHelper- def body_css_classes- classes = super- classes = classes + " bcf-#{@project&.module_enabled?(:bcf) ? 'activated' : 'deactivated'}"+module BcfApplicationHelper+ def body_css_classes+ classes = super+ classes = classes + " bcf-#{@project&.module_enabled?(:bim) ? 'activated' : 'deactivated'}"- classes- end+ classesendenddiff --git a/modules/bim/app/helpers/bim/bcf_work_packages_filter_helper.rb b/modules/bim/app/helpers/bcf_work_packages_filter_helper.rbsimilarity index 77%rename from modules/bim/app/helpers/bim/bcf_work_packages_filter_helper.rbrename to modules/bim/app/helpers/bcf_work_packages_filter_helper.rbindex 599ecb25bac..c17defd0a2d 100644--- a/modules/bim/app/helpers/bim/bcf_work_packages_filter_helper.rb+++ b/modules/bim/app/helpers/bcf_work_packages_filter_helper.rb@@ -28,21 +28,19 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim- module BcfWorkPackagesFilterHelper- include WorkPackagesFilterHelper+module BcfWorkPackagesFilterHelper+ include WorkPackagesFilterHelper- def project_work_packages_bcf_issues_path(project)- query = {- f: [- filter_object('status_id', 'o')- ],- hi: true,- hl: 'priority',- dr: 'card'- }+ def project_work_packages_bcf_issues_path(project)+ query = {+ f: [+ filter_object('status_id', 'o')+ ],+ hi: true,+ hl: 'priority',+ dr: 'card'+ }- project_work_packages_with_query_path(project, query)- end+ project_work_packages_with_query_path(project, query)endenddiff --git a/modules/bim/app/helpers/bim/ifc_models_helper.rb b/modules/bim/app/helpers/bim/ifc_models_helper.rbdeleted file mode 100644index 4a5c60b6524..00000000000--- a/modules/bim/app/helpers/bim/ifc_models_helper.rb+++ /dev/null@@ -1,57 +0,0 @@-module Bim- module IFCModelsHelper- def provision_gon_for_ifc_model(all_models, models_to_load = [])- all_converted_models = converted_ifc_models(all_models)-- gon.ifc_models = {- models: gon_ifc_model_models(all_converted_models, models_to_load),- default_models: gon_ifc_default_models(all_converted_models, models_to_load),- projects: [{id: @project.identifier, name: @project.name}],- xkt_attachment_ids: gon_ifc_model_xkt_attachment_ids(all_converted_models),- metadata_attachment_ids: gon_ifc_model_metadata_attachment_ids(all_converted_models),- permissions: {- manage: User.current.allowed_to?(:manage_ifc_models, @project)- }- }- end-- def converted_ifc_models(ifc_models)- ifc_models.select(&:converted?)- end-- def gon_ifc_model_models(all_models, models_to_load)- all_converted_models = converted_ifc_models(all_models)-- all_converted_models.map do |ifc_model|- {- id: ifc_model.id,- name: ifc_model.title,- saoEnabled: models_to_load.include?(ifc_model)- }- end- end-- def gon_ifc_default_models(all_models, models_to_load)- all_converted_models = converted_ifc_models(all_models)- default_models = []-- all_converted_models.map do |ifc_model|- default_models << ifc_model.id.to_s if models_to_load.include?(ifc_model)- end- default_models- end-- def gon_ifc_model_xkt_attachment_ids(models)- Hash[models.map { |model| [model.id, model.xkt_attachment.id] }]- end-- def gon_ifc_model_metadata_attachment_ids(models)- Hash[- models.map do |model|- [model.id,- model.metadata_attachment.id]- end- ]- end- end-enddiff --git a/modules/bim/app/helpers/ifc_models_helper.rb b/modules/bim/app/helpers/ifc_models_helper.rbnew file mode 100644index 00000000000..fba541aa6d3--- /dev/null+++ b/modules/bim/app/helpers/ifc_models_helper.rb@@ -0,0 +1,55 @@+module IfcModelsHelper+ def provision_gon_for_ifc_model(all_models, models_to_load = [])+ all_converted_models = converted_ifc_models(all_models)++ gon.ifc_models = {+ models: gon_ifc_model_models(all_converted_models, models_to_load),+ default_models: gon_ifc_default_models(all_converted_models, models_to_load),+ projects: [{id: @project.identifier, name: @project.name}],+ xkt_attachment_ids: gon_ifc_model_xkt_attachment_ids(all_converted_models),+ metadata_attachment_ids: gon_ifc_model_metadata_attachment_ids(all_converted_models),+ permissions: {+ manage: User.current.allowed_to?(:manage_ifc_models, @project)+ }+ }+ end++ def converted_ifc_models(ifc_models)+ ifc_models.select(&:converted?)+ end++ def gon_ifc_model_models(all_models, models_to_load)+ all_converted_models = converted_ifc_models(all_models)++ all_converted_models.map do |ifc_model|+ {+ id: ifc_model.id,+ name: ifc_model.title,+ saoEnabled: models_to_load.include?(ifc_model)+ }+ end+ end++ def gon_ifc_default_models(all_models, models_to_load)+ all_converted_models = converted_ifc_models(all_models)+ default_models = []++ all_converted_models.map do |ifc_model|+ default_models << ifc_model.id.to_s if models_to_load.include?(ifc_model)+ end+ default_models+ end++ def gon_ifc_model_xkt_attachment_ids(models)+ Hash[models.map { |model| [model.id, model.xkt_attachment.id] }]+ end++ def gon_ifc_model_metadata_attachment_ids(models)+ Hash[+ models.map do |model|+ [model.id,+ model.metadata_attachment.id]+ end+ ]+ end+enddiff --git a/modules/bim/app/models/bim/bcf/comment.rb b/modules/bim/app/models/bim/bcf/comment.rbindex 16c6e7bebb8..9c9bb9cea73 100644--- a/modules/bim/app/models/bim/bcf/comment.rb+++ b/modules/bim/app/models/bim/bcf/comment.rb@@ -1,10 +1,10 @@-module Bcf+module Bim::Bcfclass Comment < ActiveRecord::Baseinclude InitializeWithUuidbelongs_to :journal- belongs_to :issue, foreign_key: :issue_id, class_name: "Bcf::Issue"- belongs_to :viewpoint, foreign_key: :viewpoint_id, class_name: "Bcf::Viewpoint", optional: true+ belongs_to :issue, foreign_key: :issue_id, class_name: "Bim::Bcf::Issue"+ belongs_to :viewpoint, foreign_key: :viewpoint_id, class_name: "Bim::Bcf::Viewpoint", optional: truevalidates_presence_of :uuidvalidates_uniqueness_of :uuid, scope: [:issue_id]diff --git a/modules/bim/app/models/bim/bcf/initialize_with_uuid.rb b/modules/bim/app/models/bim/bcf/initialize_with_uuid.rbindex 2afb49468af..2df5ec0b55e 100644--- a/modules/bim/app/models/bim/bcf/initialize_with_uuid.rb+++ b/modules/bim/app/models/bim/bcf/initialize_with_uuid.rb@@ -1,4 +1,4 @@-module Bcf+module Bim::Bcf### Module to set an initial UUID on the model# whenever it is createddiff --git a/modules/bim/app/models/bim/bcf/issue.rb b/modules/bim/app/models/bim/bcf/issue.rbindex 60be43bc69e..a44434ae82e 100644--- a/modules/bim/app/models/bim/bcf/issue.rb+++ b/modules/bim/app/models/bim/bcf/issue.rb@@ -1,4 +1,4 @@-module Bcf+module Bim::Bcfclass Issue < ActiveRecord::Baseinclude InitializeWithUuidinclude ::Concerns::VirtualAttribute@@ -7,8 +7,8 @@ module Bcfbelongs_to :work_packagehas_one :project, through: :work_package- has_many :viewpoints, foreign_key: :issue_id, class_name: "Bcf::Viewpoint", dependent: :destroy- has_many :comments, foreign_key: :issue_id, class_name: "Bcf::Comment", dependent: :destroy+ has_many :viewpoints, foreign_key: :issue_id, class_name: "Bim::Bcf::Viewpoint", dependent: :destroy+ has_many :comments, foreign_key: :issue_id, class_name: "Bim::Bcf::Comment", dependent: :destroyafter_update :invalidate_markup_cachediff --git a/modules/bim/app/models/bim/bcf/viewpoint.rb b/modules/bim/app/models/bim/bcf/viewpoint.rbindex 76995f053f1..165625ac1fd 100644--- a/modules/bim/app/models/bim/bcf/viewpoint.rb+++ b/modules/bim/app/models/bim/bcf/viewpoint.rb@@ -1,4 +1,4 @@-module Bcf+module Bim::Bcfclass Viewpoint < ActiveRecord::Baseinclude InitializeWithUuid@@ -11,8 +11,8 @@ module Bcfwhere(uuid: uuid).exists?end- belongs_to :issue, foreign_key: :issue_id, class_name: "Bcf::Issue"- has_many :comments, foreign_key: :viewpoint_id, class_name: "Bcf::Comment"+ belongs_to :issue, foreign_key: :issue_id, class_name: "Bim::Bcf::Issue"+ has_many :comments, foreign_key: :viewpoint_id, class_name: "Bim::Bcf::Comment"delegate :project, :project_id, to: :issue, allow_nil: truevalidates :issue, presence: truediff --git a/modules/bim/app/models/bim/ifc_models/ifc_model.rb b/modules/bim/app/models/bim/ifc_models/ifc_model.rbindex da864fca0fc..cdb30ced64a 100644--- a/modules/bim/app/models/bim/ifc_models/ifc_model.rb+++ b/modules/bim/app/models/bim/ifc_models/ifc_model.rb@@ -1,6 +1,6 @@module Bim- module IFCModels- class IFCModel < ActiveRecord::Base+ module IfcModels+ class IfcModel < ActiveRecord::Baseacts_as_attachable delete_permission: :manage_ifc_models, view_permission: :view_ifc_modelsbelongs_to :projectdiff --git a/modules/bim/app/representers/bcf/api/v2_1/auth/single_representer.rb b/modules/bim/app/representers/bim/bcf/api/v2_1/auth/single_representer.rbsimilarity index 98%rename from modules/bim/app/representers/bcf/api/v2_1/auth/single_representer.rbrename to modules/bim/app/representers/bim/bcf/api/v2_1/auth/single_representer.rbindex bb65531fe68..6dc9116ab27 100644--- a/modules/bim/app/representers/bcf/api/v2_1/auth/single_representer.rb+++ b/modules/bim/app/representers/bim/bcf/api/v2_1/auth/single_representer.rb@@ -28,7 +28,7 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfAPI::V2_1+module Bim::Bcf::API::V2_1class Auth::SingleRepresenter < BaseRepresenterinclude OpenProject::StaticRouting::UrlHelpersdiff --git a/modules/bim/app/representers/bcf/api/v2_1/base_representer.rb b/modules/bim/app/representers/bim/bcf/api/v2_1/base_representer.rbsimilarity index 98%rename from modules/bim/app/representers/bcf/api/v2_1/base_representer.rbrename to modules/bim/app/representers/bim/bcf/api/v2_1/base_representer.rbindex 081ec3cda27..36dd5aad0a1 100644--- a/modules/bim/app/representers/bcf/api/v2_1/base_representer.rb+++ b/modules/bim/app/representers/bim/bcf/api/v2_1/base_representer.rb@@ -28,7 +28,7 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfAPI::V2_1+module Bim::Bcf::API::V2_1class BaseRepresenter < Roar::Decoratorinclude Representable::JSONdiff --git a/modules/bim/app/representers/bcf/api/v2_1/errors/error_mapper.rb b/modules/bim/app/representers/bim/bcf/api/v2_1/errors/error_mapper.rbsimilarity index 95%rename from modules/bim/app/representers/bcf/api/v2_1/errors/error_mapper.rbrename to modules/bim/app/representers/bim/bcf/api/v2_1/errors/error_mapper.rbindex 887ce976dfa..a18cbbbbfa6 100644--- a/modules/bim/app/representers/bcf/api/v2_1/errors/error_mapper.rb+++ b/modules/bim/app/representers/bim/bcf/api/v2_1/errors/error_mapper.rb@@ -28,7 +28,7 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfAPI::V2_1::Errors+module Bim::Bcf::API::V2_1::Errorsclass ErrorMapperextend ActiveModel::Namingextend ActiveModel::Translation@@ -40,7 +40,7 @@ module Bim::BcfAPI::V2_1::Errors# In case the error lookups collide, we need to provide# separate error mappers for every class.def self.lookup_ancestors- [::Bcf::Issue, ::Bcf::Viewpoint]+ [::Bim::Bcf::Issue, ::Bim::Bcf::Viewpoint]enddef self.map(original_errors)diff --git a/modules/bim/app/representers/bcf/api/v2_1/errors/error_representer.rb b/modules/bim/app/representers/bim/bcf/api/v2_1/errors/error_representer.rbsimilarity index 97%rename from modules/bim/app/representers/bcf/api/v2_1/errors/error_representer.rbrename to modules/bim/app/representers/bim/bcf/api/v2_1/errors/error_representer.rbindex 1ec9d419ffa..a14853309ba 100644--- a/modules/bim/app/representers/bcf/api/v2_1/errors/error_representer.rb+++ b/modules/bim/app/representers/bim/bcf/api/v2_1/errors/error_representer.rb@@ -28,7 +28,7 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfAPI::V2_1::Errors+module Bim::Bcf::API::V2_1::Errorsclass ErrorRepresenter < BaseRepresenterproperty :message,getter: ->(*) {diff --git a/modules/bim/app/representers/bcf/api/v2_1/project_extensions/representer.rb b/modules/bim/app/representers/bim/bcf/api/v2_1/project_extensions/representer.rbsimilarity index 99%rename from modules/bim/app/representers/bcf/api/v2_1/project_extensions/representer.rbrename to modules/bim/app/representers/bim/bcf/api/v2_1/project_extensions/representer.rbindex 4acbbdfcea6..b9b9741038b 100644--- a/modules/bim/app/representers/bcf/api/v2_1/project_extensions/representer.rb+++ b/modules/bim/app/representers/bim/bcf/api/v2_1/project_extensions/representer.rb@@ -28,7 +28,7 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfAPI::V2_1+module Bim::Bcf::API::V2_1class ProjectExtensions::Representer < BaseRepresenterproperty :topic_type,getter: ->(decorator:, **) {diff --git a/modules/bim/app/representers/bcf/api/v2_1/projects/single_representer.rb b/modules/bim/app/representers/bim/bcf/api/v2_1/projects/single_representer.rbsimilarity index 98%rename from modules/bim/app/representers/bcf/api/v2_1/projects/single_representer.rbrename to modules/bim/app/representers/bim/bcf/api/v2_1/projects/single_representer.rbindex 2fd181ba5a8..ec3f7c48ca0 100644--- a/modules/bim/app/representers/bcf/api/v2_1/projects/single_representer.rb+++ b/modules/bim/app/representers/bim/bcf/api/v2_1/projects/single_representer.rb@@ -28,7 +28,7 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfAPI::V2_1+module Bim::Bcf::API::V2_1class Projects::SingleRepresenter < BaseRepresenterproperty :id,as: :project_iddiff --git a/modules/bim/app/representers/bcf/api/v2_1/topics/authorization_representer.rb b/modules/bim/app/representers/bim/bcf/api/v2_1/topics/authorization_representer.rbsimilarity index 98%rename from modules/bim/app/representers/bcf/api/v2_1/topics/authorization_representer.rbrename to modules/bim/app/representers/bim/bcf/api/v2_1/topics/authorization_representer.rbindex 30e9172f685..ab2153dedeb 100644--- a/modules/bim/app/representers/bcf/api/v2_1/topics/authorization_representer.rb+++ b/modules/bim/app/representers/bim/bcf/api/v2_1/topics/authorization_representer.rb@@ -28,7 +28,7 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfAPI::V2_1+module Bim::Bcf::API::V2_1class Topics::AuthorizationRepresenter < BaseRepresenterproperty :topic_actions,getter: ->(decorator:, **) {diff --git a/modules/bim/app/representers/bcf/api/v2_1/topics/single_representer.rb b/modules/bim/app/representers/bim/bcf/api/v2_1/topics/single_representer.rbsimilarity index 99%rename from modules/bim/app/representers/bcf/api/v2_1/topics/single_representer.rbrename to modules/bim/app/representers/bim/bcf/api/v2_1/topics/single_representer.rbindex ce3aad2b9db..c35449710f4 100644--- a/modules/bim/app/representers/bcf/api/v2_1/topics/single_representer.rb+++ b/modules/bim/app/representers/bim/bcf/api/v2_1/topics/single_representer.rb@@ -28,7 +28,7 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfAPI::V2_1+module Bim::Bcf::API::V2_1class Topics::SingleRepresenter < BaseRepresenterinclude API::V3::Utilities::PathHelperdiff --git a/modules/bim/app/representers/bcf/api/v2_1/users/single_representer.rb b/modules/bim/app/representers/bim/bcf/api/v2_1/users/single_representer.rbsimilarity index 98%rename from modules/bim/app/representers/bcf/api/v2_1/users/single_representer.rbrename to modules/bim/app/representers/bim/bcf/api/v2_1/users/single_representer.rbindex 6df069028ce..edf9d341755 100644--- a/modules/bim/app/representers/bcf/api/v2_1/users/single_representer.rb+++ b/modules/bim/app/representers/bim/bcf/api/v2_1/users/single_representer.rb@@ -28,7 +28,7 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfAPI::V2_1+module Bim::Bcf::API::V2_1class Users::SingleRepresenter < BaseRepresenterproperty :mail,as: :iddiff --git a/modules/bim/app/representers/bcf/api/v2_1/viewpoints/base_representer.rb b/modules/bim/app/representers/bim/bcf/api/v2_1/viewpoints/base_representer.rbsimilarity index 98%rename from modules/bim/app/representers/bcf/api/v2_1/viewpoints/base_representer.rbrename to modules/bim/app/representers/bim/bcf/api/v2_1/viewpoints/base_representer.rbindex 703c9f98323..08945eecc03 100644--- a/modules/bim/app/representers/bcf/api/v2_1/viewpoints/base_representer.rb+++ b/modules/bim/app/representers/bim/bcf/api/v2_1/viewpoints/base_representer.rb@@ -28,7 +28,7 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfAPI::V2_1+module Bim::Bcf::API::V2_1class Viewpoints::BaseRepresenter < BaseRepresenterattr_reader :base_scopediff --git a/modules/bim/app/representers/bcf/api/v2_1/viewpoints/coloring_representer.rb b/modules/bim/app/representers/bim/bcf/api/v2_1/viewpoints/coloring_representer.rbsimilarity index 97%rename from modules/bim/app/representers/bcf/api/v2_1/viewpoints/coloring_representer.rbrename to modules/bim/app/representers/bim/bcf/api/v2_1/viewpoints/coloring_representer.rbindex 310dac54e97..fa607ffc410 100644--- a/modules/bim/app/representers/bcf/api/v2_1/viewpoints/coloring_representer.rb+++ b/modules/bim/app/representers/bim/bcf/api/v2_1/viewpoints/coloring_representer.rb@@ -30,7 +30,7 @@require_relative 'base_representer'-module Bim::BcfAPI::V2_1::Viewpoints+module Bim::Bcf::API::V2_1::Viewpointsclass ColoringRepresenter < BaseRepresenterprotecteddiff --git a/modules/bim/app/representers/bcf/api/v2_1/viewpoints/full_representer.rb b/modules/bim/app/representers/bim/bcf/api/v2_1/viewpoints/full_representer.rbsimilarity index 97%rename from modules/bim/app/representers/bcf/api/v2_1/viewpoints/full_representer.rbrename to modules/bim/app/representers/bim/bcf/api/v2_1/viewpoints/full_representer.rbindex 0c4d4398fbe..1b5777aca66 100644--- a/modules/bim/app/representers/bcf/api/v2_1/viewpoints/full_representer.rb+++ b/modules/bim/app/representers/bim/bcf/api/v2_1/viewpoints/full_representer.rb@@ -29,7 +29,7 @@#++require_relative 'base_representer'-module Bim::BcfAPI::V2_1::Viewpoints+module Bim::Bcf::API::V2_1::Viewpointsclass FullRepresenter < BaseRepresenterprotecteddiff --git a/modules/bim/app/representers/bcf/api/v2_1/viewpoints/selection_representer.rb b/modules/bim/app/representers/bim/bcf/api/v2_1/viewpoints/selection_representer.rbsimilarity index 97%rename from modules/bim/app/representers/bcf/api/v2_1/viewpoints/selection_representer.rbrename to modules/bim/app/representers/bim/bcf/api/v2_1/viewpoints/selection_representer.rbindex 2e731e677d4..4e3e2a944f1 100644--- a/modules/bim/app/representers/bcf/api/v2_1/viewpoints/selection_representer.rb+++ b/modules/bim/app/representers/bim/bcf/api/v2_1/viewpoints/selection_representer.rb@@ -30,7 +30,7 @@require_relative 'base_representer'-module Bim::BcfAPI::V2_1::Viewpoints+module Bim::Bcf::API::V2_1::Viewpointsclass SelectionRepresenter < BaseRepresenterprotecteddiff --git a/modules/bim/app/representers/bcf/api/v2_1/viewpoints/single_representer.rb b/modules/bim/app/representers/bim/bcf/api/v2_1/viewpoints/single_representer.rbsimilarity index 98%rename from modules/bim/app/representers/bcf/api/v2_1/viewpoints/single_representer.rbrename to modules/bim/app/representers/bim/bcf/api/v2_1/viewpoints/single_representer.rbindex c71ecbed251..9b7ec955298 100644--- a/modules/bim/app/representers/bcf/api/v2_1/viewpoints/single_representer.rb+++ b/modules/bim/app/representers/bim/bcf/api/v2_1/viewpoints/single_representer.rb@@ -28,7 +28,7 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfAPI::V2_1+module Bim::Bcf::API::V2_1class Viewpoints::SingleRepresenter < BaseRepresenterproperty :linesdiff --git a/modules/bim/app/representers/bcf/api/v2_1/viewpoints/visibility_representer.rb b/modules/bim/app/representers/bim/bcf/api/v2_1/viewpoints/visibility_representer.rbsimilarity index 97%rename from modules/bim/app/representers/bcf/api/v2_1/viewpoints/visibility_representer.rbrename to modules/bim/app/representers/bim/bcf/api/v2_1/viewpoints/visibility_representer.rbindex 9fd67c0d252..b2c40925f2a 100644--- a/modules/bim/app/representers/bcf/api/v2_1/viewpoints/visibility_representer.rb+++ b/modules/bim/app/representers/bim/bcf/api/v2_1/viewpoints/visibility_representer.rb@@ -30,7 +30,7 @@require_relative 'base_representer'-module Bim::BcfAPI::V2_1::Viewpoints+module Bim::Bcf::API::V2_1::Viewpointsclass VisibilityRepresenter < BaseRepresenterprotecteddiff --git a/modules/bim/app/seeders/bim/demo_data/bcf_xml_seeder.rb b/modules/bim/app/seeders/bim/demo_data/bcf_xml_seeder.rbindex 189a1e4b7a9..7c348372298 100644--- a/modules/bim/app/seeders/bim/demo_data/bcf_xml_seeder.rb+++ b/modules/bim/app/seeders/bim/demo_data/bcf_xml_seeder.rb@@ -52,7 +52,7 @@ module Bim}bcf_xml_file = File.new(File.join(Rails.root, 'modules/bim_seeder/files', filename))- importer = ::OpenProject::Bcf::BcfXml::Importer.new(bcf_xml_file, project, current_user: user)+ importer = ::OpenProject::Bim::BcfXml::Importer.new(bcf_xml_file, project, current_user: user)importer.import!(import_options).flattenendenddiff --git a/modules/bim/app/seeders/bim/demo_data/ifc_model_seeder.rb b/modules/bim/app/seeders/bim/demo_data/ifc_model_seeder.rbindex 3a40e505979..b8b2c134f02 100644--- a/modules/bim/app/seeders/bim/demo_data/ifc_model_seeder.rb+++ b/modules/bim/app/seeders/bim/demo_data/ifc_model_seeder.rb@@ -71,7 +71,7 @@ module Bimenddef create_model_container(project, user, title, default)- model_container = IFCModels::IFCModel.new+ model_container = Bim::IfcModels::IfcModel.newmodel_container.title = titlemodel_container.project = projectmodel_container.uploader = userdiff --git a/modules/bim/app/services/bcf/issues/transform_attributes_service.rb b/modules/bim/app/services/bcf/issues/transform_attributes_service.rbdeleted file mode 100644index db88a7104bb..00000000000--- a/modules/bim/app/services/bcf/issues/transform_attributes_service.rb+++ /dev/null@@ -1,166 +0,0 @@-#-- encoding: UTF-8--#-- copyright-# OpenProject is an open source project management software.-# Copyright (C) 2012-2020 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-2017 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 docs/COPYRIGHT.rdoc for more details.-#++--module Bim::BcfIssues- class TransformAttributesService- def initialize(project)- self.project = project- end-- def call(attributes)- ServiceResult.new success: true,- result: work_package_attributes(attributes)- end-- private-- attr_accessor :project-- ##- # BCF issues might have empty titles. OP needs one.- def title(attributes)- if attributes[:title]- attributes[:title]- elsif attributes[:import_options]- '(Imported BCF issue contained no title)'- end- end-- def author(project, attributes)- find_user_in_project(project, attributes[:author]) || User.system- end-- def assignee(attributes)- assignee = find_user(attributes[:assignee])-- return assignee if assignee.present?-- missing_assignee(attributes[:assignee], attributes[:import_options] || {})- end-- ##- # Try to find the given user by mail in the project- def find_user(mail)- project.users.find_by(mail: mail)- end-- def type(attributes)- type_name = attributes[:type]- type = project.types.find_by(name: type_name)-- return type if type.present?-- missing_type(type_name, attributes[:import_options] || {})- end-- ##- # Handle unknown statuses during import- def status(attributes)- status_name = attributes[:status]- status = ::Status.find_by(name: status_name)-- return status if status.present?-- missing_status(status_name, attributes[:import_options] || {})- end-- ##- # Handle unknown priorities during import- def priority(attributes)- priority_name = attributes[:priority]- priority = ::IssuePriority.find_by(name: priority_name)-- return priority if priority.present?-- missing_priority(priority_name, attributes[:import_options] || {})- end-- ##- # Get mapped and raw attributes from MarkupExtractor- # and return all values that are non-nil- def work_package_attributes(attributes)- {- type: type(attributes),-- # Native attributes from the extractor- subject: title(attributes),- description: attributes[:description],- due_date: attributes[:due_date],- start_date: attributes[:start_date],-- # Mapped attributes- assigned_to: assignee(attributes),- status: status(attributes),- priority: priority(attributes)- }.compact- end-- def missing_status(status_name, import_options)- if import_options[:unknown_statuses_action] == 'use_default'- ::Status.default- elsif import_options[:unknown_statuses_action] == 'chose' &&- import_options[:unknown_statuses_chose_ids].any?- ::Status.find_by(id: import_options[:unknown_statuses_chose_ids].first)- elsif status_name- Status::InexistentStatus.new- end- end-- def missing_priority(priority_name, import_options)- if import_options[:unknown_priorities_action] == 'use_default'- # NOP The 'use_default' case gets already covered by OP.- elsif import_options[:unknown_priorities_action] == 'chose' &&- import_options[:unknown_priorities_chose_ids].any?- ::IssuePriority.find_by(id: import_options[:unknown_priorities_chose_ids].first)- elsif priority_name- Priority::InexistentPriority.new- end- end-- def missing_type(type_name, import_options)- types = project.types-- if import_options[:unknown_types_action] == 'use_default'- types.default&.first- elsif import_options[:unknown_types_action] == 'chose' &&- import_options[:unknown_types_chose_ids].any?- types.find_by(id: import_options[:unknown_types_chose_ids].first)- elsif type_name- Type::InexistentType.new- end- end-- def missing_assignee(assignee_name, import_options)- if import_options[:invalid_people_action] != 'anonymize' && assignee_name- User::InexistentUser.new- end- end- end-enddiff --git a/modules/bim/app/services/bcf/viewpoints/set_attributes_service.rb b/modules/bim/app/services/bcf/viewpoints/set_attributes_service.rbdeleted file mode 100644index bc276a68a7c..00000000000--- a/modules/bim/app/services/bcf/viewpoints/set_attributes_service.rb+++ /dev/null@@ -1,87 +0,0 @@-#-- encoding: UTF-8--#-- copyright-# OpenProject is an open source project management software.-# Copyright (C) 2012-2020 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-2017 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 docs/COPYRIGHT.rdoc for more details.-#++--module Bim::BcfViewpoints- class SetAttributesService < ::BaseServices::SetAttributes- def set_attributes(params)- super-- set_snapshot- end-- def set_default_attributes(_params)- model.json_viewpoint['guid'] = model.uuid- end-- def set_snapshot- return unless snapshot_data_complete? && snapshot_content_type-- file = OpenProject::Files- .create_uploaded_file(name: "snapshot.#{snapshot_extension}",- content_type: snapshot_content_type,- content: snapshot_binary_contents,- binary: true)-- # This might break once the service is also used- # to update existing viewpoints as the snapshot method will- # delete any existing snapshot right away while the expectation- # on a SetAttributesService is to not perform persisted changes.- model.snapshot = file- end-- def snapshot_data_complete?- model.json_viewpoint['snapshot'] &&- model.json_viewpoint['snapshot']['snapshot_type'] &&- model.json_viewpoint['snapshot']['snapshot_data']- end-- def snapshot_content_type- # Return nil when the extension is not within the specified set- # which will lead to the snapshot not being created.- # The contract will catch the error.- return unless model.json_viewpoint['snapshot']-- case model.json_viewpoint['snapshot']['snapshot_type']- when 'png'- 'image/png'- when 'jpg'- 'image/jpeg'- end- end-- def snapshot_extension- model.json_viewpoint['snapshot']['snapshot_type']- end-- def snapshot_binary_contents- Base64.decode64 model.json_viewpoint['snapshot']['snapshot_data']- end- end-enddiff --git a/modules/bim/app/services/bcf/api/v2_1/parse_resource_params_service.rb b/modules/bim/app/services/bim/bcf/api/v2_1/parse_resource_params_service.rbsimilarity index 98%rename from modules/bim/app/services/bcf/api/v2_1/parse_resource_params_service.rbrename to modules/bim/app/services/bim/bcf/api/v2_1/parse_resource_params_service.rbindex 72dcd2d3d12..7ab6fc575f9 100644--- a/modules/bim/app/services/bcf/api/v2_1/parse_resource_params_service.rb+++ b/modules/bim/app/services/bim/bcf/api/v2_1/parse_resource_params_service.rb@@ -26,7 +26,7 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bcf+module Bim::Bcfmodule APImodule V2_1class ParseResourceParamsService < ::API::ParseResourceParamsServicediff --git a/modules/bim/app/services/bcf/issues/create_service.rb b/modules/bim/app/services/bim/bcf/issues/create_service.rbsimilarity index 73%rename from modules/bim/app/services/bcf/issues/create_service.rbrename to modules/bim/app/services/bim/bcf/issues/create_service.rbindex 941eee9a034..fd47148fc0d 100644--- a/modules/bim/app/services/bcf/issues/create_service.rb+++ b/modules/bim/app/services/bim/bcf/issues/create_service.rb@@ -28,23 +28,25 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfIssues- class CreateService < ::BaseServices::Create- private+module Bim::Bcf+ module Issues+ class CreateService < ::BaseServices::Create+ private- def before_perform(params)- wp_call = WorkPackages::CreateService- .new(user: user)- .call(params)+ def before_perform(params)+ wp_call = WorkPackages::CreateService+ .new(user: user)+ .call(params)- if wp_call.success?- issue_params = {- work_package: wp_call.result- }.merge(params.slice(*Bcf::Issue::SETTABLE_ATTRIBUTES))+ if wp_call.success?+ issue_params = {+ work_package: wp_call.result+ }.merge(params.slice(*Bim::Bcf::Issue::SETTABLE_ATTRIBUTES))- super(issue_params)- else- wp_call+ super(issue_params)+ else+ wp_call+ endendendenddiff --git a/modules/bim/app/services/bcf/issues/delete_service.rb b/modules/bim/app/services/bim/bcf/issues/delete_service.rbsimilarity index 69%rename from modules/bim/app/services/bcf/issues/delete_service.rbrename to modules/bim/app/services/bim/bcf/issues/delete_service.rbindex ff23b0a706c..d3eb727a059 100644--- a/modules/bim/app/services/bcf/issues/delete_service.rb+++ b/modules/bim/app/services/bim/bcf/issues/delete_service.rb@@ -28,26 +28,28 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfIssues- class DeleteService < ::BaseServices::Delete- private+module Bim::Bcf+ module Issues+ class DeleteService < ::BaseServices::Delete+ private- def before_perform(params)- associated_wp = WorkPackage.find(model.work_package_id)- # Load the project association as AR fails do do so once the work package- # is destroyed.- model.project+ def before_perform(params)+ associated_wp = WorkPackage.find(model.work_package_id)+ # Load the project association as AR fails do do so once the work package+ # is destroyed.+ model.project- wp_call = WorkPackages::DeleteService- .new(user: user,- model: associated_wp.reload)- .call(params)+ wp_call = WorkPackages::DeleteService+ .new(user: user,+ model: associated_wp.reload)+ .call(params)- if wp_call.success?- super(params)- else- wp_call+ if wp_call.success?+ super(params)+ else+ wp_call+ endendendend-end+end\ No newline at end of filediff --git a/modules/bim/app/services/bcf/issues/set_attributes_service.rb b/modules/bim/app/services/bim/bcf/issues/set_attributes_service.rbsimilarity index 92%rename from modules/bim/app/services/bcf/issues/set_attributes_service.rbrename to modules/bim/app/services/bim/bcf/issues/set_attributes_service.rbindex 8e95fb29579..2d15eb7d65b 100644--- a/modules/bim/app/services/bcf/issues/set_attributes_service.rb+++ b/modules/bim/app/services/bim/bcf/issues/set_attributes_service.rb@@ -28,7 +28,9 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfIssues- class SetAttributesService < ::BaseServices::SetAttributes+module Bim::Bcf+ module Issues+ class SetAttributesService < ::BaseServices::SetAttributes+ endendenddiff --git a/modules/bim/app/services/bim/bcf/issues/transform_attributes_service.rb b/modules/bim/app/services/bim/bcf/issues/transform_attributes_service.rbnew file mode 100644index 00000000000..77e6fd5e8cb--- /dev/null+++ b/modules/bim/app/services/bim/bcf/issues/transform_attributes_service.rb@@ -0,0 +1,168 @@+#-- encoding: UTF-8++#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2012-2020 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-2017 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 docs/COPYRIGHT.rdoc for more details.+#++++module Bim::Bcf+ module Issues+ class TransformAttributesService+ def initialize(project)+ self.project = project+ end++ def call(attributes)+ ServiceResult.new success: true,+ result: work_package_attributes(attributes)+ end++ private++ attr_accessor :project++ ##+ # BCF issues might have empty titles. OP needs one.+ def title(attributes)+ if attributes[:title]+ attributes[:title]+ elsif attributes[:import_options]+ '(Imported BCF issue contained no title)'+ end+ end++ def author(project, attributes)+ find_user_in_project(project, attributes[:author]) || User.system+ end++ def assignee(attributes)+ assignee = find_user(attributes[:assignee])++ return assignee if assignee.present?++ missing_assignee(attributes[:assignee], attributes[:import_options] || {})+ end++ ##+ # Try to find the given user by mail in the project+ def find_user(mail)+ project.users.find_by(mail: mail)+ end++ def type(attributes)+ type_name = attributes[:type]+ type = project.types.find_by(name: type_name)++ return type if type.present?++ missing_type(type_name, attributes[:import_options] || {})+ end++ ##+ # Handle unknown statuses during import+ def status(attributes)+ status_name = attributes[:status]+ status = ::Status.find_by(name: status_name)++ return status if status.present?++ missing_status(status_name, attributes[:import_options] || {})+ end++ ##+ # Handle unknown priorities during import+ def priority(attributes)+ priority_name = attributes[:priority]+ priority = ::IssuePriority.find_by(name: priority_name)++ return priority if priority.present?++ missing_priority(priority_name, attributes[:import_options] || {})+ end++ ##+ # Get mapped and raw attributes from MarkupExtractor+ # and return all values that are non-nil+ def work_package_attributes(attributes)+ {+ type: type(attributes),++ # Native attributes from the extractor+ subject: title(attributes),+ description: attributes[:description],+ due_date: attributes[:due_date],+ start_date: attributes[:start_date],++ # Mapped attributes+ assigned_to: assignee(attributes),+ status: status(attributes),+ priority: priority(attributes)+ }.compact+ end++ def missing_status(status_name, import_options)+ if import_options[:unknown_statuses_action] == 'use_default'+ ::Status.default+ elsif import_options[:unknown_statuses_action] == 'chose' &&+ import_options[:unknown_statuses_chose_ids].any?+ ::Status.find_by(id: import_options[:unknown_statuses_chose_ids].first)+ elsif status_name+ Status::InexistentStatus.new+ end+ end++ def missing_priority(priority_name, import_options)+ if import_options[:unknown_priorities_action] == 'use_default'+ # NOP The 'use_default' case gets already covered by OP.+ elsif import_options[:unknown_priorities_action] == 'chose' &&+ import_options[:unknown_priorities_chose_ids].any?+ ::IssuePriority.find_by(id: import_options[:unknown_priorities_chose_ids].first)+ elsif priority_name+ Priority::InexistentPriority.new+ end+ end++ def missing_type(type_name, import_options)+ types = project.types++ if import_options[:unknown_types_action] == 'use_default'+ types.default&.first+ elsif import_options[:unknown_types_action] == 'chose' &&+ import_options[:unknown_types_chose_ids].any?+ types.find_by(id: import_options[:unknown_types_chose_ids].first)+ elsif type_name+ Type::InexistentType.new+ end+ end++ def missing_assignee(assignee_name, import_options)+ if import_options[:invalid_people_action] != 'anonymize' && assignee_name+ User::InexistentUser.new+ end+ end+ end+ end+enddiff --git a/modules/bim/app/services/bcf/issues/update_service.rb b/modules/bim/app/services/bim/bcf/issues/update_service.rbsimilarity index 71%rename from modules/bim/app/services/bcf/issues/update_service.rbrename to modules/bim/app/services/bim/bcf/issues/update_service.rbindex 816cd073e4f..3467ad28261 100644--- a/modules/bim/app/services/bcf/issues/update_service.rb+++ b/modules/bim/app/services/bim/bcf/issues/update_service.rb@@ -28,23 +28,25 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfIssues- class UpdateService < ::BaseServices::Update- private+module Bim::Bcf+ module Issues+ class UpdateService < ::BaseServices::Update+ private- def before_perform(params)- wp_call = ::WorkPackages::UpdateService- .new(model: model.work_package,- user: user,- contract_class: Bcf::WorkPackages::UpdateContract)- .call(params)+ def before_perform(params)+ wp_call = ::WorkPackages::UpdateService+ .new(model: model.work_package,+ user: user,+ contract_class: Bcf::WorkPackages::UpdateContract)+ .call(params)- if wp_call.success?- issue_params = params.slice(*Bcf::Issue::SETTABLE_ATTRIBUTES)+ if wp_call.success?+ issue_params = params.slice(*Bim::Bcf::Issue::SETTABLE_ATTRIBUTES)- super(issue_params)- else- wp_call+ super(issue_params)+ else+ wp_call+ endendendenddiff --git a/modules/bim/app/services/bcf/viewpoints/create_service.rb b/modules/bim/app/services/bim/bcf/viewpoints/create_service.rbsimilarity index 93%rename from modules/bim/app/services/bcf/viewpoints/create_service.rbrename to modules/bim/app/services/bim/bcf/viewpoints/create_service.rbindex 303d071e101..9e676ae54e9 100644--- a/modules/bim/app/services/bcf/viewpoints/create_service.rb+++ b/modules/bim/app/services/bim/bcf/viewpoints/create_service.rb@@ -28,7 +28,9 @@# See docs/COPYRIGHT.rdoc for more details.#++-module Bim::BcfViewpoints- class CreateService < ::BaseServices::Create+module Bim::Bcf+ module Viewpoints+ class CreateService < ::BaseServices::Create+ endendenddiff --git a/modules/bim/app/services/bcf/viewpoints/delete_service.rb b/modules/bim/app/services/bim/bcf/viewpoints/delete_service.rbsimilarity index 92%rename from modules/bim/app/services/bcf/viewpoints/delete_service.rbrename to modules/bim/app/services/bim/bcf/viewpoints/delete_service.rbindex 3e8d9649f83..2d6deb4c188 100644--- a/modules/bim/app/services/bcf/viewpoints/delete_service.rb+++ b/modules/bim/app/services/bim/bcf/viewpoints/delete_service.rb@@ -28,7 +28,9 @@# See doc/COPYRIGHT.rdoc for more details.#++-module Bim::BcfViewpoints- class DeleteService < ::BaseServices::Delete+module Bim::Bcf+ module Viewpoints+ class DeleteService < ::BaseServices::Delete+ endendenddiff --git a/modules/bim/app/services/bim/bcf/viewpoints/set_attributes_service.rb b/modules/bim/app/services/bim/bcf/viewpoints/set_attributes_service.rbnew file mode 100644index 00000000000..72e2221834f--- /dev/null+++ b/modules/bim/app/services/bim/bcf/viewpoints/set_attributes_service.rb@@ -0,0 +1,89 @@+#-- encoding: UTF-8++#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2012-2020 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-2017 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 docs/COPYRIGHT.rdoc for more details.+#++++module Bim::Bcf+ module Viewpoints+ class SetAttributesService < ::BaseServices::SetAttributes+ def set_attributes(params)+ super++ set_snapshot+ end++ def set_default_attributes(_params)+ model.json_viewpoint['guid'] = model.uuid+ end++ def set_snapshot+ return unless snapshot_data_complete? && snapshot_content_type++ file = OpenProject::Files+ .create_uploaded_file(name: "snapshot.#{snapshot_extension}",+ content_type: snapshot_content_type,+ content: snapshot_binary_contents,+ binary: true)++ # This might break once the service is also used+ # to update existing viewpoints as the snapshot method will+ # delete any existing snapshot right away while the expectation+ # on a SetAttributesService is to not perform persisted changes.+ model.snapshot = file+ end++ def snapshot_data_complete?+ model.json_viewpoint['snapshot'] &&+ model.json_viewpoint['snapshot']['snapshot_type'] &&+ model.json_viewpoint['snapshot']['snapshot_data']+ end++ def snapshot_content_type+ # Return nil when the extension is not within the specified set+ # which will lead to the snapshot not being created.+ # The contract will catch the error.+ return unless model.json_viewpoint['snapshot']++ case model.json_viewpoint['snapshot']['snapshot_type']+ when 'png'+ 'image/png'+ when 'jpg'+ 'image/jpeg'+ end+ end++ def snapshot_extension+ model.json_viewpoint['snapshot']['snapshot_type']+ end++ def snapshot_binary_contents+ Base64.decode64 model.json_viewpoint['snapshot']['snapshot_data']+ end+ end+ end+enddiff --git a/modules/bim/app/services/ifc_models/create_service.rb b/modules/bim/app/services/bim/ifc_models/create_service.rbsimilarity index 92%rename from modules/bim/app/services/ifc_models/create_service.rbrename to modules/bim/app/services/bim/ifc_models/create_service.rbindex 1c319c2b2b7..ca4c0232030 100644--- a/modules/bim/app/services/ifc_models/create_service.rb+++ b/modules/bim/app/services/bim/ifc_models/create_service.rb@@ -27,20 +27,20 @@#+module Bim- module IFCModels+ module IfcModelsclass CreateService < ::BaseServices::Createprotecteddef after_perform(call)if call.success?- IFCConversionJob.perform_later(call.result)+ IfcConversionJob.perform_later(call.result)endcallenddef instance(_params)- ::IFCModels::IFCModel.new+ ::Bim::IfcModels::IfcModel.newendendenddiff --git a/modules/bim/app/services/ifc_models/set_attributes_service.rb b/modules/bim/app/services/bim/ifc_models/set_attributes_service.rbsimilarity index 99%rename from modules/bim/app/services/ifc_models/set_attributes_service.rbrename to modules/bim/app/services/bim/ifc_models/set_attributes_service.rbindex ac4f9a05685..2f65b6d1d57 100644--- a/modules/bim/app/services/ifc_models/set_attributes_service.rb+++ b/modules/bim/app/services/bim/ifc_models/set_attributes_service.rb@@ -29,7 +29,7 @@#++module Bim- module IFCModels+ module IfcModelsclass SetAttributesService < ::BaseServices::SetAttributesprotecteddiff --git a/modules/bim/app/services/ifc_models/update_service.rb b/modules/bim/app/services/bim/ifc_models/update_service.rbsimilarity index 96%rename from modules/bim/app/services/ifc_models/update_service.rbrename to modules/bim/app/services/bim/ifc_models/update_service.rbindex 03360b98625..d3f66fed662 100644--- a/modules/bim/app/services/ifc_models/update_service.rb+++ b/modules/bim/app/services/bim/ifc_models/update_service.rb@@ -27,7 +27,7 @@#+module Bim- module IFCModels+ module IfcModelsclass UpdateService < ::BaseServices::Updateprotected@@ -44,7 +44,7 @@ module Bimmodel.attachments.select(&:marked_for_destruction?).each(&:destroy)if @ifc_attachment_replaced- IFCConversionJob.perform_later(call.result)+ IfcConversionJob.perform_later(call.result)endenddiff --git a/modules/bim/app/services/ifc_models/view_converter_service.rb b/modules/bim/app/services/bim/ifc_models/view_converter_service.rbsimilarity index 99%rename from modules/bim/app/services/ifc_models/view_converter_service.rbrename to modules/bim/app/services/bim/ifc_models/view_converter_service.rbindex 3af5786af63..321634581d5 100644--- a/modules/bim/app/services/ifc_models/view_converter_service.rb+++ b/modules/bim/app/services/bim/ifc_models/view_converter_service.rb@@ -28,7 +28,7 @@require 'open3'module Bim- module IFCModels+ module IfcModelsclass ViewConverterServiceattr_reader :ifc_model, :errorsdiff --git a/modules/bim/app/views/bim/ifc_models/_form.html.erb b/modules/bim/app/views/bim/ifc_models/ifc_models/_form.html.erbsimilarity index 100%rename from modules/bim/app/views/bim/ifc_models/_form.html.erbrename to modules/bim/app/views/bim/ifc_models/ifc_models/_form.html.erbdiff --git a/modules/bim/app/views/bim/ifc_models/_no_default_notice.html.erb b/modules/bim/app/views/bim/ifc_models/ifc_models/_no_default_notice.html.erbsimilarity index 100%rename from modules/bim/app/views/bim/ifc_models/_no_default_notice.html.erbrename to modules/bim/app/views/bim/ifc_models/ifc_models/_no_default_notice.html.erbdiff --git a/modules/bim/app/views/bim/ifc_models/_panels.html.erb b/modules/bim/app/views/bim/ifc_models/ifc_models/_panels.html.erbsimilarity index 100%rename from modules/bim/app/views/bim/ifc_models/_panels.html.erbrename to modules/bim/app/views/bim/ifc_models/ifc_models/_panels.html.erbdiff --git a/modules/bim/app/views/bim/ifc_models/_show_headers.html.erb b/modules/bim/app/views/bim/ifc_models/ifc_models/_show_headers.html.erbsimilarity index 72%rename from modules/bim/app/views/bim/ifc_models/_show_headers.html.erbrename to modules/bim/app/views/bim/ifc_models/ifc_models/_show_headers.html.erbindex f5b7aa5a065..d0d864696dc 100644--- a/modules/bim/app/views/bim/ifc_models/_show_headers.html.erb+++ b/modules/bim/app/views/bim/ifc_models/ifc_models/_show_headers.html.erb@@ -1,5 +1,5 @@<% content_for :header_tags do %>- <%= stylesheet_link_tag "ifc_viewer/generic", media: 'all' %>+ <%= stylesheet_link_tag "bim/ifc_viewer/generic", media: 'all' %><% provision_gon_for_ifc_model(all_models, selected_models) %><%= include_gon(nonce: content_security_policy_script_nonce) %><% end %>diff --git a/modules/bim/app/views/bim/ifc_models/_unconverted_notice.html.erb b/modules/bim/app/views/bim/ifc_models/ifc_models/_unconverted_notice.html.erbsimilarity index 100%rename from modules/bim/app/views/bim/ifc_models/_unconverted_notice.html.erbrename to modules/bim/app/views/bim/ifc_models/ifc_models/_unconverted_notice.html.erbdiff --git a/modules/bim/app/views/bim/ifc_models/defaults.html.erb b/modules/bim/app/views/bim/ifc_models/ifc_models/defaults.html.erbsimilarity index 100%rename from modules/bim/app/views/bim/ifc_models/defaults.html.erbrename to modules/bim/app/views/bim/ifc_models/ifc_models/defaults.html.erbdiff --git a/modules/bim/app/views/bim/ifc_models/edit.html.erb b/modules/bim/app/views/bim/ifc_models/ifc_models/edit.html.erbsimilarity index 96%rename from modules/bim/app/views/bim/ifc_models/edit.html.erbrename to modules/bim/app/views/bim/ifc_models/ifc_models/edit.html.erbindex 4901c91bfd6..2cd4e863006 100644--- a/modules/bim/app/views/bim/ifc_models/edit.html.erb+++ b/modules/bim/app/views/bim/ifc_models/ifc_models/edit.html.erb@@ -30,7 +30,7 @@ See doc/COPYRIGHT.rdoc for more details.++#%>-<%= toolbar title: IFCModels::IFCModel.model_name.human %>+<%= toolbar title: IfcModels::IfcModel.model_name.human %><%= labelled_tabular_form_for @ifc_model, url: ifc_models_project_ifc_model_path(@project, @ifc_model), method: 'PATCH' do |f| -%><%= error_messages_for_contract @ifc_model, @errors %>diff --git a/modules/bim/app/views/bim/ifc_models/index.html.erb b/modules/bim/app/views/bim/ifc_models/ifc_models/index.html.erbsimilarity index 94%rename from modules/bim/app/views/bim/ifc_models/index.html.erbrename to modules/bim/app/views/bim/ifc_models/ifc_models/index.html.erbindex 9b7affc6426..eafa0da2cc6 100644--- a/modules/bim/app/views/bim/ifc_models/index.html.erb+++ b/modules/bim/app/views/bim/ifc_models/ifc_models/index.html.erb@@ -36,7 +36,7 @@ See docs/COPYRIGHT.rdoc for more details.aria: { label: t(:'ifc_models.label_new_ifc_model') },title: t(:'ifc_models.label_new_ifc_model') } do %><%= op_icon('button--icon icon-add') %>- <span class="button--text"><%= ::IFCModels::IFCModel.model_name.human %></span>+ <span class="button--text"><%= ::Bim::IfcModels::IfcModel.model_name.human %></span><% end %></li><% end %>@@ -57,4 +57,4 @@ See docs/COPYRIGHT.rdoc for more details.<%= render partial: 'no_default_notice', locals: { project: @project } %><% end %>-<%= cell ::IFCModels::Models::TableCell, @ifc_models %>+<%= cell ::Bim::IfcModels::TableCell, @ifc_models %>diff --git a/modules/bim/app/views/bim/ifc_models/new.html.erb b/modules/bim/app/views/bim/ifc_models/ifc_models/new.html.erbsimilarity index 100%rename from modules/bim/app/views/bim/ifc_models/new.html.erbrename to modules/bim/app/views/bim/ifc_models/ifc_models/new.html.erbdiff --git a/modules/bim/app/views/bim/ifc_models/show.html.erb b/modules/bim/app/views/bim/ifc_models/ifc_models/show.html.erbsimilarity index 100%rename from modules/bim/app/views/bim/ifc_models/show.html.erbrename to modules/bim/app/views/bim/ifc_models/ifc_models/show.html.erbdiff --git a/modules/bim/app/workers/bim/ifc_models/ifc_conversion_job.rb b/modules/bim/app/workers/bim/ifc_models/ifc_conversion_job.rbindex c478eff237c..c983bb63793 100644--- a/modules/bim/app/workers/bim/ifc_models/ifc_conversion_job.rb+++ b/modules/bim/app/workers/bim/ifc_models/ifc_conversion_job.rb@@ -1,6 +1,6 @@module Bim- module IFCModels- class IFCConversionJob < ::ApplicationJob+ module IfcModels+ class IfcConversionJob < ::ApplicationJobqueue_as :ifc_conversion##diff --git a/modules/bim/config/locales/en.yml b/modules/bim/config/locales/en.ymlindex b958ab0ef75..e0ccb135022 100644--- a/modules/bim/config/locales/en.yml+++ b/modules/bim/config/locales/en.yml@@ -76,8 +76,10 @@ en:bcf_v2_1_text: "Application will receive full read & write access to the OpenProject BCF API v2.1 to perform actions on your behalf."activerecord:+ models:+ bim/ifc_models/ifc_model: "IFC model"attributes:- ifc_models/ifc_model:+ bim/ifc_models/ifc_model:ifc_attachment: "IFC file"is_default: "Default model"attachments: "IFC file"diff --git a/modules/bim/config/routes.rb b/modules/bim/config/routes.rbindex 9f665ee6b85..10dabeb038e 100644--- a/modules/bim/config/routes.rb+++ b/modules/bim/config/routes.rb@@ -28,25 +28,25 @@OpenProject::Application.routes.draw doscope '', as: 'bcf' do- mount Bcf::API::Root => '/api/bcf'+ mount ::Bim::Bcf::API::Root => '/api/bcf'scope 'projects/:project_id', as: 'project' do- resources :issues, controller: 'bcf/issues' do+ resources :issues, controller: 'bim/bcf/issues' doget :upload, action: :upload, on: :collectionpost :prepare_import, action: :prepare_import, on: :collectionpost :configure_import, action: :configure_import, on: :collectionpost :import, action: :perform_import, on: :collectionend- get 'bcf_issues', to: 'bcf/issues#redirect_to_bcf_issues_list', as: :work_packages+ get 'bcf_issues', to: 'bim/bcf/issues#redirect_to_bcf_issues_list', as: :work_packagesendendscope '', as: 'ifc_models' doscope 'projects/:project_id', as: 'project' do- resources :ifc_models, except: [:show], controller: 'ifc_models/ifc_models' do+ resources :ifc_models, except: [:show], controller: 'bim/ifc_models/ifc_models' docollection do- get 'defaults(/*state)', action: :defaults+ get 'defaults(/*state)', action: :defaults, as: 'defaults'get 'list(/*state)', action: :defaultsenddiff --git a/modules/bim/db/migrate/20190823090211_remove_project_id_from_bcf_issue.rb b/modules/bim/db/migrate/20190823090211_remove_project_id_from_bcf_issue.rbindex 38ceb9e6c02..f23482504e5 100644--- a/modules/bim/db/migrate/20190823090211_remove_project_id_from_bcf_issue.rb+++ b/modules/bim/db/migrate/20190823090211_remove_project_id_from_bcf_issue.rb@@ -6,7 +6,7 @@ class RemoveProjectIdFromBcfIssue < ActiveRecord::Migration[5.1]def downadd_reference :bcf_issues, :project, foreign_key: { on_delete: :cascade }, index: true- Bcf::Issue.includes(:work_package).find_each do |bcf_issue|+ Bim::Bcf::Issue.includes(:work_package).find_each do |bcf_issue|if bcf_issue.work_packagebcf_issue.project_id = bcf_issue.work_package.project_idbcf_issue.savediff --git a/modules/bim/db/migrate/20191029155327_add_ifc_models_plugin.rb b/modules/bim/db/migrate/20191029155327_add_ifc_models_plugin.rbindex bd19ddfecd4..15b8a40bef6 100644--- a/modules/bim/db/migrate/20191029155327_add_ifc_models_plugin.rb+++ b/modules/bim/db/migrate/20191029155327_add_ifc_models_plugin.rb@@ -1,4 +1,4 @@-class AddIFCModelsPlugin < ActiveRecord::Migration[5.1]+class AddIfcModelsPlugin < ActiveRecord::Migration[5.1]def changecreate_table :ifc_models do |t|t.string :titlediff --git a/modules/bim/db/migrate/20191114090353_add_is_default_to_ifc_models.rb b/modules/bim/db/migrate/20191114090353_add_is_default_to_ifc_models.rbindex e9aefeed8f7..571d383101c 100644--- a/modules/bim/db/migrate/20191114090353_add_is_default_to_ifc_models.rb+++ b/modules/bim/db/migrate/20191114090353_add_is_default_to_ifc_models.rb@@ -1,4 +1,4 @@-class AddIsDefaultToIFCModels < ActiveRecord::Migration[5.1]+class AddIsDefaultToIfcModels < ActiveRecord::Migration[5.1]def changeadd_column :ifc_models, :is_default, :boolean, default: false, null: falsediff --git a/modules/bim/db/migrate/20191121140202_migrate_xml_viewpoint_to_json.rb b/modules/bim/db/migrate/20191121140202_migrate_xml_viewpoint_to_json.rbindex 8f8fc3e00a7..f0438abb340 100644--- a/modules/bim/db/migrate/20191121140202_migrate_xml_viewpoint_to_json.rb+++ b/modules/bim/db/migrate/20191121140202_migrate_xml_viewpoint_to_json.rb@@ -6,9 +6,9 @@ class MigrateXmlViewpointToJson < ActiveRecord::Migration[6.0]end# Convert viewpoints- ::Bcf::Viewpoint.reset_column_information- ::Bcf::Viewpoint.find_each do |resource|- mapper = ::OpenProject::Bcf::BcfJson::ViewpointReader+ ::Bim::Bcf::Viewpoint.reset_column_information+ ::Bim::Bcf::Viewpoint.find_each do |resource|+ mapper = ::OpenProject::Bim::BcfJson::ViewpointReader.new(resource.uuid, resource.viewpoint)resource.update_column(:json_viewpoint, mapper.result)diff --git a/modules/bim/lib/api/bim/bcf_xml/v1/bcf_xml_api.rb b/modules/bim/lib/api/bim/bcf_xml/v1/bcf_xml_api.rbindex 625b87c88fb..6e00840cca9 100644--- a/modules/bim/lib/api/bim/bcf_xml/v1/bcf_xml_api.rb+++ b/modules/bim/lib/api/bim/bcf_xml/v1/bcf_xml_api.rb@@ -70,7 +70,7 @@ module APIquery = Query.new_default(name: '_', project: project)updated_query = ::API::V3::UpdateQueryFromV3ParamsService.new(query, User.current).call(params)- exporter = ::OpenProject::Bcf::BcfXml::Exporter.new(updated_query.result)+ exporter = ::OpenProject::Bim::BcfXml::Exporter.new(updated_query.result)header['Content-Disposition'] = "attachment; filename=\"#{exporter.bcf_filename}\""env['api.format'] = :binaryexporter.list_from_api.read@@ -85,7 +85,7 @@ module APIbeginfile = params[:bcf_xml_file][:tempfile]- importer = ::OpenProject::Bcf::BcfXml::Importer.new(file,+ importer = ::OpenProject::Bim::BcfXml::Importer.new(file,project,current_user: User.current)importer.import!(import_options)diff --git a/modules/bim/lib/open_project/bim/bcf_issue_associated_filter.rb b/modules/bim/lib/open_project/bim/bcf_issue_associated_filter.rbindex 92983922a88..2046b54b26a 100644--- a/modules/bim/lib/open_project/bim/bcf_issue_associated_filter.rb+++ b/modules/bim/lib/open_project/bim/bcf_issue_associated_filter.rb@@ -45,9 +45,9 @@ module ::OpenProject::Bimdef whereif associated?- ::Queries::Operators::All.sql_for_field(values, ::Bcf::Issue.table_name, 'id')+ ::Queries::Operators::All.sql_for_field(values, ::Bim::Bcf::Issue.table_name, 'id')elsif not_associated?- ::Queries::Operators::None.sql_for_field(values, ::Bcf::Issue.table_name, 'id')+ ::Queries::Operators::None.sql_for_field(values, ::Bim::Bcf::Issue.table_name, 'id')elseraise 'Unsupported operator or value'enddiff --git a/modules/bim/lib/open_project/bim/bcf_json/viewpoint_reader.rb b/modules/bim/lib/open_project/bim/bcf_json/viewpoint_reader.rbindex 89ba7ba79f2..a45cc8886c9 100644--- a/modules/bim/lib/open_project/bim/bcf_json/viewpoint_reader.rb+++ b/modules/bim/lib/open_project/bim/bcf_json/viewpoint_reader.rb@@ -1,6 +1,6 @@require 'bigdecimal'-module OpenProject::Bcf+module OpenProject::Bimmodule BcfJsonclass ViewpointReaderROOT_NODE ||= 'VisualizationInfo'.freezediff --git a/modules/bim/lib/open_project/bim/bcf_xml/aggregations.rb b/modules/bim/lib/open_project/bim/bcf_xml/aggregations.rbindex 28090a1792a..bdbca3286c4 100644--- a/modules/bim/lib/open_project/bim/bcf_xml/aggregations.rb+++ b/modules/bim/lib/open_project/bim/bcf_xml/aggregations.rb@@ -1,4 +1,4 @@-module OpenProject::Bcf::BcfXml+module OpenProject::Bim::BcfXmlclass Aggregationsattr_reader :listings, :project, :instance_cachediff --git a/modules/bim/lib/open_project/bim/bcf_xml/base_writer.rb b/modules/bim/lib/open_project/bim/bcf_xml/base_writer.rbindex ad86e1885ab..3548cf02f17 100644--- a/modules/bim/lib/open_project/bim/bcf_xml/base_writer.rb+++ b/modules/bim/lib/open_project/bim/bcf_xml/base_writer.rb@@ -1,6 +1,6 @@### Creates or updates a BCF issue and markup from a work package-module OpenProject::Bcf::BcfXml+module OpenProject::Bim::BcfXmlclass BaseWriterattr_reader :markup_docdiff --git a/modules/bim/lib/open_project/bim/bcf_xml/exporter.rb b/modules/bim/lib/open_project/bim/bcf_xml/exporter.rbindex 630ce25ae4d..460b4ee700d 100644--- a/modules/bim/lib/open_project/bim/bcf_xml/exporter.rb+++ b/modules/bim/lib/open_project/bim/bcf_xml/exporter.rb@@ -1,6 +1,6 @@require 'fileutils'-module OpenProject::Bcf::BcfXml+module OpenProject::Bim::BcfXmlclass Exporter < ::WorkPackage::Exporter::Baseinclude Redmine::I18ndiff --git a/modules/bim/lib/open_project/bim/bcf_xml/file_entry.rb b/modules/bim/lib/open_project/bim/bcf_xml/file_entry.rbindex 5f17f9f53c4..7e0d77ea7b0 100644--- a/modules/bim/lib/open_project/bim/bcf_xml/file_entry.rb+++ b/modules/bim/lib/open_project/bim/bcf_xml/file_entry.rb@@ -1,6 +1,6 @@### Helper class to provide uploads from IO streams.-module OpenProject::Bcf::BcfXml+module OpenProject::Bim::BcfXmlclass FileEntry < StringIOdef initialize(stream, filename:)super(stream.read)diff --git a/modules/bim/lib/open_project/bim/bcf_xml/importer.rb b/modules/bim/lib/open_project/bim/bcf_xml/importer.rbindex f96d785436b..65728c1cad4 100644--- a/modules/bim/lib/open_project/bim/bcf_xml/importer.rb+++ b/modules/bim/lib/open_project/bim/bcf_xml/importer.rb@@ -2,7 +2,7 @@ require 'activerecord-import'require_relative 'issue_reader'require_relative 'aggregations'-module OpenProject::Bcf::BcfXml+module OpenProject::Bim::BcfXmlclass Importerattr_reader :file, :project, :current_userdiff --git a/modules/bim/lib/open_project/bim/bcf_xml/issue_reader.rb b/modules/bim/lib/open_project/bim/bcf_xml/issue_reader.rbindex e5120f7d70c..82c0a25ae8d 100644--- a/modules/bim/lib/open_project/bim/bcf_xml/issue_reader.rb+++ b/modules/bim/lib/open_project/bim/bcf_xml/issue_reader.rb@@ -4,7 +4,7 @@# this should be turned into a representable/xml decoratorrequire_relative 'file_entry'-module OpenProject::Bcf::BcfXml+module OpenProject::Bim::BcfXmlclass IssueReaderattr_reader :zip, :entry, :issue, :extractor, :project, :user, :import_optionsattr_accessor :wp_last_updated_at, :is_update@@ -92,7 +92,7 @@ module OpenProject::Bcf::BcfXml## Get mapped and raw attributes from MarkupExtractor## and return all values that are non-nildef work_package_attributes- attributes = ::Bcf::Issues::TransformAttributesService+ attributes = ::Bim::Bcf::Issues::TransformAttributesService.new(project).call(extractor_attributes.merge(import_options: import_options)).result@@ -200,11 +200,11 @@ module OpenProject::Bcf::BcfXml### Find existing issue or create newdef find_or_initialize_issue- ::Bcf::Issue+ ::Bim::Bcf::Issue.joins(:work_package).where(uuid: topic_uuid, 'work_packages.project_id': @project.id).references(:work_package).first ||- ::Bcf::Issue.new(uuid: topic_uuid)+ ::Bim::Bcf::Issue.new(uuid: topic_uuid)end##@@ -233,7 +233,7 @@ module OpenProject::Bcf::BcfXml### Map the xml viewpoint as jsondef viewpoint_as_json(uuid, xml)- ::OpenProject::Bcf::BcfJson::ViewpointReader+ ::OpenProject::Bim::BcfJson::ViewpointReader.new(uuid, xml).resultenddiff --git a/modules/bim/lib/open_project/bim/bcf_xml/issue_writer.rb b/modules/bim/lib/open_project/bim/bcf_xml/issue_writer.rbindex 0da31e0bf5c..479903d3eb8 100644--- a/modules/bim/lib/open_project/bim/bcf_xml/issue_writer.rb+++ b/modules/bim/lib/open_project/bim/bcf_xml/issue_writer.rb@@ -1,6 +1,6 @@### Creates or updates a BCF issue and markup from a work package-module OpenProject::Bcf::BcfXml+module OpenProject::Bim::BcfXmlclass IssueWriter < BaseWriterattr_reader :work_package, :issue, :markup_doc, :markup_node@@ -231,7 +231,7 @@ module OpenProject::Bcf::BcfXml### Find existing issue or create newdef find_or_initialize_issue- ::Bcf::Issue.find_or_initialize_by(work_package: work_package)+ ::Bim::Bcf::Issue.find_or_initialize_by(work_package: work_package)endendenddiff --git a/modules/bim/lib/open_project/bim/bcf_xml/markup_extractor.rb b/modules/bim/lib/open_project/bim/bcf_xml/markup_extractor.rbindex 26801fd2402..03364a9a77f 100644--- a/modules/bim/lib/open_project/bim/bcf_xml/markup_extractor.rb+++ b/modules/bim/lib/open_project/bim/bcf_xml/markup_extractor.rb@@ -3,7 +3,7 @@# manually. If we want to extract the entire markup,# this should be turned into a representable/xml decorator-module OpenProject::Bcf::BcfXml+module OpenProject::Bim::BcfXmlclass MarkupExtractorattr_reader :entryattr_accessor :markup, :docdiff --git a/modules/bim/lib/open_project/bim/bcf_xml/viewpoint_writer.rb b/modules/bim/lib/open_project/bim/bcf_xml/viewpoint_writer.rbindex d0a3b0ab634..4d734da22eb 100644--- a/modules/bim/lib/open_project/bim/bcf_xml/viewpoint_writer.rb+++ b/modules/bim/lib/open_project/bim/bcf_xml/viewpoint_writer.rb@@ -1,6 +1,6 @@### Creates or updates a BCF issue and markup from a work package-module OpenProject::Bcf::BcfXml+module OpenProject::Bim::BcfXmlclass ViewpointWriter < BaseWriterattr_reader :viewpointdiff --git a/modules/bim/lib/open_project/bim/engine.rb b/modules/bim/lib/open_project/bim/engine.rbindex d6d4847a7e6..5bc5cabfb28 100644--- a/modules/bim/lib/open_project/bim/engine.rb+++ b/modules/bim/lib/open_project/bim/engine.rb@@ -44,16 +44,16 @@ module OpenProject::Bim} doproject_module :bim dopermission :view_ifc_models,- { 'bim/ifc_models/ifc_models': %i[index show defaults] }+ {'bim/ifc_models/ifc_models': %i[index show defaults]}permission :manage_ifc_models,- { 'bim/ifc_models/ifc_models': %i[index show destroy edit update create new] },+ {'bim/ifc_models/ifc_models': %i[index show destroy edit update create new]},dependencies: %i[view_ifc_models]permission :view_linked_issues,- { 'bim/bcf/issues': %i[index] },+ {'bim/bcf/issues': %i[index]},dependencies: %i[view_work_packages]permission :manage_bcf,- { 'bim/bcf/issues': %i[index upload prepare_import configure_import perform_import] },+ {'bim/bcf/issues': %i[index upload prepare_import configure_import perform_import]},dependencies: %i[view_linked_issuesview_work_packagesadd_work_packages@@ -65,7 +65,7 @@ module OpenProject::Bim::Redmine::MenuManager.map(:project_menu) do |menu|menu.push(:ifc_models,- { controller: '/bim/ifc_models/ifc_models', action: 'defaults' },+ {controller: '/bim/ifc_models/ifc_models', action: 'defaults'},caption: :'bim.label_bim',param: :project_id,after: :work_packages,@@ -73,7 +73,7 @@ module OpenProject::Bimbadge: :label_new)menu.push :ifc_viewer_panels,- { controller: '/bim/ifc_models/ifc_models', action: 'defaults' },+ {controller: '/bim/ifc_models/ifc_models', action: 'defaults'},param: :project_id,parent: :ifc_models,partial: '/bim/ifc_models/ifc_models/panels'@@ -83,7 +83,7 @@ module OpenProject::Bimassets %w(bim/bcf.css bim/ifc_viewer/generic.css)- patches %i[WorkPackage Type Journal RootSeeder]+ patches %i[WorkPackage Type Journal RootSeeder Project]patch_with_namespace :BasicData, :SettingSeederpatch_with_namespace :BasicData, :RoleSeeder@@ -158,7 +158,11 @@ module OpenProject::Bimendconfig.to_prepare do- require 'open_project/ifc_models/hooks'+ require_relative 'hooks'++ # The DesignPatch is not a typical method patch, as it replaces a constant and thus needs to be applied without the+ # standard patch logic for plugins.+ require_relative "patches/design_patch"endinitializer 'bim.bcf.register_hooks' do@@ -186,16 +190,16 @@ module OpenProject::Bimconfig.to_prepare do::WorkPackage::Exporter- .register_for_list(:bcf, OpenProject::Bcf::BcfXml::Exporter)+ .register_for_list(:bcf, OpenProject::Bim::BcfXml::Exporter)- ::Queries::Register.filter ::Query, OpenProject::Bcf::BcfIssueAssociatedFilter- ::Queries::Register.column ::Query, OpenProject::Bcf::QueryBcfThumbnailColumn+ ::Queries::Register.filter ::Query, OpenProject::Bim::BcfIssueAssociatedFilter+ ::Queries::Register.column ::Query, OpenProject::Bim::QueryBcfThumbnailColumn::API::Root.class_eval docontent_type :binary, 'application/octet-stream'default_format :binaryversion 'v1', using: :path do- mount ::API::BcfXml::V1::BcfXmlAPI+ mount ::API::Bim::BcfXml::V1::BcfXmlAPIendendenddiff --git a/modules/bim/lib/open_project/bim/hooks.rb b/modules/bim/lib/open_project/bim/hooks.rbindex f37217255e9..4f3c6e26ee5 100644--- a/modules/bim/lib/open_project/bim/hooks.rb+++ b/modules/bim/lib/open_project/bim/hooks.rb@@ -34,7 +34,7 @@ module OpenProject::Bim::Hooksdef admin_information_checklist(*)[- [:'extraction.available.ifc_convert', ::Bim::IFCModels::ViewConverterService.available?]+ [:'extraction.available.ifc_convert', ::Bim::IfcModels::ViewConverterService.available?]]endenddiff --git a/modules/bim/lib/open_project/bim/patches/aggregated_journal_patch.rb b/modules/bim/lib/open_project/bim/patches/aggregated_journal_patch.rbindex 6e618e73117..3514342e6a2 100644--- a/modules/bim/lib/open_project/bim/patches/aggregated_journal_patch.rb+++ b/modules/bim/lib/open_project/bim/patches/aggregated_journal_patch.rb@@ -43,7 +43,7 @@ module OpenProject::Bim::Patches::AggregatedJournalPatchaggregated_journals = super(journable, aggregated_journals, includes)if includes.include?(:bcf_comments)bcf_comments = if includes.include?(:bcf_comment)- ::Bcf::Comment+ ::Bim::Bcf::Comment.where(journal_id: journal_ids).all.group_by(&:journal_id)diff --git a/modules/bim/lib/open_project/bim/patches/api/v3/export_formats.rb b/modules/bim/lib/open_project/bim/patches/api/v3/export_formats.rbindex 6e7bb68c843..533cceb30ad 100644--- a/modules/bim/lib/open_project/bim/patches/api/v3/export_formats.rb+++ b/modules/bim/lib/open_project/bim/patches/api/v3/export_formats.rb@@ -1,4 +1,4 @@-module OpenProject::Bcf::Patches+module OpenProject::Bim::Patchesmodule Api::V3::ExportFormatsdef representation_formatssuper + [representation_format_bcf]diff --git a/modules/bim/lib/open_project/bim/patches/journal_patch.rb b/modules/bim/lib/open_project/bim/patches/journal_patch.rbindex d397c556ae9..447aeb2d0d3 100644--- a/modules/bim/lib/open_project/bim/patches/journal_patch.rb+++ b/modules/bim/lib/open_project/bim/patches/journal_patch.rb@@ -31,7 +31,7 @@ require_dependency 'journal'module OpenProject::Bim::Patches::JournalPatchdef self.included(base)base.class_eval do- has_one :bcf_comment, class_name: 'Bcf::Comment', foreign_key: 'journal_id'+ has_one :bcf_comment, class_name: 'Bim::Bcf::Comment', foreign_key: 'journal_id'endendenddiff --git a/modules/bim/lib/open_project/bim/patches/project_patch.rb b/modules/bim/lib/open_project/bim/patches/project_patch.rbindex 9e71e81ea48..715e3e51265 100644--- a/modules/bim/lib/open_project/bim/patches/project_patch.rb+++ b/modules/bim/lib/open_project/bim/patches/project_patch.rb@@ -31,7 +31,7 @@ require_dependency 'work_package'module OpenProject::Bim::Patches::ProjectPatchdef self.included(base)base.class_eval do- has_many :ifc_models, class_name: 'Bim::IFCModels::IFCModel', foreign_key: 'project_id'+ has_many :ifc_models, class_name: 'Bim::IfcModels::IfcModel', foreign_key: 'project_id'endendenddiff --git a/modules/bim/lib/open_project/bim/patches/work_package_patch.rb b/modules/bim/lib/open_project/bim/patches/work_package_patch.rbindex 030f6985911..54aebc9e701 100644--- a/modules/bim/lib/open_project/bim/patches/work_package_patch.rb+++ b/modules/bim/lib/open_project/bim/patches/work_package_patch.rb@@ -31,7 +31,7 @@ require_dependency 'work_package'module OpenProject::Bim::Patches::WorkPackagePatchdef self.included(base)base.class_eval do- has_one :bcf_issue, class_name: 'Bcf::Issue', foreign_key: 'work_package_id'+ has_one :bcf_issue, class_name: 'Bim::Bcf::Issue', foreign_key: 'work_package_id'endendenddiff --git a/modules/bim/spec/api/v3/queries/filters/query_filter_instance_representer_spec.rb b/modules/bim/spec/api/v3/queries/filters/query_filter_instance_representer_spec.rbindex a574b68d6f7..8638758a37e 100644--- a/modules/bim/spec/api/v3/queries/filters/query_filter_instance_representer_spec.rb+++ b/modules/bim/spec/api/v3/queries/filters/query_filter_instance_representer_spec.rb@@ -31,7 +31,7 @@ require 'spec_helper'describe ::API::V3::Queries::Filters::QueryFilterInstanceRepresenter dolet(:operator) { '=' }let(:filter) do- ::OpenProject::Bcf::BcfIssueAssociatedFilter.create!(name: "bcf_issue_associated", operator: operator, values: values)+ ::OpenProject::Bim::BcfIssueAssociatedFilter.create!(name: "bcf_issue_associated", operator: operator, values: values)endlet(:representer) { described_class.new(filter) }diff --git a/modules/bim/spec/bcf/bcf_xml/exporter_spec.rb b/modules/bim/spec/bcf/bcf_xml/exporter_spec.rbindex 74417212bb0..c07fa0a07f2 100644--- a/modules/bim/spec/bcf/bcf_xml/exporter_spec.rb+++ b/modules/bim/spec/bcf/bcf_xml/exporter_spec.rb@@ -28,7 +28,7 @@require 'spec_helper'-describe ::OpenProject::Bcf::BcfXml::Exporter do+describe ::OpenProject::Bim::BcfXml::Exporter dolet(:query) { FactoryBot.build(:global_query)}let(:work_package) { FactoryBot.create :work_package }let(:admin) { FactoryBot.create(:admin) }diff --git a/modules/bim/spec/bcf/bcf_xml/importer_spec.rb b/modules/bim/spec/bcf/bcf_xml/importer_spec.rbindex 4388dd6eb54..6b62590db60 100644--- a/modules/bim/spec/bcf/bcf_xml/importer_spec.rb+++ b/modules/bim/spec/bcf/bcf_xml/importer_spec.rb@@ -28,7 +28,7 @@require 'spec_helper'-describe ::OpenProject::Bcf::BcfXml::Importer do+describe ::OpenProject::Bim::BcfXml::Importer dolet(:filename) { 'MaximumInformation.bcf' }let(:file) doRack::Test::UploadedFile.new(@@ -95,7 +95,7 @@ describe ::OpenProject::Bcf::BcfXml::Importer doit 'creates 2 work packages' dosubject.import!- expect(::Bcf::Issue.count).to be_eql 2+ expect(::Bim::Bcf::Issue.count).to be_eql 2expect(WorkPackage.count).to be_eql 2endenddiff --git a/modules/bim/spec/bcf/bcf_xml/issue_reader_spec.rb b/modules/bim/spec/bcf/bcf_xml/issue_reader_spec.rbindex ce7e97b97b6..16d942684ef 100644--- a/modules/bim/spec/bcf/bcf_xml/issue_reader_spec.rb+++ b/modules/bim/spec/bcf/bcf_xml/issue_reader_spec.rb@@ -28,7 +28,7 @@require 'spec_helper'-describe ::OpenProject::Bcf::BcfXml::IssueReader do+describe ::OpenProject::Bim::BcfXml::IssueReader dolet(:absolute_file_path) { "63E78882-7C6A-4BF7-8982-FC478AFB9C97/markup.bcf" }let(:type) { FactoryBot.create :type, name: 'Issue', is_standard: true, is_default: true }let(:project) do@@ -87,7 +87,7 @@ describe ::OpenProject::Bcf::BcfXml::IssueReader do.new(absolute_file_path, entry_stream)endlet(:entry_stream) { StringIO.new(markup) }- let(:import_options) { OpenProject::Bcf::BcfXml::Importer::DEFAULT_IMPORT_OPTIONS }+ let(:import_options) { OpenProject::Bim::BcfXml::Importer::DEFAULT_IMPORT_OPTIONS }subject dodescribed_class.new(project,@@ -112,7 +112,7 @@ describe ::OpenProject::Bcf::BcfXml::IssueReader doexpect(bcf_issue.work_package.start_date).to eql(subject.extractor.creation_date.to_date)end- it 'BCF::Issue get initialized with the GUID form the XML file' do+ it 'Bim::Bcf::Issue get initialized with the GUID form the XML file' doexpect(bcf_issue.uuid).to eql("63E78882-7C6A-4BF7-8982-FC478AFB9C97")endenddiff --git a/modules/bim/spec/bcf/bcf_xml/issue_writer_spec.rb b/modules/bim/spec/bcf/bcf_xml/issue_writer_spec.rbindex 308857ee935..21c696c5980 100644--- a/modules/bim/spec/bcf/bcf_xml/issue_writer_spec.rb+++ b/modules/bim/spec/bcf/bcf_xml/issue_writer_spec.rb@@ -28,7 +28,7 @@require 'spec_helper'-describe ::OpenProject::Bcf::BcfXml::IssueWriter do+describe ::OpenProject::Bim::BcfXml::IssueWriter dolet(:project) { FactoryBot.create(:project) }let(:markup) do<<-MARKUP@@ -174,7 +174,7 @@ describe ::OpenProject::Bcf::BcfXml::IssueWriter doit 'creates BCF comments for comments that were created within OP.' doexpect(subject.at('/Markup/Comment[2]/Comment').content).to eql("Some note created in OP.")- expect(Bcf::Comment.count).to eql(2)+ expect(Bim::Bcf::Comment.count).to eql(2)endenddiff --git a/modules/bim/spec/bcf/bcf_xml/markup_extractor_spec.rb b/modules/bim/spec/bcf/bcf_xml/markup_extractor_spec.rbindex 5f62ea5a98c..317e38c0896 100644--- a/modules/bim/spec/bcf/bcf_xml/markup_extractor_spec.rb+++ b/modules/bim/spec/bcf/bcf_xml/markup_extractor_spec.rb@@ -28,7 +28,7 @@require 'spec_helper'-describe ::OpenProject::Bcf::BcfXml::MarkupExtractor do+describe ::OpenProject::Bim::BcfXml::MarkupExtractor dolet(:filename) { 'MaximumInformation.bcf' }let(:file) doRack::Test::UploadedFile.new(diff --git a/modules/bim/spec/contracts/bcf/issues/create_contract_spec.rb b/modules/bim/spec/contracts/bcf/issues/create_contract_spec.rbindex 46535488b83..d6bb44d5d3f 100644--- a/modules/bim/spec/contracts/bcf/issues/create_contract_spec.rb+++ b/modules/bim/spec/contracts/bcf/issues/create_contract_spec.rb@@ -29,10 +29,10 @@require 'spec_helper'require_relative './shared_contract_examples'-describe Bcf::Issues::CreateContract do+describe Bim::Bcf::Issues::CreateContract doit_behaves_like 'issues contract' dolet(:issue) do- Bcf::Issue.new(uuid: issue_uuid,+ Bim::Bcf::Issue.new(uuid: issue_uuid,work_package: issue_work_package,index: issue_index)enddiff --git a/modules/bim/spec/contracts/bcf/issues/update_contract_spec.rb b/modules/bim/spec/contracts/bcf/issues/update_contract_spec.rbindex c12b54f5fc6..110e5359fee 100644--- a/modules/bim/spec/contracts/bcf/issues/update_contract_spec.rb+++ b/modules/bim/spec/contracts/bcf/issues/update_contract_spec.rb@@ -29,7 +29,7 @@require 'spec_helper'require_relative './shared_contract_examples'-describe Bcf::Issues::UpdateContract do+describe Bim::Bcf::Issues::UpdateContract doit_behaves_like 'issues contract' dolet(:issue) doFactoryBot.build_stubbed(:bcf_issue,diff --git a/modules/bim/spec/contracts/bcf/viewpoints/create_contract_spec.rb b/modules/bim/spec/contracts/bcf/viewpoints/create_contract_spec.rbindex f4d89089f00..bc3d5a51b4c 100644--- a/modules/bim/spec/contracts/bcf/viewpoints/create_contract_spec.rb+++ b/modules/bim/spec/contracts/bcf/viewpoints/create_contract_spec.rb@@ -28,9 +28,9 @@require 'spec_helper'-describe Bcf::Viewpoints::CreateContract do+describe Bim::Bcf::Viewpoints::CreateContract dolet(:viewpoint) do- Bcf::Viewpoint.new(uuid: viewpoint_uuid,+ Bim::Bcf::Viewpoint.new(uuid: viewpoint_uuid,issue: viewpoint_issue,json_viewpoint: viewpoint_json_viewpoint)enddiff --git a/modules/bim/spec/contracts/ifc_models/create_contract_spec.rb b/modules/bim/spec/contracts/ifc_models/create_contract_spec.rbindex 5729fdfbac5..ae03649c5af 100644--- a/modules/bim/spec/contracts/ifc_models/create_contract_spec.rb+++ b/modules/bim/spec/contracts/ifc_models/create_contract_spec.rb@@ -31,10 +31,10 @@require 'spec_helper'require_relative './shared_contract_examples'-describe IFCModels::CreateContract do+describe IfcModels::CreateContract doit_behaves_like 'ifc model contract' dolet(:ifc_model) do- ::IFCModels::IFCModel.new(project: model_project,+ ::Bim::IfcModels::IfcModel.new(project: model_project,title: model_title,uploader: model_user)enddiff --git a/modules/bim/spec/contracts/ifc_models/update_contract_spec.rb b/modules/bim/spec/contracts/ifc_models/update_contract_spec.rbindex 35eae0092b5..34693eeae3b 100644--- a/modules/bim/spec/contracts/ifc_models/update_contract_spec.rb+++ b/modules/bim/spec/contracts/ifc_models/update_contract_spec.rb@@ -31,7 +31,7 @@require 'spec_helper'require_relative './shared_contract_examples'-describe IFCModels::UpdateContract do+describe IfcModels::UpdateContract doit_behaves_like 'ifc model contract' dolet(:ifc_model) doFactoryBot.build_stubbed(:ifc_model,diff --git a/modules/bim/spec/controllers/issues_controller_spec.rb b/modules/bim/spec/controllers/issues_controller_spec.rbindex 15314beafb7..fa638253107 100644--- a/modules/bim/spec/controllers/issues_controller_spec.rb+++ b/modules/bim/spec/controllers/issues_controller_spec.rb@@ -28,7 +28,7 @@require 'spec_helper'-describe ::Bcf::IssuesController, type: :controller do+describe ::Bim::Bcf::IssuesController, type: :controller dolet(:manage_bcf_role) doFactoryBot.create(:role,permissions: %i[manage_bcf view_linked_issues view_work_packages add_work_packages edit_work_packages])diff --git a/modules/bim/spec/factories/bcf_comment_factory.rb b/modules/bim/spec/factories/bcf_comment_factory.rbindex 3280dc52b1d..4a92777f3f1 100644--- a/modules/bim/spec/factories/bcf_comment_factory.rb+++ b/modules/bim/spec/factories/bcf_comment_factory.rb@@ -27,7 +27,7 @@#++FactoryBot.define do- factory :bcf_comment, class: ::Bcf::Comment do+ factory :bcf_comment, class: ::Bim::Bcf::Comment doafter(:create) do |bcf_comment|bcf_comment.journal = create(:work_package_journal)bcf_comment.journal.update_attribute(:notes, 'Some BCF comment.')diff --git a/modules/bim/spec/factories/bcf_issue_factory.rb b/modules/bim/spec/factories/bcf_issue_factory.rbindex 49aaab47f80..799ce49f1d3 100644--- a/modules/bim/spec/factories/bcf_issue_factory.rb+++ b/modules/bim/spec/factories/bcf_issue_factory.rb@@ -29,7 +29,7 @@#++FactoryBot.define do- factory :bcf_issue, class: ::Bcf::Issue do+ factory :bcf_issue, class: ::Bim::Bcf::Issue domarkup do<<-MARKUP<Markup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">diff --git a/modules/bim/spec/factories/bcf_viewpoint_factory.rb b/modules/bim/spec/factories/bcf_viewpoint_factory.rbindex 7b9e333bcf0..4272ced9563 100644--- a/modules/bim/spec/factories/bcf_viewpoint_factory.rb+++ b/modules/bim/spec/factories/bcf_viewpoint_factory.rb@@ -27,12 +27,12 @@#++FactoryBot.define do- factory :bcf_viewpoint, class: ::Bcf::Viewpoint do+ factory :bcf_viewpoint, class: ::Bim::Bcf::Viewpoint donew_uuid = SecureRandom.uuiduuid { new_uuid }viewpoint_name { "full_viewpoint.bcfv" }json_viewpoint do- file = OpenProject::Bcf::Engine.root.join("spec/fixtures/viewpoints/#{viewpoint_name}.json")+ file = OpenProject::Bim::Engine.root.join("spec/fixtures/viewpoints/#{viewpoint_name}.json")if file.readable?JSON.parse(file.read)elsediff --git a/modules/bim/spec/factories/ifc_model_factory.rb b/modules/bim/spec/factories/ifc_model_factory.rbindex 1c1bd73719c..f1b431ade94 100644--- a/modules/bim/spec/factories/ifc_model_factory.rb+++ b/modules/bim/spec/factories/ifc_model_factory.rb@@ -27,7 +27,7 @@#++FactoryBot.define do- factory :ifc_model, class: ::IFCModels::IFCModel do+ factory :ifc_model, class: ::Bim::IfcModels::IfcModel dotitle { 'My IFC model' }project factory: :projectuploader factory: :userdiff --git a/modules/bim/spec/factories/xml_viewpoint_factory.rb b/modules/bim/spec/factories/xml_viewpoint_factory.rbindex 6ea13aa4c3e..d3ad8fde9da 100644--- a/modules/bim/spec/factories/xml_viewpoint_factory.rb+++ b/modules/bim/spec/factories/xml_viewpoint_factory.rb@@ -31,7 +31,7 @@ FactoryBot.define douuid { SecureRandom.uuid }viewpoint_name { "full_viewpoint.bcfv" }viewpoint do- file = OpenProject::Bcf::Engine.root.join("spec/fixtures/viewpoints/#{viewpoint_name}.xml")+ file = OpenProject::Bim::Engine.root.join("spec/fixtures/viewpoints/#{viewpoint_name}.xml")if file.readable?file.readelsediff --git a/modules/bim/spec/features/bcf_export_spec.rb b/modules/bim/spec/features/bcf_export_spec.rbindex c3e88ecc53b..d22ec9d22b9 100644--- a/modules/bim/spec/features/bcf_export_spec.rb+++ b/modules/bim/spec/features/bcf_export_spec.rb@@ -59,7 +59,7 @@ describe 'work package export', type: :feature, js: true do::DownloadedFile.wait_for_download_content# Check the downloaded file- OpenProject::Bcf::BcfXml::Importer.new(+ OpenProject::Bim::BcfXml::Importer.new(::DownloadedFile.download,project,current_user: current_userdiff --git a/modules/bim/spec/lib/open_project/bcf/bcf_json/viewpoint_reader_shared_examples.rb b/modules/bim/spec/lib/open_project/bcf/bcf_json/viewpoint_reader_shared_examples.rbindex d331b856bb2..eb79015775b 100644--- a/modules/bim/spec/lib/open_project/bcf/bcf_json/viewpoint_reader_shared_examples.rb+++ b/modules/bim/spec/lib/open_project/bcf/bcf_json/viewpoint_reader_shared_examples.rb@@ -168,7 +168,7 @@ endshared_examples 'matches the JSON counterpart' doit 'matches the JSON viewpoint counterpart' do- path = OpenProject::Bcf::Engine.root.join("spec/fixtures/viewpoints/#{xml_viewpoint.viewpoint_name}.json")+ path = OpenProject::Bim::Engine.root.join("spec/fixtures/viewpoints/#{xml_viewpoint.viewpoint_name}.json")raise "Expected #{path} to be readable for JSON comparsion" unless path.readable?json = path.readdiff --git a/modules/bim/spec/lib/open_project/bcf/bcf_json/viewpoint_reader_spec.rb b/modules/bim/spec/lib/open_project/bcf/bcf_json/viewpoint_reader_spec.rbindex edb88d095a0..e952bcf1bcb 100644--- a/modules/bim/spec/lib/open_project/bcf/bcf_json/viewpoint_reader_spec.rb+++ b/modules/bim/spec/lib/open_project/bcf/bcf_json/viewpoint_reader_spec.rb@@ -29,7 +29,7 @@require 'spec_helper'require_relative './viewpoint_reader_shared_examples.rb'-describe OpenProject::Bcf::BcfJson::ViewpointReader do+describe OpenProject::Bim::BcfJson::ViewpointReader dolet(:instance) { described_class.new xml_viewpoint.uuid, xml_viewpoint.viewpoint }subject { instance.result }diff --git a/modules/bim/spec/lib/open_project/bcf/bcf_xml/viewpoint_writer_spec.rb b/modules/bim/spec/lib/open_project/bcf/bcf_xml/viewpoint_writer_spec.rbindex 6515cb116e6..71b3c70589c 100644--- a/modules/bim/spec/lib/open_project/bcf/bcf_xml/viewpoint_writer_spec.rb+++ b/modules/bim/spec/lib/open_project/bcf/bcf_xml/viewpoint_writer_spec.rb@@ -29,9 +29,9 @@require 'spec_helper'require 'compare-xml'-describe OpenProject::Bcf::BcfXml::ViewpointWriter do+describe OpenProject::Bim::BcfXml::ViewpointWriter dolet(:writer_instance) { described_class.new json_resource }- let(:reader_instance) { ::OpenProject::Bcf::BcfJson::ViewpointReader.new xml_resource.uuid, subject.to_xml }+ let(:reader_instance) { ::OpenProject::Bim::BcfJson::ViewpointReader.new xml_resource.uuid, subject.to_xml }let(:xml_comparison) { Nokogiri::XML(xml_resource.viewpoint) }let(:json_comparison) { json_resource.raw_json_viewpoint }diff --git a/modules/bim/spec/models/bcf/issue_spec.rb b/modules/bim/spec/models/bcf/issue_spec.rbindex 687b12be715..cea49131fba 100644--- a/modules/bim/spec/models/bcf/issue_spec.rb+++ b/modules/bim/spec/models/bcf/issue_spec.rb@@ -28,7 +28,7 @@require 'spec_helper'-describe ::Bcf::Issue, type: :model do+describe ::Bim::Bcf::Issue, type: :model dolet(:type) { FactoryBot.create :type, name: "Issue [BCF]" }let(:work_package) { FactoryBot.create :work_package, type: type }let(:issue) { FactoryBot.create :bcf_issue, work_package: work_package }diff --git a/modules/bim/spec/models/ifc_model_spec.rb b/modules/bim/spec/models/ifc_model_spec.rbindex d24dfa033d2..86e25ac4b6e 100644--- a/modules/bim/spec/models/ifc_model_spec.rb+++ b/modules/bim/spec/models/ifc_model_spec.rb@@ -1,6 +1,6 @@require 'spec_helper'-describe ::IFCModels::IFCModel, type: :model do+describe ::Bim::IfcModels::IfcModel, type: :model dosubject { described_class.new params }let(:params) { { title: 'foo', is_default: true } }diff --git a/modules/bim/spec/requests/api/bcf/v2_1/topics_api_spec.rb b/modules/bim/spec/requests/api/bcf/v2_1/topics_api_spec.rbindex af4ea3dac4f..bbcb4a343ab 100644--- a/modules/bim/spec/requests/api/bcf/v2_1/topics_api_spec.rb+++ b/modules/bim/spec/requests/api/bcf/v2_1/topics_api_spec.rb@@ -297,7 +297,7 @@ describe 'BCF 2.1 topics resource', type: :request, content_type: :json, with_mait 'deletes the Bcf Issue as well as the belonging Work Package' doexpect(WorkPackage.where(id: work_package.id)).to match_array []- expect(Bcf::Issue.where(id: bcf_issue.id)).to match_array []+ expect(Bim::Bcf::Issue.where(id: bcf_issue.id)).to match_array []endcontext 'lacking permission to manage bcf' do@@ -307,7 +307,7 @@ describe 'BCF 2.1 topics resource', type: :request, content_type: :json, with_mait 'deletes neither the Work Package nor the Bcf Issue' doexpect(WorkPackage.where(id: work_package.id)).to match_array [work_package]- expect(Bcf::Issue.where(id: bcf_issue.id)).to match_array [bcf_issue]+ expect(Bim::Bcf::Issue.where(id: bcf_issue.id)).to match_array [bcf_issue]endendend@@ -537,7 +537,7 @@ describe 'BCF 2.1 topics resource', type: :request, content_type: :json, with_mait_behaves_like 'bcf api successful response' dolet(:expected_status) { 201 }let(:expected_body) do- issue = Bcf::Issue.last+ issue = Bim::Bcf::Issue.lastwork_package = WorkPackage.last{@@ -577,7 +577,7 @@ describe 'BCF 2.1 topics resource', type: :request, content_type: :json, with_mait_behaves_like 'bcf api successful response' dolet(:expected_status) { 201 }let(:expected_body) do- issue = Bcf::Issue.last+ issue = Bim::Bcf::Issue.lastwork_package = WorkPackage.last{@@ -678,7 +678,7 @@ describe 'BCF 2.1 topics resource', type: :request, content_type: :json, with_mait_behaves_like 'bcf api successful response' dolet(:expected_body) do- issue = Bcf::Issue.last+ issue = Bim::Bcf::Issue.lastwork_package = WorkPackage.last{diff --git a/modules/bim/spec/requests/api/bcf/v2_1/viewpoints_api_spec.rb b/modules/bim/spec/requests/api/bcf/v2_1/viewpoints_api_spec.rbindex 54d707da4fc..b505a321552 100644--- a/modules/bim/spec/requests/api/bcf/v2_1/viewpoints_api_spec.rb+++ b/modules/bim/spec/requests/api/bcf/v2_1/viewpoints_api_spec.rb@@ -133,7 +133,7 @@ describe 'BCF 2.1 viewpoints resource', type: :request, content_type: :json, witendit 'deletes the viewpoint' do- expect(Bcf::Viewpoint.where(id: viewpoint.id)).not_to be_exist+ expect(Bim::Bcf::Viewpoint.where(id: viewpoint.id)).not_to be_existendend@@ -253,7 +253,7 @@ describe 'BCF 2.1 viewpoints resource', type: :request, content_type: :json, witit_behaves_like 'bcf api successful response' dolet(:expected_body) do- new_viewpoint = Bcf::Viewpoint.last+ new_viewpoint = Bim::Bcf::Viewpoint.lastparams.merge(guid: new_viewpoint.uuid)@@ -263,10 +263,10 @@ describe 'BCF 2.1 viewpoints resource', type: :request, content_type: :json, witendit 'creates the viewpoint with an attachment for the snapshot' do- expect(Bcf::Viewpoint.count)+ expect(Bim::Bcf::Viewpoint.count).to eql 2- expect(Bcf::Viewpoint.last.attachments.count)+ expect(Bim::Bcf::Viewpoint.last.attachments.count).to eql 1enddiff --git a/modules/bim/spec/seeders/demo_data_seeder_spec.rb b/modules/bim/spec/seeders/demo_data_seeder_spec.rbindex 6a878f28e74..ea3be5f722d 100644--- a/modules/bim/spec/seeders/demo_data_seeder_spec.rb+++ b/modules/bim/spec/seeders/demo_data_seeder_spec.rb@@ -64,7 +64,7 @@ describe 'seeds' doexpect(Status.count).to eq 4expect(IssuePriority.count).to eq 4expect(Project::Status.count).to eq 4- expect(IFCModels::IFCModel.count).to eq 6+ expect(Bim::IfcModels::IfcModel.count).to eq 6ensureActionMailer::Base.perform_deliveries = perform_deliveriesenddiff --git a/modules/bim/spec/services/bcf/issues/create_service_spec.rb b/modules/bim/spec/services/bcf/issues/create_service_spec.rbindex b9cb981367c..1895179c78c 100644--- a/modules/bim/spec/services/bcf/issues/create_service_spec.rb+++ b/modules/bim/spec/services/bcf/issues/create_service_spec.rb@@ -30,7 +30,7 @@require 'spec_helper'-describe Bcf::Issues::CreateService, type: :model do+describe Bim::Bcf::Issues::CreateService, type: :model dolet(:user) { FactoryBot.build_stubbed(:user) }let(:contract_class) dodouble('contract_class', '<=': true)@@ -80,7 +80,7 @@ describe Bcf::Issues::CreateService, type: :model dolet!(:created_issue) doissue = FactoryBot.build_stubbed(:bcf_issue)- allow(Bcf::Issue)+ allow(Bim::Bcf::Issue).to receive(:new).and_return(issue)@@ -93,7 +93,7 @@ describe Bcf::Issues::CreateService, type: :model dolet!(:set_attributes_service) doservice = double('set_attributes_service_instance')- allow(Bcf::Issues::SetAttributesService)+ allow(Bim::Bcf::Issues::SetAttributesService).to receive(:new).with(user: user,model: created_issue,diff --git a/modules/bim/spec/services/bcf/viewpoints/create_service_spec.rb b/modules/bim/spec/services/bcf/viewpoints/create_service_spec.rbindex 50bc0a2d058..d18f508ea2c 100644--- a/modules/bim/spec/services/bcf/viewpoints/create_service_spec.rb+++ b/modules/bim/spec/services/bcf/viewpoints/create_service_spec.rb@@ -30,7 +30,7 @@require 'spec_helper'-describe Bcf::Viewpoints::CreateService, type: :model do+describe Bim::Bcf::Viewpoints::CreateService, type: :model dolet(:user) { FactoryBot.build_stubbed(:user) }let(:contract_class) dodouble('contract_class', '<=': true)@@ -63,7 +63,7 @@ describe Bcf::Viewpoints::CreateService, type: :model dolet!(:created_viewpoint) doviewpoint = FactoryBot.build_stubbed(:bcf_viewpoint)- allow(Bcf::Viewpoint)+ allow(Bim::Bcf::Viewpoint).to receive(:new).and_return(viewpoint)@@ -76,7 +76,7 @@ describe Bcf::Viewpoints::CreateService, type: :model dolet!(:set_attributes_service) doservice = double('set_attributes_service_instance')- allow(Bcf::Viewpoints::SetAttributesService)+ allow(Bim::Bcf::Viewpoints::SetAttributesService).to receive(:new).with(user: user,model: created_viewpoint,diff --git a/modules/bim/spec/services/bcf/viewpoints/set_attributes_service_spec.rb b/modules/bim/spec/services/bcf/viewpoints/set_attributes_service_spec.rbindex 0155e2187cb..d0491a3bcba 100644--- a/modules/bim/spec/services/bcf/viewpoints/set_attributes_service_spec.rb+++ b/modules/bim/spec/services/bcf/viewpoints/set_attributes_service_spec.rb@@ -30,7 +30,7 @@require 'spec_helper'-describe Bcf::Viewpoints::SetAttributesService, type: :model do+describe Bim::Bcf::Viewpoints::SetAttributesService, type: :model dolet(:user) { FactoryBot.build_stubbed(:user) }let(:contract_class) docontract = double('contract_class')@@ -57,7 +57,7 @@ describe Bcf::Viewpoints::SetAttributesService, type: :model doendlet(:call_attributes) { {} }let(:viewpoint) do- Bcf::Viewpoint.new+ Bim::Bcf::Viewpoint.newenddescribe 'call' dodiff --git a/modules/bim/spec/services/ifc_models/create_service_spec.rb b/modules/bim/spec/services/ifc_models/create_service_spec.rbindex 5d3786e8db0..c59a8fa7416 100644--- a/modules/bim/spec/services/ifc_models/create_service_spec.rb+++ b/modules/bim/spec/services/ifc_models/create_service_spec.rb@@ -1,6 +1,6 @@require 'spec_helper'-describe IFCModels::CreateService do+describe IfcModels::CreateService dolet(:user) { FactoryBot.build_stubbed(:user) }let(:contract_class) dodouble('contract_class', '<=': true)@@ -25,7 +25,7 @@ describe IFCModels::CreateService dolet!(:created_model) domodel = FactoryBot.build_stubbed(:ifc_model)- allow(IFCModels::IFCModel)+ allow(Bim::IfcModels::IfcModel).to receive(:new).and_return(model)@@ -38,7 +38,7 @@ describe IFCModels::CreateService dolet!(:set_attributes_service) doservice = double('set_attributes_service_instance')- allow(IFCModels::SetAttributesService)+ allow(IfcModels::SetAttributesService).to receive(:new).with(user: user,model: created_model,@@ -54,7 +54,7 @@ describe IFCModels::CreateService doallow(job).to receive(:perform_later)- stub_const('IFCModels::IFCConversionJob', job)+ stub_const('IfcModels::IfcConversionJob', job)endenddiff --git a/modules/bim/spec/services/ifc_models/set_attributes_service_spec.rb b/modules/bim/spec/services/ifc_models/set_attributes_service_spec.rbindex 6957a1db7a2..d25ab30195a 100644--- a/modules/bim/spec/services/ifc_models/set_attributes_service_spec.rb+++ b/modules/bim/spec/services/ifc_models/set_attributes_service_spec.rb@@ -30,7 +30,7 @@require 'spec_helper'-describe IFCModels::SetAttributesService, type: :model do+describe IfcModels::SetAttributesService, type: :model dolet(:user) { FactoryBot.build_stubbed(:user) }let(:other_user) { FactoryBot.build_stubbed(:user) }let(:contract_class) do@@ -109,7 +109,7 @@ describe IFCModels::SetAttributesService, type: :model docontext 'for a new record' dolet(:model) do- IFCModels::IFCModel.new+ Bim::IfcModels::IfcModel.newendcontext 'with an ifc_attachment' dodiff --git a/modules/bim/spec/services/ifc_models/update_service_spec.rb b/modules/bim/spec/services/ifc_models/update_service_spec.rbindex 4863dcd1ca5..c49b47f87a1 100644--- a/modules/bim/spec/services/ifc_models/update_service_spec.rb+++ b/modules/bim/spec/services/ifc_models/update_service_spec.rb@@ -1,6 +1,6 @@require 'spec_helper'-describe IFCModels::UpdateService do+describe IfcModels::UpdateService dolet(:user) { FactoryBot.build_stubbed(:user) }let(:contract_class) dodouble('contract_class', '<=': true)@@ -39,7 +39,7 @@ describe IFCModels::UpdateService dolet!(:set_attributes_service) doservice = double('set_attributes_service_instance')- allow(IFCModels::SetAttributesService)+ allow(IfcModels::SetAttributesService).to receive(:new).with(user: user,model: model,@@ -55,7 +55,7 @@ describe IFCModels::UpdateService doallow(job).to receive(:perform_later)- stub_const('IFCModels::IFCConversionJob', job)+ stub_const('IfcModels::IfcConversionJob', job)endendlet(:ifc_attachment) { FactoryBot.build_stubbed(:attachment) }diff --git a/modules/bim/spec/services/ifc_models/view_conversion_service_spec.rb b/modules/bim/spec/services/ifc_models/view_conversion_service_spec.rbindex 540c8cb40ee..365af6907de 100644--- a/modules/bim/spec/services/ifc_models/view_conversion_service_spec.rb+++ b/modules/bim/spec/services/ifc_models/view_conversion_service_spec.rb@@ -1,6 +1,6 @@require 'spec_helper'-describe IFCModels::ViewConverterService do+describe IfcModels::ViewConverterService dolet(:model) { FactoryBot.build :ifc_model }subject { described_class.new(model) }diff --git a/modules/bim/spec/workers/ifc_conversion_job_spec.rb b/modules/bim/spec/workers/ifc_conversion_job_spec.rbindex bc4b5e3802d..fd4296c28b9 100644--- a/modules/bim/spec/workers/ifc_conversion_job_spec.rb+++ b/modules/bim/spec/workers/ifc_conversion_job_spec.rb@@ -1,11 +1,11 @@require 'spec_helper'-describe IFCModels::IFCConversionJob, type: :job do+describe IfcModels::IfcConversionJob, type: :job dolet(:model) { FactoryBot.build :ifc_model }subject { described_class.perform_now(model) }it 'calls the conversion service' do- expect(::IFCModels::ViewConverterService)+ expect(::IfcModels::ViewConverterService).to receive_message_chain(:new, :call).and_return ServiceResult.new success: true