[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 <fs-modal> for view all authors, to trigger it when isMobile.
3. landing-header.component.ts: Added @Input() isMobile: boolean = false; | Pass input param isMobile to <showAuthors>.
4. resultLanding.component.html: Pass input param isMobile to <showSubjects>, <showIdentifiers>, <landing-header>.
This commit is contained in:
Konstantina Galouni 2023-02-22 23:13:46 +02:00
parent 3b9d585da1
commit 44825c5985
5 changed files with 46 additions and 15 deletions

View File

@ -25,12 +25,13 @@ import {AlertModal} from "../../../utils/modal/alert";
</div> </div>
<div *ngIf="authors"> <div *ngIf="authors">
<showAuthors [authorsLimit]="authorLimit" [modal]="modal" [showAll]="showAllAuthors" [authors]="authors" <showAuthors [authorsLimit]="authorLimit" [modal]="modal" [showAll]="showAllAuthors" [authors]="authors"
[isSticky]="isSticky"></showAuthors> [isSticky]="isSticky" [isMobile]="isMobile"></showAuthors>
</div> </div>
</div> </div>
` `
}) })
export class LandingHeaderComponent { export class LandingHeaderComponent {
@Input() isMobile: boolean = false;
@Input() entityType: string; @Input() entityType: string;
@Input() properties: EnvProperties; @Input() properties: EnvProperties;
@Input() types: string[]; @Input() types: string[];

View File

@ -47,14 +47,21 @@ import {properties} from "../../../../environments/environment";
<a (click)="openIdentifiersModal()" class="view-more-less-link">View all</a> <a (click)="openIdentifiersModal()" class="view-more-less-link">View all</a>
</div> </div>
<modal-alert #identifiersModal> <modal-alert *ngIf="!isMobile" #identifiersModal>
<div class="uk-text-small"> <div class="uk-text-small">
<ng-container *ngTemplateOutlet="identifiers_template; context: { modal: true}"></ng-container> <ng-container *ngTemplateOutlet="identifiers_template; context: { modal: true}"></ng-container>
</div> </div>
</modal-alert> </modal-alert>
<fs-modal *ngIf="isMobile" #identifiersModal>
<div class="uk-text-small">
<ng-container *ngTemplateOutlet="identifiers_template; context: { modal: true}"></ng-container>
</div>
</fs-modal>
` `
}) })
export class ShowIdentifiersComponent implements AfterViewInit { export class ShowIdentifiersComponent implements AfterViewInit {
@Input() isMobile: boolean = false;
@Input() identifiers: Map<string, string[]>; @Input() identifiers: Map<string, string[]>;
@Input() showViewAll: boolean = false; @Input() showViewAll: boolean = false;
large: Map<string, boolean> = new Map<string, boolean>(); large: Map<string, boolean> = new Map<string, boolean>();
@ -121,9 +128,15 @@ export class ShowIdentifiersComponent implements AfterViewInit {
} }
public openIdentifiersModal() { public openIdentifiersModal() {
this.identifiersModal.cancelButton = false; if(this.isMobile) {
this.identifiersModal.okButton = false; this.identifiersModal.okButton = false;
this.identifiersModal.alertTitle = "Persistent Identifiers"; this.identifiersModal.title = "Persistent Identifiers";
this.identifiersModal.open(); this.identifiersModal.open();
} else {
this.identifiersModal.cancelButton = false;
this.identifiersModal.okButton = false;
this.identifiersModal.alertTitle = "Persistent Identifiers";
this.identifiersModal.open();
}
} }
} }

View File

@ -472,12 +472,13 @@
[entityType]="getTypeName()" [types]="resultLandingInfo.types" [entityType]="getTypeName()" [types]="resultLandingInfo.types"
[date]="resultLandingInfo.dateofacceptance" [embargoEndDate]="resultLandingInfo.embargoEndDate" [date]="resultLandingInfo.dateofacceptance" [embargoEndDate]="resultLandingInfo.embargoEndDate"
[publisher]="resultLandingInfo.publisher" [journal]="resultLandingInfo.journal" [publisher]="resultLandingInfo.publisher" [journal]="resultLandingInfo.journal"
[languages]="resultLandingInfo.languages" [programmingLanguages]="resultLandingInfo.programmingLanguages"> [languages]="resultLandingInfo.languages" [programmingLanguages]="resultLandingInfo.programmingLanguages"
[isMobile]="true">
</landing-header> </landing-header>
<div class="uk-text-small"> <div class="uk-text-small">
<!-- Identifiers --> <!-- Identifiers -->
<div *ngIf="resultLandingInfo.identifiers && resultLandingInfo.identifiers.size > 0" class="uk-margin-small-top"> <div *ngIf="resultLandingInfo.identifiers && resultLandingInfo.identifiers.size > 0" class="uk-margin-small-top">
<showIdentifiers [identifiers]="resultLandingInfo.identifiers" [showViewAll]="true"></showIdentifiers> <showIdentifiers [identifiers]="resultLandingInfo.identifiers" [showViewAll]="true" [isMobile]="true"></showIdentifiers>
</div> </div>
<!-- SDGs --> <!-- SDGs -->
<div *ngIf="resultLandingInfo.sdg && resultLandingInfo.sdg.length > 0 && !viewAllMobile" class="uk-margin-small-top"> <div *ngIf="resultLandingInfo.sdg && resultLandingInfo.sdg.length > 0 && !viewAllMobile" class="uk-margin-small-top">
@ -849,7 +850,7 @@
[otherSubjects]="resultLandingInfo.otherSubjects" [otherSubjects]="resultLandingInfo.otherSubjects"
[classifiedSubjects]="resultLandingInfo.classifiedSubjects" [classifiedSubjects]="resultLandingInfo.classifiedSubjects"
[eoscSubjects]="resultLandingInfo.eoscSubjects" [eoscSubjects]="resultLandingInfo.eoscSubjects"
[isMobile]="isMobile" [isMobile]="isMobile">
[viewAllSubjects]="viewAllMobile=='subjects'" [viewAllSubjects]="viewAllMobile=='subjects'"
[viewAllClassifiedSubjects]="viewAllMobile=='classifiedSubjects'" [viewAllClassifiedSubjects]="viewAllMobile=='classifiedSubjects'"
(viewAllClicked)="viewAllSubjectsMobileClicked($event)"> (viewAllClicked)="viewAllSubjectsMobileClicked($event)">

View File

@ -88,18 +88,27 @@ import {properties} from "../../../../environments/environment";
</div> </div>
</div> </div>
<modal-alert #authorsModal> <modal-alert *ngIf="!isMobile" #authorsModal>
<div class="uk-text-small uk-text-emphasis uk-grid uk-grid-column-collapse uk-grid-row-small" uk-grid> <div class="uk-text-small uk-text-emphasis uk-grid uk-grid-column-collapse uk-grid-row-small" uk-grid>
<ng-container *ngFor="let author of authors; let i=index"> <ng-container *ngFor="let author of authors; let i=index">
<ng-container *ngTemplateOutlet="author_template; context: { author: author, i:i}"></ng-container> <ng-container *ngTemplateOutlet="author_template; context: { author: author, i:i}"></ng-container>
</ng-container> </ng-container>
</div> </div>
</modal-alert> </modal-alert>
<fs-modal *ngIf="isMobile" #authorsModal>
<div class="uk-text-small uk-text-emphasis uk-grid uk-grid-column-collapse uk-grid-row-small" uk-grid>
<ng-container *ngFor="let author of authors; let i=index">
<ng-container *ngTemplateOutlet="author_template; context: { author: author, i:i}"></ng-container>
</ng-container>
</div>
</fs-modal>
` `
}) })
export class ShowAuthorsComponent { export class ShowAuthorsComponent {
@Input() isMobile: boolean = false;
@Input() authors: Author[]; @Input() authors: Author[];
@Input() isSticky: boolean = false; @Input() isSticky: boolean = false;
@Input() authorsLimit: number = 7; @Input() authorsLimit: number = 7;
@ -137,10 +146,16 @@ export class ShowAuthorsComponent {
} }
public openAuthorsModal() { public openAuthorsModal() {
this.authorsModal.cancelButton = false; if (this.isMobile) {
this.authorsModal.okButton = false; this.authorsModal.okButton = false;
this.authorsModal.alertTitle = "Authors"; this.authorsModal.title = "Authors";
this.authorsModal.open(); this.authorsModal.open();
} else {
this.authorsModal.cancelButton = false;
this.authorsModal.okButton = false;
this.authorsModal.alertTitle = "Authors";
this.authorsModal.open();
}
} }
copyToClipboard(element: HTMLInputElement) { copyToClipboard(element: HTMLInputElement) {

View File

@ -5,10 +5,11 @@ import {RouterModule} from '@angular/router';
import {ShowAuthorsComponent} from './showAuthors.component'; import {ShowAuthorsComponent} from './showAuthors.component';
import {AlertModalModule} from "../modal/alertModal.module"; import {AlertModalModule} from "../modal/alertModal.module";
import {FullScreenModalModule} from "../modal/full-screen-modal/full-screen-modal.module";
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, FormsModule, RouterModule, AlertModalModule CommonModule, FormsModule, RouterModule, AlertModalModule, FullScreenModalModule
], ],
declarations: [ declarations: [
ShowAuthorsComponent ShowAuthorsComponent