Commit Graph

12726 Commits

Author SHA1 Message Date
Derek Bender d6619c11c3 warn when grade has too many or negative points
refs: CNVS-27399

Test Plan:
 - Given an assignment with 100 points possible
 - In gradebook, submission details modal
   (the comments icon), Gradebook: Individual View,
   and from SpeedGrader™:
   - When the assignment is graded with 149 or 0 points
   - Then no warning is present

   - When the assignment is graded 150
   - Then a warning is present

   - When the assignment is graded -1
   - Then a negative warning is present

   - When the assignment has no points possible, or is excused
   - Then there is no warning present

Notes:
 - This should work for any assignment where there is a total points
   possible value except for 0

Change-Id: I528f3c4e71276d1e2696d47cb5709ff9d7c44fff
Reviewed-on: https://gerrit.instructure.com/85945
Tested-by: Jenkins
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Neil Gupta <ngupta@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Christi Wruck
2016-08-15 15:08:55 +00:00
Jacob Fugal 9a077a7873 AddressBook facade
fixes CNVS-29824
refs CNVS-29862, CNVS-29867

test-plan:
  check for regressions around:

  * accessing profile#show endpoint, with profiles enabled, is
    authorized if and only if current user knows profile owner.

  * eportfolios#show, with profiles enabled, includes link to owner's
    profile if and only if current user knows owner.

  * conversations:
    - filtering of individual recipients when creating a conversation
    - expansion of context recipients when creating a conversation
    - restriction of individual recipients to those known via course
      when creating a conversation in a course
      - including as an admin over that course
    - filtering of individual recipients when adding a message to an
      existing conversation allows existing recipients

  * searching/browsing address book (conversation creation, link
    observer to students, due date overrides, etc.):
    - when loading info about single user (user_id parameter), including
      combinations of conversation_id and context parameters, returns
      user data if and only if the target is known to current user under
      those parameters
    - users matched:
      - excludes already listed users
      - restricts to users known via specified context, if any
        - including as an admin over that context
      - finds users with weak associations (e.g. invited student that
        hasn't logged in for first time yet) when linking observers
      - doesn't find users with weak associations otherwise
    - contexts matched:
      - limited to those known to current user
      - have count of known users
      - have counts of known users in synthetic contexts

  * data returned for known users in various API calls include common
    course and groups between current user and returned user

Change-Id: I66bca0921b298be8d529a713fa982a6dfdcbcc8e
Reviewed-on: https://gerrit.instructure.com/84045
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2016-08-15 15:03:56 +00:00
Chris Wang 191526ce16 add filter for users on quiz moderation
closes CNVS-3080

test plan:
- Course with at least two students and a quiz
- Go to moderation page
- input somthing into the filter
- ensure that filters correctly

Change-Id: Ia893d7b26c63e3596e9a1d42c33a75972574d467
Reviewed-on: https://gerrit.instructure.com/85870
Tested-by: Jenkins
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2016-08-12 22:27:11 +00:00
James Williams 3fce1ac602 fix cross-shard conversations attachment folder id env variable
should be a string because a global id will be truncated because
 javascript is terrible

closes #CNVS-30837

Change-Id: I9ee17cccd1f373cc3cfa3e7bf01bf4bf1879ff40
Reviewed-on: https://gerrit.instructure.com/87636
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-08-12 20:59:04 +00:00
Jason Steck 3bbb103cb7 with RCS flags, let RCEs handle textareas without ids
fixes CNVS-30767

test plan:
 - make sure the three Rich Content Editor feature flags are on
 - create or edit a quiz that has at least these three types of questions:
   Fill In Multiple Blanks
   Multiple Dropdowns
   Formula Question
 - you should be able to edit each one

Change-Id: I1d367294b63c78b58596cfd398f73538d254409a
Reviewed-on: https://gerrit.instructure.com/87210
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Product-Review: Jason Steck <jsteck@instructure.com>
2016-08-12 20:46:44 +00:00
Jeremy Stanley 4508269e5a cache submission folder on user
this was intended but missed in the original commit

test plan: ensure that submitting a file to an assignment works
 as a new user in a course, with the submissions folder feature on

refs CNVS-30811

Change-Id: Iaa8e00a070e41f39e7890aa89749daeaf9164dce
Reviewed-on: https://gerrit.instructure.com/87156
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2016-08-12 18:28:48 +00:00
Jennifer Stern 26e781fe75 Show help dialog from global nav when support_url setting is set
fixes CNVS-30931

The help tray should come up whenever the show_feedback_link setting is set
even if the default account has a support_url setting.

Test plan:
- Set the support_url account setting for the domain root account or the
default account.
- Set the show_feedback_link setting
- Verify that the help tray appears in the global nav

Change-Id: Id27ea4b1630afbf30ff71fbfd0854c1289915fb5
Reviewed-on: https://gerrit.instructure.com/87528
Tested-by: Jenkins
QA-Review: Pierce Arner <pierce@instructure.com>
Reviewed-by: Stephen Jensen <sejensen@instructure.com>
Product-Review: Jennifer Stern <jstern@instructure.com>
2016-08-12 17:19:53 +00:00
Steven Burnett d2477f1cc1 remove daily digests from sms, twitter
fixes CNVS-30616

Test Plan:
- Add a communication channel that is a twitter endpoint
  and one that is an sms.
- Notice there is no option to get daily digests for
  either endpoint

Change-Id: I3d9a4107b7a275fb64828edf67b0e095146da52e
Reviewed-on: https://gerrit.instructure.com/86852
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2016-08-12 16:30:44 +00:00
Cody Cutrer e835285ea0 bump rails 4.2 for security fixes
and fix something that became deprecated

Change-Id: Ib335f248add8dc4644b41c56639274a0b3858a66
Reviewed-on: https://gerrit.instructure.com/87533
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-08-11 23:12:43 +00:00
Cody Cutrer 74295796b2 use the cache key method for plugin settings in-proc cache
Change-Id: I2119ae85c8ccee3290f054e172a947894f30529f
Reviewed-on: https://gerrit.instructure.com/87541
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-08-11 19:23:47 +00:00
Simon Williams dcf880cf3d query the right shard for checking failed message existance
fixes CNVS-30881

there seems to be a bug with switchman and using .exists? with
a condition, so for now, just format the query this way.

test plan:
- setup the notification service
- create a message on shard 2 that will fail to send
- run the notification failure processor on shard 1
- it should correctly mark the message as failed

Change-Id: Ib33f05c283d91dd91fd6dea562fdcd760a96b054
Reviewed-on: https://gerrit.instructure.com/87322
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2016-08-11 16:30:45 +00:00
Aaron Kc Hsu 82a71f0452 Conditional Breakdown Graph for Teacher
refs CYOE-246

Test Plan
* Turn on conditional-release feature in Canvas and then go to
assignment show page and check for three bar chart showing in
the sidebar
* Turn off conditional-release feature and the chart should go away

Change-Id: If34a88fb5f9695f813a09228e85a7b4f328c291a
Reviewed-on: https://gerrit.instructure.com/85050
Reviewed-by: Felix Milea-Ciobanu <fmileaciobanu@instructure.com>
QA-Review: Alex Morris <amorris@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
Tested-by: Jenkins
2016-08-11 14:56:13 +00:00
Clay Diffrient d233f8eec3 Move js file to being jsx to prevent errors with compilation
Test Plan:
  - Automated tests pass

Change-Id: I36882bcd0eb7ed008abe98c56d0bce2e04265b62
Reviewed-on: https://gerrit.instructure.com/87430
Reviewed-by: Derek Bender <djbender@instructure.com>
Tested-by: Jenkins
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
2016-08-11 14:20:12 +00:00
Spencer Olson 7f7b041368 use set_id when creating periods via batch update
previously, when a period was created as part of
the batch update process, it would always create
the period on the first grading period group
associated with the context. now, when a set_id
is passed to batch_update, grading periods are
created on the set with the matching set_id.

closes CNVS-30868

test plan:
 - enable multiple grading periods for an account
 - go to the account grading standards page and
   create at least 2 grading period sets
 - create at least one grading period in each of
   the grading period sets
 - refresh the page and verify the grading periods
   you created are contained within the correct
   grading period sets

Change-Id: I0f279496ac75af6240a3caf5259380cc7c51a402
Reviewed-on: https://gerrit.instructure.com/87284
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Nicholas Pitrak <npitrak@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Christi Wruck
2016-08-10 22:26:42 +00:00
Cody Cutrer b331c0512f disable new plugin settings when creating them, not on display
refs CNVS-30864

also be tolerant of plugin settings change from a, uh, plugin

Change-Id: Ib61280fc79ea57a3791092e3a36273f1ccbcaa95
Reviewed-on: https://gerrit.instructure.com/38462
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-08-10 15:37:07 +00:00
Chris Hart 2ece0e01ed Change the (i) icon used for KB shortcuts in RCE
Fixes: CNVS-30749

Test plan:
- Go to any page in Canvas that has the keyboard shortcuts
  link above the TinyMCE/RCE (Assignments, Discussions,
  Outcomes, etc.)
- The icon should now look like a keyboard:
  http://screencast.com/t/ba72OodbaxKH
- There should also be more spacing between the keyboard
  shortcuts link and the HTML Editor link on its right
- The keyboard shortcuts modal should function exactly
  as it did before

Change-Id: I888c605ce49b90d957cdb81a3444f11c12b78145
Reviewed-on: https://gerrit.instructure.com/87212
Tested-by: Jenkins
Reviewed-by: Stephen Jensen <sejensen@instructure.com>
QA-Review: Pierce Arner <pierce@instructure.com>
Product-Review: Chris Hart <chart@instructure.com>
2016-08-10 15:28:47 +00:00
James Williams adf19b364e fix enrollment invalidation/recalculation logging
don't update "state_recalculated_at" on direct recalculation
since we're primarily trying to log the time difference
when invalidated by course/term dates changes

refs #CNVS-29460

Change-Id: I93265d236c8ab958700dab500c49ad3f348aea75
Reviewed-on: https://gerrit.instructure.com/87268
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-08-10 15:21:38 +00:00
Matthew Sessions f5e94e2ce1 Add deleted conversations api
Site admin users can query for deleted conversations
allowing support to handle cases involving disputes
regarding content of conversations that have been
deleted.

Fixes CNVS-30743

Test Plan:
 - Create a conversation
 - Ensure the conversation has a message
 - Delete the conversation which will
   delete all of the messages
 - As a site admin hit
   /api/v1/conversations/deleted?user_id=<user_id>
 - The list of conversation messages should show
 - Provide another query param of conversation_id=<conversation_id>
 - Only deleted messages from the provided conversation
   should show
 - Using the deleted_before and deleted_after query
   params you should be able to filter based on the
   deleted_at date

Change-Id: Ia39d2763627be82f8084877a307ee2737a7e97d2
Reviewed-on: https://gerrit.instructure.com/86946
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Matthew Sessions <msessions@instructure.com>
2016-08-10 15:11:59 +00:00
Jeremy Stanley b736634c58 fix information leak on "broken link" page
fixes CNVS-30850

the "oops you've found a broken link" page leaks the
(non-)existence of a file and also the name of the context
(user or course).

test plan: ensure you are redirected to a login page
if you try to access these URLs when not logged in
(except for a public course):
 - /courses/1/files/course files/blah
 - /users/1/files/my files/blah

in particular, we do not want the name of course 1 or user 1
to be revealed to an unauthorized user

Change-Id: Iad952c35c31cd5034052163bb55db9209aba2125
Reviewed-on: https://gerrit.instructure.com/87228
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: David Tan <dtan@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2016-08-10 01:37:14 +00:00
Chris Hart becd4a223d Fix gray icon color in publish/unpublish button
Fixes: CNVS-30755

Test plan:

When you use the publish button to publish and
unpublish things in Canvas, the icon should
no longer be dark gray:
http://screencast.com/t/cHCeNc6KEA5e

Note: the number of files changed is due to the
icon font stylesheet being dynamically generated
through font custom. If you edit the stylesheet, it
also recreates all the SVG files, etc., when you
compile the icon font.

Change-Id: I00b2ce52027ca64516d4bdd35dff7c315c78d25e
Reviewed-on: https://gerrit.instructure.com/87277
Tested-by: Jenkins
Reviewed-by: Pam Hiett <phiett@instructure.com>
Product-Review: Pam Hiett <phiett@instructure.com>
QA-Review: Pierce Arner <pierce@instructure.com>
2016-08-09 23:39:14 +00:00
Cody Cutrer 9d2a548e74 make sure to mark new plugin settings as not enabled
refs CNVS-30864

and handle more boolean forms of disabled

Change-Id: Icb339ea2431cd5b40cd1762a57e5ee4761c11695
Reviewed-on: https://gerrit.instructure.com/87285
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-08-09 21:51:35 +00:00
James Williams a8e96c8579 cache false values in locked_serializer
Change-Id: I7265c6e4de39a03c87aca54755899e38a7193b1e
Reviewed-on: https://gerrit.instructure.com/87253
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-08-09 19:45:23 +00:00
Pam Hiett b41f0cb370 Add "underline all links" as a user feature option
Fixes: CNVS-30148

notes: can't figure out how to span the feature description
and have it actually work correctly

test plan:
- as a user, navigate to the "account" link from themain nav
- select "settings"
- scroll down to 'feature options' section
- there is an 'underline links' option
- click it on (the links in the left-hand nav will now be
  underlined, as will the titles on the dashboard and the
  links in the right-hand nav = all text links will now
  be underlined)

  example of dashboard with the feature turned on:
  http://screencast.com/t/1Wyo3DdyHDeL

  example of dashboard with the feature turned off:
  http://screencast.com/t/Ws7KMH6Lr

Change-Id: Ice804f343442feb9276ebdf6935462d2853871a5
Reviewed-on: https://gerrit.instructure.com/85229
Tested-by: Jenkins
Reviewed-by: Stephen Jensen <sejensen@instructure.com>
QA-Review: Pierce Arner <pierce@instructure.com>
Product-Review: Kyle Follett <kfollett@instructure.com>
2016-08-09 19:45:01 +00:00
James Williams 6838bf7150 performance improvements for frequent methods
these are being called on every page load
do some caching/preloading to speed them up

Change-Id: If04f98d40e1f9f733529ba971cf3a822701cd78c
Reviewed-on: https://gerrit.instructure.com/87205
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-08-09 19:29:23 +00:00
Colleen Palmer c70e0554f6 Move Help Link
closes: CNVS-30609

This moves the help link to be underneath the other links in the global
navigation, but not fixed to the bottom.

Test Plan:
- Login to Canvas
- Make sure help link is enabled
- Help should now be at the bottom of the global navigation link list

Change-Id: Id17287441f1d52b66cf22a2a871c8a6719cf391a
Reviewed-on: https://gerrit.instructure.com/86222
Tested-by: Jenkins
Reviewed-by: Jennifer Stern <jstern@instructure.com>
Product-Review: Jennifer Stern <jstern@instructure.com>
QA-Review: Pierce Arner <pierce@instructure.com>
2016-08-09 18:50:51 +00:00
Kacey Roberts efb663e016 New Syllabus visibility option for authenticated non-course user.
Test Plan:
- Create a new course
  Course setting[public_syllabus_to_auth] will be false
    Authenticated users not enrolled in the couse can not see the syllabus
     contents.
- Change course setting[public_syllabus_to_auth] to true
  Authenticaed users not enrolled in the course will be have access to
    syllabus as if it was setting[public_syllabus] were true.
- Change setting[public_syllabus_to_auth] to false and set
  setting[public_syllabus] to true
  All access rules will remane the same.
- Setting both settings to false
  The couse will only allow enrolled students to view the syllabus.

Change-Id: I97f49035c8a4749afbffbb5dd08c7b1facea6b03
Fixes: PFS-4867
Reviewed-on: https://gerrit.instructure.com/85169
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2016-08-09 16:26:37 +00:00
Stephen Jensen f3c5500a12 Add loading indicator to modal while upload is happening
closes: CNVS-28752

This commit improves the user feedback throughout the
dashboard card image process by adding a loading spinner
on the course settings page, the change course image modal,
and the flickr search.

Test Plan:
- Enable course images feature flag

- Go to course settings

- Click the "Change Image" button to open
  the Change Image modal

- Drag and drop an image over the modal,
  upload by browsing your computer, and
  upload an image by searching flickr

- In all cases, a loading spinner should
  appear immediately while the upload
  processes (with flickr, it is sometimes
  really brief because the upload happens
  faster)

- Return to the course settings page after
  uploading an image

- Select the cog dropdown on the course
  image and choose 'remove image'

- A loading spinner should briefly appear
  while the image is removed

- Open the Change Image modal again and
  search flickr for an image

- As you search, you should see a loading
  spinner appear as flickr generates
  results

Change-Id: I81b47bdfcfd894cfc73e37fa7e5112cdb72a3a0e
Reviewed-on: https://gerrit.instructure.com/86146
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Pierce Arner <pierce@instructure.com>
Product-Review: Pam Hiett <phiett@instructure.com>
2016-08-09 15:13:26 +00:00
James Williams ad1d6767db improve calls to enrollment_dates
refs #CNVS-29460

Change-Id: Iefaeba6585fb655cf027f6b849c4981af288ec8b
Reviewed-on: https://gerrit.instructure.com/87066
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-08-09 12:35:40 +00:00
James Williams ac73f764d4 fix errors with quiz#root_entries_max_position when loaded
refs #CNVS-29640 #CNVS-30748

Change-Id: I78d6a0feeadd0187506ec9fc8bca13102b6d1d8b
Reviewed-on: https://gerrit.instructure.com/87136
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-08-09 12:35:16 +00:00
Matthew Berns f7bd0a129d remove autofill text from outcome group creation
fixes CNVS-30263

test plan:
- Attempt to create an outcome group
- The text "New Outcome Group" should appear
  as placeholder text, not actual title text
- No other changes in behavior should occur

Change-Id: I21bc21425131215b3664d407db894b588b118e2b
Reviewed-on: https://gerrit.instructure.com/84122
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Tested-by: Jenkins
QA-Review: Alex Ortiz-Rosado <aortiz@instructure.com>
Product-Review: McCall Smith <mcsmith@instructure.com>
2016-08-08 21:44:31 +00:00
James Williams 955a7671cb fix creation of completed enrollments through sis import
test plan:
* use a SIS import to create a new enrollment
 in a course in a 'completed' state
* it should not fail

closes #CNVS-30810

Change-Id: I044fa08bcf2f1992edf3856168572d9dfc611521
Reviewed-on: https://gerrit.instructure.com/87063
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-08-08 21:23:49 +00:00
Clay Diffrient 281463041b Bump version of react-tray to 2.0.1
closes CNVS-24092
closes CNVS-30394
closes CNVS-30342

Test Plan:
  - Make sure the tray is accessible
  - It should maintain focus within the tray when it is open
  - Screenreaders should announce things properly

Change-Id: I743c663a9dcda369faee8986d63d549a96423b07
Reviewed-on: https://gerrit.instructure.com/84736
Tested-by: Jenkins
Reviewed-by: Jennifer Stern <jstern@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2016-08-08 21:16:43 +00:00
Jennifer Stern 669b1fac27 Add help subnavigation panel to global navigation
Refs: CNVS-28038

Test Plan:
- enable the help link in the rails console:
  `Setting.set('show_feedback_link', 'true')`
- enable new ui
- verify that when you clik on the 'help' link in the global nav, the links
display in a navigation tray.
- verify that the create ticket and teacher feedback forms work fine
  (within the tray).
- verify that there is no change to the 'help' dialog when launched from
  the login page or the speedgrader.
- verify that there is no change to the 'help' dialog when launched with
  old ui.

Change-Id: If455bc198fca89a2bf242a8230b30dc8ddfc234d
Reviewed-on: https://gerrit.instructure.com/84116
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Jennifer Stern <jstern@instructure.com>
QA-Review: Pierce Arner <pierce@instructure.com>
2016-08-08 21:15:52 +00:00
Jennifer Stern 8eac576bd0 Add settings to enable/disable and sort default help links
refs CNVS-29180
refs CNVS-28039

Test Plan:
- enable the help link in the rails console:
  `Setting.set('show_feedback_link', 'true')`
- Go to the account settings page for the root account.
- Scroll down to the 'Help menu Options' section
- Verify that you can remove the default links.
- Verify that you can change the order of the links.
- Verify that you can re-add the default links via the '+ Link' button.
- Verify that you can add a custom link via the '+ Link' button.
- Verify keyboard a11y (focus).
- Note: verify help dialog links from both global nav and login page

Change-Id: I11bc305a9e04cafbaca565853fb96991260c8a8c
Reviewed-on: https://gerrit.instructure.com/81629
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Product-Review: Jennifer Stern <jstern@instructure.com>
Tested-by: Jenkins
2016-08-08 21:14:12 +00:00
Stephen Jensen 6e8285d72e Save background image on dashcard automatically
closes CNVS-30697

Test Plan:
- Enable course images feature flag

- Go to the course settings

- Upload an image in the change image modal via
  drag and drop, by browsing through local files,
  and via flickr

- In all cases, on upload the modal should close
  automatically and you should see the preview of
  the image on the course settings page

- Previously, in order for the image to persist there,
  you had to scroll down the page and select the
  'update course settings' button

- Now, if you refresh the page, the image should
  automatically persist without updating the
  course settings

- From the cog dropdown on the image, select the
  option to remove image.

- Previously for image removal to persist, you had
  to update the course settings

- Now, if you refresh, the image removal should
  persist without updating the course settings

Change-Id: Icc91146ad29f936fdcfd8c0f55c54deb85e1dde5
Reviewed-on: https://gerrit.instructure.com/86671
Reviewed-by: Matt Zabriskie <mzabriskie@instructure.com>
Tested-by: Jenkins
QA-Review: Pierce Arner <pierce@instructure.com>
Product-Review: Kyle Follett <kfollett@instructure.com>
2016-08-08 19:37:09 +00:00
Matthew Berns 8ef2bfa815 disable "Edit" button on assessed Account outcome
fixes CNVS-23842

test plan:
- create two account level outcomes (A and B)
- import them into two different courses
- assess outcome A in one of the courses
- editing/deleting outcome A should be disabled in
  that course and on the account level
- you should still be able to delete outcome A
  in the course it's not assessed in
- outcome B should be able to be deleted from either
  course or edited at the account level

Change-Id: I886d6c8dd6e4456772a531d02d0c4c27c95b92c4
Reviewed-on: https://gerrit.instructure.com/84203
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
QA-Review: Alex Ortiz-Rosado <aortiz@instructure.com>
Tested-by: Jenkins
Product-Review: McCall Smith <mcsmith@instructure.com>
2016-08-08 18:57:12 +00:00
Matthew Berns 8f2d1530ce add workflow_state to submission api documentation
closes CNVS-28074

test plan:
- go to submission api documentation page
- there should be documentation for workflow_state

Change-Id: I93f2e33e19476da638ddc6ef294c00194975c073
Reviewed-on: https://gerrit.instructure.com/84911
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
QA-Review: Alex Ortiz-Rosado <aortiz@instructure.com>
Tested-by: Jenkins
Product-Review: Josh Simpson <jsimpson@instructure.com>
2016-08-08 17:55:39 +00:00
Pam Hiett 5997cad4c8 remove extra padding on images in rce
Fixes: CNVS-30279

test plan:
- as a teacher/admin
- navigate to a course > then an assignment (if you already have
  an assignment that has an image in it - go there)... otherwise
  upload an image inside the rce and type some text

  - the old experience added some extra padding within the edit
    view of the rce but it was removed once the assignment was
    saved (for consistency - it no longer exists in either...
    unless the teacher/admin adds it themselves for aesthetics)
    example of new view: http://screencast.com/t/fKAG7H5lk4S

Change-Id: Id80c5dcc71d5f8d242573b7751180dbc4ae2d0e5
Reviewed-on: https://gerrit.instructure.com/86221
Tested-by: Jenkins
Reviewed-by: Jennifer Stern <jstern@instructure.com>
QA-Review: Pierce Arner <pierce@instructure.com>
Product-Review: Kyle Follett <kfollett@instructure.com>
2016-08-08 15:34:57 +00:00
James Williams 67b8fb6025 improve user_dashboard recent activity stream performance
fix some N+1 queries, repeated time_zone calls,
and add a temporary cache around expensive stream item code

Change-Id: Iae5c385d6fd5917d9f35626e2d160ad71074f498
Reviewed-on: https://gerrit.instructure.com/87012
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-08-08 14:50:08 +00:00
Felix Milea-Ciobanu 6fddd54915 cleanup modules view logic
test plan:
- modules functionality should NOT have changed at all to the user

refs CYOE-234

Change-Id: I02dee3ba4c0d9f8712c920e04cefe05b43434f7c
Reviewed-on: https://gerrit.instructure.com/84327
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Alex Morris <amorris@instructure.com>
Product-Review: Felix Milea-Ciobanu <fmileaciobanu@instructure.com>
2016-08-08 14:22:14 +00:00
Andrew Huff 3983e8da1c add Enrollment + UserAccountAssociation kinesis live events
Adds kinesis events for enrollment create and
user_account_association create.

Adds missing specs for kinesis events

Test Plan:
* Set up Kinesis locally (see doc/live_events.md for instructions)
* Create an enrollment; verify that a `enrollment_created` event is sent
  to kinesis (use the `script/tail_kinesis` tool to view kinesis events)
* Reigster a new user; verify that a `user_account_association_created`
  event is sent to kinesis with `is_admin: false`
* Reigster a new admin; verify that a `user_account_association_created`
  event is sent to kinesis with `is_admin: true`

refs CNVS-30241
refs CNVS-30242

Change-Id: If1a4a2f415b95cc78a177a7cef75fbb03808dce1
Reviewed-on: https://gerrit.instructure.com/84339
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Andrew Huff <ahuff@instructure.com>
2016-08-07 17:39:06 +00:00
James Williams c2408f388a don't show groups to students for unpublished courses
try to future proof it as well by tying to :read permission

test plan:
* add a student a group in an unpublished course
* it should not be shown on the dashboard list of groups

closes #CNVS-30391

Change-Id: I84ddeb9a096ad80aec89805b044e03a2c2670ea3
Reviewed-on: https://gerrit.instructure.com/86823
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-08-06 01:54:33 +00:00
Nick Pitrak ebdd8419db fix grading periods api to allow proper delete functionality
fixes CNVS-30548
fixes CNVS-30739

test plan:
- create a course with a teacher and enable multiple grading periods
- create a grading period set and three grading periods in the
  browser, called 'Account Period 1', 'Account Period 2', and
  'Account Period 3'

  course index:
  - hit GET /api/v1/courses/<Course ID>/grading_periods
  - ensure that the request succeeds
  - ensure that all three account periods are returned

  course show:
  - hit GET /api/v1/courses/<Course ID>/grading_periods/
    <Grading Period ID>, where the grading period is any of
    the three account periods
  - ensure that the request succeeds

- create a grading period group off the course by using
  course.grading_period_groups.create!()
- create a grading period by using group.grading_periods.create!(
  title: 'Course Period 1', start_date: Time.now, end_date: Time.now,
  close_date: Time.now)
- create two more grading periods called 'Course Period 2' and
  'Course Period 3'

  course index:
  - hit GET /api/v1/courses/<Course ID>/grading_periods
  - ensure that the request succeeds
  - ensure that only all three of the course grading periods
    are returned

  course show:
  - hit GET /api/v1/courses/<Course ID>/grading_periods/
    <Grading Period ID>, where the grading period is a
    course grading period
  - ensure the request succeeds
  - hit it again with an account grading period
  - ensure the request fails

  course update:
  - hit PUT /api/v1/courses/<Course ID>/grading_periods/
    <Grading Period ID>, where the grading period is a
    course grading period
  - include the argument
    { grading_periods: [{ title: 'New Title' }] }
  - ensure the request succeeds
  - ensure the title of the grading period is changed in the
    console
  - hit it again with an account grading period with the
    same arguments
  - ensure the request fails

  course delete:
  - hit DELETE /api/v1/courses/<Course ID>/grading_periods/
    <Grading Period ID>, where the grading period is a
    course grading period
  - ensure the request succeeds
  - ensure the period has its workflow state set to deleted
    in the console
  - hit it again with an account grading period
  - ensure the request fails

  account index:
  - hit GET /api/v1/accounts/<Account ID>/grading_periods
  - ensure the request succeeds
  - ensure that only all three of the account grading periods
    are returned

  account delete:
  - hit DELETE /api/v1/accounts/<Account ID>/grading_periods/
    <Grading Period ID>, where the grading period is an
    account grading period
  - ensure the request succeeds
  - ensure the period has its workflow state set to deleted
    in the console
  - hit it again with a course grading period
  - ensure the request fails

Change-Id: I34e43e10aadb30a349e1932c132554c44f7ec24a
Reviewed-on: https://gerrit.instructure.com/86961
Reviewed-by: Neil Gupta <ngupta@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Christi Wruck
2016-08-06 00:29:16 +00:00
James Williams a814712b34 add more preloads for enrollment state
should improve state_based_on_date performance

refs #CNVS-29460

Change-Id: Iaffdefd5280b3d3c360cd96b99e171b9c2b3f63e
Reviewed-on: https://gerrit.instructure.com/86977
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-08-05 19:36:46 +00:00
Ryan Shaw 2121cf7430 move "old_unsupported_react" to client_apps
closes: CNVS-30472

since client_apps/canvas_quizzes is the only
thing that cares about our old version of
react and react-router, this moves them out
of canvas and into canvas_quizzes so it is the
only one that can use them. This simplifies
things in canvas so no one ever tries to
use them going forward.

test plan:

* inside of client_apps/canvas_quzzes
  run: `script/build && grunt test`
* it should pass jenkins
* click around in the quiz stats and quiz log
auditing apps to make sure they still load

mv old_unsupported

Change-Id: I56eadedfe2417f32f2afb99ec76a21870871ad7e

WIP move "old_unsupported_react" to client_apps

Change-Id: I673321b51db9b197a298ccb831c417e902aaae28
Reviewed-on: https://gerrit.instructure.com/85483
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2016-08-05 19:26:33 +00:00
Cody Cutrer b2d203bf4b fix cross-shard todo lists
fixes CNVS-30216

test plan:
 * enroll a user into a course on another shard
 * add an assignment to that course, due within the next week
 * masquerade as the out-of-shard student
 * go to the course home page
 * it should show the assignment in the todo list on the top right

Change-Id: I5fdc8fb0eba4b4d4826272450521dc7765ce3203
Reviewed-on: https://gerrit.instructure.com/86838
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2016-08-05 19:07:34 +00:00
James Williams 114fa41175 course timetable event generator
test plan:
* see the new api endpoints in the calendar events controller

* can use the 'set_course_timetable' endpoint to send a schedule
 for a course (optionally per section) with a list of
 weekdays (e.g. "Mon,Wed,Fri") and times

* it will automatically generate calendar events from the start date
 of the course (or section) to the end date that correspond to the dates

* if the schedule is changed, the old events will be deleted and
 new ones generated

* can also use the 'set_course_timetable_events' endpoint to
 generate events from a complete list

closes #CNVS-30523

Change-Id: Idf2b4047af14a6e71838bbe9672583f5bddc3e9f
Reviewed-on: https://gerrit.instructure.com/86051
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2016-08-05 17:07:21 +00:00
John Corrigan a2f1068ae9 enable use of MathMan PluginSetting for latex => svg conversion
fixes CNVS-30392

test plan:

** Code Cogs **

- Add an assignment (or some type of content with a description editable
  via tinymce / rcs).
- Update the description to include a latex equation using the equation
  editor.
- Upon saving the assignment, observe that an image of the equation is
  visible.

*With Mathman*

- Navigate to an account's plugin page, and select the MathMan plugin.
- On the edit screen, enable the plugin, and provide a working mathman
  base url and check the 'Use for svg' checkbox. Save the changes.
- Add an assignment (or some type of content with a description editable
  via tinymce / rcs).
- Update the description to include a latex equation using the equation
  editor.
- Upon saving the assignment, observe that an image of the equation is
  visible.

Change-Id: I1737fc4e583ea82f31875d4ea62dcd9a6bd549e3
Reviewed-on: https://gerrit.instructure.com/84796
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Product-Review: John Corrigan <jcorrigan@instructure.com>
2016-08-05 15:31:36 +00:00
John Corrigan db7d3ccfc1 add PluginSetting for MathMan
fixes CNVS-30442

test plan:
- Navigate to plugin management page.
- Observe that plugin for MathMan is present in the list.
- Click on MathMan.
- Observe that a base_url can be provided, and MathMan can be configured
  to be used for the conversion of latex to svg & MathML.
- Observe that entering a non-url value for the base url will fail.

Change-Id: If72075a57921ae3e3e13fa4665fe093678412da4
Reviewed-on: https://gerrit.instructure.com/85311
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Product-Review: John Corrigan <jcorrigan@instructure.com>
2016-08-05 15:31:09 +00:00
Stephen Jensen 4d3c924758 Allow users to remove images from Dashcard
closes: CNVS-30603

Test Plan:
- Enable the course images feature flag

- Navigate to the Course Settings and select
  'Change Image' to open the Change Image modal

- Use the flickr search option and select an
  image from flickr

- Update course settings so the image persists

- If you navigate to the dashboard, the image
  should display on the dashboard card for
  that course

- Return to course settings

- A cog should now appear overlayed on the
  image in course settings

- If you select the cog, you should see a
  dropdown menu with the options to change
  the image, or remove the image

- If you select 'Change Image', the change
  image modal should appear and you should
  be able to select a different image

- If you select 'Remove Image' the image
  should disappear from the preview in
  course settings

- If you update course settings, the image
  removal should persist, and the image should
  not appear in the preview in course settings

- If you navigate to the dashboard, the image
  should also not appear on the corresponding
  course dashboard card

- Repeat the same process for uploading an
  image from your computer locally

- NOTE: local image uploads are being stored in
  the users course files inside a directory
  labeled 'course_image'. If the currently
  assigned course image is a local image
  upload, and you delete it from this directory,
  and you return to course settings or the dashboard,
  the image should not appear in either place
  after being deleted.

Change-Id: I29ecc3e702cd8e58939da367cc89325027c57c5c
Reviewed-on: https://gerrit.instructure.com/84244
Tested-by: Jenkins
QA-Review: Pierce Arner <pierce@instructure.com>
Reviewed-by: Matt Zabriskie <mzabriskie@instructure.com>
Product-Review: Colleen Palmer <colleen@instructure.com>
2016-08-05 15:13:52 +00:00