[Connect | Trunk]: Add urlPrefix on affiliations, curators and community logo

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@60582 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2021-03-04 13:46:40 +00:00
parent 87ffb845b7
commit a17b8bb887
9 changed files with 20 additions and 19 deletions

View File

@ -5,7 +5,8 @@
[ngClass]="(!fullView)?'uk-card-body':'uk-card-media-top uk-padding-small'"> [ngClass]="(!fullView)?'uk-card-body':'uk-card-media-top uk-padding-small'">
<div class="uk-align-center"> <div class="uk-align-center">
<img *ngIf="organization.logo_url != null && organization.logo_url != '' " <img *ngIf="organization.logo_url != null && organization.logo_url != '' "
src="{{urlPrefix(organization.logo_url) + organization.logo_url}}" alt="{{(organization.name)?organization.name:''}} logo"> [src]="organization.logo_url | urlPrefix"
alt="{{(organization.name)?organization.name:''}} logo">
<span *ngIf="organization.logo_url == null || organization.logo_url == ''" class="uk-icon"> <span *ngIf="organization.logo_url == null || organization.logo_url == ''" class="uk-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" icon="image" ratio="2.5"><circle cx="16.1" cy="6.1" <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" icon="image" ratio="2.5"><circle cx="16.1" cy="6.1"
r="1.1"></circle><rect r="1.1"></circle><rect
@ -35,7 +36,7 @@
<div *ngFor="let affiliation of affiliations;"> <div *ngFor="let affiliation of affiliations;">
<div class="uk-card portalSearchCard"> <div class="uk-card portalSearchCard">
<a *ngIf="affiliation.website_url" target="_blank" [href]="urlPrefix(affiliation.website_url) + affiliation.website_url" class="affiliation-content"> <a *ngIf="affiliation.website_url" target="_blank" [href]="affiliation.website_url | urlPrefix" class="affiliation-content">
<ng-container *ngTemplateOutlet="card; context: { organization: affiliation, fullView: true}"></ng-container> <ng-container *ngTemplateOutlet="card; context: { organization: affiliation, fullView: true}"></ng-container>
</a> </a>
<span *ngIf="!affiliation.website_url" class="affiliation-content"> <span *ngIf="!affiliation.website_url" class="affiliation-content">

View File

@ -87,11 +87,7 @@ export class AffiliationsComponent {
}); });
this.affiliationService.clearSubscriptions(); this.affiliationService.clearSubscriptions();
} }
public urlPrefix(url: string): string {
return StringUtils.urlPrefix(url);
}
private updateDescription(description: string) { private updateDescription(description: string) {
this._meta.updateTag({content: description}, "name='description'"); this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'"); this._meta.updateTag({content: description}, "property='og:description'");

View File

@ -10,11 +10,12 @@ import {CommonModule} from "@angular/common";
import {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module"; import {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module";
import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module"; import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module";
import {PiwikServiceModule} from "../openaireLibrary/utils/piwik/piwikService.module"; import {PiwikServiceModule} from "../openaireLibrary/utils/piwik/piwikService.module";
import {UrlPrefixModule} from "../openaireLibrary/utils/pipes/url-prefix.module";
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, RouterModule, Schema2jsonldModule, SEOServiceModule, CommonModule, RouterModule, Schema2jsonldModule, SEOServiceModule,
PiwikServiceModule PiwikServiceModule, UrlPrefixModule
], ],
declarations: [ declarations: [
AffiliationsComponent AffiliationsComponent

View File

@ -15,6 +15,7 @@ import {Header} from "./openaireLibrary/sharedComponents/navigationBar.component
import {Subscriber} from "rxjs"; import {Subscriber} from "rxjs";
import {CommunityService} from "./openaireLibrary/connect/community/community.service"; import {CommunityService} from "./openaireLibrary/connect/community/community.service";
import {CommunityInfo} from "./openaireLibrary/connect/community/communityInfo"; import {CommunityInfo} from "./openaireLibrary/connect/community/communityInfo";
import {StringUtils} from "./openaireLibrary/utils/string-utils.class";
@Component({ @Component({
//changeDetection: ChangeDetectionStrategy.Default, //changeDetection: ChangeDetectionStrategy.Default,
@ -175,7 +176,7 @@ export class AppComponent {
this.community = { this.community = {
id: community.communityId, id: community.communityId,
name: (community.shortTitle) ? community.shortTitle : community.title, name: (community.shortTitle) ? community.shortTitle : community.title,
logoUrl: community.logoUrl, logoUrl: (community.isUpload) ? (properties.utilsService + '/download/' + community.logoUrl):(StringUtils.urlPrefix(community.logoUrl) + community.logoUrl),
description:community.description description:community.description
}; };
this.header = { this.header = {

View File

@ -12,7 +12,11 @@
<div class="uk-card-media-top uk-padding uk-padding-remove-vertical uk-flex uk-flex-center uk-flex-middle"> <div class="uk-card-media-top uk-padding uk-padding-remove-vertical uk-flex uk-flex-center uk-flex-middle">
<a *ngIf="directLink" [href]="getCommunityPageUrl()" target="_blank"> <a *ngIf="directLink" [href]="getCommunityPageUrl()" target="_blank">
<div class="community"> <div class="community">
<img *ngIf="community.logoUrl != null && community.logoUrl != ''" src="{{community.logoUrl}}" <img *ngIf="community.logoUrl && community.isUpload && community.logoUrl != ''"
[src]="properties.utilsService + '/download/' + community.logoUrl"
alt="{{(community.title)?community.title:community.shortTitle}} logo">
<img *ngIf="community.logoUrl && !community.isUpload && community.logoUrl != ''"
[src]="community.logoUrl | urlPrefix"
alt="{{(community.title)?community.title:community.shortTitle}} logo"> alt="{{(community.title)?community.title:community.shortTitle}} logo">
<span *ngIf="community.logoUrl == null || community.logoUrl == ''" class="uk-icon"> <span *ngIf="community.logoUrl == null || community.logoUrl == ''" class="uk-icon">
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="2.5"> <circle fill="none" stroke="#000" <svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="2.5"> <circle fill="none" stroke="#000"

View File

@ -8,11 +8,12 @@ import {BrowseCommunityComponent} from './browse-community.component';
import {SearchFormModule} from '../../openaireLibrary/searchPages/searchUtils/searchForm.module'; import {SearchFormModule} from '../../openaireLibrary/searchPages/searchUtils/searchForm.module';
import {ManageModule} from '../../openaireLibrary/utils/manage/manage.module'; import {ManageModule} from '../../openaireLibrary/utils/manage/manage.module';
import {AlertModalModule} from "../../openaireLibrary/utils/modal/alertModal.module"; import {AlertModalModule} from "../../openaireLibrary/utils/modal/alertModal.module";
import {UrlPrefixModule} from "../../openaireLibrary/utils/pipes/url-prefix.module";
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, FormsModule, RouterModule, CommonModule, FormsModule, RouterModule,
SearchFormModule, ManageModule, AlertModalModule SearchFormModule, ManageModule, AlertModalModule, UrlPrefixModule
], ],
declarations: [ declarations: [
BrowseCommunityComponent BrowseCommunityComponent

View File

@ -56,11 +56,11 @@
</div> </div>
<div *ngFor="let affiliation of curator.affiliations"> <div *ngFor="let affiliation of curator.affiliations">
<span *ngIf="!affiliation.website_url"> <span *ngIf="!affiliation.website_url">
<img [src]="urlPrefix(affiliation.logo_url) + affiliation.logo_url" [alt]="affiliation.name"> <img [src]="affiliation.logo_url | urlPrefix" [alt]="affiliation.name">
</span> </span>
<a *ngIf="affiliation.website_url" <a *ngIf="affiliation.website_url"
target="_blank" [href]="urlPrefix(affiliation.website_url) + affiliation.website_url"> target="_blank" [href]="affiliation.website_url | urlPrefix">
<img [src]="urlPrefix(affiliation.logo_url) + affiliation.logo_url" [alt]="affiliation.name"> <img [src]="affiliation.logo_url | urlPrefix" [alt]="affiliation.name">
</a> </a>
</div> </div>
</div> </div>

View File

@ -132,10 +132,6 @@ export class CuratorsComponent {
} }
} }
public urlPrefix(url: string): string {
return StringUtils.urlPrefix(url);
}
private updateDescription(description: string) { private updateDescription(description: string) {
this._meta.updateTag({content: description}, "name='description'"); this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'"); this._meta.updateTag({content: description}, "property='og:description'");

View File

@ -12,13 +12,14 @@ import {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2js
import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module"; import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module";
import {PiwikServiceModule} from "../openaireLibrary/utils/piwik/piwikService.module"; import {PiwikServiceModule} from "../openaireLibrary/utils/piwik/piwikService.module";
import {BreadcrumbsModule} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.module"; import {BreadcrumbsModule} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.module";
import {UrlPrefixModule} from "../openaireLibrary/utils/pipes/url-prefix.module";
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, FormsModule, RouterModule, CommonModule, FormsModule, RouterModule,
CuratorsRoutingModule, AffiliationsModule, HelperModule, CuratorsRoutingModule, AffiliationsModule, HelperModule,
Schema2jsonldModule, SEOServiceModule, PiwikServiceModule, Schema2jsonldModule, SEOServiceModule, PiwikServiceModule,
BreadcrumbsModule BreadcrumbsModule, UrlPrefixModule
], ],
declarations: [ declarations: [
CuratorsComponent CuratorsComponent