From 72f1f8c5be6c1b19e0aebeb32e29ea6b92b65a00 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Tue, 20 Feb 2024 12:23:04 +0200 Subject: [PATCH 1/7] [develop] update submodules --- src/app/openaireLibrary | 2 +- src/assets/common-assets | 2 +- src/assets/openaire-theme | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index 5195306..35323bd 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 5195306ee6dfd664b207c3536234f43adc39ad33 +Subproject commit 35323bd7441d7d21ce785aade0002ee02fdc402a diff --git a/src/assets/common-assets b/src/assets/common-assets index 6cef9eb..651102a 160000 --- a/src/assets/common-assets +++ b/src/assets/common-assets @@ -1 +1 @@ -Subproject commit 6cef9ebed0db7ecbcca023bae824239106907960 +Subproject commit 651102a5ba049b71bed8eb6a85a8d02cefcb24cc diff --git a/src/assets/openaire-theme b/src/assets/openaire-theme index 419d7e2..37639ea 160000 --- a/src/assets/openaire-theme +++ b/src/assets/openaire-theme @@ -1 +1 @@ -Subproject commit 419d7e200b60639ebcb9660c0e77b06a02504caa +Subproject commit 37639eab68c63a506b7df10c42e3379c4a05d94d -- 2.17.1 From 159a175089c095af7fd593ec0717ab8e9a836d81 Mon Sep 17 00:00:00 2001 From: argirok Date: Thu, 29 Feb 2024 09:35:33 +0200 Subject: [PATCH 2/7] [develop | DONE | ADDED] add /health-check method --- server.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/server.ts b/server.ts index 569bb24..7f54264 100644 --- a/server.ts +++ b/server.ts @@ -198,6 +198,30 @@ export function app() { buildCss(req.params.id, req.params.suffix, variables); res.status(200).send({code: 200, message: 'CSS build for ' + req.params.id + ' layout was successful'}); }); + server.get('/health-check', async (_req, res, _next) => { + var uptime = process.uptime(); + const date = new Date(uptime*1000); + const days = date.getUTCDate() - 1, + hours = date.getUTCHours(), + minutes = date.getUTCMinutes(), + seconds = date.getUTCSeconds(), + milliseconds = date.getUTCMilliseconds(); + + + const healthcheck = { + uptime: days + " days, " + hours + " hours, " + minutes + " minutes, " + seconds + " seconds, " + milliseconds + " milliseconds", + message: 'OK', + timestamp: new Date() + }; + try { + res.send(healthcheck); + } catch (error) { + healthcheck.message = error; + res.status(503).send(); + } + }); + + // Example Express Rest API endpoints // server.get('/api/**', (req, res) => { }); // Serve static files from /browser -- 2.17.1 From 9d54e942b72a2922112a8eac2ccf270e07bd1b4a Mon Sep 17 00:00:00 2001 From: argirok Date: Mon, 4 Mar 2024 12:32:55 +0200 Subject: [PATCH 3/7] [develop | DONE | CHANGED] remove default properties footer in case of community dashboard --- src/app/app.component.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 9f01a3f..bbbf31b 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -376,6 +376,7 @@ export class AppComponent implements OnInit, OnDestroy { if (this.community && !ConnectHelper.isPrivate(this.community, this.user)) { this.communityId = this.community.communityId; this.initAdminToolCommunity(this.communityId); + this.properties.footerGrantText = ""; // this.header = { // url: 'https://' + (this.properties.environment == 'beta' ? 'beta.' : '') + this.community.id + '.openaire.eu', route: "/", -- 2.17.1 From 73b9a03d60ee37e3d8cbf67ae558bbb2652b243d Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 6 Mar 2024 11:17:01 +0200 Subject: [PATCH 4/7] [develop | DONE | ADDED] create CommunityAccess guard, replace isCommunity guard --- src/app/app-routing.module.ts | 82 +++++++++++++------------- src/app/app.component.ts | 2 + src/app/app.module.ts | 4 +- src/app/utils/communityAccess.guard.ts | 77 ++++++++++++++++++++++++ 4 files changed, 122 insertions(+), 43 deletions(-) create mode 100644 src/app/utils/communityAccess.guard.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 6fc032e..7f293c6 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -2,7 +2,7 @@ import {NgModule} from '@angular/core'; import {RouterModule, Routes} from '@angular/router'; import {OpenaireErrorPageComponent} from './error/errorPage.component'; import {PageURLResolverComponent} from "./openaireLibrary/utils/pageURLResolver.component"; -import {IsCommunity} from "./openaireLibrary/connect/communityGuard/isCommunity.guard"; +import {CommunityAccessGuard} from "./utils/communityAccess.guard"; const routes: Routes = [ // ORCID Pages @@ -40,7 +40,7 @@ const routes: Routes = [ { path: 'content', loadChildren: () => import('./content/contentPage.module').then(m => m.ContentPageModule), - data: {hasQuickContact: false}, canActivate: [IsCommunity] + data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard] }, { path: 'sdgs', @@ -55,22 +55,22 @@ const routes: Routes = [ { path: 'organizations', loadChildren: () => import('./htmlPages/organizations/organizationsPage.module').then(m => m.OrganizationsPageModule), - data: {hasQuickContact: false}, canActivate: [IsCommunity] + data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard] }, { path: 'publications', loadChildren: () => import('./htmlPages/publications/publications-page.module').then(m => m.PublicationsPageModule), - data: {hasQuickContact: false}, canActivate: [IsCommunity] + data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard] }, { path: 'projects', loadChildren: () => import('./htmlPages/projects/projectsPage.module').then(m => m.ProjectsPageModule), - data: {hasQuickContact: false}, canActivate: [IsCommunity] + data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard] }, { path: 'national-bulletins', loadChildren: () => import('./htmlPages/nationalBulletins/nationalBulletinsPage.module').then(m => m.NaionalBulletinPageModule), - data: {hasQuickContact: false}, canActivate: [IsCommunity] + data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard] }, { path: 'faqs', @@ -88,24 +88,24 @@ const routes: Routes = [ // { // path: '', // loadChildren: () => import('./htmlPages/featured/featuredPage.module').then(m => m.FeaturedPageModule), - // data: {hasQuickContact: false}, canActivateChild: [IsCommunity], + // data: {hasQuickContact: false}, canActivateChild: [CommunityAccessGuard], // }, // { // path: '**', // loadChildren: () => import('./htmlPages/featured/featuredPage.module').then(m => m.FeaturedPageModule), - // data: {hasQuickContact: false}, canActivateChild: [IsCommunity], + // data: {hasQuickContact: false}, canActivateChild: [CommunityAccessGuard], // }, // ] // }, { path: 'curators', loadChildren: () => import('./curators/curators.module').then(m => m.CuratorsModule), - data: {hasQuickContact: false}, canActivate: [IsCommunity] + data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard] }, { path: 'subjects', loadChildren: () => import('./subjects/subjects.module').then(m => m.SubjectsModule), - data: {hasQuickContact: false}, canActivate: [IsCommunity] + data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard] }, { path: 'myCommunities', @@ -114,7 +114,7 @@ const routes: Routes = [ { path: 'develop', loadChildren: () => import('./develop/develop.module').then(m => m.DevelopModule), - data: {hasQuickContact: false}, canActivate: [IsCommunity] + data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard] }, /** Testing Page for help contents */ {path: 'helper-test', loadChildren: () => import('./helper-test/helper-test.module').then(m => m.HelperTestModule)}, @@ -122,41 +122,41 @@ const routes: Routes = [ { path: 'search/result', loadChildren: () => import('./landingPages/result/libResult.module').then(m => m.LibResultModule), - data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [IsCommunity] + data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [CommunityAccessGuard] }, { path: 'search/publication', loadChildren: () => import('./landingPages/publication/libPublication.module').then(m => m.LibPublicationModule), - data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [IsCommunity] + data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [CommunityAccessGuard] }, { path: 'search/dataset', loadChildren: () => import('./landingPages/dataset/libDataset.module').then(m => m.LibDatasetModule), - data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [IsCommunity] + data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [CommunityAccessGuard] }, { path: 'search/software', loadChildren: () => import('./landingPages/software/libSoftware.module').then(m => m.LibSoftwareModule), - data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [IsCommunity] + data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [CommunityAccessGuard] }, { path: 'search/other', loadChildren: () => import('./landingPages/orp/libOrp.module').then(m => m.LibOrpModule), - data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [IsCommunity] + data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [CommunityAccessGuard] }, { path: 'search/project', loadChildren: () => import('./landingPages/project/libProject.module').then(m => m.LibProjectModule), - data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [IsCommunity] + data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [CommunityAccessGuard] }, { path: 'search/dataprovider', loadChildren: () => import('././landingPages/dataProvider/libDataProvider.module').then(m => m.LibDataProviderModule), - data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [IsCommunity] + data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [CommunityAccessGuard] }, { path: 'search/organization', loadChildren: () => import('./landingPages/organization/libOrganization.module').then(m => m.LibOrganizationModule), - data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [IsCommunity] + data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [CommunityAccessGuard] }, /** Search Pages */ {path: 'search/find', redirectTo: 'search/find/research-outcomes', pathMatch: 'full'}, @@ -168,86 +168,86 @@ const routes: Routes = [ { path: 'search/find/research-outcomes', loadChildren: () => import('./searchPages/simple/searchResearchResults.module').then(m => m.OpenaireSearchResearchResultsModule), - data: {hasQuickContact: false}, canActivate: [IsCommunity] + data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard] }, { path: 'search/find/publications', component: PageURLResolverComponent, data: {hasQuickContact: false}, - canActivate: [IsCommunity] + canActivate: [CommunityAccessGuard] }, { path: 'search/find/datasets', component: PageURLResolverComponent, data: {hasQuickContact: false}, - canActivate: [IsCommunity] + canActivate: [CommunityAccessGuard] }, { path: 'search/find/software', component: PageURLResolverComponent, data: {hasQuickContact: false}, - canActivate: [IsCommunity] + canActivate: [CommunityAccessGuard] }, { path: 'search/find/other', component: PageURLResolverComponent, data: {hasQuickContact: false}, - canActivate: [IsCommunity] + canActivate: [CommunityAccessGuard] }, { path: 'search/find/projects', loadChildren: () => import('./searchPages/simple/searchProjects.module').then(m => m.LibSearchProjectsModule), - data: {hasQuickContact: false}, canActivate: [IsCommunity] + data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard] }, { path: 'search/find/dataproviders', loadChildren: () => import('./searchPages/simple/searchDataProviders.module').then(m => m.LibSearchDataProvidersModule), - data: {hasQuickContact: false}, canActivate: [IsCommunity] + data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard] }, /** Advanced Search Pages */ { path: 'search/advanced/research-outcomes', loadChildren: () => import('./searchPages/advanced/searchResearchResults.module').then(m => m.OpenaireAdvancedSearchResearchResultsModule), - data: {hasQuickContact: false}, canActivate: [IsCommunity] + data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard] }, { path: 'search/advanced/publications', component: PageURLResolverComponent, data: {hasQuickContact: false}, - canActivate: [IsCommunity] + canActivate: [CommunityAccessGuard] }, { path: 'search/advanced/datasets', component: PageURLResolverComponent, data: {hasQuickContact: false}, - canActivate: [IsCommunity] + canActivate: [CommunityAccessGuard] }, { path: 'search/advanced/software', component: PageURLResolverComponent, data: {hasQuickContact: false}, - canActivate: [IsCommunity] + canActivate: [CommunityAccessGuard] }, { path: 'search/advanced/other', component: PageURLResolverComponent, data: {hasQuickContact: false}, - canActivate: [IsCommunity] + canActivate: [CommunityAccessGuard] }, { path: 'search/advanced/organizations', loadChildren: () => import('./searchPages/advanced/advancedSearchOrganizations.module').then(m => m.LibAdvancedSearchOrganizationsModule), - data: {hasQuickContact: false}, canActivate: [IsCommunity] + data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard] }, { path: 'search/advanced/dataproviders', loadChildren: () => import('./searchPages/advanced/advancedSearchDataProviders.module').then(m => m.LibAdvancedSearchDataProvidersModule), - data: {hasQuickContact: false}, canActivate: [IsCommunity] + data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard] }, { path: 'search/advanced/projects', loadChildren: () => import('./searchPages/advanced/advancedSearchProjects.module').then(m => m.LibAdvancedSearchProjectsModule), - data: {hasQuickContact: false}, canActivate: [IsCommunity] + data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard] }, /** Deposit Pages */ { path: 'participate/deposit-datasets', @@ -271,37 +271,37 @@ const routes: Routes = [ { path: 'participate/deposit/learn-how', loadChildren: () => import('./deposit/deposit.module').then(m => m.LibDepositModule), - data: {hasQuickContact: false}, canActivate: [IsCommunity] + data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard] }, { path: 'participate/deposit/search', loadChildren: () => import('./deposit/searchDataprovidersToDeposit.module').then(m => m.LibSearchDataprovidersToDepositModule), - data: {hasQuickContact: false}, canActivate: [IsCommunity] + data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard] }, { path: 'participate/deposit/zenodo', loadChildren: () => import('./deposit/zenodo/shareInZenodo.module').then(m => m.ShareInZenodoModule), - data: {hasQuickContact: false}, canActivate: [IsCommunity] + data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard] }, /** Linking Pages */ { path: 'myclaims', loadChildren: () => import('./claims/myClaims/myClaims.module').then(m => m.LibMyClaimsModule), - data: {hasQuickContact: false}, canActivate: [IsCommunity] + data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard] }, { path: 'participate/claim', loadChildren: () => import('./claims/linking/linkingGeneric.module').then(m => m.LibLinkingGenericModule), - data: {hasQuickContact: false}, canActivate: [IsCommunity] + data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard] }, { path: 'participate/direct-claim', loadChildren: () => import('./claims/directLinking/directLinking.module').then(m => m.LibDirectLinkingModule), - data: {hasQuickContact: false}, canActivate: [IsCommunity] + data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard] }, { path: 'preview', loadChildren: () => import('./demo/demo.module').then(m => m.DemoModule), - data: {hasQuickContact: false}, canActivate: [IsCommunity] + data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard] }, /** help pages - do not exist in Admin portal/api/db */ { diff --git a/src/app/app.component.ts b/src/app/app.component.ts index bbbf31b..3919236 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -308,11 +308,13 @@ export class AppComponent implements OnInit, OnDestroy { initAdminToolCommunity(communityId) { if (communityId) { this.properties.adminToolsPortalType = "community"; + this.properties.adminToolsCommunity = communityId; if (this.document) { this.initLayout(communityId); } } else { this.properties.adminToolsPortalType = "connect"; + this.properties.adminToolsCommunity = "connect"; if (this.document) { this.initLayout(this.communityId?this.communityId:'connect'); } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 4913b10..f40867b 100755 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -22,12 +22,12 @@ import {PageURLResolverModule} from "./openaireLibrary/utils/pageURLResolver.mod import {Schema2jsonldModule} from "./openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module"; import {DEFAULT_TIMEOUT, TimeoutInterceptor} from "./openaireLibrary/timeout-interceptor.service"; import {ErrorInterceptorService} from "./openaireLibrary/error-interceptor.service"; -import {IsCommunity} from "./openaireLibrary/connect/communityGuard/isCommunity.guard"; import {SubscribeService} from "./openaireLibrary/utils/subscribe/subscribe.service"; import {RoleVerificationModule} from "./openaireLibrary/role-verification/role-verification.module"; import {QuickContactModule} from "./openaireLibrary/sharedComponents/quick-contact/quick-contact.module"; import {AlertModalModule} from "./openaireLibrary/utils/modal/alertModal.module"; import {CustomizationService} from "./openaireLibrary/services/customization.service"; +import {CommunityAccessGuard} from "./utils/communityAccess.guard"; @NgModule({ @@ -49,7 +49,7 @@ import {CustomizationService} from "./openaireLibrary/services/customization.ser declarations: [AppComponent, OpenaireErrorPageComponent], exports: [AppComponent], providers: [ - CommunitiesService, CustomizationService, IsCommunity, SubscribeService, + CommunitiesService, CustomizationService, CommunityAccessGuard, SubscribeService, {provide: APP_ID, useValue: 'serverApp'}, { provide: HTTP_INTERCEPTORS, diff --git a/src/app/utils/communityAccess.guard.ts b/src/app/utils/communityAccess.guard.ts new file mode 100644 index 0000000..82342d7 --- /dev/null +++ b/src/app/utils/communityAccess.guard.ts @@ -0,0 +1,77 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Router, RouterStateSnapshot, UrlTree} from '@angular/router'; +import {forkJoin, Observable} from 'rxjs'; +import {CommunityService} from "../openaireLibrary/connect/community/community.service"; +import {UserManagementService} from "../openaireLibrary/services/user-management.service"; +import {ConnectHelper} from "../openaireLibrary/connect/connectHelper"; +import {properties} from "../../environments/environment"; +import {map, take} from "rxjs/operators"; +import {LoginErrorCodes} from "../openaireLibrary/login/utils/guardHelper.class"; +import {Session} from "../openaireLibrary/login/utils/helper.class"; + +@Injectable() +export class CommunityAccessGuard { + + constructor(private router: Router, + private communityService: CommunityService, private userManagementService: UserManagementService) { + } + + check(path: string): Observable | boolean { + let community = ConnectHelper.getCommunityFromDomain(properties.domain); + if (!community) { + this.router.navigate([properties.errorLink], {queryParams: {page: path}}); + return false; + } + return forkJoin([ + this.userManagementService.getUserInfo().pipe(take(1)), + this.communityService.getCommunity(community).pipe(take(1)) + ]).pipe( + map(([user, communityInfo]) => { + console.log(user, communityInfo) + if (communityInfo) { + console.log(communityInfo.status) + if (communityInfo.isPublic()) { + return true; + } else if (communityInfo.isPrivate()) { + this.router.navigate([properties.errorLink], {queryParams: {page: path}}); + return false; + } else { + if (!user) { + this.router.navigate(['/user-info'], { + queryParams: { + 'errorCode': LoginErrorCodes.NOT_LOGIN, + 'redirectUrl': path + } + }) + return false; + } + if (Session.isPortalAdministrator(user) || Session.isCommunityCurator(user) || Session.isManager('community', community, user) || Session.isSubscribedTo('community', community, user)) { + console.log("user: has access") + return true; + } else { + this.router.navigate(['/user-info'], { + queryParams: { + 'errorCode': LoginErrorCodes.NOT_AUTHORIZED, + 'redirectUrl': path + } + }) + return false; + } + + } + } + this.router.navigate([properties.errorLink], {queryParams: {page: path}}); + return false; + + }) + ); + } + + canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree { + return this.check(state.url); + } + + canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree { + return this.check(state.url); + } +} -- 2.17.1 From 1f29b3200f8cab4789e17b6207013c15e4932575 Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 13 Mar 2024 12:05:31 +0200 Subject: [PATCH 5/7] [develop | DONE | CHANGED] community home page: use method for grouped count queries --- src/app/community/community.component.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/app/community/community.component.ts b/src/app/community/community.component.ts index a4cc69c..6fe378f 100644 --- a/src/app/community/community.component.ts +++ b/src/app/community/community.component.ts @@ -232,10 +232,7 @@ export class CommunityComponent { } })); - this.countResearchResults("publication"); - this.countResearchResults("dataset"); - this.countResearchResults("software"); - this.countResearchResults("other"); + this.getCountResearchResults(); if(this.communityId == "enermaps"){ this.countResearchResults("dataset", "enermaps::selection" ); } @@ -389,6 +386,15 @@ export class CommunityComponent { } this.reloadFeaturedDatasets = false; } + private getCountResearchResults(){ + this.fetchPublications.searchUtils.status = this.errorCodes.LOADING; + this._searchResearchResultsService.countResults("communityid", this.communityId).subscribe(res =>{ + this.fetchPublications.searchUtils.totalResults = res['publications']; + this.fetchDatasets.searchUtils.totalResults = res['datasets']; + this.fetchSoftware.searchUtils.totalResults = res['software']; + this.fetchOrps.searchUtils.totalResults = res['other']; + }) + } private countResearchResults(resultType: string, contextId = null) { let fetch: FetchResearchResults; -- 2.17.1 From 1aa3b54a1ab139a6f99c173abd7fc05a7f9a3f33 Mon Sep 17 00:00:00 2001 From: argirok Date: Thu, 14 Mar 2024 10:29:51 +0200 Subject: [PATCH 6/7] [develop | DONE | REMOVED] remove test logs --- src/app/utils/communityAccess.guard.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/app/utils/communityAccess.guard.ts b/src/app/utils/communityAccess.guard.ts index 82342d7..6b11736 100644 --- a/src/app/utils/communityAccess.guard.ts +++ b/src/app/utils/communityAccess.guard.ts @@ -27,9 +27,7 @@ export class CommunityAccessGuard { this.communityService.getCommunity(community).pipe(take(1)) ]).pipe( map(([user, communityInfo]) => { - console.log(user, communityInfo) if (communityInfo) { - console.log(communityInfo.status) if (communityInfo.isPublic()) { return true; } else if (communityInfo.isPrivate()) { @@ -46,7 +44,6 @@ export class CommunityAccessGuard { return false; } if (Session.isPortalAdministrator(user) || Session.isCommunityCurator(user) || Session.isManager('community', community, user) || Session.isSubscribedTo('community', community, user)) { - console.log("user: has access") return true; } else { this.router.navigate(['/user-info'], { -- 2.17.1 From 6b634f93e0553ecd8e96f3022c58726387b11750 Mon Sep 17 00:00:00 2001 From: argirok Date: Fri, 22 Mar 2024 11:27:49 +0200 Subject: [PATCH 7/7] [develop | DONE | FIX] undo setting this.properties.adminToolsCommunity in app component - fixes issue with wrong community in the server --- src/app/app.component.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 3919236..bbbf31b 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -308,13 +308,11 @@ export class AppComponent implements OnInit, OnDestroy { initAdminToolCommunity(communityId) { if (communityId) { this.properties.adminToolsPortalType = "community"; - this.properties.adminToolsCommunity = communityId; if (this.document) { this.initLayout(communityId); } } else { this.properties.adminToolsPortalType = "connect"; - this.properties.adminToolsCommunity = "connect"; if (this.document) { this.initLayout(this.communityId?this.communityId:'connect'); } -- 2.17.1