From ad17146a85cff095cbf62e94a484464b1592e22e Mon Sep 17 00:00:00 2001 From: Gautam Jajoo Date: Wed, 18 Aug 2021 00:25:49 +0530 Subject: [PATCH] Frontend_V2: Add note for unapproved challenge(#3556) Co-authored-by: Rishabh Jain --- .../app/components/challenge/challenge.component.html | 11 +++++++++++ .../app/components/challenge/challenge.component.ts | 6 ++++++ .../app/components/not-found/not-found.component.scss | 2 +- frontend_v2/src/app/services/challenge.service.ts | 7 ++++++- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/frontend_v2/src/app/components/challenge/challenge.component.html b/frontend_v2/src/app/components/challenge/challenge.component.html index 17ddb9d0f5..78dde2006a 100644 --- a/frontend_v2/src/app/components/challenge/challenge.component.html +++ b/frontend_v2/src/app/components/challenge/challenge.component.html @@ -5,6 +5,17 @@
+
+
+
+
Thank you for successfully creating a challenge on EvalAI. + The challenge is ready to accept submissions from host the team. Please note that the submissions from the host team won't be visible on leaderboard until you mark them as baseline submission. + In order for the challenge to accept submissions from the public, it requires approval from the EvalAI Team. Please reach out to us at + team@cloudcv.org for challenge approval. +
+
+
+
diff --git a/frontend_v2/src/app/components/challenge/challenge.component.ts b/frontend_v2/src/app/components/challenge/challenge.component.ts index 4f94271ab8..c374cb28ce 100644 --- a/frontend_v2/src/app/components/challenge/challenge.component.ts +++ b/frontend_v2/src/app/components/challenge/challenge.component.ts @@ -37,6 +37,11 @@ export class ChallengeComponent implements OnInit { */ isChallengeHost = false; + /** + * Is challenge approved by admin + */ + isApprovedByAdmin = false; + /** * Is participated in Challenge */ @@ -107,6 +112,7 @@ export class ChallengeComponent implements OnInit { this.challenge = challenge; this.isForumEnabled = challenge.enable_forum; this.forumURL = challenge.forum_url; + this.isApprovedByAdmin = challenge.approved_by_admin; // update meta tag SELF.meta.updateTag({ property: 'og:title', diff --git a/frontend_v2/src/app/components/not-found/not-found.component.scss b/frontend_v2/src/app/components/not-found/not-found.component.scss index cd43605715..e2c7faa0dd 100644 --- a/frontend_v2/src/app/components/not-found/not-found.component.scss +++ b/frontend_v2/src/app/components/not-found/not-found.component.scss @@ -5,7 +5,7 @@ background: $red-light; color: white; overflow: hidden; - position: absolute; + position: fixed; top: 0; width: 100%; left: 0; diff --git a/frontend_v2/src/app/services/challenge.service.ts b/frontend_v2/src/app/services/challenge.service.ts index 91a1bdd648..e6813f65bd 100644 --- a/frontend_v2/src/app/services/challenge.service.ts +++ b/frontend_v2/src/app/services/challenge.service.ts @@ -1,6 +1,7 @@ import { Injectable } from '@angular/core'; import { BehaviorSubject } from 'rxjs'; import { NGXLogger } from 'ngx-logger'; +import { Router } from '@angular/router'; // import service import { ApiService } from './api.service'; @@ -50,7 +51,8 @@ export class ChallengeService { private globalService: GlobalService, private authService: AuthService, private endpointsService: EndpointsService, - private logger: NGXLogger + private logger: NGXLogger, + private router: Router ) {} /** @@ -183,6 +185,9 @@ export class ChallengeService { }, (err) => { SELF.globalService.handleApiError(err); + if(err.error.error == "Challenge does not exist!") { + this.router.navigate(['not-found']); + } }, () => { this.logger.info('Challenge', id, 'fetched!');