Commit Graph

24 Commits

Author SHA1 Message Date
James Williams 11585b2d33 fix legacy wiki front page behavior
test plan:
* create a course
* create a wiki page with the old default front page title
 "Front Page"
* replicate the legacy wiki state in the console with the
 following command:

 course = Course.find <COURSE_ID>
 course.wiki.update_attribute(:has_no_front_page, false)

* "Front Page" should be the front page

closes #CNVS-18060

Change-Id: Ieabf84d5c601bab4f5a2d898af847b933aa1e5eb
Reviewed-on: https://gerrit.instructure.com/47605
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Tested-by: Jenkins
2015-01-22 14:33:36 +00:00
Mark Severson 789f25b1b2 fix group wiki pages
fixes CNVS-17705

test plan:
 * smoke test group Pages (/groups/:id/wiki)

Change-Id: Ie3ee3e26a008f59716b135d8e0b62f2f89b480ec
Reviewed-on: https://gerrit.instructure.com/46534
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Mark Severson <markse@instructure.com>
2015-01-06 19:26:57 +00:00
James Williams 2c69f3966b remove non-draft-state everything
test plan:
* basic regression test on assignments, discussion topics
 gradebook, and modules (mostly make sure the basic
 index/show/edit views aren't broken)

closes #CNVS-15563

Change-Id: I3411bfb7645b3c4bf8a4663e3e052b4402f899ba
Reviewed-on: https://gerrit.instructure.com/43609
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
2014-12-10 17:57:18 +00:00
Mark Severson 1a245e6bdd remove non-draft state wiki pages
test plan:
* regression test wiki pages

closes CNVS-16203

Change-Id: Ic37c69c8696151dc99f1df6f3cc9b013835b12a4
Reviewed-on: https://gerrit.instructure.com/42552
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2014-12-09 20:12:24 +00:00
James Williams 8eaaa98cf8 make api wiki page retrieval consistent
test plan:
* use the wiki sidebar to create a link
to a new wiki page with a title containing
escapable characters (e.g. spaces)
* follow the link and create the page

* the link will look something like:
/courses/:course_id/pages/new%20page?titleize=0

* confirm that using that url in the api
(e.g. /api/v1/courses/:course_id/pages/new%20page)
retreives the page as well

closes #MBL-3057

Change-Id: I1aba32bef5558b545bf7024e22c3fea76643f231
Reviewed-on: https://gerrit.instructure.com/43145
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
2014-10-22 19:54:49 +00:00
James Williams 8f9c47e0e5 spec: fix some wiki page related specs for draft state
refs #CNVS-15563

Change-Id: I27b19f52389d7ce4a7d7d77554f9c563168ef556
Reviewed-on: https://gerrit.instructure.com/42275
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2014-10-09 19:29:25 +00:00
Cody Cutrer 102fdfc849 no more dynamic finders (models)
refs CNVS-15126

Change-Id: I2996e0e262c41274c34d0ea3bfde757074416b8c
Reviewed-on: https://gerrit.instructure.com/40973
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-09-24 20:51:48 +00:00
Nick Cloward e9595976c1 clean up permission calls for grants_rights?
refs: CNVS-11425

Change-Id: Ia0145e4b4d1da9e0f83a1845647ce203b3586057
Reviewed-on: https://gerrit.instructure.com/34280
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-06-19 18:10:30 +00:00
Anthus Williams 828981e72c define exportable attributes/associations on models
instead of passing an :exportable option to
ActiveRecord::Associations, simply define a constant
on the class containing exportable associations and
attributes. This is due to :exportable breaking
ActiveRecord, and we can't simply monkey-patch in
config/initializers because models are included in
migrations before the initializers are run

Change-Id: I11f1a6b4570c397d8e01010c517bc6efdac7afca
Reviewed-on: https://gerrit.instructure.com/33235
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
QA-Review: Anthus Williams <awilliams@instructure.com>
2014-05-06 23:54:24 +00:00
Kenneth Romney 31361b5255 extract lib/text_helper to gems/canvas_text_helper
fixes: CNVS-12305

test plan:
summaries email should be formatted correctly with indentations.
twitter messages should not be longer than 140 characters.

Change-Id: I912a63b03c6c14de0c1d678063bb8fa33504d843
Reviewed-on: https://gerrit.instructure.com/33171
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-30 15:18:40 +00:00
James Williams 6f2b03a56b create temporary records with .scoped.new for rails 3 compatibility
in rails 3, .new is analogous to .build for collections, so otherwise
temporary records will be added to the collection (and be autosaved)

Change-Id: I08ce7b4b35ee35646aff3afd237bbe896162a014
Reviewed-on: https://gerrit.instructure.com/30334
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2014-02-20 20:55:11 +00:00
Mark Severson d88bd8f289 fix hidden/unpublished wiki page visibility
test plan:
 * disable the 'Manage wiki' permission for teachers
 - with draft state disabled
   * navigate to the wiki
     - hidden pages should be listed in the sidebar
   * navigate to a hidden page
     - the page should be shown without error
 - with draft state enabled
   * navigate to the pages index (/courses/.../pages)
     - unpublished pages should be listed in the index
   * navigate to an unpublished page
     - the page should be shown without error
     - the top bar should indicate the page is unpublished

fixes CNVS-10706

Change-Id: I4c6ec29645620a1f6f9386c56e4236d50832ebee
Reviewed-on: https://gerrit.instructure.com/29235
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
2014-01-25 01:10:57 +00:00
Jeremy Stanley dcf3df456b move draft state under feature flag umbrella
fixes CNVS-9496

test plan:
 - draft state feature should show up in site admin feature
   flags, or root account feature flags when called as site
   admin
 - when site admin hits "allow" for the feature, it should
   appear in the root account administrator's settings
   in "Off" state
 - the root account admin should be able to "Allow" the setting
   which allows a sub-account or course to turn it on
 - when the feature is turned on via the Feature Settings tab
   or features API, draft state functionality should appear
   in the course wiki pages and elsewhere

Change-Id: Id7403f2a8371b0a7bfebffbb8f29330fff5c94c5
Reviewed-on: https://gerrit.instructure.com/26308
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2013-11-26 20:43:49 +00:00
Cody Cutrer bb0061832c fix cross-shard permissions checks on wikis
fixes MBL-956

test plan:
 * access a wiki page from a shard it's not on (via the API)
 * it should work

Change-Id: I19a6cc1a87b302ad408a12f97d20d773ec198b51
Reviewed-on: https://gerrit.instructure.com/26252
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-11-13 20:19:40 +00:00
Mark Severson 074151402d allow PUT requests to create wiki pages implicitly
testing note:
  this change affects all wiki page endpoints: api, draft state,
  and non-draft state. basic functionality for all of these
  pages should be verified, specifically when dealing with
  non-existent or deleted pages.

test plan:
 * PUT to /api/v1/courses/:course_id/front_page
   - variations:
     * wiki_page[title] - provided/not provided
     * wiki_page[published] - true/false/not provided
     * wiki_page[hide_from_students] - true/false/not provided
     (hiding/unpublishing the front page is not allowed)
 * PUT to /api/v1/courses/:course_id/pages/non-existent-page
   - same variations as front_page (above)
 * navigating to a non-existent/deleted page (draft state/non-draft state)
   - should redirect teachers to the edit page
   - should redirect students to the index page
     (with an alert message indicating why)
 * navigating to the 'Pages' tab (non-draft state)
   - if the 'Front Page' exists
     - shows the page
   - if the 'Front Page' has been deleted (with draft state enabled)
     - shows the edit page
   - if the 'Front Page' has never existed
     - shows the edit page

 * all other pages functionality should remain unchanged
   - non-draft state UI
     - show page
     - edit page
   - draft state UI
     - index page
     - show page
     - edit page
   - api
     - .../pages
       - GET (index)
       - POST (create page)
     - .../front_page
       - GET (show front page)
       - PUT (create/update front page)
     - .../pages/page-url
       - GET (show page)
       - PUT (create/update page)
       - DELETE (destroy page)

fixes CNVS-8488

Change-Id: I563e6944e1602e0b21ab69c6fe2dcd643c06611d
Reviewed-on: https://gerrit.instructure.com/23590
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-10-04 21:44:29 +00:00
Mark Severson 932bd3dc0e fix legacy wiki front page behavior
test plan:
 - in a course with no pages (new course is best)
 * manually update the course object:
   * set default_view to 'wiki'
 * manually update the course's wiki object:
   * set front_page_url to nil
   * set has_no_front_page to true
 * navigate to the course home page
 - there should not be an error on the page

fixes CNVS-7744

Change-Id: I047db32d2fa7a376be994a1314c0e55a0cadffde
Reviewed-on: https://gerrit.instructure.com/23751
QA-Review: Hannah Bottalla <hannah@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-09-03 19:27:02 +00:00
James Williams 93fb3b95d2 copy wiki front page setting
test plan:
- account-level draft state => disabled
  * create a course
  * set a custom wiki page as the home page
  * copy the course
  * the new course's home page should be the copied front page

  * copy the original course again
  * selectively omit copying the front page
  * the new course's home page should be an empty front page

- account-level draft state => enabled
  * create a course
  * set a custom wiki page as the home page
  * copy the course
  * the new course's home page should be the copied front page

  * copy the original course again
  * selectively omit copying the front page
  * the new course's home page should be the dashboard

fixes #CNVS-7774

Change-Id: If9987cad55f069a2803002de611ecb0d81b2ebc5
Reviewed-on: https://gerrit.instructure.com/23788
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-08-30 12:34:49 +00:00
Mark Severson 4c913efc2e change new pages to show/hide elements correctly
test plan (in the course and group wikis):
 * enable draft state for the account (enable_draft)
 - general
   * Pages course tab navigates to new pages
     - front page
     - index page (if no front page is set)
   * Pages breadcrumb (in pages) navigates to new pages index
 - index page
   * New Page button is hidden unless user has create rights
   * Publish icon & settings cog hidden unless user is a teacher or admin
 - show page
   * Published button is hidden unless user is a teacher or admin
   * Published button functions properly (publishes and unpublishes)
   * Edit button is hidden unless user has edit rights to the page
   * Settings cog/Delete button is hidden unless the user has delete rights to the page
   * Page content is restricted if the page is locked by a module
 - edit page
   * Published indicator is hidden unless user is a teacher or admin
   * Settings cog/Delete button is hidden unless the user has delete rights to the page
   * Title field is hidden unless user has full edit rights (course setting)
   * Hide this page from students is hidden unless user is a teacher or admin
   * ... can edit this page is hidden unless user has full edit rights (course setting)
   * Unauthorized error if page is locked by a module
 - pages api
   * Unauthorized error when updating page if page is locked by a module

fixes #CNVS-6859

Change-Id: I12239e58a5f267c43fd2bcb912c7b485693de2c1
Reviewed-on: https://gerrit.instructure.com/22677
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Sterling Cobb <sterling@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
2013-08-09 17:04:18 +00:00
Mark Severson b06b9388de change wiki permissions to be simpler and more consistent
test plan (on a course wiki and group wiki):
 - the following roles should interact with the wiki as they did before:
   - admin (non-enrolled)
   - teacher
   - student
   - member (group wiki)
   - public (non-enrolled)
 - course setting set to "Teachers and Students" (or "Anyone")
   - students (or anyone) can create pages
   - students (or anyone) can edit an existing page (unless the page is set to "Teachers only")
   - students (or anyone) cannot edit pages set as "Teachers only"
 - non-enrolled admins behave as an enrolled teacher

fixes #CNVS-7046

Change-Id: I677d52a53e83580a56aa9b5b834a50610719e42f
Reviewed-on: https://gerrit.instructure.com/22606
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-07-26 21:53:08 +00:00
James Williams d71b258ed2 allow any wiki page to be set as front page
test plan:
* confirm that wiki pages can be created and updated
with the parameter wiki_page[front_page]
 * if true, this will set the wiki page as the
 front page for the context (assuming the page is
 not hidden to students)
 * if false, this will unset the page as the front page
 (assuming it was the front page to begin with)

* confirm that /courses/:course_id/front_page acts
as a proper endpoint for show/update/destroy and
acts just as /courses/:course_id/pages/:url
for whichever page is set as the front page

* confirm that none of the above page breaks
normal wiki functionality

closes #CNVS-5528

Change-Id: I3f51d740e90ff0a5a39f2aafc988a1a33947ca18
Reviewed-on: https://gerrit.instructure.com/20938
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-05-30 02:51:35 +00:00
James Williams 9cc01263ff don't error on course export if the course name is too long
test plan:
* make a course with a name as long as you can
(255 characters)
* confirm that you can export it successfully

fixes #CNVS-3549

Change-Id: I34dc93ba4578bf67b7155138beee231adeb5d4ef
Reviewed-on: https://gerrit.instructure.com/17376
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
2013-02-05 10:21:20 -07:00
Cody Cutrer 29cf0db046 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>
2012-07-30 09:15:04 -06:00
Jon Jensen fba0c94e4a string extraction for most i18n oddities
Change-Id: Ibdf9315b6165269af2ee0c99a27093d5abc75641
Reviewed-on: https://gerrit.instructure.com/4509
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-06-30 16:48:12 -06:00
Brian Whitmer 8b8173dcc9 Initial commit.
closes #6988138
2011-01-31 18:57:29 -07:00