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

[#43693] fixed custom actions state

Eric Schubert74aed734b48e
diff --git a/frontend/src/app/features/work-packages/components/wp-single-view/wp-single-view.component.ts b/frontend/src/app/features/work-packages/components/wp-single-view/wp-single-view.component.ts
index 54c41e25abe..f944f370f34 100644
--- a/frontend/src/app/features/work-packages/components/wp-single-view/wp-single-view.component.ts
+++ b/frontend/src/app/features/work-packages/components/wp-single-view/wp-single-view.component.ts
@@ -40,7 +40,6 @@ import {
BehaviorSubject,
combineLatest,
of,
- Subject,
} from 'rxjs';
import { distinctUntilChanged, map, switchMap } from 'rxjs/operators';
@@ -111,10 +110,6 @@ export class WorkPackageSingleViewComponent extends UntilDestroyedMixin implemen
// Grouped fields returned from API
public groupedFields:GroupDescriptor[] = [];
- // State updated when structural changes to the single view may occur.
- // (e.g., when changing the type or project context).
- public resourceContextChange = new Subject<ResourceContextChange>();
-
// Project context as an indicator
// when editing the work package in a different project
public projectContext:{
@@ -183,6 +178,9 @@ export class WorkPackageSingleViewComponent extends UntilDestroyedMixin implemen
this.uiSelfRef = this.$state.$current.name;
+ const change = this.halEditing.changeFor<WorkPackageResource, WorkPackageChangeset>(this.workPackage);
+ this.refresh(change);
+
// Whenever the temporary resource changes in any way,
// update the visible fields.
this.halEditing
diff --git a/spec/features/types/form_configuration_spec.rb b/spec/features/types/form_configuration_spec.rb
index 7a6350023df..f96defaced7 100644
--- a/spec/features/types/form_configuration_spec.rb
+++ b/spec/features/types/form_configuration_spec.rb
@@ -118,7 +118,7 @@ describe 'form configuration', js: true do
wp_page.expect_hidden_field(:done_ratio)
groups = page.all('.attributes-group--header-text').map(&:text)
- expect(groups).to eq ['FILES']
+ expect(groups).to eq []
expect(page)
.to have_selector('.work-packages--details--description', text: work_package.description)
end
diff --git a/spec/features/work_packages/tabs/files_tab_spec.rb b/spec/features/work_packages/tabs/files_tab_spec.rb
deleted file mode 100644
index 25497d19cde..00000000000
--- a/spec/features/work_packages/tabs/files_tab_spec.rb
+++ /dev/null
@@ -1,75 +0,0 @@
-#-- copyright
-# OpenProject is an open source project management software.
-# Copyright (C) 2012-2023 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.
-#++
-
-require 'spec_helper'
-
-describe 'Files tab', js: true do
- let(:role) { create(:role, permissions: %i[view_work_packages edit_work_packages]) }
- let(:user) { create(:user, member_in_project: project, member_through_role: role) }
- let(:project) { create :project }
- let(:work_package) { create(:work_package, project:) }
- let(:wp_page) { Pages::FullWorkPackage.new(work_package, project) }
-
- before do
- login_as(user)
- end
-
- describe 'navigation to new files tab from work package view' do
- before do
- wp_page.visit!
- end
-
- context 'if on work packages full view' do
- it 'must open files tab' do
- wp_page.switch_to_tab tab: 'activity'
- expect(page).not_to have_selector '[data-qa-selector="op-attachments--drop-box"]'
-
- files_link = wp_page.find('.work-packages--files-container .attributes-group--icon-indented-text a')
- files_link.click
-
- expect(page).to have_current_path project_work_package_path(project, work_package, 'files')
- expect(page).to have_selector '[data-qa-selector="op-attachments--drop-box"]'
- end
- end
-
- context 'if on work packages split view' do
- let(:wp_page) { Pages::SplitWorkPackage.new(work_package, project) }
-
- it 'must open files tab' do
- wp_page.switch_to_tab tab: 'overview'
- expect(page).not_to have_selector '[data-qa-selector="op-attachments--drop-box"]'
-
- files_link = wp_page.find('.work-packages--files-container .attributes-group--icon-indented-text a')
- files_link.click
-
- expect(page).to have_current_path project_work_packages_path(project) + "/details/#{work_package.id}/files"
- expect(page).to have_selector '[data-qa-selector="op-attachments--drop-box"]'
- end
- end
- end
-end