From 44825c59850491185fcb991528d64100f45576e2 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 22 Feb 2023 23:13:46 +0200 Subject: [PATCH] [Library | explore-redesign]: In small screens (mobile) open full screen modal when viewing all authors or all identifiers. 1. showAuthors.module.ts: Imported FullScreenModalModule. 2. showAuthors.component.ts & showIdentifiers.component.ts: Added @Input() isMobile: boolean = false; | Added for view all authors, to trigger it when isMobile. 3. landing-header.component.ts: Added @Input() isMobile: boolean = false; | Pass input param isMobile to . 4. resultLanding.component.html: Pass input param isMobile to , , . --- .../landing-header.component.ts | 3 ++- .../showIdentifiers.component.ts | 23 +++++++++++++---- .../result/resultLanding.component.html | 7 +++--- utils/authors/showAuthors.component.ts | 25 +++++++++++++++---- utils/authors/showAuthors.module.ts | 3 ++- 5 files changed, 46 insertions(+), 15 deletions(-) diff --git a/landingPages/landing-utils/landing-header/landing-header.component.ts b/landingPages/landing-utils/landing-header/landing-header.component.ts index 0f006aa4..140db0dc 100644 --- a/landingPages/landing-utils/landing-header/landing-header.component.ts +++ b/landingPages/landing-utils/landing-header/landing-header.component.ts @@ -25,12 +25,13 @@ import {AlertModal} from "../../../utils/modal/alert";
+ [isSticky]="isSticky" [isMobile]="isMobile">
` }) export class LandingHeaderComponent { + @Input() isMobile: boolean = false; @Input() entityType: string; @Input() properties: EnvProperties; @Input() types: string[]; diff --git a/landingPages/landing-utils/showIdentifiers.component.ts b/landingPages/landing-utils/showIdentifiers.component.ts index 2e3dcff5..2391f877 100644 --- a/landingPages/landing-utils/showIdentifiers.component.ts +++ b/landingPages/landing-utils/showIdentifiers.component.ts @@ -47,14 +47,21 @@ import {properties} from "../../../../environments/environment"; View all - +
+ + +
+ +
+
` }) export class ShowIdentifiersComponent implements AfterViewInit { + @Input() isMobile: boolean = false; @Input() identifiers: Map; @Input() showViewAll: boolean = false; large: Map = new Map(); @@ -121,9 +128,15 @@ export class ShowIdentifiersComponent implements AfterViewInit { } public openIdentifiersModal() { - this.identifiersModal.cancelButton = false; - this.identifiersModal.okButton = false; - this.identifiersModal.alertTitle = "Persistent Identifiers"; - this.identifiersModal.open(); + if(this.isMobile) { + this.identifiersModal.okButton = false; + this.identifiersModal.title = "Persistent Identifiers"; + this.identifiersModal.open(); + } else { + this.identifiersModal.cancelButton = false; + this.identifiersModal.okButton = false; + this.identifiersModal.alertTitle = "Persistent Identifiers"; + this.identifiersModal.open(); + } } } diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index 0947b2c5..17d260e6 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -472,12 +472,13 @@ [entityType]="getTypeName()" [types]="resultLandingInfo.types" [date]="resultLandingInfo.dateofacceptance" [embargoEndDate]="resultLandingInfo.embargoEndDate" [publisher]="resultLandingInfo.publisher" [journal]="resultLandingInfo.journal" - [languages]="resultLandingInfo.languages" [programmingLanguages]="resultLandingInfo.programmingLanguages"> + [languages]="resultLandingInfo.languages" [programmingLanguages]="resultLandingInfo.programmingLanguages" + [isMobile]="true">
- +
@@ -849,7 +850,7 @@ [otherSubjects]="resultLandingInfo.otherSubjects" [classifiedSubjects]="resultLandingInfo.classifiedSubjects" [eoscSubjects]="resultLandingInfo.eoscSubjects" - [isMobile]="isMobile" + [isMobile]="isMobile"> [viewAllSubjects]="viewAllMobile=='subjects'" [viewAllClassifiedSubjects]="viewAllMobile=='classifiedSubjects'" (viewAllClicked)="viewAllSubjectsMobileClicked($event)"> diff --git a/utils/authors/showAuthors.component.ts b/utils/authors/showAuthors.component.ts index daf87fb3..215c835c 100644 --- a/utils/authors/showAuthors.component.ts +++ b/utils/authors/showAuthors.component.ts @@ -88,18 +88,27 @@ import {properties} from "../../../../environments/environment";
- +
+ + +
+ + + +
+
` }) export class ShowAuthorsComponent { + @Input() isMobile: boolean = false; @Input() authors: Author[]; @Input() isSticky: boolean = false; @Input() authorsLimit: number = 7; @@ -137,10 +146,16 @@ export class ShowAuthorsComponent { } public openAuthorsModal() { - this.authorsModal.cancelButton = false; - this.authorsModal.okButton = false; - this.authorsModal.alertTitle = "Authors"; - this.authorsModal.open(); + if (this.isMobile) { + this.authorsModal.okButton = false; + this.authorsModal.title = "Authors"; + this.authorsModal.open(); + } else { + this.authorsModal.cancelButton = false; + this.authorsModal.okButton = false; + this.authorsModal.alertTitle = "Authors"; + this.authorsModal.open(); + } } copyToClipboard(element: HTMLInputElement) { diff --git a/utils/authors/showAuthors.module.ts b/utils/authors/showAuthors.module.ts index a9cd2e12..f98f42e5 100644 --- a/utils/authors/showAuthors.module.ts +++ b/utils/authors/showAuthors.module.ts @@ -5,10 +5,11 @@ import {RouterModule} from '@angular/router'; import {ShowAuthorsComponent} from './showAuthors.component'; import {AlertModalModule} from "../modal/alertModal.module"; +import {FullScreenModalModule} from "../modal/full-screen-modal/full-screen-modal.module"; @NgModule({ imports: [ - CommonModule, FormsModule, RouterModule, AlertModalModule + CommonModule, FormsModule, RouterModule, AlertModalModule, FullScreenModalModule ], declarations: [ ShowAuthorsComponent