Fix community logo url upload. Update library

This commit is contained in:
Konstantinos Triantafyllou 2021-11-12 12:37:01 +02:00
parent 5d731ea8b8
commit 26ea5cc265
5 changed files with 7 additions and 6 deletions

View File

@ -200,7 +200,7 @@ export class AppComponent implements OnInit {
this.userMenuItems.push(new MenuItem("", "User information", "", "/user-info", false, [], [], {}));
}
if (this.community) {
this.headerLogoUrl = this.community.logoUrl;
this.headerLogoUrl = this.community.getLogoUrl();
this.headerUrl = 'https://' + ((properties.environment !== 'production')?'beta.':'') + this.community.communityId + '.openaire.eu';
this.menuHeader = {
route: "/" + this.community.communityId,

@ -1 +1 @@
Subproject commit 3632510e387b3a83f8d8e0f27cd796912a19c741
Subproject commit 79e6748d7f4ed7da329ed7d2678a88320a2bf1a5

View File

@ -200,8 +200,8 @@ export class EditCommunityComponent {
this.communityFb.get('shortName').enable();
this.subscriptions.push(this.utilsService.uploadPhoto(this.properties.utilsService + "/upload/stakeholder/" + encodeURIComponent(this.communityFb.value.communityId), this.file).subscribe(res => {
this.deletePhoto();
this.removePhoto();
this.communityFb.get('logoUrl').setValue(res.filename);
this.removePhoto();
this.saveCommunity(callback, errorCallback);
}, error => {
this.uploadError = "An error has been occurred during upload your image. Try again later";
@ -311,7 +311,7 @@ export class EditCommunityComponent {
}
public deletePhoto() {
if (this.community.logoUrl) {
if (this.community.logoUrl && this.community.isUpload) {
this.subscriptions.push(this.utilsService.deletePhoto(this.properties.utilsService + '/delete/stakeholder/' + this.community.logoUrl).subscribe());
}
}

View File

@ -69,7 +69,7 @@ type Tab = 'all' | 'communities' | 'ris';
{{community.shortTitle}}
</div>
<div *ngIf="community.logoUrl" class="logo uk-margin-top uk-margin-bottom">
<img [src]="community.logoUrl | urlPrefix">
<img [src]="community.getLogoUrl() | urlPrefix">
</div>
</a>
</div>
@ -110,6 +110,7 @@ export class ManageCommunitiesComponent implements OnInit, OnDestroy {
communities => {
this.communities = [];
this.ris = [];
console.log(communities);
communities.forEach(community => {
if (Session.isPortalAdministrator(this.user) || Session.isCommunityCurator(this.user) || Session.isManager('community', community.communityId, this.user)) {
if (community.type === 'community') {

@ -1 +1 @@
Subproject commit 318c6560565a7a0da818385de27ebb430b22aea3
Subproject commit 999d3833d3805534677aa741a3759e26e09b50f2