From 4d339595d2c959991b770adbdc0f210207e1d33c Mon Sep 17 00:00:00 2001 From: Ed Schiebel Date: Wed, 8 Mar 2017 09:41:38 -0500 Subject: [PATCH] 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 Product-Review: Clay Diffrient QA-Review: Dan Sasaki --- app/controllers/users_controller.rb | 3 +- .../trays/CollaborationsTray.jsx | 22 +++++++++ .../trays/ConferencesTray.jsx | 24 ++++++++++ .../new_user_tutorial/trays/ImportTray.jsx | 22 +++++++++ .../new_user_tutorial/trays/SyllabusTray.jsx | 23 +++++++++ .../new_user_tutorial/utils/getProperTray.jsx | 17 ++++++- .../utils/getProperTraySpec.jsx | 48 +++++++++++++++++-- 7 files changed, 152 insertions(+), 7 deletions(-) create mode 100644 app/jsx/new_user_tutorial/trays/CollaborationsTray.jsx create mode 100644 app/jsx/new_user_tutorial/trays/ConferencesTray.jsx create mode 100644 app/jsx/new_user_tutorial/trays/ImportTray.jsx create mode 100644 app/jsx/new_user_tutorial/trays/SyllabusTray.jsx diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 441a13b997a..255fdd2ad0d 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -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]) diff --git a/app/jsx/new_user_tutorial/trays/CollaborationsTray.jsx b/app/jsx/new_user_tutorial/trays/CollaborationsTray.jsx new file mode 100644 index 00000000000..3216b13ec95 --- /dev/null +++ b/app/jsx/new_user_tutorial/trays/CollaborationsTray.jsx @@ -0,0 +1,22 @@ +define([ + 'react', + 'i18n!new_user_tutorial', + 'instructure-ui', +], (React, I18n, { Typography, Heading }) => { + const CollaborationsTray = () => ( +
+ {I18n.t('Collaborations')} + + {I18n.t('Work and create together')} + + + { + I18n.t(`Provide a space for users to work on a single Google Doc + simultaneously, from within your Canvas course.`) + } + +
+ ); + + return CollaborationsTray; +}); diff --git a/app/jsx/new_user_tutorial/trays/ConferencesTray.jsx b/app/jsx/new_user_tutorial/trays/ConferencesTray.jsx new file mode 100644 index 00000000000..e66a6ff9d98 --- /dev/null +++ b/app/jsx/new_user_tutorial/trays/ConferencesTray.jsx @@ -0,0 +1,24 @@ +define([ + 'react', + 'i18n!new_user_tutorial', + 'instructure-ui', +], (React, I18n, { Typography, Heading }) => { + const ConferencesTray = () => ( +
+ {I18n.t('Conferences')} + + {I18n.t('Virtual lectures in real-time')} + + + { + 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.`) + } + +
+ ); + + return ConferencesTray; +}); diff --git a/app/jsx/new_user_tutorial/trays/ImportTray.jsx b/app/jsx/new_user_tutorial/trays/ImportTray.jsx new file mode 100644 index 00000000000..2b1c4d83d7b --- /dev/null +++ b/app/jsx/new_user_tutorial/trays/ImportTray.jsx @@ -0,0 +1,22 @@ +define([ + 'react', + 'i18n!new_user_tutorial', + 'instructure-ui', +], (React, I18n, { Typography, Heading }) => { + const ImportTray = () => ( +
+ {I18n.t('Import')} + + {I18n.t('Bring your content into your course')} + + + { + I18n.t(`Bring existing content from another course or course + management system into your Canvas course.`) + } + +
+ ); + + return ImportTray; +}); diff --git a/app/jsx/new_user_tutorial/trays/SyllabusTray.jsx b/app/jsx/new_user_tutorial/trays/SyllabusTray.jsx new file mode 100644 index 00000000000..ce4da0218b5 --- /dev/null +++ b/app/jsx/new_user_tutorial/trays/SyllabusTray.jsx @@ -0,0 +1,23 @@ +define([ + 'react', + 'i18n!new_user_tutorial', + 'instructure-ui', +], (React, I18n, { Typography, Heading }) => { + const SyllabusTray = () => ( +
+ {I18n.t('Syllabus')} + + {I18n.t('An auto-generated chronological summary of your course')} + + + { + 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.`) + } + +
+ ); + + return SyllabusTray; +}); diff --git a/app/jsx/new_user_tutorial/utils/getProperTray.jsx b/app/jsx/new_user_tutorial/utils/getProperTray.jsx index 2945d16f3d3..31d2fe05d7d 100644 --- a/app/jsx/new_user_tutorial/utils/getProperTray.jsx +++ b/app/jsx/new_user_tutorial/utils/getProperTray.jsx @@ -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'); } diff --git a/spec/javascripts/jsx/new_user_tutorial/utils/getProperTraySpec.jsx b/spec/javascripts/jsx/new_user_tutorial/utils/getProperTraySpec.jsx index 836071eab62..be8a002183a 100644 --- a/spec/javascripts/jsx/new_user_tutorial/utils/getProperTraySpec.jsx +++ b/spec/javascripts/jsx/new_user_tutorial/utils/getProperTraySpec.jsx @@ -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', () => { @@ -55,7 +61,7 @@ define([ equal(trayObj.label, 'Settings Tutorial Tray', 'label matches'); }); - + test('if files is in the path argument returns the FilesTray', () => { const trayObj = getProperTray('/courses/3/files/'); equal(trayObj.component, FilesTray, 'component matches'); @@ -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'); + }); });