Add syllabus, collaborations, import, and conferences tutorial trays

closes FALCOR-122, FALCOR-124, FALCOR-125, FALCOR-123

Test Plan:
  - Enable new user tutorials
   syllabus:
  - Go to the course syllabus  page
  - The proper tray data should show like https://cl.ly/402N2o3Q0J3j
  - Collapsing/Expanding should persist to the server
  collaborations:
  - setup the collaboration lti tool
    - go to https://lti-tool-provider-example.herokuapp.com/xml_builder
    - check Collaborations and choose basic_lti_request from the
      dropdown
    - copy the xml
    - go to course > settings > apps and add a new app
    - choose Configuration Type = Paste XML
    - paste the xml
    - add a name and submit
    - refresh the page
  - Go to the course Collaborations page
  - The proper tray data should show like https://cl.ly/3t2O1t031635
  - Collapsing/Expanding should persist
  Import:
  - Go to the course Settings page
  - click "Import content into this course" button
  - The proper tray data should show like https://cl.ly/1N0T32413N2t
  - Collapsing/Expanding should persist
  Conferences:
  - Go to the course conferences page (presumes you've setup
    conferences)
  - The proper tray data should show like https://cl.ly/2e2Y31113I3I
  - Collapsing/Expanding should persist

Change-Id: Ia158689786e71c7eb03754787f2100cf1a3e65b1
Reviewed-on: https://gerrit.instructure.com/104416
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Dan Sasaki
This commit is contained in:
Ed Schiebel 2017-03-08 09:41:38 -05:00
parent 25f5496b2a
commit 4d339595d2
7 changed files with 152 additions and 7 deletions

View File

@ -1343,7 +1343,8 @@ class UsersController < ApplicationController
return render(json: { :message => "This endpoint only works against the current user" }, status: :unauthorized)
end
valid_names = %w{home modules pages assignments quizzes settings files people announcements grades discussions}
valid_names = %w{home modules pages assignments quizzes settings files people announcements
grades discussions syllabus collaborations import conferences}
# Check if the page_name is valid
unless valid_names.include?(params[:page_name])

View File

@ -0,0 +1,22 @@
define([
'react',
'i18n!new_user_tutorial',
'instructure-ui',
], (React, I18n, { Typography, Heading }) => {
const CollaborationsTray = () => (
<div>
<Heading as="h2" level="h1" >{I18n.t('Collaborations')}</Heading>
<Typography size="large" as="p">
{I18n.t('Work and create together')}
</Typography>
<Typography as="p">
{
I18n.t(`Provide a space for users to work on a single Google Doc
simultaneously, from within your Canvas course.`)
}
</Typography>
</div>
);
return CollaborationsTray;
});

View File

@ -0,0 +1,24 @@
define([
'react',
'i18n!new_user_tutorial',
'instructure-ui',
], (React, I18n, { Typography, Heading }) => {
const ConferencesTray = () => (
<div>
<Heading as="h2" level="h1" >{I18n.t('Conferences')}</Heading>
<Typography size="large" as="p">
{I18n.t('Virtual lectures in real-time')}
</Typography>
<Typography as="p">
{
I18n.t(`Conduct virtual lectures, virtual office hours, and student
groups. Broadcast real-time audio and video, share presentation
slides, give demonstrations of applications and online resources,
and more.`)
}
</Typography>
</div>
);
return ConferencesTray;
});

View File

@ -0,0 +1,22 @@
define([
'react',
'i18n!new_user_tutorial',
'instructure-ui',
], (React, I18n, { Typography, Heading }) => {
const ImportTray = () => (
<div>
<Heading as="h2" level="h1" >{I18n.t('Import')}</Heading>
<Typography size="large" as="p">
{I18n.t('Bring your content into your course')}
</Typography>
<Typography as="p">
{
I18n.t(`Bring existing content from another course or course
management system into your Canvas course.`)
}
</Typography>
</div>
);
return ImportTray;
});

View File

@ -0,0 +1,23 @@
define([
'react',
'i18n!new_user_tutorial',
'instructure-ui',
], (React, I18n, { Typography, Heading }) => {
const SyllabusTray = () => (
<div>
<Heading as="h2" level="h1" >{I18n.t('Syllabus')}</Heading>
<Typography size="large" as="p">
{I18n.t('An auto-generated chronological summary of your course')}
</Typography>
<Typography as="p">
{
I18n.t(`Communicate to your students exactly what will be required
of them throughout the course in chronological order. Generate a
built-in Syllabus based on Assignments and Events that you've created.`)
}
</Typography>
</div>
);
return SyllabusTray;
});

View File

@ -10,9 +10,14 @@ define([
'../trays/PeopleTray',
'../trays/AnnouncementsTray',
'../trays/GradesTray',
'../trays/DiscussionsTray'
'../trays/DiscussionsTray',
'../trays/SyllabusTray',
'../trays/CollaborationsTray',
'../trays/ImportTray',
'../trays/ConferencesTray'
], (I18n, HomeTray, ModulesTray, PagesTray, AssignmentsTray, QuizzesTray, SettingsTray,
FilesTray, PeopleTray, AnnouncementsTray, GradesTray, DiscussionsTray) => {
FilesTray, PeopleTray, AnnouncementsTray, GradesTray, DiscussionsTray, SyllabusTray,
CollaborationsTray, ImportTray, ConferencesTray) => {
const generateObject = (component, label, pageName) => ({
component,
label,
@ -24,6 +29,8 @@ define([
return generateObject(ModulesTray, I18n.t('Modules Tutorial Tray'), 'modules');
} else if (path.includes('pages')) {
return generateObject(PagesTray, I18n.t('Pages Tutorial Tray'), 'pages');
} else if (path.includes('syllabus')) { // syllabus must come before assignments (courses/#/assignments/syllabus)
return generateObject(SyllabusTray, I18n.t('Syllabus Tutorial Tray'), 'syllabus');
} else if (path.includes('assignments')) {
return generateObject(AssignmentsTray, I18n.t('Assignments Tutorial Tray'), 'assignments');
} else if (path.includes('quizzes')) {
@ -40,6 +47,12 @@ define([
return generateObject(GradesTray, I18n.t('Gradebook Tutorial Tray'), 'grades');
} else if (path.includes('discussion_topics')) {
return generateObject(DiscussionsTray, I18n.t('Discussions Tutorial Tray'), 'discussions');
} else if (path.includes('lti_collaborations') || path.includes('collaborations')) {
return generateObject(CollaborationsTray, I18n.t('Collaborations Tutorial Tray'), 'collaborations');
} else if (path.includes('content_migrations')) {
return generateObject(ImportTray, I18n.t('Import Tutorial Tray'), 'collaborations');
} else if (path.includes('conferences')) {
return generateObject(ConferencesTray, I18n.t('Conferences Tutorial Tray'), 'conferences');
}
return generateObject(HomeTray, I18n.t('Home Tutorial Tray'), 'home');
}

View File

@ -10,9 +10,15 @@ define([
'jsx/new_user_tutorial/trays/PeopleTray',
'jsx/new_user_tutorial/trays/AnnouncementsTray',
'jsx/new_user_tutorial/trays/GradesTray',
'jsx/new_user_tutorial/trays/DiscussionsTray'
'jsx/new_user_tutorial/trays/DiscussionsTray',
'jsx/new_user_tutorial/trays/SyllabusTray',
'jsx/new_user_tutorial/trays/CollaborationsTray',
'jsx/new_user_tutorial/trays/ImportTray',
'jsx/new_user_tutorial/trays/ConferencesTray'
], (getProperTray, HomeTray, ModulesTray, PagesTray, AssignmentsTray, QuizzesTray,
SettingsTray, FilesTray, PeopleTray, AnnouncementsTray, GradesTray, DiscussionsTray) => {
SettingsTray, FilesTray, PeopleTray, AnnouncementsTray,
GradesTray, DiscussionsTray, SyllabusTray, CollaborationsTray, ImportTray,
ConferencesTray) => {
QUnit.module('getProperTray test');
test('if no match is in the path argument returns the HomeTray', () => {
@ -82,7 +88,6 @@ define([
equal(trayObj.component, GradesTray, 'component matches');
equal(trayObj.label, 'Gradebook Tutorial Tray', 'label matches');
});
test('if discussion_topics is in the path argument returns the DiscussionsTray', () => {
@ -91,4 +96,39 @@ define([
equal(trayObj.label, 'Discussions Tutorial Tray', 'label matches');
});
test('if syllabus is in the path argument returns the SyllabusTray', () => {
const trayObj = getProperTray('/courses/3/assignments/syllabus/');
equal(trayObj.component, SyllabusTray, 'component matches');
equal(trayObj.label, 'Syllabus Tutorial Tray', 'label matches');
});
test('if lti_collaborations is in the path argument returns the CollaborationsTray', () => {
const trayObj = getProperTray('/courses/3/lti_collaborations/');
equal(trayObj.component, CollaborationsTray, 'component matches');
equal(trayObj.label, 'Collaborations Tutorial Tray', 'label matches');
});
test('if collaborations is in the path argument returns the CollaborationsTray', () => {
const trayObj = getProperTray('/courses/3/collaborations/');
equal(trayObj.component, CollaborationsTray, 'component matches');
equal(trayObj.label, 'Collaborations Tutorial Tray', 'label matches');
});
test('if content_migrations is in the path argument returns the ImportTray', () => {
const trayObj = getProperTray('/courses/3/content_migrations/');
equal(trayObj.component, ImportTray, 'component matches');
equal(trayObj.label, 'Import Tutorial Tray', 'label matches');
});
test('if conferences is in the path argument returns the ConferencesTray', () => {
const trayObj = getProperTray('/courses/3/conferences/');
equal(trayObj.component, ConferencesTray, 'component matches');
equal(trayObj.label, 'Conferences Tutorial Tray', 'label matches');
});
});