From 26ea5cc265354bccf961ea89168a6632be77e0de Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Fri, 12 Nov 2021 12:37:01 +0200 Subject: [PATCH] Fix community logo url upload. Update library --- src/app/app.component.ts | 2 +- src/app/openaireLibrary | 2 +- .../profile/edit-community/edit-community.component.ts | 4 ++-- .../pages/manage-communities/manage-communities.component.ts | 3 ++- src/assets/common-assets | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index ab09232..66dc3f4 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -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, diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index 3632510..79e6748 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 3632510e387b3a83f8d8e0f27cd796912a19c741 +Subproject commit 79e6748d7f4ed7da329ed7d2678a88320a2bf1a5 diff --git a/src/app/pages/community-info/profile/edit-community/edit-community.component.ts b/src/app/pages/community-info/profile/edit-community/edit-community.component.ts index 31e8f50..1cd445e 100644 --- a/src/app/pages/community-info/profile/edit-community/edit-community.component.ts +++ b/src/app/pages/community-info/profile/edit-community/edit-community.component.ts @@ -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()); } } diff --git a/src/app/pages/manage-communities/manage-communities.component.ts b/src/app/pages/manage-communities/manage-communities.component.ts index d445255..5ee0388 100644 --- a/src/app/pages/manage-communities/manage-communities.component.ts +++ b/src/app/pages/manage-communities/manage-communities.component.ts @@ -69,7 +69,7 @@ type Tab = 'all' | 'communities' | 'ris'; {{community.shortTitle}} @@ -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') { diff --git a/src/assets/common-assets b/src/assets/common-assets index 318c656..999d383 160000 --- a/src/assets/common-assets +++ b/src/assets/common-assets @@ -1 +1 @@ -Subproject commit 318c6560565a7a0da818385de27ebb430b22aea3 +Subproject commit 999d3833d3805534677aa741a3759e26e09b50f2