Commit Graph

14 Commits

Author SHA1 Message Date
Aaron Shafovaloff 51474c7796 Spec: Remove use of .js extension from JS spec imports
Also applies Prettier to spec folder

Test plan:
  - All existing tests pass

flag=none

Change-Id: I60ac855d9f8c7130c5be69ef4417f2c7bf3485fd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/302581
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Christopher Soto <christopher.soto@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Eduardo Escobar <eduardo.escobar@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Deborah Kwak <deborah.kwak@instructure.com>
2022-10-06 15:56:39 +00:00
Alexandre Trindade 32a9372888 fix iframe height when the viewport is smaller than 450px
why:
  The iframe used for LTI messages has 450px as minimum height

  When the user has a viewport smaller than the min-height (450px)
  and launches a tool in a fullscreen placement, the iframe is
  not resized

previous commit
  https://gerrit.instructure.com/c/canvas-lms/+/291039/8

  ignore PS 9 it got messed up

refs INTEROP-7431
flag=none

--------------------------------------------------
Test plan
--------------------------------------------------
* Compile the CSS and JS. Run:
  ```
  rake canvas:compile_assets_dev
  ```

* Open the Browser Developer Tools (F12)

* Open the Responsive Design Mode

* Choose a viewport smaller than 450px

* Launch any LTI tool from a fullscreen placement like global
  navigation

* The tool should fit the available height

* Exit the Responsive Design Mode and launch the tool from the
  same placement and the tool must also fit the available height

Change-Id: I043c9fb6e3a772f1237ba30d1a59162e3ae6da9a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/292646
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Ryan Hawkins <ryan.hawkins@instructure.com>
Product-Review: Alexis Nast <alexis.nast@instructure.com>
2022-05-25 21:37:03 +00:00
Evan Battaglia 8ccdf65306 Revert "change the minimum height of the iframe used for LTI messages"
This reverts commit 078a06d50e.

Reason for revert: Broke some iframe heights in canaries

Change-Id: I3a594dc516c4ba03ec1fbd4a24f67a5223c54827
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/285820
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
Reviewed-by: Mark Starkman <mark.starkman@instructure.com>
2022-03-02 17:36:04 +00:00
Alexandre Trindade 078a06d50e change the minimum height of the iframe used for LTI messages
why
 The iframe used for LTI messages has 450px as minimum height

 When the user zooms in the browser (3-400%) the visible viewport
 will be much smaller than the min-height (450px) of the iframe
 which causes problem and the focused elements are not visible

 Instead of setting an absolute value for this property, we can
 use 100% of the iframe's height

fixes INTEROP-7093
flag=none

--------------------------------------------------
Test plan
--------------------------------------------------
* Compile the CSS. Run:
```
rake css:compile
```

* Compile the JS. Run:
```
rake js:webpack_development
```

* Launch any LTI tool

* Open the Browser Developer Tools (F12)

* Locate the HTML element iframe#tool_content

* Check the height property of the iframe. It should allow values
  below 450px when zooming in

Change-Id: I4b20909d3accdb00de3320de7b3ecc61997e4df0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282126
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
Reviewed-by: Tucker Mcknight <tmcknight@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
2022-02-11 19:56:15 +00:00
Ahmad Amireh 4243097b21 rename some things
fixes FOO-1265

[skip-eslint=true]
[pin-commit-analytics=7e49eefd7f59cbf43fd03bf8957bbbfa76f8d9d5]
[pin-commit-demo_site=adade2e38e46a358a4643cd3db2fe5ccffe39ec5]
[pin-commit-instructure_misc_plugin=47a3161102b0611af56d134fbd0c828ddc1b8abf]
[pin-commit-migration_tool=0dbac2f5b421d894395605ce4b583ef0f7d60b22]
[pin-commit-multiple_root_accounts=cc96d28c0d59bbe47acc64de4fdd8e1d2b029805]

Change-Id: I14c07f20bd260cf0de1f48ceb70b3c2313edf2d2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258807
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
2021-04-06 01:12:49 +00:00
Clay Diffrient 9b08b0b3e1 spec: Run prettier on spec/coffeescripts
This also adds things in this directory to the whitelist
to make sure nothing ugly gets introduced.

Test Plan:
  - Automated tests pass
  - Make a non-pretty change in a js file within spec/coffeescripts
  - Commit it
  - Notice it has been prettierfied

refs COREFE-347

flag = none

Change-Id: I52a32b5888da2ad8fc8054f753bc75e48b5ab843
Reviewed-on: https://gerrit.instructure.com/212515
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2019-10-10 19:33:55 +00:00
Marc Phillips b3e640ac52 Fix XSS PostMessage on External Tools
fixes PLAT-3232

Test Plan:
 - Launch a tool and put the following command in your browswer
   console:
window.postMessage('{"subject":"lti.screenReaderAlert","body":
{"html":"<img src=x onerror=alert(document.domain)>"}}','*')
 - Note that the alert does not occur
 - Also post the following:
window.postMessage('{"subject":"lti.setUnloadMessage","message":
{"html":"<img src=x onerror=alert(document.domain)>"}}','*')i
  - Note that the alert does not occur

Change-Id: I7309d8de36cbcbe3646714786d603afbe8ce7178
Reviewed-on: https://gerrit.instructure.com/147255
Tested-by: Jenkins
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Marc Alan Phillips <mphillips@instructure.com>
2018-04-18 20:25:17 +00:00
decaffeinate f5e4bc2d80 [spec][decaffeinate] convert coffe specs to js syntax
...and pass them through amdtoes6, eslint, and prettier

This converts most of our coffeescript spec files to javscript, to
es module syntax and applies our eslint code formatting rules to it.

Because this is just spec files, as long as the tests still run
and they all still pass, this should be good. That makes these a lot
easier and safer to deal with converting than the stuff in
app/coffeescripts

After this commit there should not be any .coffee files in the
/spec/ directory.

test plan:
* jenkins should run the same # of js specs as before and they should
  all pass

Change-Id: I701c101777486e2e37d0ec1327692f16099352cd
Reviewed-on: https://gerrit.instructure.com/141556
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-02-22 16:45:17 +00:00
decaffeinate c08c698d05 [spec][decaffeinate] rename coffe specs from .coffee to .js
this will not pass jenkins since it renames these files to .js
without also converting the syntax to javaScript. However, this is
intentionally it's own commit so that when you `git log --follow`
a file, it can track its history across the name change.

the following commit actually changes the syntax.

test plan:
* make sure the next commit passes. This should just rename things

Change-Id: I4b56f2789eda12cba64a3716462fecce31b2e895
Reviewed-on: https://gerrit.instructure.com/141555
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Simon Williams <simon@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Ryan Shaw <ryan@instructure.com>
2018-02-22 16:45:05 +00:00
wdransfield 47dc390ac1 Make min tool launch heights match
Closes PLAT-2730

Test Plan:
- Follow the steps to reproduce at
  https://instructure.atlassian.net/browse/PLAT-2730
- Navigate to the module and verify that the module navigation
  no longer covers the bottom of the tool launch iframe

Change-Id: I9136392046edeade0906c038a69c5dcbd108e720
Reviewed-on: https://gerrit.instructure.com/122642
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-08-18 17:04:21 +00:00
wdransfield 7464d9fb31 Handle multiple tool on the page when resizing
Closes PLAT-2738

Test Plan:
- Install two lti tools that use the new
  'com.instructure.PostMessageToken' variable expansion.
- Visit a page with two LTI tools launched (this happens when
  launching a tool in a course that has chat enabled).
- Have one tool send a resize post message and verify the correct
  tool is resized. The post message should include the token
  for the value of 'token':

  <script type="text/javascript">
   parent.postMessage({
      subject: 'lti.frameResize',
      height: 12000,
      token: '<%= @wrapper_id %>'
   }, '*');
  </script>

- Verify the proper tool is resized.

Change-Id: Ie7e976c5cd53ef5c61cd86c471ba416045a0fb68
Reviewed-on: https://gerrit.instructure.com/119858
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Tested-by: Jenkins
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-08-18 16:30:28 +00:00
Landon Wilkins 2f26c46311 da licença part 43
add consistent license headers to all source files

Change-Id: Ief50339aedf02bb206dcc2ccba1716353702a8a9
Reviewed-on: https://gerrit.instructure.com/110148
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:48:54 +00:00
Ryan Shaw 6ca8acffb8 s/module/QUnit.module/ in spec/coffeescripts
closes:  CNVS-34769

this is the result of running this find & replace
(^\s+)(module)(\s[\"\']|\()
\1QUnit.module\3

s/module/qunit.module/ in spec/coffeescripts

and the result of running this find & replace
(^\s+)(module)(\s*\()
\1qunit.module\3

in canvas-lms/spec/javascripts/

test plan:
* automated js specs should pass in requireJS and webpack 

Change-Id: I65188cce4bd5e6e5caa199dc108393a93f400a67
Reviewed-on: https://gerrit.instructure.com/101100
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:46:51 +00:00
Eric Berry d8d3123df1 submit assignments via embedded LTI apps in tabs
fixes PLAT-477
fixes PLAT-479
fixes PLAT-480

test steps:
- Add one or two external tools which allow homework submission (e.g.
  box) and find the tabs on the submit assignment page
- Submit assignment using tool
- Add three more external tools which allow homework submission
- Ensure that you see the 'More' tab on submit assignment page and
  submit assignment using items under 'More' tab

Change-Id: I118b3fa059e6a4046c87b8cf894ce77ecffd9252
Reviewed-on: https://gerrit.instructure.com/33421
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Product-Review: Eric Berry <ericb@instructure.com>
QA-Review: Eric Berry <ericb@instructure.com>
2014-04-29 20:06:37 +00:00