Commit Graph

23 Commits

Author SHA1 Message Date
Landon Wilkins c6beee4c5f da licença part 44
add consistent license headers to all source files

Change-Id: I621e5e994129722ebeedb6b1cc3e75fa80ded63f
Reviewed-on: https://gerrit.instructure.com/110147
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 22:48:20 +00:00
Jon Jensen 99938e6e09 don't import :allthethings: instructure-*, fixes SD-2345
import just the particular instructure-ui / instructure-icon modules we
need, so that we don't get everything in the webpack bundle. also tweak
webpack config so people can't make this mistake again.

67d7ec7197 caused several bundles to balloon in size by a couple MB. this
gets us back down to sane levels (and many bundles are now smaller)

test plan:
specs? ¯\_(ツ)_/¯

Change-Id: I92b859063f56c672b85ec63f5c61ffd17735ced4
Reviewed-on: https://gerrit.instructure.com/107504
Tested-by: Jenkins
Reviewed-by: Jennifer Stern <jstern@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-04-05 13:45:13 +00:00
Ed Schiebel 8d3b9e4b2f Support canvas brand themes in inst-ui components
Inst-ui components need to honor a school's brandable theme
settings.

fixes CNVS-33500
fixes CNVS-34223
fixes CNVS-33809

Test Plan:
  CNVS-33500
  - enable high contrast mode
  - navigate to the Grading page of an account (/accounts/#/grading_standards
  > expected reault: 
      - the "+ Set of Grading Periods" button is the high contrast color
  - Click on the "+ Set of Grading Periods" button
  > expected result: 
     - the Create button is the high contrast color
  CNVS-33809
  - with high contrast mode still enabled
  - go to course's people page (/courses/#/users)
  - click on the +People button
  - see that the modal uses high contrast colors (the cancel and next
    buttons are the easiest to see)
    
  CNVS-34223
  setup
    - turn of high contrast
    - go to Admin > Site Admin > Themes
      (/accounts/site_admin/brand_configs)
    - select the State U. theme
    - click Save and give it a name
    - click Apply theme (the UI should get a lot of red)
  test
    - go to a course's people page (/courses/#/users)
    - click on the "+ People" button
  expected result
    - it looks like the rest of the UI
      (e.g. the Cancel and Next buttons are red)

Change-Id: Idf9b9efbad4c1d88f72052d08f161b5d148464db
Reviewed-on: https://gerrit.instructure.com/102908
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
QA-Review: Dan Sasaki
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2017-03-13 13:05:38 +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 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
Brent Burgoyne 0ed97361a0 fix running js specs in docker/phantom
- removed arrow functions and const/let
- loaded ie11 polyfill for Object.assign

closes CNVS-35004

test plan:
- in docker
- ensuere docker-compose has phantomjs-tests in
  docker-compose.local.[username].yml (see doc/testing_javascript.md)
- run docker-compose run --rm web npm run jspec-watch \
  spec/javascripts/jsx/grade_summarySpec.jsx
- in another terminal run docker-compose run --rm phantomjs-tests
- all tests should pass

  spec/javascripts/jsx/shared

Change-Id: I326833f3799b895ddcfcd7e07b4d69f443641e11
Reviewed-on: https://gerrit.instructure.com/102426
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2017-02-16 18:03:25 +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 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
Felix Milea-Ciobanu 61218a3e8a fix running all js specs
test plan:
- builds pass?

Change-Id: I504b632bf8dfd3024bb1d8529bcc9c894bd2c12d
Reviewed-on: https://gerrit.instructure.com/96390
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2016-11-30 22:01:17 +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
Derek Bender f73f261213 move to ReactDOM
removes React.render stragglers:
 - React.render -> ReactDOM.render
 - React.unmountComponentAtNode -> ReactDOM.unmountComponentAtNode
 - React.findDOMNode -> ReactDOM.findDOMNode

closes: CNVS-32975

test plan:
 - all specs pass

Change-Id: I6d6b4243fe7ca11f003d03d54e57c7b20dad9365
Reviewed-on: https://gerrit.instructure.com/93872
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jennifer Stern <jstern@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
2016-10-28 16:45:35 +00:00
Ethan Vizitei d32465ecd5 make web pack specs pick up jsx specs
closes CNVS-27835

TEST PLAN:
  1) aux builds should pass

Change-Id: I882c89fba1240037bbda11f321a5afd85e854ced
Reviewed-on: https://gerrit.instructure.com/73971
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2016-03-08 19:08:14 +00:00
Ethan Vizitei 17d79595ff glob webpack unit tests
maintaining a list of specs manually is crummy.  This loads them
dynamically.

also solves some run-order fragileness between screenreader
gradebook and shared ember component tests.

TEST PLAN:
 1) webpack aux build should pass

Change-Id: I120b0bafc3b48523e758f576babea7f4af244673
Reviewed-on: https://gerrit.instructure.com/71082
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2016-01-29 00:08:50 +00:00
Ethan Vizitei 61f668fb7d spec: fix webpack aux build
refs CNVS-25916

this file moved, and so was no longer buildable

TEST PLAN:
 1) webpack aux build should pass

Change-Id: Ib89abbcd4e21d0dd2abf957e695d20b914cffd2d
Reviewed-on: https://gerrit.instructure.com/70324
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2016-01-15 20:11:10 +00:00
Ethan Vizitei 542d5896a1 remove proximity loader
refs CNVS-25916

Proximity loader makes little sense
in a bundled environment anyway. This was
the last thing that used it.

TEST PLAN:

1) regression test profile editing, avatar in
   particular
2) web pack selenium builds should have another passing file

Change-Id: Id6e0a93f1dbcf308b49500ead5f72551adad73d8
Reviewed-on: https://gerrit.instructure.com/69407
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-05 20:17:21 +00:00
Ethan Vizitei b5f593aa5d fix a rogue require statement to work with web pack
refs CNVS-25916

TEST PLAN:
  1) discussion_show_page_specific_user_spec should pass
    under webpack selenium

WARNING: This has possible regression impact on all places where we use
the little "Add Rubric" button (quizzes in the 'view rubric' link from
the gear dropdown, assignments when given the option to add a rubric
while editing an assignment, and discussions where you can mess with the
rubric on a "graded" discussion), so each rubric adding workflow should
be checked.

Change-Id: I84af8b58e4143e79bff96bd638bd2149d8e73c2e
Reviewed-on: https://gerrit.instructure.com/68988
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2015-12-21 23:25:13 +00:00
Michael Nomitch f9dae39292 pass custom options to RCS loader
fixes CNVS-25489

also extracted some code from eportfolios
for easier use in other files

test plan:
  - load RCE normally
    - it works fine
    - also run the c/29651 test plan
      (minus the unsupported IE versions)
  - load RCE via service on eportfolios
    - it works fine

Change-Id: I4eaf0ac1e11ae249c92a2cd2f9e249bc117986cd
Reviewed-on: https://gerrit.instructure.com/68349
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-12-18 20:18:44 +00:00
Michael Nomitch d692a83efd RCS - allow instructure record call via event
refs CNVS-25536

test plan:
  - with MCE loaded on non eportfolio page
    - you can record a media comment like usual

  - eportfolios with tinyMCE loaded via service
    - it loads properly (though you wont be
      able to add a media comment)

Change-Id: I892eb6033a18d67d712bda2f1bf7528533cf3ff6
Reviewed-on: https://gerrit.instructure.com/68224
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-12-14 23:01:06 +00:00
Michael Nomitch 6fa581278d RCS - initialize external tool plugin via event
refs CNVS-25535

test plan:
  - with MCE loaded normally
    - external tools are added to the tinymce
      toolbar
    - they work like normal (test multiple
      external tools)

  - eportfolios with tinyMCE loaded via service
    - loads normally and works
      (external tools arent used on this page
       so cant test this remotely until we
       add remote RCS to a different page)

Change-Id: I1ce0f9dc644d567d56615a61d7788ce42044bb2f
Reviewed-on: https://gerrit.instructure.com/68195
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-12-14 23:01:04 +00:00
Michael Nomitch 39e0f80355 RCS: set up event listener for image plugin
refs CNVS-25291

test plan:
  - when the RCS service has the image plugin code
    and the RCS feature flag on
    - the RCS can add images from a url or canvas
  - when the RCS flag is turned off
    - the image plugin works like normal

Change-Id: Idaac68887f9ae2dd36410a5922a0b161cca13316
Reviewed-on: https://gerrit.instructure.com/67450
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2015-12-10 17:13:36 +00:00
Michael Nomitch 0ea92efcae integration of RCS into eportfolios
closes CNVS-24828

test plan:
  - have rcs running
  - with remote tinyMCE feature flag off
    - regression test of eportfolios page
    - check DnD & multiple tinyMCEs
  - with feature flag on
    - check that a tinymce instance
      on eportfolios page can load & save
      - note: many features will be missing

Change-Id: Ib6471729fa83c15107898134fc1f1306c8e7be8f
Reviewed-on: https://gerrit.instructure.com/66378
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2015-12-07 23:31:33 +00:00
Simon Williams a1e7f57c56 webpack tests
closes CNVS-24966

change js specs to work with web pack.
update some dependency references, make some aliases
for external dependencies to get the right version,
and clean up a bunch of leaky state.

TEST PLAN:
js tests should pass in web pack _and_ requires

Change-Id: If37fbce93e7e67021d90bacb470ffc4f1b17402d
Reviewed-on: https://gerrit.instructure.com/66309
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2015-11-24 18:40:58 +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