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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
add wp#shares controller stub
ulferts66e1d0496556
diff --git a/app/controllers/work_packages/shares_controller.rb b/app/controllers/work_packages/shares_controller.rbnew file mode 100644index 00000000000..7a313cda4e6--- /dev/null+++ b/app/controllers/work_packages/shares_controller.rb@@ -0,0 +1,32 @@+# -- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2010-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.+# ++++class WorkPackages::SharesController < ApplicationController+ def index+ end+enddiff --git a/config/routes.rb b/config/routes.rbindex 65ccdb1f7a4..514a481ec14 100644--- a/config/routes.rb+++ b/config/routes.rb@@ -457,6 +457,9 @@ OpenProject::Application.routes.draw do# states managed by client-side routing on work_package#indexget 'details/*state' => 'work_packages#index', on: :collection, as: :details+ # Rails managed sharing route+ get '/share' => 'work_packages/shares#index', on: :member+# states managed by client-side (angular) routing on work_package#showget '/' => 'work_packages#index', on: :collection, as: 'index'get '/create_new' => 'work_packages#index', on: :collection, as: 'new_split'diff --git a/frontend/src/app/features/work-packages/components/wp-buttons/wp-share-button/wp-share-button.component.ts b/frontend/src/app/features/work-packages/components/wp-buttons/wp-share-button/wp-share-button.component.tsindex 639a5a42004..72fc50379a2 100644--- a/frontend/src/app/features/work-packages/components/wp-buttons/wp-share-button/wp-share-button.component.ts+++ b/frontend/src/app/features/work-packages/components/wp-buttons/wp-share-button/wp-share-button.component.ts@@ -59,6 +59,6 @@ export class WorkPackageShareButtonComponent extends UntilDestroyedMixin {}openModal():void {- this.opModalService.show(WorkPackageShareModalComponent, 'global', {});+ this.opModalService.show(WorkPackageShareModalComponent, 'global', { workPackage: this.workPackage });}}diff --git a/frontend/src/app/features/work-packages/components/wp-share-modal/wp-share.modal.html b/frontend/src/app/features/work-packages/components/wp-share-modal/wp-share.modal.htmlindex 11047b6edc4..2ce06769f65 100644--- a/frontend/src/app/features/work-packages/components/wp-share-modal/wp-share.modal.html+++ b/frontend/src/app/features/work-packages/components/wp-share-modal/wp-share.modal.html@@ -6,7 +6,8 @@>TODO</div><div class="spot-modal--body spot-container">- DO SOME TURBO Stuff+ <turbo-frame src="{{this.frameSrc}}">+ </turbo-frame></div><div class="spot-action-bar hidden-for-mobile"><div class="spot-action-bar--right">diff --git a/frontend/src/app/features/work-packages/components/wp-share-modal/wp-share.modal.ts b/frontend/src/app/features/work-packages/components/wp-share-modal/wp-share.modal.tsindex 8e48dde6fe2..88cfdf14860 100644--- a/frontend/src/app/features/work-packages/components/wp-share-modal/wp-share.modal.ts+++ b/frontend/src/app/features/work-packages/components/wp-share-modal/wp-share.modal.ts@@ -10,12 +10,16 @@ import { OpModalLocalsMap } from 'core-app/shared/components/modal/modal.types';import { OpModalComponent } from 'core-app/shared/components/modal/modal.component';import { OpModalLocalsToken } from 'core-app/shared/components/modal/modal.service';import { I18nService } from 'core-app/core/i18n/i18n.service';+import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource';@Component({templateUrl: './wp-share.modal.html',changeDetection: ChangeDetectionStrategy.OnPush,})export class WorkPackageShareModalComponent extends OpModalComponent implements OnInit {+ private workPackage:WorkPackageResource;+ public frameSrc:string;+constructor(@Inject(OpModalLocalsToken) public locals:OpModalLocalsMap,readonly cdRef:ChangeDetectorRef,@@ -23,6 +27,10 @@ export class WorkPackageShareModalComponent extends OpModalComponent implementsreadonly elementRef:ElementRef,) {super(locals, cdRef, elementRef);++ this.workPackage = this.locals.workPackage as WorkPackageResource;+ // TODO: put into path helper+ this.frameSrc = `/work_packages/${this.workPackage.id as string}/share`;}ngOnInit() {diff --git a/frontend/src/app/features/work-packages/openproject-work-packages.module.ts b/frontend/src/app/features/work-packages/openproject-work-packages.module.tsindex 1441ef0dba7..9a220d73244 100644--- a/frontend/src/app/features/work-packages/openproject-work-packages.module.ts+++ b/frontend/src/app/features/work-packages/openproject-work-packages.module.ts@@ -29,6 +29,7 @@import {Injector,NgModule,+ CUSTOM_ELEMENTS_SCHEMA,} from '@angular/core';import { OpSharedModule } from 'core-app/shared/shared.module';import { OpenprojectFieldsModule } from 'core-app/shared/components/fields/openproject-fields.module';@@ -190,6 +191,7 @@ import { WorkPackageTimerButtonComponent } from 'core-app/features/work-packagesimport { OpenprojectTimeEntriesModule } from 'core-app/shared/components/time_entries/openproject-time-entries.module';import { RecentItemsService } from 'core-app/core/recent-items.service';import { WorkPackageShareButtonComponent } from 'core-app/features/work-packages/components/wp-buttons/wp-share-button/wp-share-button.component';+import { WorkPackageShareModalComponent } from 'core-app/features/work-packages/components/wp-share-modal/wp-share.modal';@NgModule({imports: [@@ -407,6 +409,7 @@ import { WorkPackageShareButtonComponent } from 'core-app/features/work-packagesQuerySharingModalComponent,SaveQueryModalComponent,WpDestroyModalComponent,+ WorkPackageShareModalComponent,// CustomActionsWpCustomActionComponent,@@ -465,6 +468,7 @@ import { WorkPackageShareButtonComponent } from 'core-app/features/work-packagesWorkPackageSplitViewComponent,BackButtonComponent,],+ schemas: [CUSTOM_ELEMENTS_SCHEMA],})export class OpenprojectWorkPackagesModule {static bootstrapAttributeGroupsCalled = false;diff --git a/spec/routing/work_packages_spec.rb b/spec/routing/work_packages_spec.rbindex 7230374f549..4dd1f203c53 100644--- a/spec/routing/work_packages_spec.rb+++ b/spec/routing/work_packages_spec.rb@@ -76,7 +76,7 @@ RSpec.describe WorkPackagesController dostate: '5/overview')end- it 'should connect GET /projects/:project_id/work_packages/details/:id/:state' ++ it 'connects GET /projects/:project_id/work_packages/details/:id/:state' +' to work_packages#index' doexpect(get('/projects/1/work_packages/details/2/overview')).to route_to(controller: 'work_packages',@@ -91,6 +91,12 @@ RSpec.describe WorkPackagesController doid: '1')end+ it 'connects GET /work_packages/:id/share to work_packages/shares#index' do+ expect(get('/work_packages/1/shares')).to route_to(controller: 'work_packages/shares',+ action: 'index',+ id: '1')+ end+it 'connects GET /work_packages/:work_package_id/moves/new to work_packages/moves#new' doexpect(get('/work_packages/1/move/new')).to route_to(controller: 'work_packages/moves',action: 'new',