From b36808ab6043196ebe3cc147aba722de0cbcfccd Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 29 Jan 2024 15:56:33 +0200 Subject: [PATCH] [master]: 1. Change feedback to open fs modal. 2. Add info floating button. --- src/app/app.component.ts | 5 ++ src/app/app.module.ts | 8 +-- src/app/contact/contact.component.html | 23 ++++++++- src/app/contact/contact.component.ts | 51 +++++++++++++------ src/app/contact/contact.module.ts | 4 +- src/app/openaireLibrary | 2 +- src/app/shared/monitor/monitor.component.html | 4 -- src/styles.less | 8 +++ 8 files changed, 78 insertions(+), 27 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index f6d2b4b..a2ac935 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -31,6 +31,11 @@ import {ConnectHelper} from "./openaireLibrary/connect/connectHelper";
+ + + + diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 73bb9a0..d1fd8f8 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -16,9 +16,9 @@ import {ErrorModule} from "./openaireLibrary/error/error.module"; import {CookieLawModule} from "./openaireLibrary/sharedComponents/cookie-law/cookie-law.module"; import {SearchResearchResultsServiceModule} from "./openaireLibrary/services/searchResearchResultsService.module"; import {SearchOrcidService} from "./openaireLibrary/claims/claim-utils/service/searchOrcid.service"; -import {LoginGuard} from "./openaireLibrary/login/loginGuard.guard"; -import {HasConsentGuard} from "./shared/hasConsent.guard"; import {SearchOrcidServiceModule} from "./openaireLibrary/claims/claim-utils/service/searchOrcidService.module"; +import {ContactModule} from "./contact/contact.module"; +import {IconsModule} from "./openaireLibrary/utils/icons/icons.module"; @NgModule({ declarations: [ @@ -36,7 +36,9 @@ import {SearchOrcidServiceModule} from "./openaireLibrary/claims/claim-utils/ser AppRoutingModule, CookieLawModule, SearchResearchResultsServiceModule, - SearchOrcidServiceModule + SearchOrcidServiceModule, + ContactModule, + IconsModule ], providers: [ SearchOrcidService, diff --git a/src/app/contact/contact.component.html b/src/app/contact/contact.component.html index 19fa7e5..6668e93 100644 --- a/src/app/contact/contact.component.html +++ b/src/app/contact/contact.component.html @@ -1,5 +1,5 @@ -
+
@@ -8,7 +8,7 @@

Contact us.

-

+

Contact us.

@@ -20,3 +20,22 @@ Our team will respond to your submission soon.
+ + + + + +
+
+ +

+ Contact us. +

+

+ Contact us. +

+
+
+
+
+
diff --git a/src/app/contact/contact.component.ts b/src/app/contact/contact.component.ts index beeb6bc..3b3c0de 100644 --- a/src/app/contact/contact.component.ts +++ b/src/app/contact/contact.component.ts @@ -1,4 +1,4 @@ -import {Component, OnInit, ViewChild} from '@angular/core'; +import {Component, Input, OnInit, ViewChild} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; import {EmailService} from "../openaireLibrary/utils/email/email.service"; import {Composer} from "../openaireLibrary/utils/email/composer"; @@ -8,16 +8,20 @@ import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service"; import {UntypedFormBuilder, UntypedFormGroup, Validators} from "@angular/forms"; import {NotificationHandler} from "../openaireLibrary/utils/notification-handler"; import {BaseComponent} from '../openaireLibrary/sharedComponents/base/base.component'; +import {FullScreenModalComponent} from "../openaireLibrary/utils/modal/full-screen-modal/full-screen-modal.component"; @Component({ selector: 'contact', templateUrl: './contact.component.html' }) export class ContactComponent extends BaseComponent implements OnInit { + @Input() + public page: boolean = true; public url: string = null; public sending = false; public contactForm: UntypedFormGroup; @ViewChild('modal') modal; + @ViewChild('fsModal') fsModal: FullScreenModalComponent; constructor(protected _route: ActivatedRoute, protected _router: Router, @@ -31,10 +35,12 @@ export class ContactComponent extends BaseComponent implements OnInit { } ngOnInit() { - this.title = 'Contact us'; - this.description = 'Contact us'; - this.url = this.properties.domain + this.properties.baseLink + this._router.url; - this.setMetadata(); + if(this.page) { + this.title = 'Contact us'; + this.description = 'Contact us'; + this.url = this.properties.domain + this.properties.baseLink + this._router.url; + this.setMetadata(); + } this.reset(); } @@ -44,11 +50,11 @@ export class ContactComponent extends BaseComponent implements OnInit { } } - public reset() { + public reset(subject: string = null) { this.contactForm = this.fb.group( { name: this.fb.control('', Validators.required), email: this.fb.control('', [Validators.required, Validators.email]), - subject: this.fb.control('', Validators.required), + subject: this.fb.control(subject, Validators.required), message: this.fb.control('', Validators.required), recaptcha: this.fb.control('', Validators.required), }); @@ -62,7 +68,11 @@ export class ContactComponent extends BaseComponent implements OnInit { res => { if (res) { this.sending = false; - this.reset(); + if(this.fsModal) { + this.fsModal.cancel(); + } else { + this.reset(); + } this.modalOpen(); } else { this.handleError('Email sent failed! Please try again.'); @@ -74,14 +84,21 @@ export class ContactComponent extends BaseComponent implements OnInit { )); } + public openFsModal() { + this.reset(this._title.getTitle()); + this.fsModal.open(); + } + public modalOpen() { - this.modal.okButton = true; - this.modal.alertTitle = 'Your request has been successfully submitted'; - this.modal.alertMessage = false; - this.modal.cancelButton = false; - this.modal.okButtonLeft = false; - this.modal.okButtonText = 'OK'; - this.modal.open(); + if(this.modal) { + this.modal.okButton = true; + this.modal.alertTitle = 'Your request has been successfully submitted'; + this.modal.alertMessage = false; + this.modal.cancelButton = false; + this.modal.okButtonLeft = false; + this.modal.okButtonText = 'OK'; + this.modal.open(); + } } handleError(message: string, error = null) { @@ -94,6 +111,8 @@ export class ContactComponent extends BaseComponent implements OnInit { } public goToHome() { - this._router.navigate(['/']); + if(!this.fsModal) { + this._router.navigate(['/']); + } } } diff --git a/src/app/contact/contact.module.ts b/src/app/contact/contact.module.ts index 30aea4d..7ece0ee 100644 --- a/src/app/contact/contact.module.ts +++ b/src/app/contact/contact.module.ts @@ -10,13 +10,15 @@ import {AlertModalModule} from "../openaireLibrary/utils/modal/alertModal.module import {IsRouteEnabled} from "../openaireLibrary/error/isRouteEnabled.guard"; import {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module"; import {ContactUsModule} from "../openaireLibrary/contact-us/contact-us.module"; +import {IconsModule} from "../openaireLibrary/utils/icons/icons.module"; +import {FullScreenModalModule} from "../openaireLibrary/utils/modal/full-screen-modal/full-screen-modal.module"; @NgModule({ imports: [ ContactRoutingModule, CommonModule, RouterModule, AlertModalModule, RecaptchaModule, - Schema2jsonldModule, ContactUsModule + Schema2jsonldModule, ContactUsModule, IconsModule, FullScreenModalModule ], declarations: [ ContactComponent diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index 340dd96..4c55fb2 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 340dd96dc21697a0e1ecf9a76b63e646c14a3490 +Subproject commit 4c55fb252cec8c1801bc37a9544c8e09412ff504 diff --git a/src/app/shared/monitor/monitor.component.html b/src/app/shared/monitor/monitor.component.html index e3ac6d5..1314d86 100644 --- a/src/app/shared/monitor/monitor.component.html +++ b/src/app/shared/monitor/monitor.component.html @@ -197,10 +197,6 @@ {{countSelectedFilters()}} - - -
diff --git a/src/styles.less b/src/styles.less index 92c21b0..08d2633 100644 --- a/src/styles.less +++ b/src/styles.less @@ -7,11 +7,19 @@ top: 400px !important; } +#info_switcher_toggle { + top: 250px !important; +} + @media (max-width: @breakpoint-small-max) { #filters_switcher_toggle { top: unset !important; bottom: 10vh; } + + #info_switcher_toggle { + display: none; + } } /* Quick fix for svgs with a class that makes their opacity: 0.5*/