This repository has been archived by the owner on Jul 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add View all submissions page in challenge(#152)
- Loading branch information
1 parent
70ff70a
commit c7bc6de
Showing
8 changed files
with
676 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
135 changes: 135 additions & 0 deletions
135
...mponents/challenge/challengeviewallsubmissions/challengeviewallsubmissions.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
<div class="challenge-card"> | ||
<div class="ev-card-panel card-bt-margin"> | ||
<div class="ev-md-container bottom-hr-line"> | ||
<div class="row row-lr-margin phase-title"> | ||
<div *ngIf="!selectedPhase" class="col-sm-12"> | ||
<strong class="fw-semibold content fs-15"> | ||
Please select a phase to get list of submissions! | ||
</strong> | ||
</div> | ||
</div> | ||
<div class="row row-lr-margin"> | ||
<div class="col-sm-6 col-xs-12 col-lr-pad phase-select-box"> | ||
<app-selectphase [phases]="filteredPhases" | ||
[phaseSelectionType]="phaseSelectionType" | ||
[phaseSelected]="phaseSelected()" #phaseselect></app-selectphase> | ||
</div> | ||
</div> | ||
<div class="row row-lr-margin"> | ||
<div class="col-md-2 col-sm-2 col-xs-6 align-left col-lr-pad | ||
all-submissions-file"> | ||
<mat-form-field> | ||
<mat-label>File</mat-label> | ||
<mat-select [(ngModel)]="fileSelected" class="rm-margin"> | ||
<mat-option *ngFor="let key of fileTypes" value={{key.name}}> | ||
{{key.name}} | ||
</mat-option> | ||
</mat-select> | ||
</mat-form-field> | ||
</div> | ||
<div class="col-md-2 col-sm-2 col-xs-6 col-lr-pad download-submissions"> | ||
<a class="ev-btn btn-waves-effect grad-rec-btn waves-dark ev-btn-dark | ||
grad-btn-dark fw-light fs-14" (click)='downloadSubmission()'>Download</a> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="ev-card-body exist-team-card"> | ||
<div class="row row-lr-margin"> | ||
<div class="col-md-12 col-lr-pad"> | ||
<div *ngIf="!isPhaseSelected" class="result-wrn">No phase selected.</div> | ||
<div *ngIf="paginationDetails.showPagination == false && isPhaseSelected" | ||
class="result-wrn">No results found.</div> | ||
<div *ngIf="submissions.length > 0" class="table-scroll"> | ||
<table class="centered highlight all-submission-table"> | ||
<thead> | ||
<tr class="content"> | ||
<th data-field="team">Team</th> | ||
<th data-field="created-by">Created By</th> | ||
<th data-field="status">Status</th> | ||
<th data-field="status">Execution Time (sec)</th> | ||
<th data-field="file">Submission No.</th> | ||
<th data-field="file">Submitted at</th> | ||
<th data-field="file">Submitted File</th> | ||
<th data-field="file">Stdout File</th> | ||
<th data-field="file">Stderr File</th> | ||
<th data-field="file">Result File</th> | ||
<th data-field="file">Metadata File</th> | ||
<th *ngIf="selectedPhase['leaderboard_public']" | ||
data-field="file">Show on Leaderboard</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr *ngFor="let key of submissions" class="result-val content"> | ||
<td>{{key.participant_team}}</td> | ||
|
||
<td>{{key.created_by}}</td> | ||
|
||
<td class="val-style capitalize" [ngClass]="key.status">{{key.status}}</td> | ||
<td>{{key.execution_time}}</td> | ||
|
||
<td>{{key.submission_number}}</td> | ||
|
||
<td>{{key.submitted_at | date:'medium'}}</td> | ||
|
||
<td><a href="{{key.input_file}}" target="_blank" class="blue-text"> | ||
<i class="fa fa-external-link"></i> Link</a></td> | ||
<td *ngIf="key.stdout_file"> | ||
<a href="{{key.stdout_file}}" target="_blank" class="blue-text"> | ||
<i class="fa fa-external-link"></i> Link</a></td> | ||
<td *ngIf="!key.stdout_file">None</td> | ||
|
||
<td *ngIf="key.stderr_file"> | ||
<a href="{{key.stderr_file}}" target="_blank" class="blue-text"> | ||
<i class="fa fa-external-link"></i> Link</a></td> | ||
<td *ngIf="!key.stderr_file">None</td> | ||
|
||
<td *ngIf="key.submission_result_file"> | ||
<a href="{{key.submission_result_file}}" target="_blank" | ||
class="blue-text"><i class="fa fa-external-link"></i> Link</a></td> | ||
<td *ngIf="!key.submission_result_file">None</td> | ||
|
||
<td *ngIf="key.submission_metadata_file"> | ||
<a href="{{key.submission_metadata_file}}" target="_blank" | ||
class="blue-text"><i class="fa fa-external-link"></i> Link</a></td> | ||
<td *ngIf="!key.submission_metadata_file">None</td> | ||
|
||
<td *ngIf="selectedPhase['leaderboard_public']"> | ||
<input [checked]="key.is_public" *ngIf="key.status == 'finished'" | ||
type="checkbox" id="isPublic{{ key.id }}" | ||
(change)="changeSubmissionVisibility(key.id, key.is_public)" | ||
class="cbx hidden" /> | ||
<label for="isPublic{{ key.id }}" class="cbx-label"></label> | ||
<span *ngIf="key.status !== 'finished'"> N/A </span> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="pagination" *ngIf="paginationDetails.showPagination && submissions.length > 0"> | ||
<div class="row row-lr-margin"> | ||
<div class="col-sm-12 left-align col-lr-pad"> | ||
<button [ngClass]="paginationDetails.isPrev" class="btn-floating | ||
btn-pagination waves-effect waves-light" | ||
(click)="loadPaginationData(paginationDetails.previous)"> | ||
<i class="fa fa-chevron-left"></i> | ||
</button> | ||
<span class="pagination-title"> | ||
<strong class="text-med-black fw-semibold content"> | ||
Page {{paginationDetails.currentPage}} of | ||
{{paginationDetails.totalPage}} | ||
</strong></span> | ||
<button [ngClass]="paginationDetails.isNext" class="btn-floating | ||
btn-pagination waves-effect waves-light" | ||
(click)="loadPaginationData(paginationDetails.next)"> | ||
<i class="fa fa-chevron-right"></i> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
47 changes: 47 additions & 0 deletions
47
...mponents/challenge/challengeviewallsubmissions/challengeviewallsubmissions.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
@import './variables.scss'; | ||
@import './mixins.scss'; | ||
|
||
.ev-md-container { | ||
.phase-title { | ||
margin-bottom: 20px; | ||
} | ||
} | ||
|
||
.show-submission-count { | ||
background: #252833; | ||
text-align: center; | ||
color: white; | ||
padding: 2px 5px 2px 5px; | ||
border-radius: 3px 3px 3px 3px; | ||
font-weight: 300; | ||
transition: all 0.2s ease-in-out; | ||
} | ||
|
||
@include screen-small-medium { | ||
.download-submissions { | ||
margin-left: 20px; | ||
margin-right: 20px; | ||
} | ||
} | ||
|
||
.add-line-height { | ||
line-height: 51px; | ||
} | ||
|
||
.result-wrn { | ||
margin-top: 15px; | ||
margin-bottom: 20px; | ||
} | ||
|
||
table { | ||
width: 160% !important; | ||
} | ||
|
||
.cbx-label { | ||
margin-left: 55px; | ||
margin-right: 55px; | ||
} | ||
|
||
.cbx:checked ~ .cbx-label { | ||
background: #4CAF50; | ||
} |
38 changes: 38 additions & 0 deletions
38
...nents/challenge/challengeviewallsubmissions/challengeviewallsubmissions.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ChallengeviewallsubmissionsComponent } from './challengeviewallsubmissions.component'; | ||
import { NO_ERRORS_SCHEMA } from '@angular/core'; | ||
import { ChallengeService } from '../../../services/challenge.service'; | ||
import { GlobalService } from '../../../services/global.service'; | ||
import { AuthService } from '../../../services/auth.service'; | ||
import { ApiService } from '../../../services/api.service'; | ||
import { EndpointsService } from '../../../services/endpoints.service'; | ||
import { WindowService } from '../../../services/window.service'; | ||
import { HttpClientModule } from '@angular/common/http'; | ||
import { RouterTestingModule } from '@angular/router/testing'; | ||
|
||
describe('ChallengeviewallsubmissionsComponent', () => { | ||
let component: ChallengeviewallsubmissionsComponent; | ||
let fixture: ComponentFixture<ChallengeviewallsubmissionsComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ ChallengeviewallsubmissionsComponent ], | ||
providers: [ ChallengeService, GlobalService, AuthService, ApiService, | ||
EndpointsService, WindowService ], | ||
imports: [ HttpClientModule, RouterTestingModule ], | ||
schemas: [ NO_ERRORS_SCHEMA ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ChallengeviewallsubmissionsComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.