[master]: Remove sandbox button from beta.

This commit is contained in:
Konstantinos Triantafyllou 2024-04-08 18:46:40 +03:00
parent ff86fb98f1
commit 6a0b9f9c06
5 changed files with 25 additions and 9 deletions

View File

@ -49,7 +49,7 @@ import {UserManagementService} from "../openaireLibrary/services/user-management
<a *ngIf="isManager" [routerLink]="adminLink" target="_blank" class="uk-button uk-flex uk-flex-middle uk-margin-small-right"> <a *ngIf="isManager" [routerLink]="adminLink" target="_blank" class="uk-button uk-flex uk-flex-middle uk-margin-small-right">
Manage Manage
</a> </a>
<a *ngIf="isMember" [href]="sandboxLink" target="_blank" class="uk-button uk-flex uk-flex-middle uk-margin-small-right"> <a *ngIf="sandboxLink" [href]="sandboxLink" target="_blank" class="uk-button uk-flex uk-flex-middle uk-margin-small-right">
Sandbox Sandbox
</a> </a>
</div> </div>
@ -131,6 +131,10 @@ export class NationalComponent extends StakeholderBaseComponent implements OnIni
} }
get sandboxLink() { get sandboxLink() {
if(this.properties.environment !== 'beta' && this.isMember) {
return beta.domain + '/national/'; return beta.domain + '/national/';
} else {
return null;
}
} }
} }

View File

@ -91,7 +91,7 @@ import {properties as beta} from "../../environments/environment.beta";
<a *ngIf="isManager" [routerLink]="adminLink" target="_blank" class="uk-button uk-flex uk-flex-middle uk-margin-small-right"> <a *ngIf="isManager" [routerLink]="adminLink" target="_blank" class="uk-button uk-flex uk-flex-middle uk-margin-small-right">
Manage Manage
</a> </a>
<a *ngIf="isMember" [href]="sandboxLink" target="_blank" class="uk-button uk-flex uk-flex-middle uk-margin-small-right"> <a *ngIf="sandboxLink" [href]="sandboxLink" target="_blank" class="uk-button uk-flex uk-flex-middle uk-margin-small-right">
Sandbox Sandbox
</a> </a>
<a *ngIf="isProvideManager && provideLink" [href]="provideLink" target="_blank" class="uk-button uk-flex uk-flex-middle"> <a *ngIf="isProvideManager && provideLink" [href]="provideLink" target="_blank" class="uk-button uk-flex uk-flex-middle">
@ -199,7 +199,11 @@ export class RepositoryComponent extends StakeholderBaseComponent implements OnI
} }
get sandboxLink() { get sandboxLink() {
if(this.properties.environment !== 'beta' && this.isMember) {
return beta.domain + '/repository/' + this.stakeholder.alias; return beta.domain + '/repository/' + this.stakeholder.alias;
} else {
return null;
}
} }
get provideLink() { get provideLink() {

View File

@ -63,7 +63,7 @@ import {properties as beta} from "../../environments/environment.beta";
<a *ngIf="isManager" [routerLink]="adminLink" target="_blank" class="uk-button uk-flex uk-flex-middle uk-margin-small-right"> <a *ngIf="isManager" [routerLink]="adminLink" target="_blank" class="uk-button uk-flex uk-flex-middle uk-margin-small-right">
Manage Manage
</a> </a>
<a *ngIf="isMember" [href]="sandboxLink" target="_blank" class="uk-button uk-flex uk-flex-middle uk-margin-small-right"> <a *ngIf="sandboxLink" [href]="sandboxLink" target="_blank" class="uk-button uk-flex uk-flex-middle uk-margin-small-right">
Sandbox Sandbox
</a> </a>
</div> </div>
@ -164,6 +164,10 @@ export class RfoComponent extends StakeholderBaseComponent implements OnInit {
} }
get sandboxLink() { get sandboxLink() {
if(this.properties.environment !== 'beta' && this.isMember) {
return beta.domain + '/rfo/' + this.stakeholder.alias; return beta.domain + '/rfo/' + this.stakeholder.alias;
} else {
return null;
}
} }
} }

View File

@ -63,7 +63,7 @@ import {UserManagementService} from "../openaireLibrary/services/user-management
<a *ngIf="isManager" [routerLink]="adminLink" target="_blank" class="uk-button uk-flex uk-flex-middle uk-margin-small-right"> <a *ngIf="isManager" [routerLink]="adminLink" target="_blank" class="uk-button uk-flex uk-flex-middle uk-margin-small-right">
Manage Manage
</a> </a>
<a *ngIf="isMember" [href]="sandboxLink" target="_blank" class="uk-button uk-flex uk-flex-middle uk-margin-small-right"> <a *ngIf="sandboxLink" [href]="sandboxLink" target="_blank" class="uk-button uk-flex uk-flex-middle uk-margin-small-right">
Sandbox Sandbox
</a> </a>
</div> </div>
@ -165,7 +165,11 @@ export class RpoComponent extends StakeholderBaseComponent implements OnInit {
} }
get sandboxLink() { get sandboxLink() {
if(this.properties.environment !== 'beta' && this.isMember) {
return beta.domain + '/rpo/' + this.stakeholder.alias; return beta.domain + '/rpo/' + this.stakeholder.alias;
} else {
return null;
}
} }
} }

View File

@ -20,7 +20,7 @@ export class SandboxGuard {
} }
canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree { canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
let sandbox = properties.environment === 'development'; let sandbox = properties.environment === 'beta';
if (childRoute.data['researcher'] && childRoute.params.stakeholder && sandbox) { if (childRoute.data['researcher'] && childRoute.params.stakeholder && sandbox) {
return this.checkResearcher(state.url, childRoute.params.stakeholder); return this.checkResearcher(state.url, childRoute.params.stakeholder);
} else { } else {