Commit Graph

4686 Commits

Author SHA1 Message Date
Simon Williams 99c5a21022 api: allow only offer as a param to course update
fixes #10063

the coures update api required passing at least one course[*something*]
parameter, which meant if all you wanted to do was offer the course, you had to
pass a dummy parameter.

test plan:
- call the course update api an only pass {:offer => 1}
- it should work

Change-Id: I5b89f1f3f474c3b097083f17403e1da20be4ca56
Reviewed-on: https://gerrit.instructure.com/13057
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-08-21 14:34:19 -06:00
Cody Cutrer 7b8dd548d3 a few more things to skip for deleted root accounts refs #6891
Change-Id: Id56c0f9a157734483fad29ffd95b9ea146ff1002
Reviewed-on: https://gerrit.instructure.com/13060
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-08-21 13:49:23 -06:00
Brian Palmer 451c42460e directly return the avatar url in api responses
This will bypass a lot of extra rails requests on things like discusison
topic pages.

refs #9679

test plan: load a discussion topic with lots of user avatars of
different types, veryify they still display correctly.

Change-Id: I29829806da30410c6b938ff3bcf54329a58698c4
Reviewed-on: https://gerrit.instructure.com/13050
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
2012-08-21 13:43:49 -06:00
Simon Williams cb9570c60d account settings ui for calendar 2 and profiles
fixes #10031

provide a checkbox on all account settings pages, only visible to site admin
users, that allows them to enable/disable the new calendar or new profiles in
that account. this will work similarly to how global includes currently works.

test plan:
- as a site admin user, go to account settings
- you should be able to change the settings above
- as a regular admin user, go to account settings
- you should not be able to see/change these settings

Change-Id: Ia36189f0b31b30f2e2aad58652a12f870b9876a6
Reviewed-on: https://gerrit.instructure.com/13016
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-08-21 13:40:06 -06:00
Zach Pendleton 09958db6b6 add highlight color back to jquery ui autocomplete suggestions.
fixes #9863

test plan:
  * navigate to /accounts/:account_id;
  * begin typing in the 'Find a Course' text box until possible
    matches are displayed;
  * verify that when you mouseover results or navigate through
    them with your arrow keys the current option is highlighted.

Change-Id: I9a2b34009f943082e91f9dc640142bfdaeccbe7b
Reviewed-on: https://gerrit.instructure.com/13037
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
2012-08-21 12:44:41 -06:00
Jeremy Stanley 31ff56e24a preserve ContentTag links when overwriting Attachments
fixes #6233

test plan:
 * add a file to a module
 * upload a new file with the same name, overwriting the old one
 * make sure the file still appears in the module
 * make sure the new content is downloaded

Change-Id: Ic861cfd89aa30436f2abcf5d52e00efbcfb935e9
Reviewed-on: https://gerrit.instructure.com/12851
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-08-21 12:05:58 -06:00
Brian Palmer 73495c84dd specs: more generalization of delayed jobs in specs
this gets rid of more of the ActiveRecord Delayed::Job calls in our
specs, so that the specs can be run against other Delayed::Job backends.

Change-Id: I0df99dbb0ab9f7719741cfe7c68e76a4ace8afcf
Reviewed-on: https://gerrit.instructure.com/12958
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-08-21 10:34:56 -06:00
Cameron Matheson 4a4a2f53c1 fix grade-dropping in gradebooks
The main feature of this commit is that it introduces a grade-dropping
scheme that maximizes the students grade (rather than the simple yet
somewhat arbitrary and inconsistent scheme we had before)

Also fixes the following bugs:

fixes #8454
fixes #8330
refs #8177

Test plan:

  Create a few assignments in an assignment group with drop rules
  (you'll need at least 'drop lowest' and 'never drop') and make sure
  those rules are respected in the gradebooks (old and new).

  Don't forget to test with the 'treat ungraded as 0s' option

Change-Id: I7e4f11939a311e1360aedbeda4d4461f317cfee6
Reviewed-on: https://gerrit.instructure.com/12405
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2012-08-21 10:29:47 -06:00
Jacob Fugal 556c94da56 allow more flexible widths/heights in user content
old UserContent.css_size was really weird about what it would accept and
when it would return a String vs. a Float. the times it returned a
Float, it would make api_user_content explode. fix that and add some
specs. the vulnerable code was exercised, among other places, in the
assignment json, which impacts gradebooks and other UI features.

fixes #9881

test-plan:
  - create an assignment in a course
  - in the assignment description, include the html
    <object width='100%' />
  - try and view the gradebook for the course
  - it should not have an ajax request error

Change-Id: I02e824414013347730185fbf7f7fb94a951f3e77
Reviewed-on: https://gerrit.instructure.com/12895
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-08-21 09:50:50 -06:00
Brian Palmer ffa00a25ec query the slave for some expensive queries
Change-Id: Ic2716b75551a85fc028fa7ac0673bf5cb01f14d1
Reviewed-on: https://gerrit.instructure.com/13042
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
2012-08-20 22:28:38 -06:00
Brian Palmer 0d4e118bda optimize query for root attachment to filter db-side
test plan: no visible change in behavior, attachments should still get
root attachments assigned when appropriate.

Change-Id: I866a81b6da81a744483fcadb2bff5b74d229619b
Reviewed-on: https://gerrit.instructure.com/13041
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
2012-08-20 22:14:24 -06:00
Cody Cutrer 02d50f181d ignore incoming messages for deleted accounts
test plan:
 * get some notifications for discussions, conversations, etc.
 * delete the root account
 * reply to the notifications via e-mail
 * undelete the root account
 * the replies should not show up

Change-Id: I2afe5de256cbd55ca360a4327150871ea40d7493
Reviewed-on: https://gerrit.instructure.com/12902
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-08-20 14:08:52 -06:00
Cody Cutrer 3854d260a8 avoid trying to create a wiki in Course#tabs_available
test plan:
 * with a read-only slave environment
 * create a new course
 * go to the course
 * it should not error

Change-Id: Ie0003cec2b684fca1400e6efbcca434a540d5c7a
Reviewed-on: https://gerrit.instructure.com/13032
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2012-08-20 12:23:43 -06:00
Cody Cutrer c45ce31cc6 use a slave for Course#tabs_available
test plan:
 * visit several different courses

Change-Id: I19e8fbefba6164392269d6688df2c58d25e0f34b
Reviewed-on: https://gerrit.instructure.com/13027
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
2012-08-20 11:34:40 -06:00
Brian Palmer 2110996c16 read from the slave for some queries
* calendar events in the .ics feed
 * searching for users in an account
 * user's recent stream items

test plan: verify that these functions still work, both with and without
a slave db configured

Change-Id: Ia596d388642cc9df16e471472406d447a5eb1cf0
Reviewed-on: https://gerrit.instructure.com/13025
Reviewed-by: Zach Wily <zach@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
2012-08-20 11:33:21 -06:00
Zach Pendleton 5600cbaa90 fix default communication channel link. fixes #9963
test plan:
  * create a user with at least 2 confirmed communication
    channels;
  * on the profile page, click the default link (the star) for
    the non-default channel and verify that it is properly set
    as the default.

Change-Id: I1f48fcc9d11d4d5ed2cff60cc5d3b2d28e3fc0d3
Reviewed-on: https://gerrit.instructure.com/12999
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2012-08-20 09:47:27 -06:00
Zach Pendleton ca110e1831 always overflow section list in gradebook2. fixes #9985
previously gradebook2 section list was only set to scroll if there
were more than 15 sections. this caused layout problems for sections
with long names that wrapped onto a second line.

solution is to always overflow the section list if it's taller than
550px.

test plan:
  * create a course with > 15 sections;
  * open gradebook2 in that course and verify that the section list
    is scrollable;
  * view a course with < 15 sections and verify that the section
    list still displays properly.

Change-Id: Iac199bfbf30e0c3f69b9e89b1f5c6b0f4f8fc5d4
Reviewed-on: https://gerrit.instructure.com/12963
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2012-08-20 09:47:09 -06:00
Brian Palmer fef6c52922 fix global_includes error when the user has no association with the account
test plan: as a site admin, or another user who has no account
association but can view an account, visit an account that you aren't linked to.
you shouldn't see a page error.

Change-Id: Ib9544d188ff0e5cb3deb4753967fd69ab485b859
Reviewed-on: https://gerrit.instructure.com/13019
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
2012-08-18 19:31:54 -06:00
Simon Williams 4086a305b5 bring back global include cache expiration
global includes for sub-accounts are cached, but we don't yet have good
expiration based on when the asset paths change, so this brings back a 15
minute caching window that was previously in place.

test plan:
- add sub-account branding
- visit a page and make sure it works (may need to wait up to 15 min)
- remove sub-account branding
- make sure it is gone after 15 minutes

Change-Id: I9c6778c673a18e95f175733bda2f4eb3d6fd2198
Reviewed-on: https://gerrit.instructure.com/13018
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
2012-08-18 18:09:48 -06:00
Simon Williams ae10e512dd change caching strategy for sub-account branding
fixes #9993; fixes #10034

we were caching the user's common account chain, but this was occasionally
caching all of the accounts loaded associations, which wasn't unmarshaling
properly.

the new strategy is to cache the global asset paths that should be used for
different contexts.

test plan:
- no visual changes in sub-account branding
- shouldn't generate any caching errors (these were intermittent and we never
  had solid steps to reproduce)

Change-Id: I37cc58a609ed7f90d967d6ebde74e849c754c0e8
Reviewed-on: https://gerrit.instructure.com/13017
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-08-18 16:07:22 -06:00
Cody Cutrer 98b2009b1c add support for looking up logins based on returned LDAP attribute
closes #9935

test plan:
 * configure an LDAP server without a Login ID Attribute
 * logging in with a pseudonym matching username should succeed
 * set the Login ID Attribute to something the LDAP server
   returns
 * change the pseudonym to match what the LDAP server will return
 * logging in with the same original username should succeed,
   finding the pseudonym named after the returned attribute

Change-Id: I84a154de2bf4fbefa6183a9381ca21441bd2c35a
Reviewed-on: https://gerrit.instructure.com/12910
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2012-08-17 20:07:30 -06:00
Simon Williams 744fa75b83 don't load all enrollments on xhr to course#show
fixes #10003

when grade publishing was disabled, a strange series of events was causing the
course settings page to make a GET xhr request to the course show action, which
handles these types of requests differently and returns the course json with
ALL current enrollments attached.

this sort of defeats the purpose of paginating the enrollments on the course
settings page, so that is sad.

test plan:
- with the network tab open, go to the course settings page in a course with
  lots of students
- you shouldn't see the offending xhr request
- grade publishing should still work

Change-Id: I3348d312ec6ad78b2a1ce9c1c2a9a9685f2f5a19
Reviewed-on: https://gerrit.instructure.com/12982
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-08-17 17:37:49 -06:00
Simon Williams ad10e9f3d0 truncate long urls in the page views table
fixes #9852

they'll be truncated to 100 characters. they'll still link to the full url, and
the full url will be visible by hovering over them for a moment.

test plan:
- as a user, visit some long canvas urls (assignment edit is a good one)
- go to /users/:id
- look through the page views table
- long urls should be truncated, so that all the other columns are always
  visible
- you should be able to see the full url by hovering
- make sure you test in all browsers

Change-Id: I56ebfc667b2252fb626b481d3541f76d0f5836b6
Reviewed-on: https://gerrit.instructure.com/13005
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-08-17 17:34:19 -06:00
Jon Jensen 4996994005 htmlify bio at display time, fixes #10026
convert line breaks, links etc.

test plan:
1. edit to your profile bio
2. put in some breaks and links
3. after saving, the formatting and links should be preserved
4. if you edit again, it should be exactly as it was

Change-Id: I294a3a593260c8b52720e7f272017139578b8031
Reviewed-on: https://gerrit.instructure.com/13007
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Bryan Madsen <bryan@instructure.com>
2012-08-17 17:13:50 -06:00
Brian Palmer 592785c4a6 allow sub-domains to match the redirect_uri on the developer key
fixes #9995

also validates_as_url the redirect_uri, sometimes people were leaving
off the http:// part when setting up the key

test plan: set up a developer key with a given domain. kick off an oauth
request flow with redirect_uri equal to that domain, it should be
accepted. use a sub-domain of that domain, it should also be accepted.
use a higher-level domain, it should not be accepted.

Change-Id: I55510f463b1faa3339b9908f9941715d93de5a16
Reviewed-on: https://gerrit.instructure.com/12980
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-08-17 16:48:34 -06:00
Jeremy Stanley dd143ee73c add data-api-endpoint attribute to urls returned by the api
fixes #9954

test plan:
 - create a wiki page
 - put in links to pages, assignments, discussion topics,
   and files, and also to the index pages for these
 - retrieve the page via the API, and check that the
   data-api-endpoint and data-api-returntype attributes
   are set

Change-Id: Ife67f3119aa73971153f88fe46787d7e1563f0ef
Reviewed-on: https://gerrit.instructure.com/12925
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-08-17 16:41:18 -06:00
Ryan Florence 108fbd3995 added instructions for social contact methods
fixes #9838

Change-Id: Idb629a4db76697092a195f80d01ba7d3b99e2904
Reviewed-on: https://gerrit.instructure.com/12985
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Bryan Madsen <bryan@instructure.com>
2012-08-17 16:08:04 -06:00
Cameron Matheson ee73e7cb06 rename 'edit profile' button to 'edit settings'
fixes #9869

Test plan:
  * go to the profile settings page
  * make sure the edit button in the right sidebar says 'edit settings'

Change-Id: I7362197618080af174f80c3e3059dabb499c8631
Reviewed-on: https://gerrit.instructure.com/12955
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Bryan Madsen <bryan@instructure.com>
2012-08-17 15:20:51 -06:00
Simon Williams ce408483b1 only touch context module once on reorder
fixes #10007

when reordering content in a module, all the content has to be resaved with
its new position. each of these saves was touching the module, which could
cause a huge number of duplicate updates in a big module

test plan:
- reordering items in a module should have no visible changes
- tail the logs while reordering items
- you should only see one call of the form UPDATE "context_modules" SET
  "updated_at" ...

Change-Id: I860c88dad3fd5fde63a2317dacf557acd02729ff
Reviewed-on: https://gerrit.instructure.com/12993
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-08-17 15:14:17 -06:00
rob orton 15c1a1e2ea fix api documentation s/pdf/sis page fixes #9965
Change-Id: I3e092477775cd6f5152b65fe8a9cbb471c411930
Reviewed-on: https://gerrit.instructure.com/12991
Reviewed-by: Jake Sorce <jake@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-08-17 15:06:57 -06:00
Ryan Shaw d97e98c148 stop discussion tooltips from clipping on small screens.
fixes #9510

this uses jqueryui tooltip for discussion unread.

test plan:
  * shrink browser window to at least 1024x768;
  * create a discussion with multiple entries;
  * log in as a member of the class;
  * hover over the total/unread counts and verify that the
    tooltips don't clip.

Change-Id: I10485e6a86debc5fca2c6a1e841568c8b6fb137c
Reviewed-on: https://gerrit.instructure.com/12664
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2012-08-17 15:02:02 -06:00
Simon Williams 1f4599b456 add more detailed errors to ldap tester
fixes #6347

* logs more information on ldap failures and passes it down to the browser in
  the ajax response.
* fixes a crazy javascript bug where we were accidentally using a reserved
  global var in webkit, 'status', which is a string, which interacted strangely
  with our use of it as a boolean. this fixes the tester for firefox/ie

test plan:
(for #6347)
- use the tester in firefox and ie, it should work

(for error messages)
- one at a time, change the fields of a config, and run the tester
- you should get (slightly) more helpful error messages about what is failing,
  based on status returned from the server.

Change-Id: Ic0837d7ff9f6283d615ddd4bbeef5a957dbd6553
Reviewed-on: https://gerrit.instructure.com/12880
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-08-17 14:31:41 -06:00
Cameron Matheson 0f6eae3cf1 include root_account in section_tabs cache key
fixes #9879

The profile nav link should only be shown when @domain_root_account has
profiles enabled.

Test plan:
  * make sure caching is enabled
  * go to to your user settings on an account with profiles enabled
    - you should see a profile link in the sidebar
  * switch to an account that doesn't have profiles
    - you should no longer see the profile tab in the sidebar

Change-Id: If502829ef9d0bfa8117df82e241beb8cd61e03a9
Reviewed-on: https://gerrit.instructure.com/12935
Reviewed-by: Jon Jensen <jon@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Tested-by: Bryan Madsen <bryan@instructure.com>
2012-08-17 14:15:10 -06:00
Cody Cutrer c41434c73c optimize GradePublishingResultsImporter
do it all in a single update query - avoids extraneous touches as well
as several queries to load data that can be checked in the update

test plan:
 * run grade publishing specs
 * publish grades with async option
 * import the results

Change-Id: I95a67cd1c4d7459cb0f28033421328da6de7113a
Reviewed-on: https://gerrit.instructure.com/12992
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-08-17 12:36:14 -06:00
Ryan Shaw 723d9c7e6d make jslint settings more sane
we use jslint just as a last resort effort to make
sure our javascript doesn't have syntax errors or
something.  these changes will make the jenkins
output less verbose.

Change-Id: I937ad1bc6f6b142c4ba424f65e72e9806468638f
Reviewed-on: https://gerrit.instructure.com/12787
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2012-08-17 11:04:40 -06:00
Ryan Florence fe603e25d7 smaller avatar, removed reporting link
closes #9889
closes #10006

Change-Id: I032a1b79d6bd78e0a6173a73ab2babf979820f9a
Reviewed-on: https://gerrit.instructure.com/12986
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-08-17 10:39:04 -06:00
Ryan Florence 7c611cd19a add 'http' to profile links w/o it fixes #9848
when the profile links are rendered they are now
checked for a simple schema, the check is very
loose so people can add tel:// file:// etc.

if there is no schema, http:// gets added to it

Change-Id: I68ad3d83d459916a25941fbf7d2803a68c5bf40b
Reviewed-on: https://gerrit.instructure.com/12987
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-08-17 10:16:39 -06:00
Ryan Florence 8d872d1f9b updated social icons fixes #9857
- moved generic "contact" method icon to "message"
- added a google docs logo

facebook used to be in the 0x0 position, making
any services without an icon default to the
facebook logo, now it defaults to the message
logo which is better until we have an icon for
everything

Change-Id: I05378295dcfc4f86ab865ada838c77e321414cc4
Reviewed-on: https://gerrit.instructure.com/12984
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-08-17 10:16:22 -06:00
Bryan Madsen d843fbf054 label a intermittently failing html editor selenium spec as pending
Change-Id: I227cc42f8f25d03924ea65a4f1c85a66a4655e1d
Reviewed-on: https://gerrit.instructure.com/12988
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-08-17 10:15:26 -06:00
Cameron Matheson ab04533f0c require name when editing profile
fixes #9890

Test plan:
  * edit a user's profile
  * delete the name
  * you should see an error about the name

Change-Id: I05a3ad4ecd429c5e6563574e92571ae59100f0a6
Reviewed-on: https://gerrit.instructure.com/12942
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-08-17 10:01:41 -06:00
Brian Palmer 785c8ca73b fix avatar fallback images using http instead of https
fixes #9451

rack's request.scheme doesn't take x-forwarded-proto into account, so it
was returning http. Using request.protocol correctly handles ssl
termination, it just means we have to chop off the "://" part of the
protocol.

test plan: In an environment using ssl behind a load balancer, load the
avatar for a user that doesn't have one. verify that the gravatar
request redirects back to canvas using https, not http.

Change-Id: Ifb5f42e91379cfe591d29e07cd2ccf1f9d2b19fa
Reviewed-on: https://gerrit.instructure.com/12865
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-08-17 09:45:39 -06:00
Ryan Shaw ac9eebb275 new discussion topics/announcement index, edit and create
closes: #7172

test plan:

* open discussion topic index page:
  - see how it looks in blank course
  - full course
  - try graded & unread filters (make sure you see things you expect to and not those you don't)
  - do bulk actions by clicking checkbox for a few and hitting delete and lock buttons
  - verify infinite scroll works
  - verify that as a student you don't see posts that had delayed posting
  - click "create new" button to make a new one, make sure it works
  - do all the above in the announcement index page

* while viewing announcements index:
  - verify teacher can create external feed on right
  - no right side unless external feeds exist or they are teacher
  - external feeds are listed
  - only teacher can delete external feed

* while editing/creating new discussion/announcement
  - verify that announcement cant be made into assignment
  - for discussion topic, set as assignment and make sure the assignment settings set.
  - cant change discussion -> announcement (& vise versa)
  - type crazy & blank input, verify that it validates it for you
  - title cant be longer than 254
  - make sure these features work:
    - podcast feed
    - student posts in podcast feed
    - delayed posting
    - toggling threaded/unthreaded
    - must post before seeing replies
  - attach file, remove file attachment, upload new attachment should work

* make sure announcements/discussions look & behave right in other places they show up
  (like course, user dashboard)

* if you can think of any other places where you can edit/create discussions/announcements, make
  sure that still works

Change-Id: Ib0acaff8542bf09f99cd7aa99fb3ed16c999d224
Reviewed-on: https://gerrit.instructure.com/12655
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-08-17 09:26:04 -06:00
Jeremy Stanley 81dbbf02fa fix return type for locked_for_user in folders api
fixes #9975

test plan:
 - retrieve a folder using the API
 - locked_for_user should be a single boolean value

Change-Id: I2bd6fcde8554be35ac497700c9e30a714fe96bed
Reviewed-on: https://gerrit.instructure.com/12975
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-08-17 08:56:00 -06:00
Zach Pendleton 8249329f9b don't display end course btn for courses in soft-concluded terms.
fixes #9872

on the course settings page, the 'end this course' button should not
display for courses whose terms have already ended.

test plan:
  * create a course inside of a term whose end_at date has already
    passed;
  * visit the course settings page and verify that the 'end this course'
    button is not visible in the sidebar.

Change-Id: I8f8ddc1cd495a3488fda6989de28d45abd67b6cd
Reviewed-on: https://gerrit.instructure.com/12893
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-08-16 17:05:56 -06:00
Jon Jensen d10d5c5b8b cache permission lookups for additional context types, refs #9957
now cache permission lookups for anything that is_a_context?, except for
the User model (since that might result in a lot of writes to the cache
that seldom get read). this expands the cacheable list to [Course, Group,
Account]

test plan:
1. use course, group and account-related functionality in canvas
2. confirm that the those permissions are cached (rails log) and used
3. do something that sets :session_affects_permissions (e.g. get a
   course invitation and go look at the course)
4. confirm that course, group and account permissions are no longer
   cached, but work correctly
5. confirm that non-context permission checks work correctly and are not
   cached (rails log)

Change-Id: I2aab74e225bb4da1a7f486512575c702415eb6fc
Reviewed-on: https://gerrit.instructure.com/12971
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-08-16 16:33:00 -06:00
Jon Jensen 41f6d8225f refactor grants_rights?, add cache expiration, refs #6058, #9957
clean up grants_right? and grants_rights?, and add cache expiration so
that stale data eventually clears. the cache-related changed are:

1. we now cache "nobody" lookups for course permissions
2. course permission lookups are cached for no more than a day

additionally, there is a slight behavior fix for non-course grants_rights?
calls that care about the session. previously, the session argument to a
"given" block would be set to nil unless the :session_affects_permissions
flag was set. this was *not* the case for grants_right?. so that means
that grants_rights? calls for a non-context could be more restrictive than
the equivalent grants_right? one(s).

a code audit reveals there should be no places where this was actually
happenening today, so the fix shouldn't affect any current permissions
checks in canvas. rubric_assessment.rb would be susceptible, but the
corresponding controller code is unused. eportfolio.rb has some session-
based policy checks, but it was setting :session_affects_permissions.

test plan:
1. use course-related functionality in canvas
2. confirm that the course permissions are cached (rails log) and used
3. do something that sets :session_affects_permissions (e.g. get a
   course invitation and go look at the course)
4. confirm that course permissions are no longer cached, but work
   correctly
5. confirm that non-course permission checks work correctly and are not
   cached (rails log)

Change-Id: Ie7f79054f48f6a9f168510349c3d1f1ef453deb4
Reviewed-on: https://gerrit.instructure.com/12933
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-08-16 16:32:27 -06:00
Cody Cutrer 350c6e498e change wording and color of high-security notice
test plan:
 * log in checking "stay signed in"
 * close the browser
 * open the browser, go to profile
 * it should say "For security purposes, please enter your password
   to continue" in yellow

Change-Id: I6a0f03d5d40314b1422d881f15f7a9053afcfc16
Reviewed-on: https://gerrit.instructure.com/12970
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-08-16 16:32:15 -06:00
Cody Cutrer 1033111308 use login/cas route for cas logins
functionally the same, but allows for higher level routing of CAS
requests apart from general login requests

test plan:
 * login and log out with CAS configured

Change-Id: Id4a9633f2dd48e9d7fe0cf9d3ec917750eb8c8ce
Reviewed-on: https://gerrit.instructure.com/12961
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-08-16 14:23:55 -06:00
Ryan Florence 39f7775ca7 added jQuery.validate method
Change-Id: I5f5e95009eec4febdfb733bbaea51ab8adf81ed9
Reviewed-on: https://gerrit.instructure.com/12941
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
2012-08-16 13:41:28 -06:00
Jeremy Stanley 4f2d096c26 add missing AssignmentsApiController#show documentation
also refactor the assignment description to an @object,
and reference it from all actions.

add some missing Assignment fields too

test plan:
 - make sure the generated documentation for Assignments is good
   (there is no behavior change)

Change-Id: I29815bb5dcd15ae14faac59f9941220415867ec4
Reviewed-on: https://gerrit.instructure.com/12867
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-08-16 13:38:20 -06:00