Merge pull request #5028 from opf/fix/24233/project-context-url

[24233] Fix deep link into work package project context
pull/5031/head
ulferts 8 years ago committed by GitHub
commit 5bb6c9c77e
  1. 6
      features/work_packages/work_package_textile_link.feature
  2. 5
      frontend/app/components/routing/ui-router.config.ts
  3. 2
      spec/features/work_packages/copy_spec.rb

@ -63,7 +63,7 @@ Feature: Work package textile quickinfo links
Then I should see a 1 hash work package quickinfo link to "January" within "div.wiki" Then I should see a 1 hash work package quickinfo link to "January" within "div.wiki"
When I follow the 1 hash work package quickinfo link to "January" When I follow the 1 hash work package quickinfo link to "January"
Then I should see "January" within ".wp-edit-field.subject" Then I should see "January" within ".wp-edit-field.subject"
And I should be on the page of the work package "January" And I should be on the page of the work package "January" in project "ecookbook"
@javascript @javascript
Scenario: Adding a work package quickinfo link Scenario: Adding a work package quickinfo link
@ -74,7 +74,7 @@ Feature: Work package textile quickinfo links
Then I should see a 2 hashes work package quickinfo link to "January" within "div.wiki" Then I should see a 2 hashes work package quickinfo link to "January" within "div.wiki"
When I follow the 2 hashes work package quickinfo link to "January" When I follow the 2 hashes work package quickinfo link to "January"
Then I should see "January" within ".wp-edit-field.subject" Then I should see "January" within ".wp-edit-field.subject"
And I should be on the page of the work package "January" And I should be on the page of the work package "January" in project "ecookbook"
@javascript @javascript
Scenario: Adding a work package quickinfo link with description Scenario: Adding a work package quickinfo link with description
@ -85,7 +85,7 @@ Feature: Work package textile quickinfo links
Then I should see a 3 hashes work package quickinfo link to "January" within "div.wiki" Then I should see a 3 hashes work package quickinfo link to "January" within "div.wiki"
When I follow the 3 hashes work package quickinfo link to "January" When I follow the 3 hashes work package quickinfo link to "January"
Then I should see "January" within ".wp-edit-field.subject" Then I should see "January" within ".wp-edit-field.subject"
And I should be on the page of the work package "January" And I should be on the page of the work package "January" in project "ecookbook"
Scenario: Adding a work package quickinfo link without the right to see the work package Scenario: Adding a work package quickinfo link without the right to see the work package

@ -235,10 +235,13 @@ openprojectModule
}); });
$rootScope.$on('$stateChangeStart', (event, toState, toParams) => { $rootScope.$on('$stateChangeStart', (event, toState, toParams) => {
const projectIdentifier = toParams.projectPath || $rootScope.projectIdentifier;
// Close all open dropdowns, if any // Close all open dropdowns, if any
$rootScope.$broadcast('openproject.dropdown.closeDropdowns'); $rootScope.$broadcast('openproject.dropdown.closeDropdowns');
if (!toParams.projects && toParams.projectPath) { if (!toParams.projects && projectIdentifier) {
toParams.projectPath = projectIdentifier;
toParams.projects = 'projects'; toParams.projects = 'projects';
$state.go(toState, toParams); $state.go(toState, toParams);
} }

@ -109,7 +109,7 @@ RSpec.feature 'Work package copy', js: true, selenium: true do
expect(copied_work_package).to_not eql original_work_package expect(copied_work_package).to_not eql original_work_package
work_package_page = Pages::FullWorkPackage.new(copied_work_package) work_package_page = Pages::FullWorkPackage.new(copied_work_package, project)
work_package_page.ensure_page_loaded work_package_page.ensure_page_loaded
work_package_page.expect_attributes Subject: original_work_package.subject, work_package_page.expect_attributes Subject: original_work_package.subject,

Loading…
Cancel
Save