Commit Graph

23 Commits

Author SHA1 Message Date
Ryan Shaw d86d69015c Opt our js build tooling dirs into prettier
I guess since our team owns these we can opt them in now


Test plan:
* nothing should change

Change-Id: Ic7207e1033869ef60644c41bd5c80a3e8532a6dd
Reviewed-on: https://gerrit.instructure.com/171471
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2018-11-07 22:46:16 +00:00
Landon Wilkins 1649b7e30c da licença part 51
add consistent license headers to all source files

Change-Id: Ie6f2d48e5615052512ee19bf090bcd06bcb8e11f
Reviewed-on: https://gerrit.instructure.com/110162
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 19:05:00 +00:00
Ryan Shaw d6cda30564 allow app/jsx/bundles/<name>.js for js bundles
closes: CNVS-35702

This makes it so you don’t have to create a coffeescript
file to make a new bundle. Putting a file in:
app/jsx/bundles/foobar.js
will be treated exactly the same as:
app/coffeescripts/bundles/foobar.coffee

So from here on out, there is no excuses to create
new coffeescript files :)


Test plan:
* in the next commit I will actually move a couple
  CoffeeScript files to be javascript files in the
  jsx folder and it will make more sense

Change-Id: Ib5911b0a19760d66f43889c94f91fdd1eb9f85e9
Reviewed-on: https://gerrit.instructure.com/105166
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-03-16 20:40:55 +00:00
Jon Jensen e65e404a56 remove ember_bundle magic, refs SD-2097
just check in main.coffee, it pretty much never changes (especially since
the ember srgb will diaf soon)

this is (hopefully) one of the last pieces of the webpack puzzle

test plan:
* webpack and requirejs builds should be happy
* srgb should boot up in both

Change-Id: Icc1a6ad811cffca5ef18a6858d9103c9bbccf037
Reviewed-on: https://gerrit.instructure.com/103352
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-02-28 00:34:24 +00:00
Ryan Shaw 6698f41c9d [webpack] don’t rely on a ‘compiled’ version of ember bundle
fixes: CNVS-35043

in the webpack build, we were relying on a 
‘public/javascripts/compiled/bundles/screenreader_gradebook.js’ file
that was created as an artifact from the requireJS build.

that looked like: 
require(['compiled/ember/screenreader_gradebook/main'], 
function(App) { window.App = App.create(); });

this file does the same thing so we don’t have to worry about running 
rake canvas:compile_assets before running webpack.


test plan:
*
* in webpack, go to the “individual view” (aka screenreader) gradebook
* it should load and not have any errors

Change-Id: I900004a6d73971f8dce01915ec69172341151f8a
Reviewed-on: https://gerrit.instructure.com/102296
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-02-17 19:06:31 +00:00
Ryan Shaw be06b8b467 Revert "get webpack to work if using symlinks"
This reverts commit 582417ce0b.

we are just going to stop using symlinks in caturday

Change-Id: If1957f932b98cca0d6e42ae9f37928a9f34249eb
Reviewed-on: https://gerrit.instructure.com/99279
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2017-01-12 17:10:03 +00:00
Ryan Shaw 582417ce0b get webpack to work if using symlinks
fixes: CNVS-34235

test plan:
* automated tests should pass
* make sure that you see that it picks up all 
  the plugin stuff in the jenkins webpack build
* mv gems/plugins ./moved_plugins
* ln -s ./moved_plugins gems/plugins
* run webpack with those plugins in the symlinked
  directory
* it should work

Change-Id: I97024d29d9dbf153147781af05c205fe766c0bd3
Reviewed-on: https://gerrit.instructure.com/99159
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-01-09 23:41:10 +00:00
Ryan Shaw e116bb0d90 Webpack: better handling of chunks and cdn stuff
fixes: CNVS-31779 [webpack] bundle file size
test plan:
* using webpack, look at the network panel in
  the chrome developer console.
* the total ammount of javascript loaded for any
  given page should be much less than before this commit
  and about on par with what requireJS loads for the same page.
* use chrome network panel to throttle to "Regular 3G"
* from both a clean cache and a primed cache:
* make sure that the total time to render the page
  is about on par with requireJS

first change: load webpack chunks from CDN

fixes: CNVS-32261

test plan:
* run `npm run webpack-production`
* check your page, it should load js files and chunks
  from the same hostname the page is served from.
* now set a host: in config/canvas_cdn.yml
  (for testing locally, I just set it to http://127.0.0.1:3000,
* restart rails and reload the page, now the scripts and
  chucks should come from that new hostname

second change:include fingerprints in webpack bundle and chunk filenames

closes: CNVS-28628

with this change we don't need to run `gulp rev`
after running webpack and we can load both the bundle
and chunk files safely from the cdn, since they will
have content-based fingerprints so we can tell
browsers to cache them forever. (we set those
http caching headers in lib/canvas/cdn/s3_uploader.rb:53)

test plan:
* for both dev and production
* run `npm run webpack` (or `npm run wepack-production`)
* with a cdn configured in canvas_cdn.yml, run:
  RAILS_ENV=<dev or prod> bundle exec rake canvas:cdn:upload_to_s3
* check to make sure that the page loads the webpack js,
  that there are no errors, and it all came from the cdn

third change: properly handle moment locale & timezone in webpack

test plan:
 (see application_helper_spec.rb)
 * set a non-default user timezone, context timezone
   and locale
* dates should show up in your timezone and and
  the date helper strings should be in your language

better handling of moment custom locales

closes: CNVS-33811

since we now have hatian and maori, we need to do this in
a way that is not just a one-off for maori

test plan:
* set your locale to maori
* in webpack & requireJS make sure dates show up right

Change-Id: I34dbff7d46a1047f9b459d5e1c0d141f435d42fb
Reviewed-on: https://gerrit.instructure.com/95737
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2017-01-03 22:50:31 +00:00
Jeremy Neander a6d83ee28f refactor front end grade calculator and increase spec coverage
This is purely a refactor of the existing grade calculator. It does not
alter existing behavior, but bolsters its spec coverage to protect
against unexpected grade calculation changes.

Ensuring that calculated grades are unchanged before and after this
refactor will be sufficient for QA.

closes CNVS-33841
refs CNVS-33572

test plan:
A. select or create:
  1. a course
  2. a teacher for the course
  3. a student for the course
  4. an assignment group for the course
  5. an assignment in the assignment group
  6. a graded student submission
B. ensure scores are calculated and visible for:
  1. Default (grid) Gradebook
  2. Individual Gradebook (SRGB)
  3. SpeedGrader
  4. Student Grades Page

Change-Id: I1e87949dc690d4ebee4e3960f2adb141bc5a5e0d
Reviewed-on: https://gerrit.instructure.com/96780
Reviewed-by: Shahbaz Javeed <sjaveed@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
Tested-by: Jenkins
2016-12-15 18:31:35 +00:00
Ryan Shaw 951e7060b1 apply standard formatting to ./frontend_build JS code
closes: CNVS-33810

because this is code that runs on node 6, we can
actually rely on all our es2015 "best practices".
this change was because the code in this folder had a bunch
of different styles and incosistencies, and I wanted to clean it
up while I am working on all this webpack stuff before we turn
it on everywhere.

this is basically the result of running:
npm install -g jscodeshift
cd ..
git clone https://github.com/cpojer/js-codemod.git
jscodeshift -t js-codemod/transforms/arrow-function.js canvas-lms/frontend_build
jscodeshift -t js-codemod/transforms/no-vars.js canvas-lms/frontend_build
jscodeshift -t js-codemod/transforms/object-shorthand.js canvas-lms/frontend_build
jscodeshift -t js-codemod/transforms/template-literals.js canvas-lms/frontend_build
jscodeshift -t js-codemod/transforms/trailing-commas.js canvas-lms/frontend_build
npm install -g standard-format
cd canvas-lms/frontend_build
standard-format -w

Change-Id: Ifb347a5577504dbca6402ad3ec71de2ec58a423a
Reviewed-on: https://gerrit.instructure.com/92166
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2016-12-12 19:10:26 +00:00
Ryan Shaw 354325c8a1 use node_modules wherever possible
closes: CNVS-31787

the only things left in bower are things that
are just not avalable on npm because they are so old.
we'll have to continue using the bower versions of them,
but it's ok since they are mostly old ember stuff
that will be ripped out when we finish our react screenreader gradebook

also:
remove some ember stuff that wasn't being used anymore.
nothing was using this stuff

test plan:

this really does touch a lot of stuff. some things
to check out specifically in the prod/optimized requireJS build:
(load the page, click around to make sure things work)

the screenreader gradebook
client_apps:
  quiz statistics
  quiz event logging

creating a new student group

calendar, try all the views (month/agenda/etc)
gradebook 2

turn on the new course/user search feature for your account
and go to accounts/x and search for a user/course

the new react gradebook

use tinymce on a page, make sure that both the service
and local version of it work

Change-Id: I4322a154d289760ab51b92e34dd7fac808b41ba8
Reviewed-on: https://gerrit.instructure.com/93102
Tested-by: Jenkins
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2016-11-01 15:14:52 +00:00
Bryan Holladay 4e9eb7c65d VeriCite plugin integration into Assignments, Gradebook, and Speedgrader 2016-10-07 08:10:56 -04:00
Ryan Shaw 76d19b0c60 in webpack: provide a fallback so require(['jquery'] works
closes: CNVS-31940

This is to try to not break code of our customers
that use RequireJS-style `require`s in their Custom
JS files from ThemeEditor. It is not meant to be
comprehensive. There will be some customers that
need to change their code, but there was a lot that
just used require to load jquery or just load an
external script. this should handle both of those cases.

test plan:
* with webpack turned on, type this into the console:
  require([
    'underscore',
    'jquery',
    'https://code.jquery.com/color/jquery.color.js'
  ], function(_, $) {
    console.log('got', $, _, $.Color.names)
  })
* it should log underscore, jquery and the colors

Change-Id: I88ad111ac6c475c9bb0987ed98bec10417a6eea0
Reviewed-on: https://gerrit.instructure.com/90379
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
2016-09-20 17:15:30 +00:00
Clay Diffrient c093331852 fix webpack trying to bundle license_help file
This fixes it post 4f547f345b

Test Plan:
  - Webpack builds without complaining about it

Change-Id: Ie6d58a3d9ac4b1c9ee4b8a1075c57321c630a3c7
Reviewed-on: https://gerrit.instructure.com/82473
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
2016-06-14 16:37:06 +00:00
Ethan Vizitei 513cadec68 remove react-router from webpack vendor bundle
fixes CNVS-29021

TEST PLAN: webpack should build

Change-Id: I5db995adfbeb876df681e310714e5b65a40af96f
Reviewed-on: https://gerrit.instructure.com/78237
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2016-04-28 21:17:32 +00:00
Ryan Shaw 80a7fb0941 remove "Tour" functionality. nothing used it.
closes: CNVS-28669
refs: CNVS-28781

Back in 2013 we came up with an awesome idea to have these
"Tours" to introduce new features and stuff. It was a
great idea but we don't use it anymore. it has been commented
out so it doesn't show up in the styleguide and all but one
(see below) were commented out of config/tours.rb.
so in the interest of not letting code hang around
that we don't use, I'm removing it (unless anyone is opposed
or has a good reason to leave it). If we want to do it in the
future, we can just add it back, because yay Git!

There was one place in quizzes that was still trying to
use a tour. if you go to create a quiz and edit a question
and then pick another option as the correct answer for a
multiple choice question it would try to show a tour telling
you that you could regrade all the existing submissions. but
in reality it just threw a javascript error and the tour never
popped up. So even though it was still in the code, it didn't
work. Since no one noticed that it stopped working, I'm assuming
we don't need it any more. Quizzes team and quizzes
product/QA, will you confirm this is ok?

test plan:
* no tours should show up anywhere in canvas
* read that paragraph above about the "regrade existing"
  thing in quizzes.
* try that feature, it should work but no tour should show up
  and no error should occur in the console

Change-Id: Ib2d6bbb80f93fd7ca0a33d20c1f57ee16e7027ea
Reviewed-on: https://gerrit.instructure.com/76875
Tested-by: Jenkins
Reviewed-by: Jennifer Stern <jstern@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2016-04-21 18:25:05 +00:00
Clay Diffrient 96674ee369 Remove firebugx from webpack build
This follows up to f725bcf813
by also removing it from the webpack build.

Test Plan:
  - The webpack build works still

Change-Id: I43aa82c129aa9dbf5bf4d4e4928f39701af147a8
Reviewed-on: https://gerrit.instructure.com/75887
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
2016-03-31 18:24:59 +00:00
Ryan Shaw b81b78b325 remove strange jquery_ui_menu bundle
it was just a bundle that required another bundle

the only place we used this calendar2.
this just removes the step of indirection and
simplifies things so we don't have to do extra work
to workaround it in webpack

refs: CNVS-27679

test plan:
in prod env, go to calendar2
do some things that cause modals to open
it should work
do the same with webpack on

Change-Id: I23fc7836e1def8283d582df98f895cdc6d8f1317
Reviewed-on: https://gerrit.instructure.com/73242
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2016-03-28 22:46:06 +00:00
Clay Diffrient 7f6d18f574 Remove unused redux-promise library
Change-Id: If8e348fbbe880034a871c35156a050f2ff486c19
Reviewed-on: https://gerrit.instructure.com/71973
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
2016-02-11 21:40:04 +00:00
Ethan Vizitei 51baba3eeb move content_migration work into support bundle
refs CNVS-25916

the migration_tool plugin uses the secondary
bundle override technique of having an extension
bundle loaded in parallel.  I don't think we
want to support both that and the glue-module
extension approach since only one plugin makes
use of the former.  In order to migrate that
work to extend a core module, the work
needs to be moved to a non-entry-point
module (because overriding require names doesn't
work if you're talking about the bundles
rails knows how to load). All this patchset does
is move the core work done in the content_migration
bundle into it's own module to make a valid
override target for the plugin refactor.

Also adds this new module as a non-entry-point
exception in the bundles.js, just like it's sibling
file.

TEST PLAN:
 1) nothing should change on /courses/x/content_migrations

Change-Id: I2dfa0d1b1d11657bb5931e8caae6ef9d4b3c9aec
Reviewed-on: https://gerrit.instructure.com/70510
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2016-01-19 18:25:12 +00:00
Ethan Vizitei f6b4b6e0e1 glob for web pack bundles
refs CNVS-25916

newly added bundles are being missed.
Look for bundles in "app/coffeescripts/bundles"
and reject those which are not entry points.

TEST PLAN:
  1) specs should pass
  2) web pack selenium build should have less failures

Change-Id: I7562e4f6124a78b62cdd59151067ce31ac65e164
Reviewed-on: https://gerrit.instructure.com/69311
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2015-12-22 15:47:36 +00:00
Ethan Vizitei 765507f63e several things to help webpack compile speed
closes CNVS-25714

TEST PLAN:
web pack should compile in like 60 seconds rather than 600

Change-Id: I74716d9cccfd0253693660c0b4ad4368e91b72e7
Reviewed-on: https://gerrit.instructure.com/68497
Tested-by: Jenkins
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2015-12-09 19:25:30 +00:00
Ethan Vizitei d7f61d1820 use web pack
closes CNVS-24124

makes working with web pack possible in canvas
instead of require-js.  See doc/working_with_webpack.md
for instructions.

TEST PLAN:
Nothing should change in non-webpack'd behavior
Things should mostly work when you use the
USE_WEBPACK environment variable, but make sure to document
and ticket things that don't

Change-Id: I493a259a609e9e183950bc57aa5876df70108547
Reviewed-on: https://gerrit.instructure.com/64386
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2015-11-02 16:27:14 +00:00