Commit Graph

11 Commits

Author SHA1 Message Date
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
James Williams 50b4e51ac0 cache mathman results generating mathml
test plan:
* with mathman configured and
 "Use MathMan to convert LaTeX to MathML?"
 enabled, mathml conversion for equations
 in rich content should work as before

closes #CORE-1551

Change-Id: Ib632ee6ea4186cabc782748727e1c67e82f30e10
Reviewed-on: https://gerrit.instructure.com/155808
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2018-07-03 19:22:08 +00:00
Simon Williams e7b8ec1d81 don't require mathman config to check enabled status
test plan:
- remove mathman configuration from consul and/or dynamic_settings.yml
- use the equation editor
- it should work, and use codecogs

Change-Id: Ifd12eca76752dfd520eca6b8aae167daadbe0582
Reviewed-on: https://gerrit.instructure.com/147739
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2018-04-30 22:46:21 +00:00
Cody Cutrer 9ba80db746 don't raise an error if consul is completely unconfigured
just pretend it's empty. the caller should be responsible for dealing
with missing consul data as appropriate

Change-Id: I2c37d33481b55776b14c6c17e109005a75dd600b
Reviewed-on: https://gerrit.instructure.com/125567
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-09-12 22:34:51 +00:00
Cody Cutrer 7197e44389 refactor and impove DynamicSettings
closes CNVS-35834

 * allow specifying tree, service, and cluster for consul stuff
 * check multiple consul keys for each setting (cluster, env, region, global)

test plan:
 * an existing consul environment still works

Change-Id: I48e8fadeac2e140973bfc4b41c1cfb386532d15c
Reviewed-on: https://gerrit.instructure.com/125271
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2017-09-12 22:34:21 +00:00
Simon Williams b2484900f8 switch enabling mathman back to a plugin setting
so we can configure per-account.  still get the url from dynamic
settings.

refs CNVS-35833
refs CNVS-37254

test plan:
- configure the url part of mathman with a dynamic setting and the
use_for svg/mml part with a plugin setting
- it should all work

Change-Id: I4a0963a566cea69fe63cfe2d77278562968d3b97
Reviewed-on: https://gerrit.instructure.com/123048
Tested-by: Jenkins
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2017-08-16 22:20:15 +00:00
Tyler Pickett 9493ad0fa8 Improve MathMan url construction
Fixes: CNVS-38278

Originally we were using Addressable::URI#merge to build up the url,
merge in Addressable isn't like merge in most URL parsers, instead of
handling merging the path component it just clobbers it. Instead, we
want to use #join which exhibits the behavior we want.

Test Plan:
* Configure Math Man to use a URL with a path component
* Rendering equations should work

Change-Id: I6f62daaf4dc2a36e39c8f00d2a974c3ba4032c3f
Reviewed-on: https://gerrit.instructure.com/119741
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Tyler Pickett <tpickett@instructure.com>
2017-07-21 16:14:08 +00:00
Tyler Pickett 823cda8924 Move MathMan to being configured by Consul
Fixes: CNVS-35833

There is a lot more than just moving to Consul going on here. The whole
PrefixProxy business wouldn't be required for this change, but it will
be really useful as we move to adding cluster awareness.

Test Plan:
- Have MathMan running
- Update config/consul.yml to enable use_for_svg and
  use_for_mml under the math-man init values key
- Start Canvas
- Build an equation with the rich content editor
- The equation should be rendered as usual.

Change-Id: I650527ebaecb6224c6ee6ba26346d27dee33b9d7
Reviewed-on: https://gerrit.instructure.com/111543
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Tyler Pickett <tpickett@instructure.com>
2017-06-26 15:54:38 +00:00
Landon Wilkins 5ba312a04d da licença part 32
add consistent license headers to all source files
(ruby, coffeescript, javascript)

except for vendor files

Change-Id: Ibb971e1256b9ebf4ed4b50efac991472abba82fc
Reviewed-on: https://gerrit.instructure.com/110058
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-27 22:00:01 +00:00
John Corrigan f09d340142 don't use PluginSetting.cached_plugin_setting outside plugin setting
fixes CNVS-31176

Also refactor a little so we're not querying the DB for the plugin
setting ~3 times per method call.

test plan:
- With the plugin disabled, observe that MathMan is not used for MathML
  or SVG generation.
- When plugin is enabled, observe that specific settings (whether or not
  to use for one or the other target (mml & svg); the base url) are
  respected.

Change-Id: Ie17942644e02088d967ad19a10b0f96f4cd57665
Reviewed-on: https://gerrit.instructure.com/88389
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: John Corrigan <jcorrigan@instructure.com>
2016-08-26 20:33:26 +00:00
John Corrigan c9e0fa96a3 enable use of MathMan for latex => mathml conversion
fixes CNVS-59514

Also adds a MathMan module that wraps some convenience methods for 1-
figuring out if it's ok to use mathman; 2- constructing urls for hitting
mathman's endpoints.

test plan:

*With Ritex*

- Add an assignment (or some type of content with a description editable
  via tinymce / rcs).
- Update the description to include a latex equation using the equation
  editor.
- Upon saving the assignment, observe that an image of the equation is
  visible.
- Using the browser's elemnt / DOM inspector, select the equation image,
  and observe that there is a hidden span that contain a math ml
  representation.

*With Mathman*

- Navigate to an account's plugin page, and select the MathMan plugin.
- On the edit screen, enable the plugin, and provide a working mathman
  base url and check the 'Use for mml' checkbox. Save the changes.
- Add an assignment (or some type of content with a description editable
  via tinymce / rcs).
- Update the description to include a latex equation using the equation
  editor.
- Upon saving the assignment, observe that an image of the equation is
  visible.
- Using the browser's elemnt / DOM inspector, select the equation image,
  and observe that there is a hidden span that contain a math ml
  representation.

Change-Id: I194d155b339123f7ed1948cf29070c1d17fc7f17
Reviewed-on: https://gerrit.instructure.com/84031
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Product-Review: John Corrigan <jcorrigan@instructure.com>
2016-08-05 15:31:23 +00:00