From 6a0b9f9c0602b60812ef17170faf52c898d66765 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 8 Apr 2024 18:46:40 +0300 Subject: [PATCH] [master]: Remove sandbox button from beta. --- src/app/national/national.component.ts | 8 ++++++-- src/app/repository/repository.component.ts | 8 ++++++-- src/app/rfo/rfo.component.ts | 8 ++++++-- src/app/rpo/rpo.component.ts | 8 ++++++-- src/app/shared/sandbox.guard.ts | 2 +- 5 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/app/national/national.component.ts b/src/app/national/national.component.ts index 30c47a5..4ef9e3f 100644 --- a/src/app/national/national.component.ts +++ b/src/app/national/national.component.ts @@ -49,7 +49,7 @@ import {UserManagementService} from "../openaireLibrary/services/user-management Manage - + Sandbox @@ -131,6 +131,10 @@ export class NationalComponent extends StakeholderBaseComponent implements OnIni } get sandboxLink() { - return beta.domain + '/national/'; + if(this.properties.environment !== 'beta' && this.isMember) { + return beta.domain + '/national/'; + } else { + return null; + } } } diff --git a/src/app/repository/repository.component.ts b/src/app/repository/repository.component.ts index cd102e3..b78483f 100644 --- a/src/app/repository/repository.component.ts +++ b/src/app/repository/repository.component.ts @@ -91,7 +91,7 @@ import {properties as beta} from "../../environments/environment.beta"; Manage - + Sandbox @@ -199,7 +199,11 @@ export class RepositoryComponent extends StakeholderBaseComponent implements OnI } get sandboxLink() { - return beta.domain + '/repository/' + this.stakeholder.alias; + if(this.properties.environment !== 'beta' && this.isMember) { + return beta.domain + '/repository/' + this.stakeholder.alias; + } else { + return null; + } } get provideLink() { diff --git a/src/app/rfo/rfo.component.ts b/src/app/rfo/rfo.component.ts index e4f5c0a..b0a1b12 100644 --- a/src/app/rfo/rfo.component.ts +++ b/src/app/rfo/rfo.component.ts @@ -63,7 +63,7 @@ import {properties as beta} from "../../environments/environment.beta"; Manage - + Sandbox @@ -164,6 +164,10 @@ export class RfoComponent extends StakeholderBaseComponent implements OnInit { } get sandboxLink() { - return beta.domain + '/rfo/' + this.stakeholder.alias; + if(this.properties.environment !== 'beta' && this.isMember) { + return beta.domain + '/rfo/' + this.stakeholder.alias; + } else { + return null; + } } } diff --git a/src/app/rpo/rpo.component.ts b/src/app/rpo/rpo.component.ts index 0e5f0c3..9d81af3 100644 --- a/src/app/rpo/rpo.component.ts +++ b/src/app/rpo/rpo.component.ts @@ -63,7 +63,7 @@ import {UserManagementService} from "../openaireLibrary/services/user-management Manage - + Sandbox @@ -165,7 +165,11 @@ export class RpoComponent extends StakeholderBaseComponent implements OnInit { } get sandboxLink() { - return beta.domain + '/rpo/' + this.stakeholder.alias; + if(this.properties.environment !== 'beta' && this.isMember) { + return beta.domain + '/rpo/' + this.stakeholder.alias; + } else { + return null; + } } } diff --git a/src/app/shared/sandbox.guard.ts b/src/app/shared/sandbox.guard.ts index 93c8741..77dd1cc 100644 --- a/src/app/shared/sandbox.guard.ts +++ b/src/app/shared/sandbox.guard.ts @@ -20,7 +20,7 @@ export class SandboxGuard { } canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree { - let sandbox = properties.environment === 'development'; + let sandbox = properties.environment === 'beta'; if (childRoute.data['researcher'] && childRoute.params.stakeholder && sandbox) { return this.checkResearcher(state.url, childRoute.params.stakeholder); } else {