Commit Graph

121 Commits

Author SHA1 Message Date
Stephen Jensen ed5d6260a7 Bump instui to version 1.0.2
Test Plan:
- InstUI components in canvas should behave as before

Change-Id: Icf74b119347d1af7d037abe6bed1cab655ca4a48
Reviewed-on: https://gerrit.instructure.com/104670
Tested-by: Jenkins
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Dan Sasaki
Product-Review: Colleen Palmer <colleen@instructure.com>
2017-03-13 22:21:58 +00:00
Ryan Shaw 5b88629fe0 Remove RequireJS support
closes: CNVS-31785

test plan:
all builds should pass

Change-Id: I2925934692a3d2f115f1289d7b50cb72d8cb907f
Reviewed-on: https://gerrit.instructure.com/104492
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2017-03-13 22:10:23 +00:00
Ed Schiebel d1664390e2 Upgrade instructure-ui to 1.0
fixes CNVS-34969

test plan:
  - go /profile/settings and turn on high contrast
  - go to the course people page (/courses/#/users)
  - click on the +People button
  > expected result: the modal honors high contrast

  - enter some text in he text area
  > expected result: nothing bad happens, as the event
    handler for TextArea has changed.
  - there's a TextArea in MessageStudents also, but I don't
    know where to find it in the UI. You should probalby
    test it doesn't blow up either.

Change-Id: Ia8102dacfa2b01ee043002ee0f5c27943abe5743
Reviewed-on: https://gerrit.instructure.com/102133
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Dan Sasaki
Product-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2017-03-08 19:23:07 +00:00
Ryan Shaw 0627c2faef Upgrade brandable_css
fixes: CNVS-35414

the actual changes are here:
https://github.com/ryankshaw/brandable_css/commit/1fa1c2bc10c

Test plan:
Before checking this out, run:
rm -rf public/dist/brandable_css
RAILS_ENV=production node_modules/.bin/brandable_css
rm public/dist/brandable_css/brandable_css_*
cd public/dist/brandable_css/
git init .
git add .
git commit -am “original”
cd ../../..

Check this out, then run:
yarn install
RAILS_ENV=production node_modules/.bin/brandable_css
rm public/dist/brandable_css/brandable_css_*
cd public/dist/brandable_css
git diff

There should be no difference

to test the S3 stuff still works:

* set up your config/cavnas_cdn.yml file with a valid s3 bucket
* run `brandable_css`
* pull up a canvas page.
* the css should show up right and should be coming from your 
  cloudfront url

Change-Id: Iee1a7a916c3f17341adf513c2981b018420f7c16
Reviewed-on: https://gerrit.instructure.com/104016
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-03-06 20:02:51 +00:00
Jon Jensen ec1840b502 make xsslint not need js:generate, fixes SD-2160
this does make xsslint about 10x slower, since:
1. babel is slower than acorn
2. we now have to coffeescript everything on the fly

will revisit perf in another commit

Change-Id: I2ddad309d1921ba6a4e15cd79d3d8bd956a7e403
Reviewed-on: https://gerrit.instructure.com/103850
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-03-03 17:24:16 +00:00
Jon Jensen 162bc79787 pin xsslint
Change-Id: Id1aacd89d1eb1218e2b2803583614b62849732a0
Reviewed-on: https://gerrit.instructure.com/103849
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
2017-03-02 23:03:05 +00:00
Clay Diffrient f8e66bd00a Put proper icons in new user tutorials
This upgrades inst-icons to 1.2.1

closes FALCOR-107

Test Plan:
  - Enable new user tutorials
  - Go to a course
  - The expand icon in the top right should be a |<-
  - When you open it, the collapse icon should be a ->|

Change-Id: Ice6faf1d0762e495d923fd8305ef56be2f268355
Reviewed-on: https://gerrit.instructure.com/102735
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Dan Sasaki
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
2017-03-01 22:30:57 +00:00
Ryan Shaw 05f55c1c30 Deprecate `npm` client. Use `yarn` instead
Closes: CNVS-35152

This changes all our tooling that used `npm` to
Run scripts to use `yarn`. `npm` will still work
for now but if you have yarn installed, it will use
that.

Cheat Sheet:
old command      -> new command
npm install      -> yarn install (or just `yarn`)
npm run webpack  -> yarn run webpack
npm test         -> yarn test
See more at https://yarnpkg.com

Test plan:
* all Jenkins builds should pass
* without yarn installed:
* run script/nuke_node.sh
* it should work and warn you about how `npm` is deprecated
* now install yarn, e.g.: `brew install yarn`
* run script/nuke_node.sh again
* it should work and you should see silly yarn emoji
  in the output and it should be a lot faster

* the docker changes I made should work and docker should
  build correctly and use yarn.

Change-Id: I4aa31eeae3ecc504634a7c72a1ea0d3396f445e3
Reviewed-on: https://gerrit.instructure.com/102969
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-03-01 19:39:01 +00:00
Ryan Shaw 43dd721d3a get `gulp rev` to work with `yarn`
Fixes: CNVS-35153

Test plan:
rm -rf node_modules && yarn install && node_modules/.bin/gulp rev
It should work
rm -rf node_modules && npm install && node_modules/.bin/gulp rev
Should also work

Change-Id: I9ac28df95f821e74ee062eca012e247d3f1f01b1
Reviewed-on: https://gerrit.instructure.com/102967
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-02-23 16:54:55 +00:00
Jon Willesen 9289923ee6 add canvas_offline_course_viewer to package.json
fixes OFFW-104

test plan:
* npm install
* with no offline_web.yml config file, do an offline course export
* should generate a package with a working viewer

Change-Id: I3e100cd1ba722a564f764dd38cd4ca33295de22e
Reviewed-on: https://gerrit.instructure.com/102650
Reviewed-by: Cameron Sutter <csutter@instructure.com>
QA-Review: Cameron Sutter <csutter@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
Tested-by: Jenkins
2017-02-18 00:08:01 +00:00
Ryan Shaw 1145e951c1 eliminate the need to run karma & webpack separately
TL;DR: running JS tests in canvas will be a lot faster & simpler

What you need to know as a developer writing JS in canvas:

Lets say you are working on the “dashboard_cards” feature, just run:
  `npm run jspec-watch spec/javascripts/jsx/dashboard_card`
While you write code and it will have a watcher that catches
any changes and re-runs just the dashboar_card specs if you save any
file that went into it. It should run & reload in less than a few
seconds. You can give it the path to a specific spec file or have it
run an entire directory.

Or, if you are working on something that might touch a lot of stuff, run:
  `npm run test-watch`
and while you are changing stuff, it will run *all* the QUnit specs on
any change. It should only take a couple seconds for webpack to process
the file change and to reload the specs in the browser.

Jenkins can now just run “npm test” for the webpack build. No need to
bundle install then run rake tasks just to run js tests.

This change also starts warning you when you have specs that take a
long time to run (e.g.: https://cl.ly/2i1O3O0J1504). It turns out we
have some *really* slow js specs (like selenium-level slow) so if you
notice a slow spec that you our your team wrote, please fix it.

Longer details:

To test our JS in webpack, we used to
1. run webpack with an env var set so it only does our ember stuff
2. run karma against ember
3. run webpack again against all the rest of the specs canvas
4 run karma again against all the specs in canvas
that took a long time. this change makes it so both the ember
specs and the specs in the rest of canvas run all in the same karma.
it also makes it so karma runs webpack itself. so you don’t need
to run `npm run webpack-test && karma start` to run tests, just
`npm run test` (which is just an alias to `karma start`). it also means
there is now just one watcher (karma) instead of one for both webpack
and karma.

Closes: CNVS-34977

Test plan:
* Jenkins builds should pass
* Try running different variations of the commands up there in the
  description. They should work and be fast-ish.

Change-Id: Ia97f9bfa3677763f218f5f02c9463344f180bc6c
Reviewed-on: https://gerrit.instructure.com/102169
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 21:52:05 +00:00
Ryan Shaw 14b9f2df14 ‘require’ axe from node_modules
Change-Id: I472dda47c01502785a4988aa8c6198e030832d36
Reviewed-on: https://gerrit.instructure.com/102168
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-02-17 19:06:50 +00:00
Ryan Shaw 01f027e2bc Revert "strip out react propTypes in prod webpack build"
this was doing something funky things in the production
webpack build eg: https://cl.ly/3q130H2z0c0u .
I am going to hold off on enabling this untill we have
a chance to really qa it well

This reverts commit 6e5aef277e.

Change-Id: I2f28b7ccc11208fb2fbc799c99aed2f1e69de241
Reviewed-on: https://gerrit.instructure.com/102569
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-02-17 18:39:03 +00:00
Ryan Shaw bfbaaeca68 update fontfaceobserver & react-modal NPM packages
closes: CNVS-34926

test plan:
* go to a page that has a react modal (like
  theme editor), make sure it works
* make sure the custom font that canvas uses
  loads correctly.

Change-Id: I9c37ddfc6b3338e2ebaacb85cb8cdb81c7f9e21c
Reviewed-on: https://gerrit.instructure.com/101681
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-02-14 23:25:54 +00:00
Ryan Shaw f2cd4f7c97 update some NPM packages
test plan:
* these are just spec things, if jenkins passes
  they should be fine

Change-Id: I1628ee92f9ccad372692df5b5c599e093c561ca0
Reviewed-on: https://gerrit.instructure.com/101682
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
2017-02-13 15:53:27 +00:00
Ryan Shaw f88f6a80d5 remove 18nliner-handlebars from canvas’s package.json
it is actually loaded from gems/canvas_i18nliner/
which has it’s own package.json so we don’t
need it in canvas’s package.json too.

test plan:
* i18n part of jenkins build should work

Change-Id: I22581bd0f9e5e39d867a6c60cea897bfb893f2ee
Reviewed-on: https://gerrit.instructure.com/101723
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-02-13 15:34:37 +00:00
Ryan Shaw 32f20ed70d [webpack] add happypack to make build faster
closes: CNVS-31791

test plan:
* automated tests should pass on jenkins
* webpack build should be considerably faster

Change-Id: I3583c92e2bbff5fbbd441853e33057603564601d
Reviewed-on: https://gerrit.instructure.com/100903
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-02-11 23:36:02 +00:00
Ryan Shaw 84dc36d3e1 handle timezone data loading out-of-band from webpack
fixes:  CNVS-34796

emitting assets for each of these timezones adds a
non-trivial amount of time to the webpack build.
by making it so webpack doesn’t have to do anything
about them, it goes a lot faster since there is just
a lot less work to do.

this commit also uses npm to get `timezone` instead
of a git checkout

test plan:
in requireJS & webpack,
* load a few pages, make sure your timezone data loads
* automated specs should pass

Change-Id: Ice3b7b6d4c7ac53315d5cb238d4213afb9faddc5
Reviewed-on: https://gerrit.instructure.com/101116
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
2017-02-10 23:42:48 +00:00
Ryan Shaw e7d9b1150d remove qunitDependencyLoader now that nothing needs it
closes: CNVS-34770

because the previous commit renamed
‘module’ to ‘qunit.module’ in all our specs,
we don’t need this loader anymore

in an effort to get rid of vendor code that is just
copy/pasted into our repo, this also has us use
npm to get qunit, sinon, and AXE.

test plan:
* because this only touches stuff for specs,
  if js specs pass in both webpack and requireJS,
  this should be good.

Change-Id: I1d1cbf187211ad1d04d775fe4469913b3942d74a
Reviewed-on: https://gerrit.instructure.com/101101
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-02-10 21:07:45 +00:00
Ryan Shaw 6e5aef277e strip out react propTypes in prod webpack build
closes: CNVS-34774

test plan:
* using webpack in prod mode
* look at the javascript sources for some components,
  there shouldn’t be anything in there about PropTypes
* the generated code should be smaller & run faster

Change-Id: I8dede0576835a280aec77dea0e128b1e87ea8c6b
Reviewed-on: https://gerrit.instructure.com/100644
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
2017-02-08 00:12:47 +00:00
Jennifer Stern 8eda359850 Upgrade instructure-ui
Fixes: CNVS-34679, FALCOR-95

Test plan:
- Verify that student name has a focus 'halo' when high contrast mode is
  enabled (in student context tray)
- Verify that the radio inputs aren't squished in IE 11 on the New
enrollment UI form.

Change-Id: I77155c2cd3b8daf42456bbc21128bfb799092a0c
Reviewed-on: https://gerrit.instructure.com/101012
Tested-by: Jenkins
Reviewed-by: Jennifer Stern <jstern@instructure.com>
Reviewed-by: Chris Hart <chart@instructure.com>
QA-Review: Dan Sasaki
Product-Review: Jennifer Stern <jstern@instructure.com>
2017-02-07 18:59:26 +00:00
Ryan Shaw 6bdc495373 parallelize the uglify step of webpack prod build
fixes:  CNVS-34725

test plan

* run `npm run webpack-production`
* it should go faster than it used to
* load a page using production webpack files
* it should work

Change-Id: I05d4e3a40f1cad16a1bd8f9e707cc2edea86f91c
Reviewed-on: https://gerrit.instructure.com/101008
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-02-06 16:10:37 +00:00
Ryan Shaw 3e83e882ef upgrade webpack to 2.2.1 final
closes: CNVS-34726

test plan:
* webpack build should pass

Change-Id: Ie789872dd16a7007239182181670644ed397591e
Reviewed-on: https://gerrit.instructure.com/101003
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-02-06 15:40:17 +00:00
Jennifer Stern ce82262cad Fix webpack build (update instructure-ui)
To fix this I released a version of instructure-ui (v0.18.2-bugfix.7)
that adds an index.js file to the lib/components directory.

So now if you require `instructure-ui` in webpack it will link to
`node_modules/instructure-ui/lib/components/index.js` and in requirejs
it will link to `node_modules/instructure-ui/dist/instructure-ui.js`.

Change-Id: Ica048ee488af4f55070260b475b759af0eaa4314
Reviewed-on: https://gerrit.instructure.com/100508
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
Product-Review: Jennifer Stern <jstern@instructure.com>
QA-Review: Dan Sasaki
2017-01-26 17:27:19 +00:00
Cameron Matheson a4a9c3e339 Temporary HCM fix for student context cards (upgrade instructure-ui)
fixes FALCOR-56

Test plan:
  * view context cards for a student (they should work)
  * turn on high contrast mode
  * the tray should also be in high-contrast mode

Change-Id: I64287db9304fca20b9e87370a92727fe4ea2f7d9
Reviewed-on: https://gerrit.instructure.com/100059
Tested-by: Jenkins
QA-Review: Dan Sasaki
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Dan Sasaki
2017-01-24 21:30:30 +00:00
Ryan Shaw e9c83d18e7 don’t try to load quiz web worker from a different origin
in webpack, it would try to load the web worker from the
cdn configured in canvas_cdn.yml. it is against browser
security rules to open a web worker on a different origin,
so in production/beta it would not load and the page to take a quiz
would not load at all. It worked in requireJS because
it didn’t actually know to load the worker from the con
and since it just loaded it from the same domain the page
was served from, it did not have that problem.

this fix just inlines the web worker into a blob and
loads it itself, so there is no cross-origin problems
and we don’t have to have a requireJS or webpack plugin
to load web workers. 

also, fix bug where webpack looked for compiled 
version of quiz_taking_police

fixes: CNVS-34349
fixes: CNVS-34386

test plan:

using the CDN setup for dev/testing

in both webpack and requireJS
go to take a quiz,
the stopwatch should tick every second

Change-Id: I31e6ea0cd22d8dff8c8cb46c68e78d3f5c1989c0
Reviewed-on: https://gerrit.instructure.com/99521
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
2017-01-24 00:51:32 +00:00
Ryan Shaw bae0e670da update react-modal dep in package.json
closes: CNVS-33970

the old version of react-modal was using an older version of lodash.
it only needed the _.assign method but with the old version of lodash
it brought in a ton of extra JS. by using this newer version our bundle
size should be noticably smaller and the webpack build time should be
shorter.

test plan:
* go to a page that has a react-modal & make sure it works
e.g.: go to theme editor and open the modal to name the theme

Change-Id: I9b82c1abe2b10a1977bb171c43878ada470400d3
Reviewed-on: https://gerrit.instructure.com/98149
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
2017-01-23 15:25:11 +00:00
Clay Diffrient 530fd0ce8e Update eslint/airbnb-eslint-config
This also ignores the doc/ directory and should fix errors
on Code Climate

Test Plan:
  - Things work

Change-Id: I5b970daf19a1cfbd4ff61bed07c4f85d6db31f8f
Reviewed-on: https://gerrit.instructure.com/99888
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
2017-01-18 18:05:09 +00:00
Colleen Palmer 7b74a4cf92 bump Instructure-Icons version
closes: CNVS-34373

Test plan:
- highlight and inspect and icon in canavs that uses the icon font
- change the class to icon-chat, if a chat icon appears it means it's
pulling in the new icons

Change-Id: I6da9e4efa35c3c74c312ddd78546aabbb1a71fdb
Reviewed-on: https://gerrit.instructure.com/99693
Reviewed-by: Jennifer Stern <jstern@instructure.com>
Tested-by: Jenkins
QA-Review: Dan Sasaki
Product-Review: Colleen Palmer <colleen@instructure.com>
2017-01-16 22:12:08 +00:00
Edward Schiebel ce821321c9 Replace avatar image cropper with keyboard accessible one
Fixes: CNVS-28306

Test Plan:
- ensure Admin > <your account> > Settings > Enable Profiles
  and User Avatars are checked
- navigate to Account > Profile
- using keyboard:
  - TAB (displays "skip to main content")
  - ENTER (focuses on the main content of the profile page
  - TAB (focuses avatar image)
  - ENTER (displayes Select Profile Picture dialog)
  - TAB 4 times (focuses "choose a picture")
  - ENTER (displays system file open dialog)
  - Select a photo
  - The selected photo and crop-box are displayed and
    have focus
  - Use arrow keys to move the crop box around
  - Use shift-arrow keys to size the crop box
  - TAB twice to focus Save button
  - ENTER closes dialog
  - cropped image should be displayed on the profile page

change history
  - added js spec for the cropper
  - fix require_js config for react-crop

2016-12-13
  - changes needed after react-crop distribution changed
  - break CanvasCropper and CanvasCropperMaker into 2 files
    in response to code review
2016-12-16
  - update the react-crop version
  - set a min size on the cropper (so it can't go negative)
  - update css so image won't overflow its box
  - address eslint warnings
2016-12-21
  - fix merge conflict

note: the .rb file change supports the build. there is no need
      for a corresponding spec

Change-Id: I2b6dc165ed5dc2865f282c35018686dd820fea30
Reviewed-on: https://gerrit.instructure.com/97197
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: David Tan <dtan@instructure.com>
Product-Review: Chris Ward <cward@instructure.com>
Tested-by: Jenkins
2017-01-10 18:47:01 +00:00
Clay Diffrient 0ca6f62cb2 Add enzyme testing to Canvas
closes CNVS-33623

Test Plan:
  - Automated tests pass

Change-Id: I0e76082e8dfc2f695717c94819de3999dd23000a
Reviewed-on: https://gerrit.instructure.com/96510
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
2017-01-04 20:21:36 +00:00
Ryan Shaw 3e3024b06e [eslint] add eslint-plugin-promise
closes: CNVS-34124

These are it’s default rules:
    "rules": {
        "promise/always-return": "error",
        "promise/no-return-wrap": "error",
        "promise/param-names": "error",
        "promise/catch-or-return": "error",
        "promise/no-native": "off",
        "promise/no-nesting": "warn",
        "promise/no-promise-in-callback": "warn",
        "promise/no-callback-in-promise": "warn",
        "promise/avoid-new": "warn"
    }

the only one I changed was set avoid-new to ignore
because I have noticed that there was a few times
where I really did need/want to make my own promise.
I am open to debate on what others think though

Test Plan:
* the eslint errors on your code that uses promises
  should have the warnings you expect

Change-Id: I46e5f2d1d2ded2dba1e5aeb2ebcf303bcd4c5981
Reviewed-on: https://gerrit.instructure.com/98201
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-01-04 18:21:04 +00:00
Pam Hiett 9329ed9fe7 replace background image icon for bookmarked banks button
Fixes: CNVS-33869

test plan:
- as an admin navigate our main account (not site admin)
- click the "question banks" link from the sub-nav
- the right side "See My Bookmarked Banks" button should
  now have our inst-icon vs the background image
  example: http://www.screencast.com/t/JWZtvXAc0Iu

- if you don't have a question bank... create one so the
  list item view shows the updated bookmark icon there
  as well

note:
- *** this commit also ups the inst-icons version being pulled
  into canvas so i have access to the new remove-bookmark
  icon ***

Change-Id: Icf521299a5bbd9256dabffde08cf5021a9fb4b38
Reviewed-on: https://gerrit.instructure.com/97600
Reviewed-by: Stephen Jensen <sejensen@instructure.com>
Product-Review: Stephen Jensen <sejensen@instructure.com>
Tested-by: Jenkins
QA-Review: Dan Sasaki
2017-01-04 16:51:13 +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
Ryan Shaw 36e88e2b99 update classnames dep in package.json
closes: CNVS-33969

because canvas was depending on an older version
than what inst-ui was looking for, we were loading
2 copies of classnames onto the page

test plan:
* using webpack, look at the “sources” panel in chrome dev tools,
* find instructure-ui, make sure it doesn’t load it’s own copy
  of classnames

Change-Id: I3850479bc07937ef0bbd9d027aa11a9a826023bc
Reviewed-on: https://gerrit.instructure.com/98150
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>
2016-12-21 18:59:32 +00:00
Ryan Shaw 75e5dbbfba update eslint deps in package.json
test plan:
* run node_modules/.bin/eslint app/jsx/*.jsx
* it should work and have the same errors as before

Change-Id: Id8dc82f975808c5a5ac1703f3e9e494e4b453d58
Reviewed-on: https://gerrit.instructure.com/98145
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2016-12-20 23:06:56 +00:00
Ryan Shaw 7e201d7a50 update build/tooling npm deps in package.json
test plan:
all the builds should pass

Change-Id: I4b35fa25741f0cc065a2580ebfae164037986ce3
Reviewed-on: https://gerrit.instructure.com/98148
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2016-12-20 20:24:33 +00:00
Clay Diffrient 77501e2688 [eslint] Improve setup for different JS levels
This makes it so eslint handles situations where we don't have
ES2015+ available, while still allowing us to have our own common
rules.

Change-Id: I86b49a32433970afbcc48ef0f6fcdd7301795b63
Reviewed-on: https://gerrit.instructure.com/97872
Tested-by: Jenkins
Reviewed-by: Dan Minkevitch <dan@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
2016-12-16 23:33:40 +00:00
Stephen Jensen 6df9485d51 Version bump for InstIcons in Canvas to 0.3.0
Closes: CNVS-33746

Test Plan:
 - Click around Canvas and ensure that icons are still
   showing properly

Change-Id: Ie7664f6b393b692d7b62b88c0a20b0277890f301
Reviewed-on: https://gerrit.instructure.com/97414
Reviewed-by: Pam Hiett <phiett@instructure.com>
Product-Review: Pam Hiett <phiett@instructure.com>
Tested-by: Jenkins
QA-Review: Dan Sasaki
2016-12-13 23:11:07 +00:00
Brent Burgoyne c64dded173 add js helper to parse number string for locale
also includes a helper to validate number strings for current locale

closes CNVS-33191

test plan:
- NA (a future commit demonstrating the use of the helper with be
  qa-able)

Change-Id: I1722aad263e611d127317b2f1a3832537742c3fb
Reviewed-on: https://gerrit.instructure.com/96677
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2016-12-13 22:42:18 +00:00
Clay Diffrient c2d6bc3c80 Bump InstUI to version 0.18.2
closes CNVS-33640

Test Plan:
  - Automated tests pass
  - InstUI components currently in Canvas are okay

Change-Id: If36cf170d1b9e75d874c7f482656165e83fb3f85
Reviewed-on: https://gerrit.instructure.com/96610
Tested-by: Jenkins
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2016-12-12 22:00:40 +00:00
Felix Milea-Ciobanu 5fcdb6d1be add test-watch npm script
goes really well with the jspec script

test plan:
- builds pass

Change-Id: If596d5f1983957eb9862021b8abaaf8f80c747c1
Reviewed-on: https://gerrit.instructure.com/96454
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Product-Review: Felix Milea-Ciobanu <fmileaciobanu@instructure.com>
QA-Review: Felix Milea-Ciobanu <fmileaciobanu@instructure.com>
2016-12-05 17:59:52 +00:00
Felix Milea-Ciobanu 03e93802fb add npm script that can run specific js specs
example usage: `npm run jspec spec/javascripts/jsx/files`

refs CNVS-33223

test plan:
- current webpack test build should work exactly the same
- `npm run jspec` should build + run all specs
- `npm run jspec path/to/stuff` should build + run only specified
 specs
- should work with both directories and individual files
- `jspec-watch` should watch + build a path, but not run specs

Change-Id: I788dd38a6c69a4c36a1300fcecf43678bc7f5327
Reviewed-on: https://gerrit.instructure.com/94625
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Product-Review: Felix Milea-Ciobanu <fmileaciobanu@instructure.com>
QA-Review: Felix Milea-Ciobanu <fmileaciobanu@instructure.com>
2016-11-30 18:37:23 +00:00
Colleen Palmer e84bd4dd80 Revert and bring InstIcons into Canvas
closes: CNVS-32953

This commit re-introduces Instructure Icons into Canvas.
Due to the range in aesthetic impact of including both line
and solid icons, the change is expansive and will be refined
in subsequent commits. The purpose of this commit is to:

- Make InstIcons available in Canvas allowing the use of the
  react components

- Replace the current icon font with the new InstIcons font

- Allow for use of both 'Line' and 'Solid' icon variants

- Update the styleguide to reference the InstIcons github
  documentation for examples

- Remove font custom from Canvas

Icons changed to line versions in Canvas:
- icon-compose (view on Dashboard card)
- icon-info (view on global notification)

- Updated icons to be larger for better visibility
  (our old font was using a small font size)

- Updated font-size is now relative vs fixed, so better a11y

Test Plan:

- On compiling, icons in Canvas should now be changed to the
  corresponding Instructure Icons as can be seen here
  http://instructure.github.io/instructure-icons/

- The icon default displaying in Canvas should be solid icons.
  If the variant "icon-Line" is added to an icon's css class,
  it should display as line. For example, in the case of
  <i class="icon-edit"></i>, adding
  <i class="icon-edit icon-Line"></i> would result in a line
  version of the edit icon displaying

- As a developer, you should be able to use InstUI react icons

- The rake task `bundle exec rake icons:compile` should no
  longer exist

- The styleguide should no longer display example icons, but
  should now include a link to the Instructure Icons github
  documentation

Change-Id: I9780332de9fdf937b35caabadc2b2ee615892a43
Reviewed-on: https://gerrit.instructure.com/94175
Reviewed-by: Pam Hiett <phiett@instructure.com>
QA-Review: Dan Sasaki
Tested-by: Jenkins
Product-Review: Kyle Follett <kfollett@instructure.com>
2016-11-29 20:52:54 +00:00
Clay Diffrient 188b711641 spec: Clean up unnecessary ajax requests in tests
This commit also cleans things up a bit to make things more inline
with our current JS style preferences.

Test Plan:
  - Specs pass

Change-Id: Idf1af11b4283844017552df62963a7740bb7f609
Reviewed-on: https://gerrit.instructure.com/95637
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
2016-11-21 15:30:15 +00:00
Clay Diffrient 56019ec813 Make dashcards reorder on drag and drop
NOTE: This commit does not make it so that the data
            persists after refreshes.

closes CNVS-32548

Test Plan:
  - Enable dashboard card reordering feature flag
  - Go to a dashboard with multiple dashcards
  - You should be able to move them around via drag
    and drop.

Change-Id: I66b91b30fd619516558841a6867ef857a33b890a
Reviewed-on: https://gerrit.instructure.com/92616
Reviewed-by: Felix Milea-Ciobanu <fmileaciobanu@instructure.com>
Tested-by: Jenkins
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2016-11-18 01:07:15 +00:00
Chris Hart 6ea6cf4d2e Make Lato the default Canvas font
Fixes: CNVS-30278

The product design team wants to standardize
on Lato across all Instructure products. See
JIRA for more information.

With this change, we no longer have to use
font-weight: 300 etc to make the right
weight of Helvetica show up. We can go back
to simply using bold and normal, etc.; so
those rules have been updated in this
commit.

Test plan:
to accurately test this you need to set up your
canvas to use a CDN. there is a dev CDN that ops
has set up for us. you put the settings in
config/canvas_cdn.yml. slack ryan if you need help
setting that up or need to know what the values
are to use.
you also need to edit your config/environments/development.rb
file so it look like this:

config.action_controller.perform_caching = true
ENV['USE_OPTIMIZED_JS'] = 'true'

and then when you make any changes you need to run:
bundle exec rake canvas:compile_assets
bundle exec rake canvas:cdn:upload_to_s3
touch tmp/restart.txt

for the changes to be seen

- This change applies only to new UI. Legacy
  should be unchanged.

- Clear cache and cookies first.

- Go to Canvas. On the first page load only
  you should see a slight shifting of the text
  as Canvas loads the Lato font and falls
  back on the Helvetica system font.

- From that point on, Lato should be
  cached in the browser and load instantly
  when you move between views:
  http://screencast.com/t/hZhUZOhH

- Canvas should still work in all supported
  languages and browsers.

Not yet converted:
- TinyMCE textarea fiekd
- Mobile login

Change-Id: I861e609c01824f60ac38d3fc15e5b960a06e44de
Reviewed-on: https://gerrit.instructure.com/85737
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Dan Sasaki
Product-Review: Kyle Follett <kfollett@instructure.com>
2016-11-11 22:09:26 +00:00
Jim Simon ece3b72371 Update instructure-ui to 0.17.3
fixes: CNVS-33148

test plan: N/A

Change-Id: I48921605924b1d303b10f670784623605c29fb35
Reviewed-on: https://gerrit.instructure.com/94727
Tested-by: Jenkins
Reviewed-by: Jennifer Stern <jstern@instructure.com>
Product-Review: Jennifer Stern <jstern@instructure.com>
QA-Review: Jennifer Stern <jstern@instructure.com>
2016-11-09 21:38:09 +00:00
Jeremy Neander d0aa529dc6 purge performance gradebook
This removes the ill-fated React Gradebook.

This commit is effectively a revert of
b9534edd64

closes CNVS-32394

test plan:
* ensure 'Gradebook Performance' is no longer available
* ensure other Gradebooks are still functional
    * Default Gradebook basic happy path
    * Individual Gradebook (SRGB) basic happy path

Change-Id: Ie71ab4dfb17f494c2a7c17a27cd551a84e7efb96
Reviewed-on: https://gerrit.instructure.com/94005
Tested-by: Jenkins
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Christi Wruck
2016-11-09 20:05:17 +00:00
Ryan Shaw 64218182cd don't pass frontend build files through babel
since we're on node 6.6 now, we don't need
babel for anything we were using it for in our
frontend build/webpack code that runs on node.
(except for es6 import/export)

Change-Id: I41352fdc8adb06fe1585565f63d808d249f92864
Reviewed-on: https://gerrit.instructure.com/91573
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2016-11-08 20:29:29 +00:00