From 99acc8871aefbcb7bb9be75f0ea083012b8787f9 Mon Sep 17 00:00:00 2001 From: JR Strayhorn Date: Wed, 20 Oct 2021 18:18:38 -0400 Subject: [PATCH 1/3] Ignore Background Click, Add Close Button --- src/app/modules/project/add/main/main.component.ts | 9 +++++++-- .../project/add/main/wizard/wizard.component.html | 7 ++++++- .../modules/project/add/main/wizard/wizard.component.ts | 4 +++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/app/modules/project/add/main/main.component.ts b/src/app/modules/project/add/main/main.component.ts index 022347fa..cc290cfd 100644 --- a/src/app/modules/project/add/main/main.component.ts +++ b/src/app/modules/project/add/main/main.component.ts @@ -20,7 +20,7 @@ import { WizardComponent } from './wizard/wizard.component'; import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { SafeUrl } from '@angular/platform-browser'; import { Router } from '@angular/router'; -import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal'; +import { BsModalRef, BsModalService, ModalOptions } from 'ngx-bootstrap/modal'; import { ExternalSource } from 'src/app/models/domain/external-source'; import { AlertConfig } from 'src/app/models/internal/alert-config'; import { AlertType } from 'src/app/models/internal/alert-type'; @@ -143,7 +143,12 @@ export class MainComponent implements OnInit { * Methods which creates the wizard modal */ private createWizardModal() { - this.modalRef = this.modalService.show(WizardComponent, {animated: true}); + const modalConfig: ModalOptions = { + animated: true, + ignoreBackdropClick: true, + keyboard: false + }; + this.modalRef = this.modalService.show(WizardComponent, modalConfig); this.modalRef.setClass('wizard-modal'); } diff --git a/src/app/modules/project/add/main/wizard/wizard.component.html b/src/app/modules/project/add/main/wizard/wizard.component.html index edceee1d..cdcfdf54 100644 --- a/src/app/modules/project/add/main/wizard/wizard.component.html +++ b/src/app/modules/project/add/main/wizard/wizard.component.html @@ -16,7 +16,12 @@ If not, see https://www.gnu.org/licenses/lgpl-3.0.txt --> -
+ +
diff --git a/src/app/modules/project/add/main/wizard/wizard.component.ts b/src/app/modules/project/add/main/wizard/wizard.component.ts index f75e82c4..7b658792 100644 --- a/src/app/modules/project/add/main/wizard/wizard.component.ts +++ b/src/app/modules/project/add/main/wizard/wizard.component.ts @@ -17,6 +17,7 @@ import { LocationStrategy } from '@angular/common'; import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; +import { BsModalRef } from 'ngx-bootstrap/modal'; import { Observable } from 'rxjs'; import { WizardPage } from 'src/app/models/domain/wizard-page'; import { AlertConfig } from 'src/app/models/internal/alert-config'; @@ -46,7 +47,8 @@ export class WizardComponent implements OnInit { private projectService: ProjectService, private alertService: AlertService, private location: LocationStrategy, - private authService: AuthService) { + private authService: AuthService, + public bsModalRef: BsModalRef) { // check if back or forward button is pressed and prevent it. this.registerNavigationListener(); } From d477318795915d9be2e50dab4f6e004a80b0f948 Mon Sep 17 00:00:00 2001 From: Bart van Eijkelenburg Date: Thu, 21 Oct 2021 12:14:59 +0200 Subject: [PATCH 2/3] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c590426..6bb0e4ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Fixed - Fixed pagination project overview - [#564](https://github.com/DigitalExcellence/dex-frontend/issues/564) - +- Added a close button onto the add project modal, ignore background click - [#558](https://github.com/DigitalExcellence/dex-frontend/issues/558) ### Security ## Release v.1.7.0-beta - 8-10-2021 From ac26f803dcafe9f4c6531e49b564dc180e27c96b Mon Sep 17 00:00:00 2001 From: Bart van Eijkelenburg <73314842+BartvanEijkelenburg@users.noreply.github.com> Date: Thu, 21 Oct 2021 12:15:27 +0200 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bb0e4ec..2e469eae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Fixed - Fixed pagination project overview - [#564](https://github.com/DigitalExcellence/dex-frontend/issues/564) - Added a close button onto the add project modal, ignore background click - [#558](https://github.com/DigitalExcellence/dex-frontend/issues/558) + ### Security ## Release v.1.7.0-beta - 8-10-2021