Fix curator full screen modal

This commit is contained in:
Konstantinos Triantafyllou 2022-07-04 22:11:59 +03:00
parent 0ce5eace2c
commit 4d8897d743
4 changed files with 14 additions and 20 deletions

View File

@ -37,7 +37,7 @@
Biography Biography
</div> </div>
<div> <div>
<div *ngIf="!viewingMore">{{_format(curator.bio)}}</div> <div *ngIf="!viewingMore">{{format(curator.bio)}}</div>
<div *ngIf="viewingMore">{{curator.bio}}</div> <div *ngIf="viewingMore">{{curator.bio}}</div>
<div *ngIf="curator.bio.length >= maxCharacters" class="uk-text-right uk-margin-small-top"> <div *ngIf="curator.bio.length >= maxCharacters" class="uk-text-right uk-margin-small-top">
<a *ngIf="curator.bio.length >= maxCharacters" <a *ngIf="curator.bio.length >= maxCharacters"
@ -100,13 +100,9 @@
</div> </div>
</div> </div>
</ng-template> </ng-template>
<fs-modal #fsModal classTitle="">
<fs-modal #fsModal>
<div *ngIf="curatorInModal" class="uk-width-1-1 uk-height-1-1"> <div *ngIf="curatorInModal" class="uk-width-1-1 uk-height-1-1">
<div class="uk-container uk-container-large uk-section"> <div class="uk-container uk-container-large uk-section">
<h2 class="uk-text-capitalize uk-text-center">
{{communityId}} Curator
</h2>
<div class="uk-margin-large-top uk-grid uk-grid-large" uk-grid> <div class="uk-margin-large-top uk-grid uk-grid-large" uk-grid>
<div class="uk-width-1-3@m"> <div class="uk-width-1-3@m">
<h2> <h2>

View File

@ -14,6 +14,7 @@ import {Subscription} from "rxjs";
import {properties} from "../../environments/environment"; import {properties} from "../../environments/environment";
import {UserRegistryService} from "../openaireLibrary/services/user-registry.service"; import {UserRegistryService} from "../openaireLibrary/services/user-registry.service";
import {FullScreenModalComponent} from '../openaireLibrary/utils/modal/full-screen-modal/full-screen-modal.component'; import {FullScreenModalComponent} from '../openaireLibrary/utils/modal/full-screen-modal/full-screen-modal.component';
import {CommunityInfo} from "../openaireLibrary/connect/community/communityInfo";
@Component({ @Component({
selector: 'curators', selector: 'curators',
@ -22,7 +23,7 @@ import {FullScreenModalComponent} from '../openaireLibrary/utils/modal/full-scre
}) })
export class CuratorsComponent { export class CuratorsComponent {
@Input() longView = true; @Input() longView = true;
communityId = null; community: CommunityInfo;
public downloadUrl = null; public downloadUrl = null;
public showLoading = true; public showLoading = true;
@ -69,16 +70,16 @@ export class CuratorsComponent {
if (!this.longView) { if (!this.longView) {
this.subs.push(this.communityService.getCommunityAsObservable().subscribe(community => { this.subs.push(this.communityService.getCommunityAsObservable().subscribe(community => {
if (community) { if (community) {
this.communityId = community.communityId; this.community = community;
this.getCurators(); this.getCurators();
} }
})); }));
} else { } else {
this.subs.push(this.communityService.getCommunityAsObservable().subscribe(community => { this.subs.push(this.communityService.getCommunityAsObservable().subscribe(community => {
if (community) { if (community) {
this.communityId = community.communityId; this.community = community;
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.subs.push(this._piwikService.trackView(this.properties, this.pageTitle, PiwikHelper.getSiteId(this.communityId)).subscribe()); this.subs.push(this._piwikService.trackView(this.properties, this.pageTitle, PiwikHelper.getSiteId(this.community.communityId)).subscribe());
} }
this.url = this.properties.domain + this._router.url; this.url = this.properties.domain + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url); this.seoService.createLinkForCanonicalURL(this.url);
@ -100,7 +101,7 @@ export class CuratorsComponent {
} }
private getCurators() { private getCurators() {
this.subs.push(this.curatorsService.getCurators(this.properties, this.communityId).subscribe(curators => { this.subs.push(this.curatorsService.getCurators(this.properties, this.community.communityId).subscribe(curators => {
this.curators = curators; this.curators = curators;
for (let i = 0; i < this.curators.length; i++) { for (let i = 0; i < this.curators.length; i++) {
this.showMore[i] = false; this.showMore[i] = false;
@ -110,13 +111,13 @@ export class CuratorsComponent {
} }
private getPageContents() { private getPageContents() {
this.subs.push(this.helper.getPageHelpContents(this.properties, this.communityId, this._router.url).subscribe(contents => { this.subs.push(this.helper.getPageHelpContents(this.properties, this.community.communityId, this._router.url).subscribe(contents => {
this.pageContents = contents; this.pageContents = contents;
})); }));
} }
private getDivContents() { private getDivContents() {
this.subs.push(this.helper.getDivHelpContents(this.properties, this.communityId, this._router.url).subscribe(contents => { this.subs.push(this.helper.getDivHelpContents(this.properties, this.community.communityId, this._router.url).subscribe(contents => {
this.divContents = contents; this.divContents = contents;
})); }));
} }
@ -125,7 +126,7 @@ export class CuratorsComponent {
this.showMore[index] = !this.showMore[index]; this.showMore[index] = !this.showMore[index];
} }
_format(name: string) { format(name: string) {
if (name) { if (name) {
return (((name).length > this.maxCharacters) ? (name.substring(0, (this.maxCharacters - ('...').length)) + '...') : name); return (((name).length > this.maxCharacters) ? (name.substring(0, (this.maxCharacters - ('...').length)) + '...') : name);
} else { } else {
@ -139,12 +140,9 @@ export class CuratorsComponent {
public openFsModal(curator) { public openFsModal(curator) {
this.curatorInModal = curator; this.curatorInModal = curator;
this.fsModal.title = this.community.shortTitle + ' Curator';
this.fsModal.open(); this.fsModal.open();
} }
public closeFsModal() {
this.fsModal.close();
}
private updateDescription(description: string) { private updateDescription(description: string) {
this._meta.updateTag({content: description}, "name='description'"); this._meta.updateTag({content: description}, "name='description'");

@ -1 +1 @@
Subproject commit ffd997dfcb94725c1a17097fe2c6224f0c272cca Subproject commit de829d2bccc33b4231c1c1349dd449a2dfb1f8c4

@ -1 +1 @@
Subproject commit 25f7f7dd34fae80d1e2e25935c2f2772c5800e70 Subproject commit 8f8b85e69d5c505ed59b12b8b70348096f339775