group assignment grade updates fixes #8469

submissions_api_controller wasn't sending all the
submissions that were updated so the JS didn't
know what to update besides the user being graded

test plan:

1. create a group assignment where students are
   not graded individually
2. go to gradebook2 and give a student a grade
3. observe that when the xhr is finished all the
   students in the group get their grade updated
4. make sure this doesn't happen for non-group
   assignments

Change-Id: Icac1b211c23ea4dee8d381876d511f19cf57239d
Reviewed-on: https://gerrit.instructure.com/12581
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
allow setting collections to private

when a collection becomes private, it can no longer be followed and so all
existing followers are removed.  if it is then set back to public, these
followers are NOT restored.

test plan:
- set a public collection with followers to private
- the collection should no longer have any followers

Change-Id: Ia57937a1fdfaab9d01137f33b2a59f332a124cfb
Reviewed-on: https://gerrit.instructure.com/12490
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
remove WikiNamespace fixes #9121

no user visible behavior change

test plan:
 * make sure existing wiki contents haven't disappeared
 * make sure a new course gets a wiki that functions correctly
 * make sure wiki rss feeds are still functional
 * try to access the wiki from a new course from multiple requests
   simultaneously; it should get a single wiki that's not conflated

Change-Id: I339b56c39d7868dbdec3df4007291a429272b1cf
Reviewed-on: https://gerrit.instructure.com/12432
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
add to filter_parameter_logging and filter query string too

refs #9321

This is fixed in Rails 3.x but the code has completely changed so this
isn't a backport so much as a re-implementation.

test plan: fire up script/server, make an api request with access_token
in the query string, and verify the token isn't logged anywhere (except
in the AR query if you're debug logging, that's still a TODO)

Change-Id: Ibeb97b5caa35b842fe5ad82127439c6b14f73e75
Reviewed-on: https://gerrit.instructure.com/12033
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
add hide student names option to gradebook2.

test plan:
  * open gradebook2 in a course with 50+ students (more
    than will fit in one slickgrid view);
  * click gradebook2 menu, select "hide student names;"
  * verify that student names and email addresses are
    hidden;
  * open menu and select "show student names;"
  * verify that names and email addresses are again visible;

Change-Id: I68e0abc35ca6cec53020dce71d862c802617bb40
Reviewed-on: https://gerrit.instructure.com/12472
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
save gradebook2 cells when clicking outside of slickgrid.

fixes #7332

when user is editing a grade in gradebook2 and clicks outside of
slickgrid, the editing interface isn't closed and slickgrid doesn't
post the new grade to canvas.

this commit adds a faux blur event to slickgrid to capture and
send these changes.

test plan:
  * open gradebook2;
  * click a cell and enter a grade;
  * click in empty space on the page and verify that the editing
    interface closes;
  * reload the page and verify that the new grade has been saved.

Change-Id: Ie97dee1159e2808cb177bd45129ecb025a1693cc
Reviewed-on: https://gerrit.instructure.com/12461
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
include sub-account assets in the right order

fixes #9674

with more than one level of sub-account branding, the branding
was being included in the wrong order for certain pages.

test plan:
- make sure global includes and sub-account includes are enabled
  on the root account
- make a sub account (S1) and enable sub-account includes
- make a sub account of that sub account (SS1)
- add custom branding on both sub accounts, where the branding on
  SS1 is meant to override the branding on S1
- the css should override in the right order

Change-Id: I7579a885e057ce06843bb0b73f2f297391466afa
Reviewed-on: https://gerrit.instructure.com/12567
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
profile links: don't save blank links

Test plan:
  * save your profile page with a row of blank links
  * the blank row should not get saved

Change-Id: I81372e653295298a6cee4e418a02da2fb616ac31
Reviewed-on: https://gerrit.instructure.com/12573
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
don't accept partial birthdates or clear them; fixes #9569

test plan:
  0. Start with a user with no birthdate stored
  1. go to the profile page
   - click Edit
   - leave the birthdate fields alone
   - click Update
   - profile should save
  2. click Edit again
   - choose some, but not all birth date fields
     (i.e., leave year, month, and/or day blank, but not all three)
   - press Update
   - you should get prompt(s) telling you to fill in the missing
     birthdate field(s)
  3. fill in the missing field(s)
   - press Update
   - profile should save
  4. click Edit again
   - verify that you cannot blank out any of the three
     birthdate fields

Change-Id: I4eab732b9bd03b85b468100a8e803996f3cf0eb2
Reviewed-on: https://gerrit.instructure.com/12486
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Fix hidden table description text on new notifications page shows in IE8. closes #9655

Testing notes:
* using IE, visit the /profile/notifications page and verify that the
  table caption does not display.

Change-Id: I6c9c5cac38380f07eae00ff12487d4173c1d0a51
Reviewed-on: https://gerrit.instructure.com/12561
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
change wording on external tool page

fixes #9642

test plan:
  1. go to the default account
  2. click sub accounts on left side nav
  3. add a new sub account under the default
  4. go into the sub account
  5. click settings on the left side nav
  6. click "External Tools" tab
  7. notice new wording on page

Change-Id: Iea1fa43340c910dcbfede4eab7e1ba8c42ff553c
Reviewed-on: https://gerrit.instructure.com/12517
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
don't require email validation on confirmation page, fixes #9591

since we have already "validated" the email (by virtue of them receiving
it and clicking on a link), we don't need to validate it here. fixes an
issue where users with non-email pseudonyms could not get past this page

also tweak form so that pseudonym can be specified if it needs to be set
(for example, the email was already taken by another user)

test plan:
1. as an admin create a new user with a login other than their email
   address
2. check the user's /messages URL to see the email that was sent to the
   user
3. copy and paste the URL that was sent in the email and navigate to it
4. the registration page should allow you to proceed and the label should
   say "Login"

Change-Id: I563b53b16b950bd7f6dafc456349db74fd97b294
Reviewed-on: https://gerrit.instructure.com/12569
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
fix jumping flash notices, fixes #9629

fix issue where flash notice is pinned to the left while it slides down
and then jumps to the middle. there seems to be a difference in how
browsers treat auto margins wrt widths and nested relative elements. we
just make sure everything that might need it gets an auto margin

test plan:
1. do something that generates a flash notice or error (e.g. send a
   message in conversations)
2. it should slide down from the top middle
3. this should work in all supported browsers (ie/ff/chrome/etc)

Change-Id: I6835b932bf057ec6083899a94fefb680b6836419
Reviewed-on: https://gerrit.instructure.com/12585
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
remove uglifier gem

This isn't currently used and won't be used in this way even once we
start using it.

Change-Id: Iba86bd4da6e7a7b08d5a73066f74994dbc667e51
Reviewed-on: https://gerrit.instructure.com/12596
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
remove separate jobs db from example test db config

Some of the selenium specs currently fail with a separate jobs db, so
this is a bad default to give people.

Change-Id: Ide0c2c037c6f5eb8e3661bb49371b6828c29565a
Reviewed-on: https://gerrit.instructure.com/12587
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
spec: fix some intermittent failures

also refactor and clean up some files

Change-Id: Id483a4ec7563023b94e628be8df9504d52ed9c0a
Reviewed-on: https://gerrit.instructure.com/12598
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
show turnitin info in gradebook2, fixes #7450

show appropriate icon in each cell (if any), fix gradebook1 state logic
(show worst state, not average), show turnitin icon/link for text entry
submissions in the submission dialog

1. set up turnitin on the account
2. create an assignment that accepts text entries and uploads
3. enable turnitin on the assignment
4. as a student, upload a file submission (e.g. .doc or something turnitin
   likes)
5. as a different student, submit it via text entry
6. as a teacher, confirm that the turnitin icons now show up in gradebook2
7. click on each submission in gradebook2 to open the comment dialog
8. confirm that the turnitin icon is present, shows the score, and links
   to the originality report
9. go to gradebook1
10. confirm that the turnitin icons still display correctly

Change-Id: If6db3bd5b627b7dd4d306b89f9d0f71acf41b22e
Reviewed-on: https://gerrit.instructure.com/12522
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
load all submissions, fixes #9376

in gradebook2, ensure that all submissions get loaded regardless of
whether a particular section is initially selected. fixes an issue where
grades from other sections would be missing if a particular was selected
when the page initially loaded

test plan:
1. set up a course with multiple sections (and students in them)
2. grade an assignment for students in all section
3. in gradebook2, select one of the sections
4. reload the page
5. confirm that the section is still selected and the grades show up
6. pick another section (or All Sections)
7. confirm that the section changes and that all grades show up

Change-Id: I2d5d44e6b930e15d612cc08a5650f4f0b0c8c336
Reviewed-on: https://gerrit.instructure.com/12605
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Display decimal group weights in GB2. Closes #7553

Display 1 decimal place for group weights in GB2 to match
GB1 behavior. NOTE: Behavior for percentages in GB2 is
a little different than GB1. It shows "0" values in
empty decimal places. (EX: 0.50%)

Testing notes:
* In Gradebook2, set a groups weight to a decimal value like 23.5.
* Verify that it displays without rounding to 24 in header.
* Verify display matches GB1.

Change-Id: I7d56921b6d9a7c3374e148c3a0c8d24a596a62dc
Reviewed-on: https://gerrit.instructure.com/12603
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
api: handle lack of params gracefully for user update

fixes #9681

the user update action was assuming a params[:user] hash, and so if one wasn't
provided, either intentionally or due to a typo or misunderstanding of the
param format, an error would occur.

test plan:
- from the console, send a put request to /api/v1/users/<id> without any
  parameters.
- it should return the user object unchanged.

Change-Id: I931b7ea71f40ff941076db7b5ca0fbf8806a83e3
Reviewed-on: https://gerrit.instructure.com/12604
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>