Commit Graph

72 Commits

Author SHA1 Message Date
Jacob Burroughs b8ec9f23f1 Bump i18nliner again
Change-Id: I3e67f7feafe50063329d28b0306734a97f669f92
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/298279
Reviewed-by: Charley Kline <ckline@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2022-08-10 22:04:14 +00:00
Spencer Olson ba3cff91bc show accurate availability window
closes EVAL-2274
flag=none

Test Plan:
1. Make sure the "Assignment Enhancements — Student" Feature Flag is
   turned OFF.
1. Create an assignment that has an availability window of exactly
   24 hours.
2. As a student, go to the assignment page (/courses/2/assignments/456)
   and verify the duration in the "Available" section shows "24 hours".
3. Change the availability window to be 2 hours and 15 minutes. As a
   student, verify the duration shows "2 hours and 15 minutes".
4. Change the availability window to be 1 hour and 15 minutes. As a
   student, verify the duration shows "1 hour and 15 minutes".
5. Change the availability window to be 1 hour exactly. As a student,
   verify the duration shows "1 hour".
6. Change the availability window to be 15 minutes. As a student, verify
   the duration shows "15 minutes".
7. Change the availability window to be 1 minute exactly. As a student,
   verify the duration shows "1 minute".
8. Change the availability window to be less than a minute. You'll have
   to do this via the API or a rails console. Here's how I did it via
   rails console:

   	 a = Assignment.find(<id>)
     a.update!(lock_at: a.unlock_at + 48.seconds)

   As a student, verify the duration shows "less than a minute".

9. Change the availability window to be 2 days. As a student, verify the
   duration is not shown.

Change-Id: I91e90e113236819cb42849d20d0d804cdd39fc13
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/292539
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
Reviewed-by: Paulo Chaves <paulo.chaves@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Jody Sailor
2022-06-02 20:40:13 +00:00
Cody Cutrer c2cba46851 RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation
[skip-stages=Flakey]

auto-corrected

Change-Id: I4a0145abfd50f126669b20f3deaeae8377bac24d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279535
Tested-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
2021-11-25 14:03:06 +00:00
Cody Cutrer e73cf9ddf4 RuboCop: Style/HashSyntax
[skip-stages=Flakey]

auto-corrected

Change-Id: I9371a61046aee6b148f89dd434114a8ba2b1188c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279533
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
2021-11-25 14:02:35 +00:00
Cody Cutrer 55428b3440 RuboCop: Rails/Blank, Rails/Present
[skip-stages=Flakey]

auto-corrected

Change-Id: Ia0f5b0a40203d2023200683fa93ab4564372b271
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279084
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-20 21:09:43 +00:00
Cody Cutrer ab80e0acea RuboCop: Style/IdenticalConditionalBranches
auto-corrected, with post review looking for important side effects
of the conditional (one found).

Change-Id: I0fb09793a8645fcac8d81974de9d18a167d2b710
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278946
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-19 22:34:16 +00:00
Cody Cutrer 16bb07021f RuboCop: Style/AndOr, Style/Not
auto-corrected

Change-Id: I410fc4618aa834c62fccf8370866e115b437386a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278802
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-19 22:22:35 +00:00
Cody Cutrer 2152076574 RuboCop: Style/ZeroLengthPredicate
[skip-stages=Flakey]

auto-corrected, and also introduced empty? method on several
file-like classes so that the autocorrect is safe on them

Change-Id: I7c84a39fc3f11cad50bf4ccb3cd97883881c2129
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278756
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-18 23:07:03 +00:00
Cody Cutrer f5a4bfe1bc RuboCop: Style/InverseMethods
auto-corrected

Change-Id: Ic87dab4c152702c8804a623d6dc76337eac2114c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278768
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-18 21:37:28 +00:00
Cody Cutrer d6cc861d50 RuboCop: Style/NegatedUnless, Style/NegatedWhile
auto-corrected

Change-Id: I382bbd776e89244784652751a7efb642827d0209
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278762
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-18 19:04:00 +00:00
Cody Cutrer fe75025e1d RuboCop: Style/RegexpLiteral
[skip-stages=Flakey]

auto-corrected

Change-Id: I98a7afefcbb3631ee046e45fcfc9f955ca7ddca8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278636
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-18 02:08:34 +00:00
Cody Cutrer 3512a9557e RuboCop: Style/SafeNavigation
[skip-stages=Flakey]

auto-corrected

Change-Id: I0a907a6fa6229f05b4f756faf53a8dd2b18ea0c5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278213
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-16 06:36:38 +00:00
Cody Cutrer b70d3ab89d RuboCop: Style/SingleLineMethods, Style/Semicolon
[skip-stages=Flakey]

auto-corrected

Change-Id: Ib94ed586a0d5bf4985a5367144d398eeee706303
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278138
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-12 18:39:32 +00:00
Cody Cutrer 1ccd29b412 RuboCop: Style/PreferredHashMethods
[skip-stages=Flakey]

auto-corrected for the most part, but I went through specs and used
the have_key matcher when possible

Change-Id: I4a2df1cdd536a94f3b493668386883d1148660c9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278050
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-12 16:24:14 +00:00
Cody Cutrer f23a4917d7 RuboCop: Style/RedundantRegexpEscape
[skip-stages=Flakey]

auto-corrected

Change-Id: I21b955242be4150034f8188eb24049cd1204956d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277883
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 02:19:02 +00:00
Cody Cutrer c65d57737a RuboCop: Layout lib
Change-Id: I0655d9a9d750f2debd6378b03d8ddc1403ebc31b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274158
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-22 20:01:52 +00:00
Jacob Burroughs 16b1a67f8e Show a maintenance window
Per-database-server offsets will be added in a separate commit

refs FOO-1600

Change-Id: I836691ba18b373717f139e116b9b91376f67b682
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260356
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2021-03-11 19:04:36 +00:00
Ethan Vizitei 3607f3990f stop NaN failures on lti scores
closes FOO-1283
flag=none

TEST PLAN:
  1) send a request for an LTI result
     with a scoreGiven of 0 and a scoreMaximum of 0
  2) you should get a 422, not a 500.

Change-Id: Iaf42d0e5b7451fba9c7aad26eab23088e3db5897
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/254615
Reviewed-by: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2020-12-08 17:50:43 +00:00
Cody Cutrer 06763dd519 add # frozen_string_literal: true for lib
Change-Id: I59b751cac52367a89e03f572477f0cf1d607b405
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251155
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-10-27 20:49:50 +00:00
Aaron Ogata bb8ea24ae2 replace rdiscount gem with redcarpet
refs CCI-391

Test Plan:
1. Jenkins passes

flag = none

Change-Id: Id4d70067959daae86835ce78a2b38a31940b31f1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242166
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
2020-07-08 18:40:24 +00:00
Landon Wilkins a1cbdc0388 da licença part 35
add consistent license headers to all source files

Change-Id: I14190f63a3c218a0762ef24bc91738bee3e5b919
Reviewed-on: https://gerrit.instructure.com/110063
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-04-28 17:30:19 +00:00
James Williams 12bd2627ab remove float rounding monkey-patch
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>
2016-04-22 18:17:18 +00:00
Jacob Fugal d79ccc78d9 localize values in datetime picker fields
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>
2015-08-14 20:25:02 +00:00
Steven Burnett 5ea437ef60 fixing date time with assignments
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>
2015-05-13 22:28:23 +00:00
Cody Cutrer 9834937c8c don't autorequire a bunch of gems that are rarely used
Change-Id: I09ed3686629b62849d392684d587f30cb2047013
Reviewed-on: https://gerrit.instructure.com/51853
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-04-09 18:47:50 +00:00
Simon Williams bbd7ffa7d7 fix default zone argument
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>
2014-11-10 16:15:12 +00:00
Ethan Vizitei 3d2a65eac4 fix day boundary in overridden time display
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>
2014-10-09 13:56:42 +00:00
Ethan Vizitei 3c19c96287 apply dual timezone filters
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>
2014-05-23 19:01:34 +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
Jacob Fugal 2474323372 don't localized datetimes formatted for datepicker
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>
2014-04-21 15:23:48 +00:00
Raphael Weiner 66e4ee8e66 create utf8_cleaner gem
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>
2014-03-25 21:56:33 +00:00
Raphael Weiner 6ae716da73 extracted html text helper methods into gem
test plan:
  * run specs

Change-Id: I8bd463396aee14853bdcf552eef144a509ffb62a
Reviewed-on: https://gerrit.instructure.com/29613
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-02-07 20:11:19 +00:00
Brian Palmer 82c39989de fix append_base_url for some versions of nokogiri
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>
2014-01-23 17:17:41 +00:00
James Williams 3332c6d60e i18n and html safety fixes for rails 3
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>
2013-12-31 18:37:12 +00:00
Zach Wily f35373286e bring back balanced parens matching, but only a single level
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>
2013-11-27 19:56:03 +00:00
Zach Pendleton 4e8a9f9401 stop adding line breaks to html announcement notifications
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>
2013-10-30 17:08:25 +00:00
James Williams e370322471 prevent incompatible character encodings errors
refs #CNVS-5828

Change-Id: Id0a165363de05f000eee956bf976ffcff70adfc7
Reviewed-on: https://gerrit.instructure.com/21674
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-06-25 19:13:13 +00:00
Eric Berry ee59a60e66 resolved html emails including html tags
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>
2013-05-10 16:48:50 +00:00
Zach Pendleton 3efc58683b preserve html line breaks in discussion entry emails.
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>
2013-03-11 14:24:19 -06:00
Brian Palmer b9692005b2 strip invalid utf-8 from AR yaml columns serialized as binary by ruby 1.8
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>
2013-02-27 11:26:35 -07:00
Brian Palmer 9631cb122a strip invalid utf-8 when loading serialized AR columns
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>
2013-01-11 17:07:26 -07:00
Jon Jensen f74ebd096b self enrollment refactor to facilitate CN integration
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>
2012-12-19 12:29:47 -07:00
Brian Palmer f02c21724e remove the parenthesis balancing matching in linkification
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>
2012-11-02 16:18:49 -06:00
Ethan Vizitei 19cddc7047 [#5773] multiple ruby 1.9 spec fixes
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>
2012-10-23 10:14:24 -06:00
Brian Palmer 325d94955f strip_invalid_utf8 for error reports and incoming messages
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>
2012-08-28 15:06:45 -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
Brian Palmer b283bc3b87 formatting for ICS calendar events
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>
2012-07-02 11:05:48 -06:00
Jon Jensen bae0ce910a fix a couple little regressions
Change-Id: Ib630cecd8f5a05cdc37783e59553e786fa9873ea
Reviewed-on: https://gerrit.instructure.com/11322
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-06-05 21:09:48 -06:00
Ryan Florence 255bd0ea0f new discussions UI
* 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>
2012-03-26 16:53:46 -06:00
Simon Williams df068f8b19 conversations rss feed; closes #6828
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>
2012-02-06 13:27:19 -07:00