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

Hide the angular close button in the primerized modal for sharing (#15006)

Oliver Güntherf7d5b6820607
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
index 420957bfdb8..a5b3a500816 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
@@ -24,6 +24,9 @@ import { shareModalUpdated } from 'core-app/features/work-packages/components/wp
export class WorkPackageShareModalComponent extends OpModalComponent implements OnInit {
@ViewChild('frameElement') frameElement:ElementRef<HTMLIFrameElement>|undefined;
+ // Hide close button so it's not duplicated in primer (WP#51699)
+ showCloseButton = false;
+
private workPackage:WorkPackageResource;
public frameSrc:string;
diff --git a/frontend/src/app/shared/components/modal/modal-overlay.component.html b/frontend/src/app/shared/components/modal/modal-overlay.component.html
index 9f62fb6a7c9..2a8e994f78f 100644
--- a/frontend/src/app/shared/components/modal/modal-overlay.component.html
+++ b/frontend/src/app/shared/components/modal/modal-overlay.component.html
@@ -13,6 +13,7 @@
aria-labelledby="spotModalTitle"
>
<button
+ *ngIf="(activeModalInstance$ | async)?.showCloseButton !== false"
type="button"
class="spot-button spot-modal-overlay--close-button"
(click)="close($event)"
diff --git a/frontend/src/app/shared/components/modal/modal.component.ts b/frontend/src/app/shared/components/modal/modal.component.ts
index d5c9a31fe02..b7fc632067c 100644
--- a/frontend/src/app/shared/components/modal/modal.component.ts
+++ b/frontend/src/app/shared/components/modal/modal.component.ts
@@ -26,9 +26,7 @@
// See COPYRIGHT and LICENSE files for more details.
//++
-import {
- ChangeDetectorRef, Directive, ElementRef, EventEmitter, Inject, OnDestroy, OnInit,
-} from '@angular/core';
+import { ChangeDetectorRef, Directive, ElementRef, EventEmitter, Inject, OnDestroy, OnInit } from '@angular/core';
import { OpModalLocalsMap } from 'core-app/shared/components/modal/modal.types';
import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
@@ -47,6 +45,9 @@ export abstract class OpModalComponent extends UntilDestroyedMixin implements On
public openingEvent = new EventEmitter<this>();
+ /** Whether we want to hide the show close button. Used to hide when rendering primer */
+ showCloseButton = true;
+
/* Data to be return from this modal instance */
public data:unknown;