pull/8071/head
Oliver Günther 5 years ago
parent 84546b7604
commit af0ebe7bdc
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 3
      frontend/src/app/components/modals/editor/macro-wp-button-modal/wp-button-macro.modal.ts
  2. 2
      frontend/src/app/modules/work_packages/routing/split-view-routes.template.ts
  3. 36
      modules/bim/spec/features/bcf/create_spec.rb
  4. 2
      modules/bim/spec/features/bcf/export_spec.rb
  5. 22
      modules/bim/spec/support/pages/bcf/create_split.rb
  6. 2
      modules/bim/spec/support/pages/ifc_models/show_default.rb
  7. 2
      spec/support/pages/work_packages/concerns/work_package_by_button_creator.rb

@ -44,8 +44,7 @@ import {CurrentProjectService} from "core-components/projects/current-project.se
import {WorkPackageDmService} from "core-app/modules/hal/dm-services/work-package-dm.service";
@Component({
templateUrl: './wp-button-macro.modal.html',
changeDetection: ChangeDetectionStrategy.OnPush
templateUrl: './wp-button-macro.modal.html'
})
export class WpButtonMacroModal extends OpModalComponent implements AfterViewInit {

@ -115,7 +115,7 @@ export function makeSplitViewRoutes(baseRoute:string,
// Split create route
{
name: baseRoute + '.new',
url: '/new?{type:[0-9]+}',
url: '/create_new?{type:[0-9]+}',
reloadOnSearch: false,
data: {
partition: '-split',

@ -2,6 +2,7 @@ require 'spec_helper'
require_relative '../../support/pages/ifc_models/show_default'
describe 'Create BCF', type: :feature, js: true, with_mail: false do
let(:project) do
FactoryBot.create(:project, types: [type, type_with_cf], work_package_custom_fields: [integer_cf])
@ -36,7 +37,7 @@ describe 'Create BCF', type: :feature, js: true, with_mail: false do
end
context 'with all permissions' do
it 'can create a new bcf work package' do
it 'can create a new bcf work package on split page' do
create_page = index_page.create_wp_by_button(type)
create_page.expect_current_path
@ -53,14 +54,43 @@ describe 'Create BCF', type: :feature, js: true, with_mail: false do
create_page.save!
# TODO: adapt notification message
index_page.expect_and_dismiss_notification(
message: 'Successful creation. Click here to open this work package in fullscreen view.'
)
work_package = WorkPackage.last
split_page = ::Pages::SplitWorkPackage.new(work_package, project)
split_page.ensure_page_loaded
split_page.expect_subject
split_page.close
split_page.expect_closed
expect(page).to have_current_path /\/bcf\/split$/, ignore_query: true
end
it 'can create on the list view' do
index_page.switch_view 'List'
create_page = index_page.create_wp_by_button(type)
create_page.view_route = :list
create_page.expect_current_path
create_page.subject_field.set(subject)
create_page.save!
index_page.expect_and_dismiss_notification(
message: 'Successful creation. Click here to open this work package in fullscreen view.'
)
work_package = WorkPackage.last
split_page = ::Pages::SplitWorkPackage.new(work_package, project)
split_page.ensure_page_loaded
split_page.expect_subject
split_page.close
split_page.expect_closed
index_page.expect_work_package_listed(work_package)
expect(page).to have_current_path /\/bcf\/list$/, ignore_query: true
end
end

@ -30,7 +30,7 @@ require 'spec_helper'
describe 'bcf export', type: :feature, js: true do
let(:status) { FactoryBot.create(:status, name: 'New', is_default: true) }
let(:closed_status) { FactoryBot.create(:closed_status, name: 'Closed') }
let(:project) { FactoryBot.create :project, enabled_module_names: [:bim, :work_package_tracking] }
let(:project) { FactoryBot.create :project, enabled_module_names: %i[bim work_package_tracking] }
let!(:open_work_package) { FactoryBot.create(:work_package, project: project, subject: 'Open WP', status: status) }
let!(:closed_work_package) { FactoryBot.create(:work_package, project: project, subject: 'Closed WP', status: closed_status) }

@ -34,35 +34,27 @@ module Pages
class CreateSplit < ::Pages::AbstractWorkPackageCreate
attr_accessor :project,
:model_id,
:type_id
:type_id,
:view_route
def initialize(project, model_id: nil, type_id: nil)
def initialize(project:, model_id: nil, type_id: nil)
super(project: project)
self.model_id = model_id
self.type_id = type_id
self.view_route = :split
end
def path
path = if default?
defaults_ifc_models_project_ifc_models_path(project)
else
ifc_models_project_ifc_model(project, id: model_id)
end + '/new'
query = if type_id
"?type=#{type_id}"
end
path + query
bcf_project_frontend_path(project, "#{view_route}/create_new")
end
def expect_current_path
expect(page)
.to have_current_path(path)
.to have_current_path(path, ignore_query: true)
end
def container
find("bcf-new-split")
find("wp-new-split-view")
end
private

@ -101,7 +101,7 @@ module Pages
end
def create_page_class_instance(type)
create_page_class.new(project, type_id: type.id)
create_page_class.new(project: project, type_id: type.id)
end
def create_page_class

@ -64,7 +64,7 @@ module Pages
private
def create_page_class_instance(_type)
create_page_class.new(project)
create_page_class.new(project: project)
end
def create_page_class

Loading…
Cancel
Save