Merge pull request #8451 from opf/fix/33317-Deleted-issue-still-in-split-view-after-deleting-it-in-WP-Fullscreen-mode-

[33317] Deleted issue still in split view after deleting it in WP-Fullscreen mode
pull/8464/head
Henriette Darge 4 years ago committed by GitHub
commit d3b7f357eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      frontend/src/app/components/wp-single-view-tabs/keep-tab/keep-tab.service.ts
  2. 1
      frontend/src/app/modules/bim/ifc_models/openproject-ifc-models.routes.ts
  3. 10
      frontend/src/app/modules/common/back-routing/back-routing.service.ts
  4. 4
      frontend/src/app/modules/work_packages/routing/split-view-routes.template.ts
  5. 26
      modules/bim/spec/features/bim_navigation_spec.rb

@ -68,8 +68,12 @@ export class KeepTabService {
return 'work-packages.partitioned.list.details.' + this.currentDetailsTab;
}
public get currentDetailsSubState():string {
return '.details.' + this.currentDetailsTab;
}
public isDetailsState(stateName:string) {
return stateName === 'work-packages.partitioned.list.details';
return !!stateName && stateName.includes('.details');
}
public get currentShowTab():string {

@ -72,6 +72,7 @@ export const IFC_ROUTES:Ng2StateDeclaration[] = [
name: 'bim.partitioned.split',
url: '/split',
data: {
baseRoute: 'bim.partitioned.split',
partition: '-split',
newRoute: 'bim.partitioned.split.new',
bodyClasses: 'router--work-packages-partitioned-split-view'

@ -35,6 +35,7 @@ interface BackRouteOptions {
name:string;
params:{};
parent:string;
baseRoute:string;
}
@Injectable({ providedIn: 'root' })
@ -50,7 +51,7 @@ export class BackRoutingService {
public goBack(preferListOverSplit:boolean = false) {
// Default: back to list
// When coming from a deep link or a create form
const baseRoute = this.$state.current.data.baseRoute || 'work-packages.partitioned.list';
const baseRoute = this.backRoute?.baseRoute || this.$state.current.data.baseRoute || 'work-packages.partitioned.list';
if (!this.backRoute || this.backRoute.name.includes('new')) {
this.$state.go(baseRoute, this.$state.params);
@ -59,7 +60,7 @@ export class BackRoutingService {
if (preferListOverSplit) {
this.$state.go(baseRoute, this.$state.params);
} else {
this.$state.go(this.keepTab.currentDetailsState, this.$state.params);
this.$state.go(baseRoute + this.keepTab.currentDetailsSubState, this.$state.params);
}
} else {
this.$state.go(this.backRoute.name, this.backRoute.params);
@ -82,7 +83,10 @@ export class BackRoutingService {
toState.data &&
fromState.data.parent !== toState.data.parent) {
const paramsFromCopy = { ...transition.params('from') };
this.backRoute = { name: fromState.name, params: paramsFromCopy, parent: fromState.data.parent };
this.backRoute = { name: fromState.name,
params: paramsFromCopy,
parent: fromState.data.parent,
baseRoute: fromState.data.baseRoute };
}
}

@ -83,6 +83,7 @@ export function makeSplitViewRoutes(baseRoute:string,
url: '/overview',
component: WorkPackageOverviewTabComponent,
data: {
baseRoute: baseRoute,
menuItem: menuItemClass,
parent: baseRoute + '.details'
}
@ -92,6 +93,7 @@ export function makeSplitViewRoutes(baseRoute:string,
url: '/activity',
component: WorkPackageActivityTabComponent,
data: {
baseRoute: baseRoute,
menuItem: menuItemClass,
parent: baseRoute + '.details'
}
@ -101,6 +103,7 @@ export function makeSplitViewRoutes(baseRoute:string,
url: '/relations',
component: WorkPackageRelationsTabComponent,
data: {
baseRoute: baseRoute,
menuItem: menuItemClass,
parent: baseRoute + '.details'
}
@ -110,6 +113,7 @@ export function makeSplitViewRoutes(baseRoute:string,
url: '/watchers',
component: WorkPackageWatchersTabComponent,
data: {
baseRoute: baseRoute,
menuItem: menuItemClass,
parent: baseRoute + '.details'
}

@ -34,7 +34,7 @@ describe 'BIM navigation spec',
js: true do
let(:project) { FactoryBot.create :project, enabled_module_names: [:bim, :work_package_tracking] }
let!(:work_package) { FactoryBot.create(:work_package, project: project) }
let(:role) { FactoryBot.create(:role, permissions: %i[view_ifc_models manage_ifc_models view_work_packages]) }
let(:role) { FactoryBot.create(:role, permissions: %i[view_ifc_models manage_ifc_models view_work_packages delete_work_packages]) }
let(:user) do
FactoryBot.create :user,
@ -52,6 +52,7 @@ describe 'BIM navigation spec',
let(:details_view) { ::Pages::BcfDetailsPage.new(work_package, project) }
let(:full_view) { Pages::FullWorkPackage.new(work_package) }
let(:model_tree) { ::Components::XeokitModelTree.new }
let(:destroy_modal) { Components::WorkPackages::DestroyModal.new }
shared_examples 'can switch from split to viewer to list-only' do
before do
@ -65,9 +66,7 @@ describe 'BIM navigation spec',
login_as(user)
model_page.visit!
model_page.finished_loading
end
it 'can switch between the different view modes' do
# Should be at split view
model_page.model_viewer_visible true
model_page.model_viewer_shows_a_toolbar true
@ -75,7 +74,9 @@ describe 'BIM navigation spec',
model_tree.sidebar_shows_viewer_menu true
expect(page).to have_selector('.wp-cards-container')
card_view.expect_work_package_listed work_package
end
it 'can switch between the different view modes' do
# Go to single view
card_view.open_full_screen_by_details(work_package)
@ -119,6 +120,25 @@ describe 'BIM navigation spec',
details_view.close
details_view.expect_closed
end
it 'after deleting an WP in full view it returns to the model and list view (see #33317)' do
# Go to full single view
card_view.open_full_screen_by_details(work_package)
details_view.switch_to_fullscreen
full_view.expect_tab 'Activity'
# Delete via the context menu
find('#action-show-more-dropdown-menu .button').click
find('.menu-item', text: 'Delete').click
destroy_modal.expect_listed(work_package)
destroy_modal.confirm_deletion
# Expect to return to the start page with closed details view and delete WP
model_page.model_viewer_visible true
details_view.expect_closed
card_view.expect_work_package_not_listed work_package
end
end
end

Loading…
Cancel
Save