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

Remove closeOnEscape and closeOnOutsideClick

Oliver Günthera0df5e8b1301
diff --git a/frontend/src/app/features/boards/board/add-list-modal/add-list-modal.component.ts b/frontend/src/app/features/boards/board/add-list-modal/add-list-modal.component.ts
index 937381bbb48..7a9ba5b7d55 100644
--- a/frontend/src/app/features/boards/board/add-list-modal/add-list-modal.component.ts
+++ b/frontend/src/app/features/boards/board/add-list-modal/add-list-modal.component.ts
@@ -86,9 +86,6 @@ export class AddListModalComponent extends OpModalComponent implements OnInit {
public trackByHref = trackByHref;
- /* Do not close on outside click (because the select option are appended to the body */
- public closeOnOutsideClick = false;
-
public warningText:string|undefined;
public text:any = {
diff --git a/frontend/src/app/features/boards/board/configuration-modal/board-configuration.modal.ts b/frontend/src/app/features/boards/board/configuration-modal/board-configuration.modal.ts
index a3b42f8960b..1d3c80bef8e 100644
--- a/frontend/src/app/features/boards/board/configuration-modal/board-configuration.modal.ts
+++ b/frontend/src/app/features/boards/board/configuration-modal/board-configuration.modal.ts
@@ -28,12 +28,6 @@ import { Board } from 'core-app/features/boards/board/board';
templateUrl: './board-configuration.modal.html',
})
export class BoardConfigurationModalComponent extends OpModalComponent implements OnInit, OnDestroy {
- /* Close on escape? */
- public closeOnEscape = false;
-
- /* Close on outside click */
- public closeOnOutsideClick = false;
-
public text = {
title: this.I18n.t('js.boards.configuration_modal.title'),
closePopup: this.I18n.t('js.close_popup_title'),
diff --git a/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial.modal.ts b/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial.modal.ts
index 55d5c265249..f0efb295819 100644
--- a/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial.modal.ts
+++ b/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial.modal.ts
@@ -55,10 +55,6 @@ export class EnterpriseTrialModalComponent extends OpModalComponent implements A
// modal configuration
public showClose = true;
- public closeOnEscape = false;
-
- public closeOnOutsideClick = false;
-
public trustedEEVideoURL:SafeResourceUrl;
public text = {
diff --git a/frontend/src/app/features/invite-user-modal/invite-user.component.ts b/frontend/src/app/features/invite-user-modal/invite-user.component.ts
index 05f291490f5..278e1efd593 100644
--- a/frontend/src/app/features/invite-user-modal/invite-user.component.ts
+++ b/frontend/src/app/features/invite-user-modal/invite-user.component.ts
@@ -40,9 +40,6 @@ export class InviteUserModalComponent extends OpModalComponent implements OnInit
public step = Steps.ProjectSelection;
- /* Close on outside click */
- public closeOnOutsideClick = true;
-
/* Data that is returned from the modal on close */
public data:any = null;
diff --git a/frontend/src/app/features/job-status/job-status-modal/job-status.modal.ts b/frontend/src/app/features/job-status/job-status-modal/job-status.modal.ts
index eb38d5a1589..64fa8a96a98 100644
--- a/frontend/src/app/features/job-status/job-status-modal/job-status.modal.ts
+++ b/frontend/src/app/features/job-status/job-status-modal/job-status.modal.ts
@@ -23,12 +23,6 @@ import { EXTERNAL_REQUEST_HEADER } from 'core-app/features/hal/http/openproject-
styleUrls: ['./job-status.modal.sass'],
})
export class JobStatusModalComponent extends OpModalComponent implements OnInit {
- /* Close on escape? */
- public closeOnEscape = false;
-
- /* Close on outside click */
- public closeOnOutsideClick = false;
-
public text = {
title: this.I18n.t('js.job_status.title'),
closePopup: this.I18n.t('js.close_popup_title'),
diff --git a/frontend/src/app/features/work-packages/components/wp-table/configuration-modal/wp-table-configuration.modal.ts b/frontend/src/app/features/work-packages/components/wp-table/configuration-modal/wp-table-configuration.modal.ts
index cc7cfad01de..4bdae03ce19 100644
--- a/frontend/src/app/features/work-packages/components/wp-table/configuration-modal/wp-table-configuration.modal.ts
+++ b/frontend/src/app/features/work-packages/components/wp-table/configuration-modal/wp-table-configuration.modal.ts
@@ -39,12 +39,6 @@ export const WpTableConfigurationModalPrependToken = new InjectionToken<Componen
templateUrl: './wp-table-configuration.modal.html',
})
export class WpTableConfigurationModalComponent extends OpModalComponent implements OnInit, OnDestroy {
- /* Close on escape? */
- public closeOnEscape = false;
-
- /* Close on outside click */
- public closeOnOutsideClick = false;
-
public text = {
title: this.I18n.t('js.work_packages.table_configuration.modal_title'),
closePopup: this.I18n.t('js.close_popup_title'),
diff --git a/frontend/src/app/shared/components/attribute-help-texts/attribute-help-text.modal.ts b/frontend/src/app/shared/components/attribute-help-texts/attribute-help-text.modal.ts
index 0245e99d05c..aed153e76cd 100644
--- a/frontend/src/app/shared/components/attribute-help-texts/attribute-help-text.modal.ts
+++ b/frontend/src/app/shared/components/attribute-help-texts/attribute-help-text.modal.ts
@@ -40,12 +40,6 @@ import { HelpTextResource } from 'core-app/features/hal/resources/help-text-reso
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AttributeHelpTextModalComponent extends OpModalComponent implements OnInit {
- /* Close on escape? */
- public closeOnEscape = true;
-
- /* Close on outside click */
- public closeOnOutsideClick = false;
-
readonly text = {
edit: this.I18n.t('js.button_edit'),
close: this.I18n.t('js.button_close'),
diff --git a/frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.ts b/frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.ts
index 3117d4c3e96..f42c1589baa 100644
--- a/frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.ts
+++ b/frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.ts
@@ -15,12 +15,6 @@ import { TimeEntriesCurrentUserConfigurationModalService } from 'core-app/shared
providers: [TimeEntriesCurrentUserConfigurationModalService],
})
export class TimeEntriesCurrentUserConfigurationModalComponent extends OpModalComponent implements OnInit {
- /* Close on escape? */
- public closeOnEscape = true;
-
- /* Close on outside click */
- public closeOnOutsideClick = true;
-
public text = {
displayedDays: this.I18n.t('js.grid.widgets.time_entries_current_user.displayed_days'),
closePopup: this.I18n.t('js.close_popup_title'),
diff --git a/frontend/src/app/shared/components/modal/modal.component.ts b/frontend/src/app/shared/components/modal/modal.component.ts
index 6e41e6103ec..403038e8f01 100644
--- a/frontend/src/app/shared/components/modal/modal.component.ts
+++ b/frontend/src/app/shared/components/modal/modal.component.ts
@@ -7,14 +7,6 @@ import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destr
@Directive()
export abstract class OpModalComponent extends UntilDestroyedMixin implements OnInit, OnDestroy {
- /* Close on escape? */
- public closeOnEscape = true;
-
- public closeOnEscapeFunction = this.closeMe;
-
- /* Close on outside click */
- public closeOnOutsideClick = true;
-
/* Reference to service */
protected service:OpModalService = this.locals.service;
diff --git a/frontend/src/app/shared/components/modals/confirm-dialog/confirm-dialog.modal.ts b/frontend/src/app/shared/components/modals/confirm-dialog/confirm-dialog.modal.ts
index 87cc9ed271e..4dde784327a 100644
--- a/frontend/src/app/shared/components/modals/confirm-dialog/confirm-dialog.modal.ts
+++ b/frontend/src/app/shared/components/modals/confirm-dialog/confirm-dialog.modal.ts
@@ -98,8 +98,6 @@ export class ConfirmDialogModalComponent extends OpModalComponent {
this.dangerHighlighting = _.defaultTo(this.options.dangerHighlighting, false);
this.passedData = _.defaultTo(this.options.passedData, []);
- this.closeOnEscape = _.defaultTo(this.options.closeByEscape, true);
- this.closeOnOutsideClick = _.defaultTo(this.options.closeByDocument, true);
this.showClose = _.defaultTo(this.options.showClose, true);
this.divideContent = _.defaultTo(this.options.divideContent, false);
// override default texts and icons if any
diff --git a/frontend/src/app/shared/components/modals/editor/macro-child-pages-modal/child-pages-macro.modal.ts b/frontend/src/app/shared/components/modals/editor/macro-child-pages-modal/child-pages-macro.modal.ts
index 3028c8fe600..015e73c0794 100644
--- a/frontend/src/app/shared/components/modals/editor/macro-child-pages-modal/child-pages-macro.modal.ts
+++ b/frontend/src/app/shared/components/modals/editor/macro-child-pages-modal/child-pages-macro.modal.ts
@@ -42,10 +42,6 @@ export class ChildPagesMacroModalComponent extends OpModalComponent implements A
public showClose = true;
- public closeOnEscape = true;
-
- public closeOnOutsideClick = true;
-
public selectedPage:string;
public selectedIncludeParent:boolean;
diff --git a/frontend/src/app/shared/components/modals/editor/macro-code-block-modal/code-block-macro.modal.ts b/frontend/src/app/shared/components/modals/editor/macro-code-block-modal/code-block-macro.modal.ts
index 34986f0dace..2bbaa9125e1 100644
--- a/frontend/src/app/shared/components/modals/editor/macro-code-block-modal/code-block-macro.modal.ts
+++ b/frontend/src/app/shared/components/modals/editor/macro-code-block-modal/code-block-macro.modal.ts
@@ -42,10 +42,6 @@ export class CodeBlockMacroModalComponent extends OpModalComponent implements Af
public showClose = true;
- public closeOnEscape = true;
-
- public closeOnOutsideClick = true;
-
// Language class from markdown, something like 'language-ruby'
public languageClass:string;
diff --git a/frontend/src/app/shared/components/modals/editor/macro-wiki-include-page-modal/wiki-include-page-macro.modal.ts b/frontend/src/app/shared/components/modals/editor/macro-wiki-include-page-modal/wiki-include-page-macro.modal.ts
index dde0a3c583a..fa7abdceca4 100644
--- a/frontend/src/app/shared/components/modals/editor/macro-wiki-include-page-modal/wiki-include-page-macro.modal.ts
+++ b/frontend/src/app/shared/components/modals/editor/macro-wiki-include-page-modal/wiki-include-page-macro.modal.ts
@@ -42,10 +42,6 @@ export class WikiIncludePageMacroModalComponent extends OpModalComponent impleme
public showClose = true;
- public closeOnEscape = true;
-
- public closeOnOutsideClick = true;
-
public selectedPage:string;
public page = '';
diff --git a/frontend/src/app/shared/components/modals/editor/macro-wp-button-modal/wp-button-macro.modal.ts b/frontend/src/app/shared/components/modals/editor/macro-wp-button-modal/wp-button-macro.modal.ts
index cd06823dbb5..68a4cd13a4c 100644
--- a/frontend/src/app/shared/components/modals/editor/macro-wp-button-modal/wp-button-macro.modal.ts
+++ b/frontend/src/app/shared/components/modals/editor/macro-wp-button-modal/wp-button-macro.modal.ts
@@ -46,10 +46,6 @@ export class WpButtonMacroModalComponent extends OpModalComponent implements Aft
public showClose = true;
- public closeOnEscape = true;
-
- public closeOnOutsideClick = true;
-
public selectedType:string;
public buttonStyle:boolean;
diff --git a/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.ts b/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.ts
index dcbfc444e4d..5ec4a94006e 100644
--- a/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.ts
+++ b/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.ts
@@ -29,12 +29,6 @@ interface ExportLink extends HalLink {
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class WpTableExportModalComponent extends OpModalComponent implements OnInit {
- /* Close on escape? */
- public closeOnEscape = true;
-
- /* Close on outside click */
- public closeOnOutsideClick = true;
-
public $element:HTMLElement;
public exportOptions:{ identifier:string, label:string, url:string }[];
@@ -60,15 +54,17 @@ export class WpTableExportModalComponent extends OpModalComponent implements OnI
super(locals, cdRef, elementRef);
}
- ngOnInit() {
+ ngOnInit():void {
super.ngOnInit();
if (this.locals.link) {
this.requestExport(this.locals.link);
} else {
- this.querySpace.results
+ void this.querySpace.results
.valuesPromise()
- .then((results) => this.exportOptions = this.buildExportOptions(results!));
+ .then((results:WorkPackageCollectionResource) => {
+ this.exportOptions = this.buildExportOptions(results);
+ });
}
}
@@ -79,12 +75,12 @@ export class WpTableExportModalComponent extends OpModalComponent implements OnI
return {
identifier: link.identifier,
label: link.title,
- url: this.addColumnsToHref(format.href!),
+ url: this.addColumnsToHref(format.href as string),
};
});
}
- private triggerByLink(url:string, event:MouseEvent) {
+ triggerByLink(url:string, event:MouseEvent):void {
event.preventDefault();
this.requestExport(url);
}
@@ -139,6 +135,6 @@ export class WpTableExportModalComponent extends OpModalComponent implements OnI
}
protected get afterFocusOn():HTMLElement {
- return document.getElementById('work-packages-settings-button')!;
+ return document.getElementById('work-packages-settings-button') as HTMLElement;
}
}
diff --git a/frontend/src/app/shared/components/modals/modal-wrapper/dynamic-content.modal.ts b/frontend/src/app/shared/components/modals/modal-wrapper/dynamic-content.modal.ts
index 7bb88f430eb..62d2336f120 100644
--- a/frontend/src/app/shared/components/modals/modal-wrapper/dynamic-content.modal.ts
+++ b/frontend/src/app/shared/components/modals/modal-wrapper/dynamic-content.modal.ts
@@ -40,11 +40,6 @@ import { I18nService } from 'core-app/core/i18n/i18n.service';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class DynamicContentModalComponent extends OpModalComponent implements OnInit, OnDestroy {
- // override superclass
- // Allowing outside clicks to close the modal leads to the user involuntarily closing
- // the modal when removing error messages or clicking on labels e.g. in the registration modal.
- public closeOnOutsideClick = false;
-
constructor(
readonly elementRef:ElementRef,
@Inject(OpModalLocalsToken) public locals:OpModalLocalsMap,
diff --git a/frontend/src/app/shared/components/modals/request-for-confirmation/password-confirmation.modal.ts b/frontend/src/app/shared/components/modals/request-for-confirmation/password-confirmation.modal.ts
index 8e8fb6c2ba7..fbe8911fa06 100644
--- a/frontend/src/app/shared/components/modals/request-for-confirmation/password-confirmation.modal.ts
+++ b/frontend/src/app/shared/components/modals/request-for-confirmation/password-confirmation.modal.ts
@@ -56,8 +56,6 @@ export class PasswordConfirmationModalComponent extends ConfirmDialogModalCompon
super.ngOnInit();
this.text.title = I18n.t('js.password_confirmation.title');
- this.closeOnEscape = false;
- this.closeOnOutsideClick = false;
this.showClose = false;
}
diff --git a/frontend/src/app/shared/components/modals/save-modal/save-query.modal.ts b/frontend/src/app/shared/components/modals/save-modal/save-query.modal.ts
index 85bbafdae25..826253c4937 100644
--- a/frontend/src/app/shared/components/modals/save-modal/save-query.modal.ts
+++ b/frontend/src/app/shared/components/modals/save-modal/save-query.modal.ts
@@ -80,17 +80,17 @@ export class SaveQueryModalComponent extends OpModalComponent {
super(locals, cdRef, elementRef);
}
- public setValues(change:QuerySharingChange) {
+ public setValues(change:QuerySharingChange):void {
this.isStarred = change.isStarred;
this.isPublic = change.isPublic;
}
- public onOpen() {
+ public onOpen():void {
this.queryNameField.nativeElement.focus();
}
- public get afterFocusOn() {
- return document.getElementById('work-packages-settings-button')!;
+ public get afterFocusOn():HTMLElement {
+ return document.getElementById('work-packages-settings-button') as HTMLElement;
}
public saveQueryAs($event:Event):void {
diff --git a/frontend/src/app/shared/components/modals/share-modal/query-sharing.modal.ts b/frontend/src/app/shared/components/modals/share-modal/query-sharing.modal.ts
index 88e0d94f498..83ea982f349 100644
--- a/frontend/src/app/shared/components/modals/share-modal/query-sharing.modal.ts
+++ b/frontend/src/app/shared/components/modals/share-modal/query-sharing.modal.ts
@@ -78,7 +78,7 @@ export class QuerySharingModalComponent extends OpModalComponent implements OnIn
super(locals, cdRef, elementRef);
}
- ngOnInit() {
+ ngOnInit():void {
super.ngOnInit();
this.query = this.querySpace.query.value!;
@@ -87,13 +87,13 @@ export class QuerySharingModalComponent extends OpModalComponent implements OnIn
this.isPublic = this.query.public;
}
- public setValues(change:QuerySharingChange) {
+ public setValues(change:QuerySharingChange):void {
this.isStarred = change.isStarred;
this.isPublic = change.isPublic;
}
- public get afterFocusOn() {
- return document.getElementById('work-packages-settings-button')!;
+ public get afterFocusOn():HTMLElement {
+ return document.getElementById('work-packages-settings-button') as HTMLElement;
}
public saveQuery($event:Event):void {
diff --git a/frontend/src/app/shared/components/time_entries/shared/modal/base.modal.ts b/frontend/src/app/shared/components/time_entries/shared/modal/base.modal.ts
index f2d58bf47b4..ff7a39002da 100644
--- a/frontend/src/app/shared/components/time_entries/shared/modal/base.modal.ts
+++ b/frontend/src/app/shared/components/time_entries/shared/modal/base.modal.ts
@@ -30,10 +30,6 @@ export abstract class TimeEntryBaseModal extends OpModalComponent {
areYouSure: this.i18n.t('js.text_are_you_sure'),
};
- public closeOnEscape = false;
-
- public closeOnOutsideClick = false;
-
public formInFlight:boolean;
@InjectField() apiV3Service:ApiV3Service;
diff --git a/frontend/src/app/shared/components/work-package-graphs/configuration-modal/wp-graph-configuration.modal.ts b/frontend/src/app/shared/components/work-package-graphs/configuration-modal/wp-graph-configuration.modal.ts
index 30af5cc521a..3e99be27eee 100644
--- a/frontend/src/app/shared/components/work-package-graphs/configuration-modal/wp-graph-configuration.modal.ts
+++ b/frontend/src/app/shared/components/work-package-graphs/configuration-modal/wp-graph-configuration.modal.ts
@@ -37,12 +37,6 @@ export const WpTableConfigurationModalPrependToken = new InjectionToken<Componen
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class WpGraphConfigurationModalComponent extends OpModalComponent implements OnInit, OnDestroy {
- /* Close on escape? */
- public closeOnEscape = false;
-
- /* Close on outside click */
- public closeOnOutsideClick = false;
-
public $element:HTMLElement;
public text = {