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

Add dummy share WP button which opens a dummy Modal

Henriette Darge6fda9aaf250b
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.ts
new file mode 100644
index 00000000000..239ddd39ce1
--- /dev/null
+++ b/frontend/src/app/features/work-packages/components/wp-buttons/wp-share-button/wp-share-button.component.ts
@@ -0,0 +1,60 @@
+// -- 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.
+//++
+
+import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource';
+import {
+ ChangeDetectionStrategy,
+ ChangeDetectorRef,
+ Component,
+ Input,
+} from '@angular/core';
+import { I18nService } from 'core-app/core/i18n/i18n.service';
+import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
+import { OpModalService } from 'core-app/shared/components/modal/modal.service';
+import { WorkPackageShareModalComponent } from 'core-app/features/work-packages/components/wp-share-modal/wp-share.modal';
+
+@Component({
+ selector: 'wp-share-button',
+ templateUrl: './wp-share-button.html',
+ changeDetection: ChangeDetectionStrategy.OnPush,
+})
+export class WorkPackageShareButtonComponent extends UntilDestroyedMixin {
+ @Input('workPackage') public workPackage:WorkPackageResource;
+
+ constructor(
+ readonly I18n:I18nService,
+ readonly opModalService:OpModalService,
+ readonly cdRef:ChangeDetectorRef,
+ ) {
+ super();
+ }
+
+ openModal():void {
+ this.opModalService.show(WorkPackageShareModalComponent, 'global', {});
+ }
+}
diff --git a/frontend/src/app/features/work-packages/components/wp-buttons/wp-share-button/wp-share-button.html b/frontend/src/app/features/work-packages/components/wp-buttons/wp-share-button/wp-share-button.html
new file mode 100644
index 00000000000..382c93d2042
--- /dev/null
+++ b/frontend/src/app/features/work-packages/components/wp-buttons/wp-share-button/wp-share-button.html
@@ -0,0 +1,7 @@
+<button
+ class="button toolbar-icon"
+ (click)="openModal()"
+>
+ <!-- <svg share-android></svg> -->
+ <span class="button--text">SHARE</span>
+</button>
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.html
new file mode 100644
index 00000000000..11047b6edc4
--- /dev/null
+++ b/frontend/src/app/features/work-packages/components/wp-share-modal/wp-share.modal.html
@@ -0,0 +1,21 @@
+<div
+ class="spot-modal"
+>
+ <div
+ class="spot-modal--header"
+ >TODO</div>
+
+ <div class="spot-modal--body spot-container">
+ DO SOME TURBO Stuff
+ </div>
+ <div class="spot-action-bar hidden-for-mobile">
+ <div class="spot-action-bar--right">
+ <button
+ class="button button_no-margin spot-action-bar--action spot-modal--cancel-button"
+ (click)="closeMe($event)"
+ >
+ CLOSE
+ </button>
+ </div>
+ </div>
+</div>
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.ts
new file mode 100644
index 00000000000..8e48dde6fe2
--- /dev/null
+++ b/frontend/src/app/features/work-packages/components/wp-share-modal/wp-share.modal.ts
@@ -0,0 +1,31 @@
+import {
+ ChangeDetectionStrategy,
+ ChangeDetectorRef,
+ Component,
+ ElementRef,
+ Inject,
+ OnInit,
+} from '@angular/core';
+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';
+
+@Component({
+ templateUrl: './wp-share.modal.html',
+ changeDetection: ChangeDetectionStrategy.OnPush,
+})
+export class WorkPackageShareModalComponent extends OpModalComponent implements OnInit {
+ constructor(
+ @Inject(OpModalLocalsToken) public locals:OpModalLocalsMap,
+ readonly cdRef:ChangeDetectorRef,
+ readonly I18n:I18nService,
+ readonly elementRef:ElementRef,
+ ) {
+ super(locals, cdRef, elementRef);
+ }
+
+ ngOnInit() {
+ super.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.ts
index e5bfc02af93..1441ef0dba7 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
@@ -189,6 +189,7 @@ import { NgSelectModule } from '@ng-select/ng-select';
import { WorkPackageTimerButtonComponent } from 'core-app/features/work-packages/components/wp-timer-button/wp-timer-button.component';
import { 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';
@NgModule({
imports: [
@@ -386,6 +387,7 @@ import { RecentItemsService } from 'core-app/core/recent-items.service';
WorkPackageBreadcrumbComponent,
WorkPackageSplitViewToolbarComponent,
WorkPackageWatcherButtonComponent,
+ WorkPackageShareButtonComponent,
WorkPackageSubjectComponent,
// Full view
diff --git a/frontend/src/app/features/work-packages/routing/wp-full-view/wp-full-view.html b/frontend/src/app/features/work-packages/routing/wp-full-view/wp-full-view.html
index 746a2047212..d17fa7a81b4 100644
--- a/frontend/src/app/features/work-packages/routing/wp-full-view/wp-full-view.html
+++ b/frontend/src/app/features/work-packages/routing/wp-full-view/wp-full-view.html
@@ -25,6 +25,11 @@
[stateName$]="stateName$">
</wp-create-button>
</li>
+ <li class="toolbar-item">
+ <wp-share-button [workPackage]="workPackage"
+ [showText]="false">
+ </wp-share-button>
+ </li>
<li class="toolbar-item hidden-for-tablet" *ngIf="displayTimerButton">
<op-wp-timer-button
[workPackage]="workPackage"
@@ -57,7 +62,6 @@
</ul>
</div>
</div>
-
<div class="work-packages-full-view--split-container">
<div class="work-packages-full-view--split-left">
<div class="work-packages--panel-inner">