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>
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>
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>
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>
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>
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>
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>
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>
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>