-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
View Submissions 'index' page with statuses --------- Co-authored-by: Stephen Chudleigh <stephen@smartlogic.io> Co-authored-by: Stephen Chudleigh <stepchud@users.noreply.github.com>
- Loading branch information
1 parent
256b649
commit b48aef2
Showing
9 changed files
with
182 additions
and
4 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
module ManageSubmissionsHelper | ||
def eligible_for_evaluation?(submission) | ||
submission.judging_status.in?(%w[selected winner]) | ||
end | ||
|
||
def selected_to_advance?(submission) | ||
submission.judging_status.in?(%w[winner]) | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<table class="usa-table usa-table--stacked-header usa-table--borderless width-full"> | ||
<thead> | ||
<tr> | ||
<th scope="col">Submission ID</th> | ||
<th scope="col">Eligible for Evaluation</th> | ||
<th scope="col">Selected to Advance</th> | ||
<th scope="col">Assigned Evaluators</th> | ||
<th scope="col">Average Score</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% @submissions.each do |submission| %> | ||
<tr> | ||
<th data-label="Submission ID" scope="row"> | ||
<span class="mobile-lg:display-none">Submission ID </span><%= submission.id %> | ||
</th> | ||
<td data-label="Eligible for Evaluation"> | ||
<div class="display-flex flex-align-center"> | ||
<% if eligible_for_evaluation?(submission) %> | ||
<input type="checkbox" disabled checked class="display-none mobile-lg:display-block"> | ||
<div class="mobile-lg:display-none"> | ||
<%= image_tag( | ||
"images/usa-icons/verified.svg", | ||
class: "usa-icon--size-3 margin-right-1", | ||
alt: "" | ||
)%> | ||
<span class="text-top">Eligible for Evaluation</span> | ||
</div> | ||
<% else %> | ||
<input type="checkbox" disabled class="display-none mobile-lg:display-block"> | ||
<div class="mobile-lg:display-none"> | ||
<%= image_tag( | ||
"images/usa-icons/highlight_off.svg", | ||
class: "usa-icon--size-3 margin-right-1", | ||
alt: "" | ||
)%> | ||
<span class="text-top">Not Eligible for Evaluation</span> | ||
</div> | ||
<% end %> | ||
</div> | ||
</td> | ||
<td data-label="Selected to Advance"> | ||
<div class="display-flex flex-align-center"> | ||
<% if selected_to_advance?(submission) %> | ||
<input type="checkbox" disabled checked class="display-none mobile-lg:display-block"> | ||
<div class="mobile-lg:display-none"> | ||
<%= image_tag( | ||
"images/usa-icons/star.svg", | ||
class: "usa-icon--size-3 margin-right-1", | ||
alt: "" | ||
)%> | ||
<span class="text-top">Selected to Advance</span> | ||
</div> | ||
<% else %> | ||
<input type="checkbox" disabled class="display-none mobile-lg:display-block"> | ||
<div class="mobile-lg:display-none"> | ||
<%= image_tag( | ||
"images/usa-icons/star_outline.svg", | ||
class: "usa-icon--size-3 margin-right-1", | ||
alt: "" | ||
)%> | ||
<span class="text-top">Not Selected to Advance</span> | ||
</div> | ||
<% end %> | ||
</div> | ||
</td> | ||
<td data-label="Assigned Evaluators"> | ||
No evaluators assigned to this submission | ||
</td> | ||
<td> | ||
N/A | ||
</td> | ||
<td> | ||
<div class="display-flex flex-no-wrap grid-row grid-gap-1"> | ||
<button class="usa-button font-body-2xs text-no-wrap"> | ||
View Submission | ||
</button> | ||
</div> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<h1><%= challenge_phase_title(@phase.challenge, @phase) %></h1> | ||
<p class="text-normal">View challenge submissions and manage evaluation progress.</p> | ||
|
||
<% if @submissions.empty? %> | ||
<div class="text-normal"> | ||
<p>This challenge phase does not currently have any submissions.</p> | ||
</div> | ||
<% else %> | ||
<%= render partial: "submissions_table", locals: { submissions: @submissions } %> | ||
<% end %> |
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
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,39 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe "A11y", :js do | ||
let(:user) { nil } | ||
|
||
before do | ||
system_login_user(user) if user | ||
end | ||
|
||
describe "Logged-in as a Challenge Manager" do | ||
let(:user) { create_user(role: "challenge_manager") } | ||
|
||
it "manage submissions index page is accessible with no challenges" do | ||
visit manage_submissions_path | ||
expect(user.role).to eq("challenge_manager") | ||
expect(page).to(be_axe_clean) | ||
end | ||
|
||
it "manage submissions index page is accessible with one challenge" do | ||
challenge = create_challenge(user: user, title: "Boston Tea Party Cleanup") | ||
create_phase(challenge_id: challenge.id) | ||
visit manage_submissions_path | ||
expect(user.role).to eq("challenge_manager") | ||
expect(page).to have_content("Boston Tea Party Cleanup") | ||
expect(page).to(be_axe_clean) | ||
end | ||
|
||
it "manage submissions by challenge phase page is accessible with one challenge" do | ||
challenge = create_challenge(user: user, title: "Boston Tea Party Cleanup") | ||
phase = create_phase(challenge_id: challenge.id) | ||
visit challenge_manage_submission_path(challenge, phase) | ||
expect(user.role).to eq("challenge_manager") | ||
expect(page).to have_content("Boston Tea Party Cleanup") | ||
expect(page).to(be_axe_clean) | ||
end | ||
end | ||
end |