Commit Graph

17 Commits

Author SHA1 Message Date
Jake Sorce eb49f9b1c8 add data validation to new folder creation, fixes #10906
test plan:
  1. login as a teacher
  2. go to a course
  3. click on files on the left nav
  4. click 'Add Folder'
  5. try to give it a name over 255 characters
  6. text stops at 255 characters, press enter to add
     the folder
  7. folder is saved with no DB error

Change-Id: I1da8595350b3d0c6f23e3052e514bcb55446f141
Reviewed-on: https://gerrit.instructure.com/13982
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
2012-10-02 15:54:37 -06:00
Jeremy Stanley 5b8524b14a Batch file notifications; closes #9012
Test plan:
(We need two users here because Canvas doesn't notify you about
files you upload yourself.  We'll call them Student and Teacher
here, but they don't actually have to be these things.)

 * As Student, enable notifications for new files in Profile.
 * As Teacher, upload a file.
 * Within an hour or so (everything about notifications occurs
   in low-priority background tasks), Student should receive
   a notification for the file.
 * As Teacher, upload multiple files.
 * Student should eventually receive a notification that
   X number of files were added.

Note that files are batched over a five-minute period; that is,
if a file is added to a course within five minutes of a previous
file, it will be counted in the same batch.

Change-Id: I09b5f497cae1d726b7aaf85824e98e69e45b0c1b
Reviewed-on: https://gerrit.instructure.com/12346
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-07-20 14:45:12 -06:00
Bracken Mosbacker c6c7247749 files/folders api
A complete api for folder and file management
Also updates the alphabetical sorting features to escape
a backslash caused errors when casting a string to a
bytea in postgres

Test Plan:
 * CRUD yourself some files
 * CRUD yourself some folder

closes #9163

Change-Id: I0b937f9273077b66ab9d6c37171bec1fcc5380dd
Reviewed-on: https://gerrit.instructure.com/12085
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-07-11 14:32:14 -06:00
Brian Palmer abe0bc7305 protect against recursive folder structures
test plan: in the file browser, try to move a folder into its own child
folder. you should get an error message, rather than a loading progress
indicator that never goes away.

Change-Id: I0e0ed12c07781b92c371068d6e47423b77f15cc2
Reviewed-on: https://gerrit.instructure.com/10952
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-05-23 14:33:11 -06:00
Jon Jensen 506ec04514 save attachments before message creation, fixes #7229
rather than proxy attachments through the conversations controller and
cause a long-running db transaction, we now just send them to the right
place (files controller, s3, whatever), and then create the message. we
now store the attachment in a special folder on the user so that they
can more easily be tracked in the future for quota management.

because we now just store one instance of each attachment, sending a
bulk private message w/ attachments should be a bit less painful.

known regression:
if a user deletes a conversation attachment from their files area, it
deletes if for all recipients. this is essentially the same problem as
tickets #6732 and #7481 where we don't let a "deleted" attachment to
still be viewed via associations with other objects.

test plan:
1. send an attachment on a new conversation and confirm that was sent
   correctly and can be viewed by recipients
2. send an attachment on an existing conversation and confirm that was
   sent correctly and can be viewed by recipients
3. send an attachment on a bulk private conversation and
   1. confirm that was sent correctly and can be viewed by recipients
   2. confirm that only one attachment was actually created, but each
      message in each conversation is linked to it
4. send multiple attachments and confirm that they were sent correctly
   and can be viewed by recipients
5. perform steps 1-4 for both local and s3 uploads

Change-Id: I7cb21c635f98e47163ef81f0c4050346c64faa91
Reviewed-on: https://gerrit.instructure.com/9046
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-04-02 16:39:27 -06:00
Cody Cutrer 0ce24b5887 remove unused notification categories fixes #7394
also move notifications in "new email messages" to "administrative alerts",
because that's a much better description of them

test plan:
 * go to communication preferences
 * the last one should be "administrative alerts"
 * "Files", "Private message from student", "New email messages",
   and "Context Message" should be nowhere to be found

Change-Id: I8b30d53b8137ab4b17cb436920d87331327e01f9
Reviewed-on: https://gerrit.instructure.com/8996
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-02-27 13:24:50 -07:00
Zach Wily 0e3265f26f redirect to new files with the same path as deleted files
Change-Id: I7b5e9736bc06901dde4f16a493f15e5c5f5124ae
Reviewed-on: https://gerrit.instructure.com/5038
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-08-10 20:58:30 -06:00
Zach Wily 10f8bb16b5 fix uploading profile pictures
also switched to storing profile pictures in a new folder ("profile pictures")
so that users will not see a ton of unrelated pictures.

Change-Id: Ia2fd55e1c090db886349319613a7d5ecb33805ac
Reviewed-on: https://gerrit.instructure.com/4950
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2011-08-04 16:18:31 -06:00
Cody Cutrer 7f5cc0693b optimize AdheresToPolicy
Basically, don't call a bazillion procs everytime you check_policy;
just the "given" statement.  Everything else is evaluated just once,
and cached on the class.  This does lose functionality (the ability
to access the instance inside of set_policy, and set methods), but
none of it was currently in use.

Change-Id: I736879d98beb4115a2e8c492931c755076291d08
Reviewed-on: https://gerrit.instructure.com/4665
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-07-14 13:25:28 -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
JT Olds e693123f82 folder i18n
Change-Id: If8bb0ec83eb794b456e5e5912a6947192bb4a148
Reviewed-on: https://gerrit.instructure.com/4142
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-06-09 17:43:24 -06:00
Zach Wily 38ed1ce6b6 look up attachments by relative path by walking the heirarchy; refs #3382
Previously we were just checking every single attachment in the course, which
could take forever in the case of a course with many files. Now we walk the
file heirarchy, which should be much more efficient.

Change-Id: Iab131c7a41c78deff09a9b848eb5a59554f08ba3
Reviewed-on: https://gerrit.instructure.com/3808
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-05-24 09:01:51 -06:00
Brian Palmer 020a92dcf3 make "imported qti files" folder hidden by default, closes #4440
Change-Id: Ifa82c83b459422bff192442025ee99f01262ef99
Reviewed-on: https://gerrit.instructure.com/3497
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-05-06 08:11:32 -06:00
Jon Jensen 528e4aa6e0 let teachers see hidden files, fixes #4489
Change-Id: Ia5a6fb7f3fbe4465851a30440c5ed51c3773eb50
Reviewed-on: https://gerrit.instructure.com/3479
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-05-05 08:55:41 -06:00
Brian Palmer 23e71e669a remove attachments created on import soley for media object import
closes #4382

Change-Id: I1b79ac0ad1043450b7c5ade09f8509b76c9bdc85
Reviewed-on: https://gerrit.instructure.com/3298
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
2011-04-27 10:33:35 -06:00
JT Olds ba735d41b6 direct-to-s3 server side changes
Change-Id: Ie7b415b84f403c98d82f0e67212ae2e7b051b67d
Reviewed-on: https://gerrit.instructure.com/2096
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-02-11 10:49:47 -07:00
Brian Whitmer 8b8173dcc9 Initial commit.
closes #6988138
2011-01-31 18:57:29 -07:00