used to turn 1.0.to_s to "1"
closes #CNVS-28310
Change-Id: I79106a4c0b42fe9b6d96097aaf9dd28a43024373
Reviewed-on: https://gerrit.instructure.com/75194
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
fixes CNVS-21581, CNVS-21582
test-plan:
- regression around all datepicker elements
- for each, when it loads with prepopulated data, that data should be
localized
- the prepopulated localized data should be valid to the datepicker
Change-Id: I633034967c70066e337dc22d9b9ad0cd84793834
Reviewed-on: https://gerrit.instructure.com/60229
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Product-Review: Mike Nomitch <mnomitch@instructure.com>
fixed some errors with really early dates
with assignments in canvas
fixes CNVS-19936
test plan:
- create an assignment with an old date (before the year 1000)
- go to the assignment index notice no crash
- go to assignment show notice correctly shown date
Change-Id: I1733729989b4cf5954dd66c83d9cbd779d189430
Reviewed-on: https://gerrit.instructure.com/53451
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
Stepping through the code, old and new, zone is set to nil when the call
to ::Time.zone happens in the default argument position, but not when it
happens as the first line of the function. I don't yet know why.
fixes CNVS-16799
test plan:
- create an assignment with a due date
- view the assignment as a student. the due date should match
(repeating test plan from commit that caused the regression)
- Create a new course shell and go to the courses settings page and set
the courses time zone as Eastern and save the change.
- Create a new assignment and put a due date of whatever day you want,
but have the time be 11pm and save it.
- When the page reloads, hover your mouse over the due date.
- The due date should be correct (on the day after).
Change-Id: I048d766f1552f2c244b5cdebbd7cc3445ed92969
Reviewed-on: https://gerrit.instructure.com/44148
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
fixes CNVS-13541
write specs to identify the issue
(and to confirm that it's not present
in the javascript layer that does similar
formatting work)
start breaking apart text helper
because we need some object that
can persist a zone override through
all the helpers
pull out a set of utils classes for dealing
with date and time presentation
fix the zone override when doing a date time
presentation across multiple zones
TEST PLAN:
- Create a new course shell and go to the
courses settings page and set the courses
time zone as Eastern and save the change.
- Create a new assignment and put a due date of
whatever day you want, but have the time be
11pm and save it.
- When the page reloads, hover your mouse over
the due date.
- The due date should be correct
(on the day after).
Change-Id: I3274a502545bdbbb482bc7e529446e2fa422740c
Reviewed-on: https://gerrit.instructure.com/42064
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
closes: CNVS-9814
add support throughout our formatting layer
to give us a way to convert values
to the wall clock time of the timezone for
a course (or really any other way we choose),
and then apply that to several selected
date/time displays.
TEST PLAN:
- Login as a user who's part of a course
with at least some data in each tab
- Check the following areas to ensure that
the correct timezone-differentiated hover
text is showing up:
* Announcements -> Date Sent column
* Announcement Detail -> Date Sent (top right)
* Assignments -> Due Date column
* Assignment Detail -> Due Date (bottom table)
* Collaborations -> Start Date
* Discussions -> Last Post Date
* Discussions -> Due Date
* Discussion Detail -> Post date of each reply
* Modules -> (if locked) shows date to unlock
* Quizzes -> Due Date
* Syllabus -> Dates on the left
* Syllabus -> Due dates on the right
* Settings -> Course Details -> start/end date
* Settings -> Sections -> start/end date
* Recent activity page -> Everything
Change-Id: I048c2de85d9f9b196d35c6c65ae104dab7441eee
Reviewed-on: https://gerrit.instructure.com/34861
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Drew Bowman <dbowman@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
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>
refs CNVS-12398
the eventual complete solution will involve teaching the date picker to
parse the localized datetime, but for now, just format the time in
english if the target is a datepicker's field value.
test-plan:
- set locale to portuguese
- datepickers (e.g. assignment due date when editing) populated on page
load should contain the date time in english (e.g. "<date> at 3:00pm"
vs. "<date> em 3:00")
- using the date picker should produce a time in english in the field
- saving the english time should work
- non-datepicker field values with the same formatting rules (e.g.
assignment due date when *not* editing) should display localized
Change-Id: Ibc69d2066518b4875c1f42b794df784c7e70c2c7
Reviewed-on: https://gerrit.instructure.com/33444
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Anthus Williams <awilliams@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
test plan:
* run specs
Change-Id: Ic2a76e3c6290c06f68f06796babbdc5ff3b405d9
Reviewed-on: https://gerrit.instructure.com/29733
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
The spec testing this code was failing in travis-ci, and I tracked it
down to a bug with the selector -- it's not quite css, but not quite
xpath either. It works or not, depending on the underlying version of
libxml that Nokogiri is using. I was able to reproduce the failure using
a recent 64-bit ubuntu VM.
Change-Id: I18838e6132ef495c909329b0a33fb7bb439b2b5d
Reviewed-on: https://gerrit.instructure.com/29181
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
Change-Id: Ibae01f4cd57bffff8d4875f0efdd229564a40a85
Reviewed-on: https://gerrit.instructure.com/27577
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
This brings runtime of the regex back down from exponential to reasonable, and
still catches the most common cases of parens in urls.
test plan:
* In conversations, send a message that includes a url with a balanced
pair of parenthesis in it, something like http://www.example.com/test(one).html
* The formatted display of the message should auto-linkify the entire
url, it shouldn't stop at the opening parens
Change-Id: Iffaea14d1a1f6e1fd1535c115a62dc18caa455a4
Reviewed-on: https://gerrit.instructure.com/15003
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
fixes CNVS-9124
test plan:
* in a course with students, create a new announcement
with at least 2 paragraphs;
* as a site admin, navigate to /users/:id/messages, where
:id is the ID of a student in the course;
* verify that the html email sent to the student displays
with only the line breaks included in the original
announcement.
Change-Id: Ib1d38cda51110e2b66cffb9dae652ad349721076
Reviewed-on: https://gerrit.instructure.com/25723
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
fixes CNVS-5493
test steps:
Trigger the following emails and ensure that the HTML and plain text
versions of the email appear proper.
* conversation message received
* new announcement
* new discussion entry
* new discussion topic
* updated wiki page
* summary (daily or weekly)
Change-Id: I9638badb500eeb6cb23e4a83bd8395cd5dc40608
Reviewed-on: https://gerrit.instructure.com/20296
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Eric Berry <ericb@instructure.com>
QA-Review: Eric Berry <ericb@instructure.com>
fixes CNVS-4514
test plan:
* set up a student or teacher with asap notifications
on discussion entries;
* as a student or teacher that shares a class with the
first user, reply to an existing discussion topic and
include some line breaks in your response;
* verify that the first user's discussion entry
notification and verify that line breaks are preserved.
Change-Id: Iabfbc8db55e883d01621434400ce234a9b3a0e33
Reviewed-on: https://gerrit.instructure.com/18467
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
fixes CNVS-4174
Ruby 1.8 somtimes inserted invalid utf-8 into these columns using a
!binary tag, which 1.9 syck deserializes as ASCII-8BIT encoded. But then
it later blows up trying to append to a UTF-8 erb view or json output.
This adds a whitelisted set of columns for which we want to not only
strip invalid utf-8, but convert ascii encoded strings to utf-8 strings
and strip those too. These columns don't contain any binary data, so
that's an OK conversion to make.
Once Canvas only supports ruby 1.9, we shouldn't get any invalid utf-8
inserted even into serialized columns (YAML in 1.9 raises an exception
on serialization), so we won't need to keep this list up to date with
newly added columns, and we'll avoid accidentally converting a
serialized column that does contain binary data to utf-8.
test plan: rather than switching to ruby 1.8 and inserting bad data,
it'll be easier to just munge the database directly. create a
quiz_questions row with question_data that contains something like:
question_name: !binary |
oHRleHSg
then load the quiz in the UI using ruby 1.9. verify that you see a
question name "test" rather than a page error.
Change-Id: I8054026a06f28b1b61e05ba187bca8403a07fbb5
Reviewed-on: https://gerrit.instructure.com/18059
Reviewed-by: Paul Hinze <paulh@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
In ruby 1.8, it was possible to get invalid utf-8 into the database in
these columns, since the database doesn't check serialized columns
encoding, and ruby 1.8 won't check the encoding either. So in ruby 1.9,
you'll get an error when you try to actually use the data for most
things. This work-around recursively checks the serialized column for
any strings containing invalid utf-8, and just strips it out.
Fixes #CNVS-2587
test plan: using ruby 1.8, insert some bad utf-8 data into a serialized
column. one vector for doing this is to put it in a quiz question. then
switch to ruby 1.9, and verify you can load up the quiz question, and
the bad data has been scrubbed out.
Change-Id: I3272e46dbe5e9b424998c3c7459ea6f5b6b363d4
Reviewed-on: https://gerrit.instructure.com/16619
QA-Review: Clare Hetherington <clare@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
fixes #CNVS-1119, potentially supersedes
https://gerrit.instructure.com/14501 with a little work.
simpler flow that is more consistent with FFT signup. whether you click
the "join course" button (popup) or go to the join url, the workflow is
the same:
1. if you are authenticated, you just click the enroll button.
2. if you are not authenticated, you can either:
1. enter your (canvas/ldap) credentials and submit to join the course.
2. register and join the course (single form). you will then be
dropped on the course dashboard in the pre_registered state just
like a /register signup (you have to follow the link in your email
to set a password).
note that if open registration is turned off, option 2.2 is not available.
other items of interest:
* fix CSRF vulnerabilities where you can enroll authenticated users in
open courses, or un-enroll them if you know their enrollment's UUID
* move to shorter course-id-less route (w/ join code)
* reuse UserController#create
* handy openAsDialog behavior and embedded view mode
* better json support in PseudonymSessionsController#create
* extract markdown helper from mt
* show "you need to confirm your email" popup when you land on the course
page the first time (already showed on dashboard)
test plan:
1. test the authenticated/unauthenticated scenarios above, for both the
popup and join pages
2. regression test of /registration forms
Change-Id: I0d8351695356d437bdbba72cb66c23ed268b0d1a
Reviewed-on: https://gerrit.instructure.com/15902
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
This has very bad performance in some cases.
test plan: text that is converted to html should still auto-linkify
urls, but a ( will now end the url rather than be included in it. for
instance, conversation messages when displayed on the dashboard.
Change-Id: I67f594a8ca18240ecc155d468b3c95d6616a8749
Reviewed-on: https://gerrit.instructure.com/14994
Reviewed-by: Zach Wily <zach@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Fix 'translation missing' helper spec
Fix intermittent timeout issue on 1.8.7
Send ZipFile::CREATE rather than true for 1.9 compatibility
Solve 2 more specs for 1.9.3 in the "lib/cc"
(the main problem here was that both files
used require strategies that assumed 1.8 style
load path configuration. Wrapping them with
'expand_path' makes them able to find the helper.
Also, in the cc_helper, a spec was passing
in a string that needed to be specified as
UTF-8 in order to not confuse nokogiri.)
Fixed google doc id access
(in 1.8.7 the Atom::SimpleExtensions::ValueProxy
representing a document's ID was being to_s'd as
a single value. In 1.9.3, it was including Array
braces around the value, causing the URL for
editing to be malformed. Updating the
GoogleDocEntry class to pull the "first"
value from the ValueProxy allowed it to function
correctly (and is backwards compatible to 1.8))
Fix multiple helper requirement issues
Fix spec string encoding for incoming message processor spec
Fix the counts_report_spec for 1.9
Fix ruby 1.9 errors when testing text_helper.rb
Fix the splat handling for the notification
policy data fixer
Change-Id: Ib70291442eaf2855565db6e451570c0a7670c6ed
Reviewed-on: https://gerrit.instructure.com/14517
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
If an incomplete utf-8 byte sequence comes at the end of an input
string, Iconv with //IGNORE will still include that incomplete sequence
in the output, causing psql errors among other problems. This new method
pads the string with spaces to work around the problem.
refs #10188
Change-Id: Idacae010462f2b98c02afbe4103974f39c0f24c1
Reviewed-on: https://gerrit.instructure.com/13258
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
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>
Return the HTML as an ext ics attribute for those few clients that
support it (Outlook), and return better-formatted plain text for all
other clients.
closes#9107
Also refactor a bit.
test plan: add assignment and calendar events to the calendar with
links, formatted text, etc in their descriptions. Export the calendar
feed. In Outlook, you'll see the full HTML of the event. In most other
clients, you'll see a plain-text version of the description, but it'll
be much better formatted than it was before.
Change-Id: I50af1c407483d84c65ca285cbf364b6a303e0379
Reviewed-on: https://gerrit.instructure.com/11891
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
* faster discussion loading, uses materialized view
* threaded discussion support
* navigate between unread messages
test plan:
* use every feature within discussions
Change-Id: I9e89028e5a618c36a57dae958a16b0be73c35baa
Reviewed-on: https://gerrit.instructure.com/9584
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
added a feed of all your conversation messages. each entry has the following
prperties:
- title is the first several words of the message
- author is the person who wrote the message
- content contains the body of the message, a list of any attachments, and
a line adding context (other participants and shared classes/groups)
test plan:
- go to conversations view
- load the rss feed
- makes sure it contains your messages, attachments, and looks good
Change-Id: I3375dd01285429010b4d75fbea3bf1f7241ddddb
Reviewed-on: https://gerrit.instructure.com/8198
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
A bug in the upgraded nokogiri library was causing nil access errors
when trying to truncate html.
See https://github.com/tenderlove/nokogiri/issues/595
test plan: Send a discussion topic message to the dashboard that is more
than 50 words long. verify that it is truncated with ..., and no error
is generated.
Change-Id: I35523d125e50beac82ed8cf7214a64d6ce0d7001
Reviewed-on: https://gerrit.instructure.com/7989
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
display stream items for new and updated appointment groups, as well as
when someone signs up another user (e.g. group signup)
removed unused message templates, fixed date_string range to just show a
single date if date parts are the same
test plan:
1. publish an appointment group and ensure all pertinent students get a
dashboard notification
2. add times to an appointment group and ensure all pertinent students
get a dashboard notification
3. sign up a group for a timeslot and ensure all other group members
get a dashboard notification
Change-Id: Id0dec52c0376fb6e14b0f26bb60e4695b25f7591
Reviewed-on: https://gerrit.instructure.com/7938
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
Date.today does not accomodate Time.zone. This is a problem when the
time at the time of the call is between Time.zone's midnight and the
system time zone's midnight; Date.today will think it's a day
earlier/later (depending on direction of offset) than Time.zone.today in
that case.
Change-Id: I54083d26dcf704ac00d812597ee6aec95ffa0685
Reviewed-on: https://gerrit.instructure.com/7584
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
You can't have a string that's both markdown_safe and html_safe, so
without this change you can't have a substitution with html in it.
Change-Id: I0f121c5dbfffd1035f937977d2bdb0851a66c320
Reviewed-on: https://gerrit.instructure.com/4251
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
this lets us use wrappers and stuff with markdown
Change-Id: Ia0f778df30ca17d3b734f0ec52b295d237e6517e
Reviewed-on: https://gerrit.instructure.com/4231
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
rails docs discourage the use of ActiveSupport::TimeWithZone.new
Change-Id: I6310ea3a5d29fd1dabd9f0be7a3385564cf011d3
Reviewed-on: https://gerrit.instructure.com/4126
Reviewed-by: JT Olds <jt@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
* Uses Mailman gem
* Can be configured for POP3, Maildir, or stdin (push from mailserver)
* Maildir can be chained with fetchmail or similar to support IMAP
* Can be run as part of the job server, or as a separate process
Change-Id: I000000000000000000000000000001
Reviewed-on: https://gerrit.instructure.com/2971
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
TextHelper#truncate_html doesn't appear to have this issue, because it
always splits and truncates on word boundaries (using String#split()).
Change-Id: I8bf301055818d7080d8e12859707458ba41e89f4
Reviewed-on: https://gerrit.instructure.com/2851
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Hudson <hudson@instructure.com>