Skip to content

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

Merge remote-tracking branch 'origin/release/11.4' into dev

Wieland Lindenthald8ff1f9e8795
diff --cc frontend/src/app/features/bim/ifc_models/openproject-ifc-models.routes.ts
index e2ca7ec7843,00000000000..fed4d6422ec
mode 100644,000000..100644
--- a/frontend/src/app/features/bim/ifc_models/openproject-ifc-models.routes.ts
+++ b/frontend/src/app/features/bim/ifc_models/openproject-ifc-models.routes.ts
@@@ -1,163 -1,0 +1,164 @@@
+// -- copyright
+// OpenProject is an open source project management software.
+// Copyright (C) 2012-2021 the OpenProject GmbH
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License version 3.
+//
+// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+// Copyright (C) 2006-2013 Jean-Philippe Lang
+// Copyright (C) 2010-2013 the ChiliProject Team
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+// See COPYRIGHT and LICENSE files for more details.
+//++
+import { Ng2StateDeclaration } from '@uirouter/angular';
+import { IFCViewerPageComponent } from 'core-app/features/bim/ifc_models/pages/viewer/ifc-viewer-page.component';
+import { IFCViewerComponent } from 'core-app/features/bim/ifc_models/ifc-viewer/ifc-viewer.component';
+import { WorkPackagesBaseComponent } from 'core-app/features/work-packages/routing/wp-base/wp--base.component';
+import { EmptyComponent } from 'core-app/features/bim/ifc_models/empty/empty-component';
+import { makeSplitViewRoutes } from 'core-app/features/work-packages/routing/split-view-routes.template';
+import { BcfListContainerComponent } from 'core-app/features/bim/ifc_models/bcf/list-container/bcf-list-container.component';
+import { WorkPackageSplitViewComponent } from 'core-app/features/work-packages/routing/wp-split-view/wp-split-view.component';
+import { ViewerBridgeService } from 'core-app/features/bim/bcf/bcf-viewer-bridge/viewer-bridge.service';
+import { WorkPackageNewFullViewComponent } from 'core-app/features/work-packages/components/wp-new/wp-new-full-view.component';
+
+export const IFC_ROUTES:Ng2StateDeclaration[] = [
+ {
+ name: 'bim',
+ parent: 'root',
+ url: '/bcf?query_props&models&viewpoint',
+ abstract: true,
+ component: WorkPackagesBaseComponent,
+ redirectTo: 'bim.partitioned',
+ params: {
+ // Use custom encoder/decoder that ensures validity of URL string
+ query_props: { type: 'opQueryString', dynamic: true },
+ models: { type: 'opQueryString', dynamic: true },
+ viewpoint: { type: 'int', dynamic: true },
+ },
+ },
+ {
+ name: 'bim.partitioned',
+ url: '',
+ component: IFCViewerPageComponent,
+ redirectTo: (transition) => {
+ const viewerBridgeService = transition.injector().get(ViewerBridgeService);
+
+ return viewerBridgeService.shouldShowViewer
+ ? 'bim.partitioned.split'
+ : 'bim.partitioned.list';
+ },
+ },
+ {
+ name: 'bim.partitioned.list',
+ url: '/list?{cards:bool}',
+ params: {
+ cards: true,
+ },
+ data: {
+ baseRoute: 'bim.partitioned.list',
+ newRoute: 'bim.partitioned.list.new',
+ partition: '-left-only',
+ },
+ reloadOnSearch: false,
+ views: {
+ 'content-left': { component: BcfListContainerComponent },
+ },
+ },
+ {
+ name: 'bim.partitioned.split',
+ url: '/split?{cards:bool}',
+ params: {
+ cards: true,
+ },
+ data: {
+ baseRoute: 'bim.partitioned.split',
+ partition: '-split',
+ newRoute: 'bim.partitioned.split.new',
+ bodyClasses: 'router--work-packages-partitioned-split-view',
+ },
+ reloadOnSearch: false,
+ views: {
+ 'content-left': { component: IFCViewerComponent },
+ 'content-right': { component: BcfListContainerComponent },
+ },
+ },
+ {
+ name: 'bim.partitioned.model',
+ url: '/model',
+ data: {
+ partition: '-left-only',
+ newRoute: 'bim.partitioned.model.new',
+ },
+ reloadOnSearch: false,
+ views: {
+ // Retarget and by that override the grandparent views
+ // https://ui-router.github.io/guide/views#relative-parent-state{
+ 'content-right': { component: EmptyComponent },
+ 'content-left': { component: IFCViewerComponent },
+ },
+ },
+ {
+ name: 'bim.partitioned.new',
+ url: '/new?type&parent_id',
+ reloadOnSearch: false,
+ data: {
+ baseRoute: 'bim.partitioned.list',
+ allowMovingInEditMode: true,
+ partition: '-left-only',
++ successState: 'bim.partitioned.show'
+ },
+ views: { 'content-left': { component: WorkPackageNewFullViewComponent } },
+ },
+ {
+ name: 'bim.partitioned.show',
+ url: '/show/{workPackageId:[0-9]+}?{cards:bool}',
+ data: {
+ baseRoute: 'bim.partitioned.list',
+ partition: '-left-only',
+ },
+ reloadOnSearch: false,
+ redirectTo: 'bim.partitioned.show.details',
+ },
+ // BCF single view for list
+ ...makeSplitViewRoutes(
+ 'bim.partitioned.list',
+ undefined,
+ WorkPackageSplitViewComponent,
+ undefined,
+ true,
+ 'bim.partitioned.show',
+ ),
+ // BCF single view for list
+ ...makeSplitViewRoutes(
+ 'bim.partitioned.list',
+ undefined,
+ WorkPackageSplitViewComponent,
+ ),
+ // BCF single view for split
+ ...makeSplitViewRoutes(
+ 'bim.partitioned.split',
+ undefined,
+ WorkPackageSplitViewComponent,
+ ),
+ // BCF single view for model-only
+ ...makeSplitViewRoutes(
+ 'bim.partitioned.model',
+ undefined,
+ WorkPackageSplitViewComponent,
+ ),
+];
diff --cc frontend/src/app/features/work-packages/components/wp-new/wp-new-full-view.component.ts
index f6ada3609c8,490fca208dc..d38a9c3a5ee
--- a/frontend/src/app/features/work-packages/components/wp-new/wp-new-full-view.component.ts
+++ b/frontend/src/app/features/work-packages/components/wp-new/wp-new-full-view.component.ts
@@@ -31,10 -31,10 +31,10 @@@ import { ChangeDetectionStrategy, Compo
@Component({
selector: 'wp-new-full-view',
- host: { 'class': 'work-packages-page--ui-view' },
+ host: { class: 'work-packages-page--ui-view' },
templateUrl: './wp-new-full-view.html',
- changeDetection: ChangeDetectionStrategy.OnPush
+ changeDetection: ChangeDetectionStrategy.OnPush,
})
export class WorkPackageNewFullViewComponent extends WorkPackageCreateComponent {
- public successState = 'work-packages.show';
+ public successState = this.$state.current.data.successState as string;
}
diff --cc frontend/src/app/features/work-packages/routing/work-packages-routes.ts
index f14f2f22a21,00000000000..6238b692d99
mode 100644,000000..100644
--- a/frontend/src/app/features/work-packages/routing/work-packages-routes.ts
+++ b/frontend/src/app/features/work-packages/routing/work-packages-routes.ts
@@@ -1,146 -1,0 +1,147 @@@
+// -- copyright
+// OpenProject is an open source project management software.
+// Copyright (C) 2012-2021 the OpenProject GmbH
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License version 3.
+//
+// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+// Copyright (C) 2006-2013 Jean-Philippe Lang
+// Copyright (C) 2010-2013 the ChiliProject Team
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+// See COPYRIGHT and LICENSE files for more details.
+//++
+
+import { WpTabWrapperComponent } from 'core-app/features/work-packages/components/wp-tabs/components/wp-tab-wrapper/wp-tab-wrapper.component';
+import { WorkPackageNewFullViewComponent } from 'core-app/features/work-packages/components/wp-new/wp-new-full-view.component';
+import { WorkPackagesFullViewComponent } from 'core-app/features/work-packages/routing/wp-full-view/wp-full-view.component';
+import { WorkPackageSplitViewComponent } from 'core-app/features/work-packages/routing/wp-split-view/wp-split-view.component';
+import { Ng2StateDeclaration } from '@uirouter/angular';
+import { WorkPackagesBaseComponent } from 'core-app/features/work-packages/routing/wp-base/wp--base.component';
+import { WorkPackageListViewComponent } from 'core-app/features/work-packages/routing/wp-list-view/wp-list-view.component';
+import { WorkPackageViewPageComponent } from 'core-app/features/work-packages/routing/wp-view-page/wp-view-page.component';
+import { makeSplitViewRoutes } from 'core-app/features/work-packages/routing/split-view-routes.template';
+import { WorkPackageCopyFullViewComponent } from 'core-app/features/work-packages/components/wp-copy/wp-copy-full-view.component';
+
+export const menuItemClass = 'work-packages-menu-item';
+
+export const WORK_PACKAGES_ROUTES:Ng2StateDeclaration[] = [
+ {
+ name: 'work-packages',
+ parent: 'root',
+ component: WorkPackagesBaseComponent,
+ url: '/work_packages?query_id&query_props&start_onboarding_tour',
+ redirectTo: 'work-packages.partitioned.list',
+ data: {
+ bodyClasses: 'router--work-packages-base',
+ menuItem: menuItemClass,
+ },
+ params: {
+ query_id: { type: 'query', dynamic: true },
+ // Use custom encoder/decoder that ensures validity of URL string
+ query_props: { type: 'opQueryString' },
+ // Optional initial tour param
+ start_onboarding_tour: { type: 'query', squash: true, value: undefined },
+ },
+ },
+ {
+ name: 'work-packages.new',
+ url: '/new?type&parent_id',
+ component: WorkPackageNewFullViewComponent,
+ reloadOnSearch: false,
+ data: {
+ baseRoute: 'work-packages',
+ allowMovingInEditMode: true,
+ bodyClasses: 'router--work-packages-full-create',
+ menuItem: menuItemClass,
++ successState: 'work-packages.show',
+ },
+ },
+ {
+ name: 'work-packages.copy',
+ url: '/{copiedFromWorkPackageId:[0-9]+}/copy',
+ component: WorkPackageCopyFullViewComponent,
+ reloadOnSearch: false,
+ data: {
+ baseRoute: 'work-packages',
+ allowMovingInEditMode: true,
+ bodyClasses: 'router--work-packages-full-create',
+ menuItem: menuItemClass,
+ },
+ },
+ {
+ name: 'work-packages.show',
+ url: '/{workPackageId:[0-9]+}',
+ // Redirect to 'activity' by default.
+ redirectTo: (trans) => {
+ const params = trans.params('to');
+ return {
+ state: 'work-packages.show.tabs',
+ params: { ...params, tabIdentifier: 'activity' },
+ };
+ },
+ component: WorkPackagesFullViewComponent,
+ data: {
+ baseRoute: 'work-packages',
+ bodyClasses: 'router--work-packages-full-view',
+ newRoute: 'work-packages.new',
+ menuItem: menuItemClass,
+ },
+ },
+ {
+ name: 'work-packages.show.tabs',
+ url: '/:tabIdentifier',
+ component: WpTabWrapperComponent,
+ data: {
+ parent: 'work-packages.show',
+ menuItem: menuItemClass,
+ },
+ },
+ {
+ name: 'work-packages.partitioned',
+ component: WorkPackageViewPageComponent,
+ url: '',
+ data: {
+ // This has to be empty to avoid inheriting the parent bodyClasses
+ bodyClasses: '',
+ },
+ },
+ {
+ name: 'work-packages.partitioned.list',
+ url: '',
+ reloadOnSearch: false,
+ views: {
+ 'content-left': { component: WorkPackageListViewComponent },
+ },
+ data: {
+ bodyClasses: 'router--work-packages-partitioned-split-view',
+ menuItem: menuItemClass,
+ partition: '-left-only',
+ },
+ },
+ ...makeSplitViewRoutes(
+ 'work-packages.partitioned.list',
+ menuItemClass,
+ WorkPackageSplitViewComponent,
+ ),
+ // Avoid lazy-loading the routes for now
+ // {
+ // name: 'work-packages.calendar.**',
+ // url: '/calendar',
+ // loadChildren: '../calendar/openproject-calendar.module#OpenprojectCalendarModule'
+ // },
+];
diff --cc modules/bim/spec/features/revit_add_in/bim_revit_add_in_navigation_spec.rb
index 9699965736f,0d8cbf8d226..17efe27120a
--- a/modules/bim/spec/features/revit_add_in/bim_revit_add_in_navigation_spec.rb
+++ b/modules/bim/spec/features/revit_add_in/bim_revit_add_in_navigation_spec.rb
@@@ -95,24 -101,35 +95,44 @@@ describe 'BIM Revit Add-in navigation s
expect(page).to have_selector('.work-packages-partitioned-page--content-right', visible: false)
end
- it 'shows work package details page in full view on Table display mode' do
- model_page.switch_view 'Table'
- wp_table.expect_work_package_listed work_package
- wp_table.open_split_view work_package
+ context 'with the table display mode' do
+ let(:wp_table) { ::Pages::WorkPackagesTable.new(project) }
- expect(page).to have_selector('.work-packages-partitioned-page--content-left', text: work_package.subject)
- expect(page).to have_selector('.work-packages-partitioned-page--content-right', visible: false)
+ it 'shows work package details page in full view on Table display mode' do
+ model_page.switch_view 'Table'
+ loading_indicator_saveguard
+
+ expect(page).to have_selector('.work-package-table')
+ wp_table.expect_work_package_listed work_package
+ wp_table.open_split_view work_package
+
+ expect(page).to have_selector('.work-packages-partitioned-page--content-left', text: work_package.subject)
+ expect(page).to have_selector('.work-packages-partitioned-page--content-right', visible: false)
+ end
end
+
+ context 'Creating BCFs' do
+ let!(:status) { FactoryBot.create(:default_status) }
+ let!(:priority) { FactoryBot.create :priority, is_default: true }
+
+ it 'redirects correctly' do
+ create_page = model_page.create_wp_by_button(FactoryBot.build(:type_standard))
+ expect(page).to have_current_path /bcf\/new$/, ignore_query: true
+ create_page.subject_field.set('Some subject')
+ create_page.save!
++
++ sleep(5)
+ last_work_package = WorkPackage.find_by(subject: 'Some subject')
+ # The currently working routes seem weird as they duplicate the work package ID.
+ expect(page).to(
+ have_current_path(/bcf\/show\/#{last_work_package.id}\/details\/#{last_work_package.id}\/overview$/,
+ ignore_query: true)
+ )
+ end
+ end
end
- context "signed out" do
+ context "when signed out" do
it 'the user menu has an option to go to the add-in settings' do
visit home_path