Add SIS Friendly Name to Assignment Group Import Icon

Fixes: SIS-2381

Test plan:
- Navigate to the Account settings page
- Add an SIS Friendly Name
- Save the settings
- Navigate to a course
- Add a new assignment group
- Query GET <canvas domain>/api/v1/courses/<course_id>/
  assignment_groups
- Copy the id from the group created
- Query PUT <canvas domain>/api/v1/courses/<course_id>/
  assignment_groups/<group id from (3)>
- Send json body content { "integration_data": { "key": "value" } }
- Reload course assignments page
- Verify sis-imported icon is displayed in assignment group header
  AND the message is `Imported from <SIS Friendly Name>`

Change-Id: I4ac2f7ca2b7b15d903c36e1a2dfaaf1aa4d1d48d
Reviewed-on: https://gerrit.instructure.com/108957
Tested-by: Jenkins
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
This commit is contained in:
Nick Houle 2017-04-18 12:05:32 -06:00
parent f33ad84435
commit 3147ff25a8
3 changed files with 13 additions and 5 deletions

View File

@ -180,6 +180,7 @@ define [
toggleMessage: @messages.toggleMessage
hasFrozenAssignments: @model.hasFrozenAssignments? and @model.hasFrozenAssignments()
hasIntegrationData: @model.hasIntegrationData? and @model.hasIntegrationData()
postToSISName: ENV.SIS_NAME
ENV: ENV
})

View File

@ -22,8 +22,8 @@
{{name}}
</a>
{{#if hasIntegrationData}}
<i class="icon-sis-imported" aria-hidden="true" title='{{#t}}Imported from SIS{{/t}}'></i>
<span class="screenreader-only">{{#t}}Imported from SIS{{/t}}</span>
<i class="icon-sis-imported" aria-hidden="true" title='{{#t}}Imported from {{postToSISName}}{{/t}}'></i>
<span class="screenreader-only">{{#t}}Imported from {{postToSISName}}{{/t}}</span>
{{/if}}
</h3>
{{else}}
@ -40,8 +40,8 @@
{{name}}
</a>
{{#if hasIntegrationData}}
<i class="icon-sis-imported" aria-hidden="true" title='{{#t}}Imported from SIS{{/t}}'></i>
<span class="screenreader-only">{{#t}}Imported from SIS{{/t}}</span>
<i class="icon-sis-imported" aria-hidden="true" title='{{#t}}Imported from {{postToSISName}}{{/t}}'></i>
<span class="screenreader-only">{{#t}}Imported from {{postToSISName}}{{/t}}</span>
{{/if}}
</h2>
{{/if}}

View File

@ -122,13 +122,20 @@ define [
assignmentGroupsView.$el.appendTo $('#fixtures')
assignmentGroupsView.render()
assignmentGroupsView
test "shows imported icon when integration_data is not empty", ->
model = createAssignmentGroup()
model.set('integration_data', { property: 'value' })
view = createView(model)
ok view.$("#assignment_group_#{model.id} .ig-header-title .icon-sis-imported").length
test "shows imported icon with custom SIS_NAME when integration_data is not empty", ->
ENV.SIS_NAME = 'PowerSchool'
model = createAssignmentGroup()
model.set('integration_data', { property: 'value' })
view = createView(model)
equal view.$("#assignment_group_#{model.id} .ig-header-title .icon-sis-imported")[0].title, 'Imported from PowerSchool'
test "does not show imported icon when integration_data is not set", ->
model = createAssignmentGroup()
view = createView(model)