add custom status pills to submission details page

add the custom status pills to the submission details page in old
assignments view, following formatting of other standard status
pills

closes EVAL-3544

flag=custom_gradebook_statuses

test plan:
- ensure a2 is disabled for the course
- add a custom status and assign that status to a user's
  submission
- act as that user and go to the grades page, then click
  on the assignment that you gave them the custom status for
- in this submission details page, ensure there is a grey pill
  with the status's name in full uppercase
- if the student submitted something, the status pill will be
  next to the submission time under the assignment name
- otherwise, it will be under the assignment name, where the
  submission time usually would be

Change-Id: If6aec1d3a64baff11543d3f962e7cd58b86af19d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/329555
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Christopher Soto <christopher.soto@instructure.com>
QA-Review: Christopher Soto <christopher.soto@instructure.com>
Product-Review: Ravi Koll <ravi.koll@instructure.com>
This commit is contained in:
rohan.chugh 2023-10-05 15:22:28 -05:00 committed by Rohan Chugh
parent 462c1114f7
commit 8ed275a69b
3 changed files with 15 additions and 3 deletions

View File

@ -60,7 +60,9 @@
{}
end,
**submission_owner_param
}
},
:CUSTOM_GRADE_STATUSES => @assignment.course.custom_grade_statuses.as_json(include_root: false)
})
provide :page_title, join_title(@assignment.title, submission_author_name_for(@assessment_request))
provide_blank :right_side
@ -209,7 +211,9 @@
<span><%= I18n.t("Submitted by: %{name}", name: @submission.proxy_submitter.short_name) %></span>
<% end %>
</div>
<% if @submission.late? %>
<% if @submission.custom_grade_status %>
<span class="submission-custom-grade-status-pill-<%= @submission.custom_grade_status_id %>" %>
<% elsif @submission.late? %>
<span class="submission-late-pill"></span>
<% elsif @submission.missing? %>
<span class="submission-missing-pill"></span>

View File

@ -839,6 +839,14 @@ describe SubmissionsController do
expect(body["published_score"]).to eq 10
end
it "renders a submission status pill if the submission has a custom status" do
@submission.update!(workflow_state: "submitted")
status = CustomGradeStatus.create!(root_account: @course.root_account, name: "CARROT", color: "#000000", created_by: @teacher)
@submission.update!(custom_grade_status: status)
get :show, params: { course_id: @context.id, assignment_id: @assignment.id, id: @student.id }, format: :json
expect(body["custom_grade_status_id"]).to eq status.id
end
it "renders json without scores for students for unposted submissions" do
user_session(@student)
@assignment.ensure_post_policy(post_manually: true)

View File

@ -22,5 +22,5 @@ import ready from '@instructure/ready'
ready(() => {
setup()
StatusPill.renderPills()
StatusPill.renderPills(ENV.CUSTOM_GRADE_STATUSES)
})