canvas-lms/.eslintrc.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

370 lines
13 KiB
JavaScript
Raw Permalink Normal View History

/*
* Copyright (C) 2017 - present Instructure, Inc.
*
* This file is part of Canvas.
*
* Canvas is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, version 3 of the License.
*
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
const {glob} = require('glob')
const path = require('path')
module.exports = {
env: {
es6: true,
amd: true,
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
browser: true,
},
extends: [
'airbnb',
'prettier/react',
'plugin:jest/recommended',
'plugin:prettier/recommended',
'plugin:eslint-comments/recommended',
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
'plugin:promise/recommended',
],
parserOptions: {
ecmaVersion: 2020,
ecmaFeatures: {
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
jsx: true,
},
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
sourceType: 'module',
},
parser: '@typescript-eslint/parser',
globals: {
ENV: true,
JSX: true,
INST: true,
tinyMCE: true,
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
tinymce: true,
structuredClone: true,
},
plugins: [
'promise',
'import',
'notice',
'jest',
'prettier',
'jsx-a11y',
'lodash',
'react',
'react-hooks',
'babel',
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
'@typescript-eslint',
],
rules: {
'no-cond-assign': ['error', 'except-parens'],
// enable the react-hooks rules
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
// These come from our extended configurations, but we don't care about them
camelcase: 'off', // because we have a ton of `const $user_name = $('#user_name')`
'comma-dangle': 'off',
'class-methods-use-this': 'off',
'consistent-return': 'off',
'default-case': 'off',
eqeqeq: 'warn', // great goal! but since we do it 1061 times, downgrade AirBnB's 'error' to 'warn' :(
'func-names': 'off',
'global-require': 'off', // every time we did this, we meant to
'guard-for-in': 'off',
'max-classes-per-file': 'off',
'no-continue': 'off',
'no-else-return': 'off',
'no-multi-assign': 'off',
'no-nested-ternary': 'off',
'no-new': 'off', // because we do `new SomeView()` all the time in Backbone just for the sideffects
'no-param-reassign': 'off',
'no-plusplus': 'off',
'no-prototype-builtins': 'off',
'no-return-assign': 'off',
'no-underscore-dangle': 'off',
'no-use-before-define': 'off',
'object-shorthand': 'warn',
'@typescript-eslint/no-use-before-define': [
'error',
{
functions: false,
classes: false,
variables: false,
},
],
'no-useless-escape': 'off',
'one-var': 'off',
'prefer-destructuring': 'off',
'prefer-rest-params': 'off',
'prefer-template': 'off', // AirBnB says 'error', we don't care
'eslint-comments/disable-enable-pair': ['error', {allowWholeFile: true}], // We are okay with turning rules off for the entirety of a file (though use it sparingly)
'import/prefer-default-export': 'off',
'jsx-a11y/label-has-for': 'off',
'jsx-a11y/anchor-is-valid': ['error', {components: []}], // InstUI has special behavior around this
'promise/always-return': 'off',
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
'promise/catch-or-return': ['warn', {allowFinally: true}], // The recommendation is to error on this, but we downgrade it to a warning
'promise/avoid-new': 'off',
'promise/no-nesting': 'off',
'react/jsx-no-target-blank': 'warn',
'react/jsx-curly-brace-presence': 'warn',
'react/destructuring-assignment': 'off',
'react/forbid-prop-types': 'off', // AirBnB doesn't want you to use PropTypes.object, and we agree normally. But there are times where you just want to pass on an opaque object to something else and forcing people to make a PropTypes.shape for it doesn't add any value. People should still encourage each other to use PropTypes.shape normally, when it makes sense, in code-review but we're not going to -2 because of it.
'react/no-typos': 'off',
'react/sort-comp': 'off',
'react/require-default-props': 'off',
'react/prop-types': ['error', {skipUndeclared: true}],
'react/default-props-match-prop-types': ['error', {allowRequiredDefaults: true}], // add the `allowRequiredDefaults: true` option to allow specifying something as a required prop (so you get propType error messages), but in case it's not present at runtime, I'll use `[]` as the default (so it is resilient)".
'react/forbid-foreign-prop-types': ['error', {allowInPropTypes: true}], // You can refer to proptypes within proptypes, but you shouldn't use proptypes in actual app code of the component
'react/jsx-boolean-value': [1, 'always'], // React recommends always passing values to props, see https://reactjs.org/docs/jsx-in-depth.html#props-default-to-true
'react/jsx-no-bind': 'off',
'react/jsx-props-no-spreading': 'off',
'react/no-danger': 'off', // dangerouslySetInnerHTML is already pretty explicit on making you aware of its danger
'react/no-render-return-value': 'warn', // In future versions of react this will fail
'react/state-in-constructor': 'off',
'react/static-property-placement': 'off',
'react/no-unknown-property': 'warn',
modernize canvas_quizzes fixes FOO-1409 flag = none no more client_apps, canvas_quizzes now lives as part of canvas-lms proper inside app/jsx/, which makes the build leaner and leaves us with one less thing to reason about logical changes: - converted from AMD to ES modules - upgraded to recent react + react-router - dropped RSVP in favor of native Promises - used CanvasModal instead of home-grown Dialog - removed dead code; notifications in particular were fishy as there had no dependents at all and did not even show up in the graph - ported tests to Jest, added more unit ones and two integration ones - removed "config.onError" and now throws errors where appropriate - disabled console statements in non-dev :: test plan :: - create a (old-school) quiz containing all types of questions - as 3 distinct students, take the quiz and try to randomize your answers at this point it's helpful to have a reference to compare the screens; I replicated the quiz on my production sandbox for this - go to /courses/:id/quizzes/:id/submissions/:id/log - verify it looks OK - click on a specific question in the stream and verify the question inspector widget works OK - go back to stream and push "View table" - verify the table and its controls are OK - go to /courses/:id/quizzes/:id/statistics - verify it looks OK - click on ? in the discrimination index chart and verify it displays a dialog with help content - click on "X respondents" in one of the charts and verify it displays a dialog with the respondent names - verify the interactive charts do interact as expected (no logic changed here so just a quick glance) - link to "View in SpeedGrader" for essay-like questions works Change-Id: I79af5ff4f1479503b5e2528b613255dde5bc45d3 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256118 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Simon Williams <simon@instructure.com> QA-Review: Simon Williams <simon@instructure.com> Product-Review: Simon Williams <simon@instructure.com>
2021-01-02 07:58:12 +08:00
// don't restrict Math.pow for ** operator
// ref: https://github.com/airbnb/javascript/blob/1f786e154f6c32385607e1688370d7f2d053f88f/packages/eslint-config-airbnb-base/rules/best-practices.js#L225
'no-restricted-properties': [
'error',
modernize canvas_quizzes fixes FOO-1409 flag = none no more client_apps, canvas_quizzes now lives as part of canvas-lms proper inside app/jsx/, which makes the build leaner and leaves us with one less thing to reason about logical changes: - converted from AMD to ES modules - upgraded to recent react + react-router - dropped RSVP in favor of native Promises - used CanvasModal instead of home-grown Dialog - removed dead code; notifications in particular were fishy as there had no dependents at all and did not even show up in the graph - ported tests to Jest, added more unit ones and two integration ones - removed "config.onError" and now throws errors where appropriate - disabled console statements in non-dev :: test plan :: - create a (old-school) quiz containing all types of questions - as 3 distinct students, take the quiz and try to randomize your answers at this point it's helpful to have a reference to compare the screens; I replicated the quiz on my production sandbox for this - go to /courses/:id/quizzes/:id/submissions/:id/log - verify it looks OK - click on a specific question in the stream and verify the question inspector widget works OK - go back to stream and push "View table" - verify the table and its controls are OK - go to /courses/:id/quizzes/:id/statistics - verify it looks OK - click on ? in the discrimination index chart and verify it displays a dialog with help content - click on "X respondents" in one of the charts and verify it displays a dialog with the respondent names - verify the interactive charts do interact as expected (no logic changed here so just a quick glance) - link to "View in SpeedGrader" for essay-like questions works Change-Id: I79af5ff4f1479503b5e2528b613255dde5bc45d3 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256118 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Simon Williams <simon@instructure.com> QA-Review: Simon Williams <simon@instructure.com> Product-Review: Simon Williams <simon@instructure.com>
2021-01-02 07:58:12 +08:00
{
object: 'arguments',
property: 'callee',
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
message: 'arguments.callee is deprecated',
modernize canvas_quizzes fixes FOO-1409 flag = none no more client_apps, canvas_quizzes now lives as part of canvas-lms proper inside app/jsx/, which makes the build leaner and leaves us with one less thing to reason about logical changes: - converted from AMD to ES modules - upgraded to recent react + react-router - dropped RSVP in favor of native Promises - used CanvasModal instead of home-grown Dialog - removed dead code; notifications in particular were fishy as there had no dependents at all and did not even show up in the graph - ported tests to Jest, added more unit ones and two integration ones - removed "config.onError" and now throws errors where appropriate - disabled console statements in non-dev :: test plan :: - create a (old-school) quiz containing all types of questions - as 3 distinct students, take the quiz and try to randomize your answers at this point it's helpful to have a reference to compare the screens; I replicated the quiz on my production sandbox for this - go to /courses/:id/quizzes/:id/submissions/:id/log - verify it looks OK - click on a specific question in the stream and verify the question inspector widget works OK - go back to stream and push "View table" - verify the table and its controls are OK - go to /courses/:id/quizzes/:id/statistics - verify it looks OK - click on ? in the discrimination index chart and verify it displays a dialog with help content - click on "X respondents" in one of the charts and verify it displays a dialog with the respondent names - verify the interactive charts do interact as expected (no logic changed here so just a quick glance) - link to "View in SpeedGrader" for essay-like questions works Change-Id: I79af5ff4f1479503b5e2528b613255dde5bc45d3 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256118 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Simon Williams <simon@instructure.com> QA-Review: Simon Williams <simon@instructure.com> Product-Review: Simon Williams <simon@instructure.com>
2021-01-02 07:58:12 +08:00
},
{
object: 'global',
property: 'isFinite',
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
message: 'Please use Number.isFinite instead',
modernize canvas_quizzes fixes FOO-1409 flag = none no more client_apps, canvas_quizzes now lives as part of canvas-lms proper inside app/jsx/, which makes the build leaner and leaves us with one less thing to reason about logical changes: - converted from AMD to ES modules - upgraded to recent react + react-router - dropped RSVP in favor of native Promises - used CanvasModal instead of home-grown Dialog - removed dead code; notifications in particular were fishy as there had no dependents at all and did not even show up in the graph - ported tests to Jest, added more unit ones and two integration ones - removed "config.onError" and now throws errors where appropriate - disabled console statements in non-dev :: test plan :: - create a (old-school) quiz containing all types of questions - as 3 distinct students, take the quiz and try to randomize your answers at this point it's helpful to have a reference to compare the screens; I replicated the quiz on my production sandbox for this - go to /courses/:id/quizzes/:id/submissions/:id/log - verify it looks OK - click on a specific question in the stream and verify the question inspector widget works OK - go back to stream and push "View table" - verify the table and its controls are OK - go to /courses/:id/quizzes/:id/statistics - verify it looks OK - click on ? in the discrimination index chart and verify it displays a dialog with help content - click on "X respondents" in one of the charts and verify it displays a dialog with the respondent names - verify the interactive charts do interact as expected (no logic changed here so just a quick glance) - link to "View in SpeedGrader" for essay-like questions works Change-Id: I79af5ff4f1479503b5e2528b613255dde5bc45d3 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256118 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Simon Williams <simon@instructure.com> QA-Review: Simon Williams <simon@instructure.com> Product-Review: Simon Williams <simon@instructure.com>
2021-01-02 07:58:12 +08:00
},
{
object: 'self',
property: 'isFinite',
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
message: 'Please use Number.isFinite instead',
modernize canvas_quizzes fixes FOO-1409 flag = none no more client_apps, canvas_quizzes now lives as part of canvas-lms proper inside app/jsx/, which makes the build leaner and leaves us with one less thing to reason about logical changes: - converted from AMD to ES modules - upgraded to recent react + react-router - dropped RSVP in favor of native Promises - used CanvasModal instead of home-grown Dialog - removed dead code; notifications in particular were fishy as there had no dependents at all and did not even show up in the graph - ported tests to Jest, added more unit ones and two integration ones - removed "config.onError" and now throws errors where appropriate - disabled console statements in non-dev :: test plan :: - create a (old-school) quiz containing all types of questions - as 3 distinct students, take the quiz and try to randomize your answers at this point it's helpful to have a reference to compare the screens; I replicated the quiz on my production sandbox for this - go to /courses/:id/quizzes/:id/submissions/:id/log - verify it looks OK - click on a specific question in the stream and verify the question inspector widget works OK - go back to stream and push "View table" - verify the table and its controls are OK - go to /courses/:id/quizzes/:id/statistics - verify it looks OK - click on ? in the discrimination index chart and verify it displays a dialog with help content - click on "X respondents" in one of the charts and verify it displays a dialog with the respondent names - verify the interactive charts do interact as expected (no logic changed here so just a quick glance) - link to "View in SpeedGrader" for essay-like questions works Change-Id: I79af5ff4f1479503b5e2528b613255dde5bc45d3 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256118 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Simon Williams <simon@instructure.com> QA-Review: Simon Williams <simon@instructure.com> Product-Review: Simon Williams <simon@instructure.com>
2021-01-02 07:58:12 +08:00
},
{
object: 'window',
property: 'isFinite',
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
message: 'Please use Number.isFinite instead',
modernize canvas_quizzes fixes FOO-1409 flag = none no more client_apps, canvas_quizzes now lives as part of canvas-lms proper inside app/jsx/, which makes the build leaner and leaves us with one less thing to reason about logical changes: - converted from AMD to ES modules - upgraded to recent react + react-router - dropped RSVP in favor of native Promises - used CanvasModal instead of home-grown Dialog - removed dead code; notifications in particular were fishy as there had no dependents at all and did not even show up in the graph - ported tests to Jest, added more unit ones and two integration ones - removed "config.onError" and now throws errors where appropriate - disabled console statements in non-dev :: test plan :: - create a (old-school) quiz containing all types of questions - as 3 distinct students, take the quiz and try to randomize your answers at this point it's helpful to have a reference to compare the screens; I replicated the quiz on my production sandbox for this - go to /courses/:id/quizzes/:id/submissions/:id/log - verify it looks OK - click on a specific question in the stream and verify the question inspector widget works OK - go back to stream and push "View table" - verify the table and its controls are OK - go to /courses/:id/quizzes/:id/statistics - verify it looks OK - click on ? in the discrimination index chart and verify it displays a dialog with help content - click on "X respondents" in one of the charts and verify it displays a dialog with the respondent names - verify the interactive charts do interact as expected (no logic changed here so just a quick glance) - link to "View in SpeedGrader" for essay-like questions works Change-Id: I79af5ff4f1479503b5e2528b613255dde5bc45d3 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256118 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Simon Williams <simon@instructure.com> QA-Review: Simon Williams <simon@instructure.com> Product-Review: Simon Williams <simon@instructure.com>
2021-01-02 07:58:12 +08:00
},
{
object: 'global',
property: 'isNaN',
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
message: 'Please use Number.isNaN instead',
modernize canvas_quizzes fixes FOO-1409 flag = none no more client_apps, canvas_quizzes now lives as part of canvas-lms proper inside app/jsx/, which makes the build leaner and leaves us with one less thing to reason about logical changes: - converted from AMD to ES modules - upgraded to recent react + react-router - dropped RSVP in favor of native Promises - used CanvasModal instead of home-grown Dialog - removed dead code; notifications in particular were fishy as there had no dependents at all and did not even show up in the graph - ported tests to Jest, added more unit ones and two integration ones - removed "config.onError" and now throws errors where appropriate - disabled console statements in non-dev :: test plan :: - create a (old-school) quiz containing all types of questions - as 3 distinct students, take the quiz and try to randomize your answers at this point it's helpful to have a reference to compare the screens; I replicated the quiz on my production sandbox for this - go to /courses/:id/quizzes/:id/submissions/:id/log - verify it looks OK - click on a specific question in the stream and verify the question inspector widget works OK - go back to stream and push "View table" - verify the table and its controls are OK - go to /courses/:id/quizzes/:id/statistics - verify it looks OK - click on ? in the discrimination index chart and verify it displays a dialog with help content - click on "X respondents" in one of the charts and verify it displays a dialog with the respondent names - verify the interactive charts do interact as expected (no logic changed here so just a quick glance) - link to "View in SpeedGrader" for essay-like questions works Change-Id: I79af5ff4f1479503b5e2528b613255dde5bc45d3 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256118 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Simon Williams <simon@instructure.com> QA-Review: Simon Williams <simon@instructure.com> Product-Review: Simon Williams <simon@instructure.com>
2021-01-02 07:58:12 +08:00
},
{
object: 'self',
property: 'isNaN',
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
message: 'Please use Number.isNaN instead',
modernize canvas_quizzes fixes FOO-1409 flag = none no more client_apps, canvas_quizzes now lives as part of canvas-lms proper inside app/jsx/, which makes the build leaner and leaves us with one less thing to reason about logical changes: - converted from AMD to ES modules - upgraded to recent react + react-router - dropped RSVP in favor of native Promises - used CanvasModal instead of home-grown Dialog - removed dead code; notifications in particular were fishy as there had no dependents at all and did not even show up in the graph - ported tests to Jest, added more unit ones and two integration ones - removed "config.onError" and now throws errors where appropriate - disabled console statements in non-dev :: test plan :: - create a (old-school) quiz containing all types of questions - as 3 distinct students, take the quiz and try to randomize your answers at this point it's helpful to have a reference to compare the screens; I replicated the quiz on my production sandbox for this - go to /courses/:id/quizzes/:id/submissions/:id/log - verify it looks OK - click on a specific question in the stream and verify the question inspector widget works OK - go back to stream and push "View table" - verify the table and its controls are OK - go to /courses/:id/quizzes/:id/statistics - verify it looks OK - click on ? in the discrimination index chart and verify it displays a dialog with help content - click on "X respondents" in one of the charts and verify it displays a dialog with the respondent names - verify the interactive charts do interact as expected (no logic changed here so just a quick glance) - link to "View in SpeedGrader" for essay-like questions works Change-Id: I79af5ff4f1479503b5e2528b613255dde5bc45d3 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256118 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Simon Williams <simon@instructure.com> QA-Review: Simon Williams <simon@instructure.com> Product-Review: Simon Williams <simon@instructure.com>
2021-01-02 07:58:12 +08:00
},
{
object: 'window',
property: 'isNaN',
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
message: 'Please use Number.isNaN instead',
modernize canvas_quizzes fixes FOO-1409 flag = none no more client_apps, canvas_quizzes now lives as part of canvas-lms proper inside app/jsx/, which makes the build leaner and leaves us with one less thing to reason about logical changes: - converted from AMD to ES modules - upgraded to recent react + react-router - dropped RSVP in favor of native Promises - used CanvasModal instead of home-grown Dialog - removed dead code; notifications in particular were fishy as there had no dependents at all and did not even show up in the graph - ported tests to Jest, added more unit ones and two integration ones - removed "config.onError" and now throws errors where appropriate - disabled console statements in non-dev :: test plan :: - create a (old-school) quiz containing all types of questions - as 3 distinct students, take the quiz and try to randomize your answers at this point it's helpful to have a reference to compare the screens; I replicated the quiz on my production sandbox for this - go to /courses/:id/quizzes/:id/submissions/:id/log - verify it looks OK - click on a specific question in the stream and verify the question inspector widget works OK - go back to stream and push "View table" - verify the table and its controls are OK - go to /courses/:id/quizzes/:id/statistics - verify it looks OK - click on ? in the discrimination index chart and verify it displays a dialog with help content - click on "X respondents" in one of the charts and verify it displays a dialog with the respondent names - verify the interactive charts do interact as expected (no logic changed here so just a quick glance) - link to "View in SpeedGrader" for essay-like questions works Change-Id: I79af5ff4f1479503b5e2528b613255dde5bc45d3 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256118 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Simon Williams <simon@instructure.com> QA-Review: Simon Williams <simon@instructure.com> Product-Review: Simon Williams <simon@instructure.com>
2021-01-02 07:58:12 +08:00
},
{
property: '__defineGetter__',
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
message: 'Please use Object.defineProperty instead.',
modernize canvas_quizzes fixes FOO-1409 flag = none no more client_apps, canvas_quizzes now lives as part of canvas-lms proper inside app/jsx/, which makes the build leaner and leaves us with one less thing to reason about logical changes: - converted from AMD to ES modules - upgraded to recent react + react-router - dropped RSVP in favor of native Promises - used CanvasModal instead of home-grown Dialog - removed dead code; notifications in particular were fishy as there had no dependents at all and did not even show up in the graph - ported tests to Jest, added more unit ones and two integration ones - removed "config.onError" and now throws errors where appropriate - disabled console statements in non-dev :: test plan :: - create a (old-school) quiz containing all types of questions - as 3 distinct students, take the quiz and try to randomize your answers at this point it's helpful to have a reference to compare the screens; I replicated the quiz on my production sandbox for this - go to /courses/:id/quizzes/:id/submissions/:id/log - verify it looks OK - click on a specific question in the stream and verify the question inspector widget works OK - go back to stream and push "View table" - verify the table and its controls are OK - go to /courses/:id/quizzes/:id/statistics - verify it looks OK - click on ? in the discrimination index chart and verify it displays a dialog with help content - click on "X respondents" in one of the charts and verify it displays a dialog with the respondent names - verify the interactive charts do interact as expected (no logic changed here so just a quick glance) - link to "View in SpeedGrader" for essay-like questions works Change-Id: I79af5ff4f1479503b5e2528b613255dde5bc45d3 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256118 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Simon Williams <simon@instructure.com> QA-Review: Simon Williams <simon@instructure.com> Product-Review: Simon Williams <simon@instructure.com>
2021-01-02 07:58:12 +08:00
},
{
property: '__defineSetter__',
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
message: 'Please use Object.defineProperty instead.',
},
{
object: 'ReactDOM',
property: 'render',
message:
'React 18 deprecates ReactDOM.render, try using ReactDOM.createRoot and render instead.',
},
modernize canvas_quizzes fixes FOO-1409 flag = none no more client_apps, canvas_quizzes now lives as part of canvas-lms proper inside app/jsx/, which makes the build leaner and leaves us with one less thing to reason about logical changes: - converted from AMD to ES modules - upgraded to recent react + react-router - dropped RSVP in favor of native Promises - used CanvasModal instead of home-grown Dialog - removed dead code; notifications in particular were fishy as there had no dependents at all and did not even show up in the graph - ported tests to Jest, added more unit ones and two integration ones - removed "config.onError" and now throws errors where appropriate - disabled console statements in non-dev :: test plan :: - create a (old-school) quiz containing all types of questions - as 3 distinct students, take the quiz and try to randomize your answers at this point it's helpful to have a reference to compare the screens; I replicated the quiz on my production sandbox for this - go to /courses/:id/quizzes/:id/submissions/:id/log - verify it looks OK - click on a specific question in the stream and verify the question inspector widget works OK - go back to stream and push "View table" - verify the table and its controls are OK - go to /courses/:id/quizzes/:id/statistics - verify it looks OK - click on ? in the discrimination index chart and verify it displays a dialog with help content - click on "X respondents" in one of the charts and verify it displays a dialog with the respondent names - verify the interactive charts do interact as expected (no logic changed here so just a quick glance) - link to "View in SpeedGrader" for essay-like questions works Change-Id: I79af5ff4f1479503b5e2528b613255dde5bc45d3 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256118 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Simon Williams <simon@instructure.com> QA-Review: Simon Williams <simon@instructure.com> Product-Review: Simon Williams <simon@instructure.com>
2021-01-02 07:58:12 +08:00
],
'no-restricted-syntax': [
// This is here because we are turning off 2 items from what AirBnB cares about.
'error',
{
selector: 'LabeledStatement',
message:
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
},
{
selector: 'WithStatement',
message:
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
'`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
},
],
// These are discouraged, but allowed
'no-console': 'warn',
'jest/no-large-snapshots': 'warn',
// These are things we care about
'react/jsx-filename-extension': ['error', {extensions: ['jsx', 'tsx']}],
'eslint-comments/no-unused-disable': 'error',
'jest/no-disabled-tests': 'off',
'import/extensions': [
'error',
'ignorePackages',
{js: 'never', ts: 'never', jsx: 'never', tsx: 'never', coffee: 'never'},
],
'import/no-commonjs': 'off', // This is overridden where it counts
'import/no-extraneous-dependencies': 'off',
'lodash/callback-binding': 'error',
'lodash/collection-method-value': 'error',
'lodash/collection-return': 'error',
'lodash/no-extra-args': 'error',
'lodash/no-unbound-this': 'error',
'notice/notice': [
'error',
{
templateFile: path.join(__dirname, 'config', 'copyright-template.js'),
// purposely lenient so we don't automatically put our copyright notice on
// top of something already copyrighted by someone else.
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
mustMatch: 'Copyright ',
},
],
'no-unused-expressions': 'off', // the babel version allows optional chaining a?.b
'babel/no-unused-expressions': ['error', {allowShortCircuit: true, allowTernary: true}],
'prettier/prettier': 'warn',
Initial pace plans import This change brings in the basic pace plans frontend with styled-components and several other smaller libraries replaced with InstUI 7 components. It also adds the 'reselect' library as a direct dependency (which we already had through @instructure/outcomes-ui) and 'tsc-files' for type-checking of staged TS files on commit. There were also some tweaks to typescript and eslint configs, mostly to get both up to speed with the typescript code. Finally, this also adds a `pace_plans` endpoint to `courses_controller` to bootstrap the frontend-- this will get moved to `pace_plans_controller` once it has been merged. It's also worth noting that no frontend tests are included with this change-- the existing tests were written with enzyme and are heavily snapshot-based, so we will be replacing those with @testing-library/react tests in later updates (in keeping with current testing best practices at Instructure). closes LS-2431, LS-2432, LS-2433, LS-2434, LS-2452 flag = pace_plans Test plan: - Set up a course with at least one module and several module items - Turn on the pace_plans feature flag in the account associated with that course - Turn on the "Enable pace plans" setting in course settings - Create a pace plan for the course via the Rails console: c = Course.find<id> pp = c.pace_plans.create! workflow_state: 'active' c.context_module_tags.each_with_index do |t, i| pp.pace_plan_module_items.create! module_item: t, duration: i*2 end - Go to the course as a teacher or admin - Expect to see a "Pace Plans" link in the course navigation - Click it, expect the pace plan you created earlier to load and render - Expect to be able to pick dates, change durations, and toggle checkboxes (although saves will fail, since there is no API yet). - Expect to not see the "Pace Plans" course nav link when the feature flag or course setting is off - Expect /courses/<id>/pace_plans to return a 404 when the feature flag or course setting is off - Expect to not see the "Pace Plans" course nav link as a student - Expect /courses/<id>/pace_plans to display an "Unauthorized" page as a student Change-Id: If4dc5d17f2c6a2109d4b4cb652c9e9ef00d7cc33 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271650 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Ed Schiebel <eschiebel@instructure.com> QA-Review: Ed Schiebel <eschiebel@instructure.com> Product-Review: Jeff Largent <jeff.largent@instructure.com>
2021-08-18 05:14:24 +08:00
// Some rules need to be replaced with typescript versions to work with TS
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': 'error',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'warn', // AirBnB says 'error', we downgrade to just 'warn'
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
Initial pace plans import This change brings in the basic pace plans frontend with styled-components and several other smaller libraries replaced with InstUI 7 components. It also adds the 'reselect' library as a direct dependency (which we already had through @instructure/outcomes-ui) and 'tsc-files' for type-checking of staged TS files on commit. There were also some tweaks to typescript and eslint configs, mostly to get both up to speed with the typescript code. Finally, this also adds a `pace_plans` endpoint to `courses_controller` to bootstrap the frontend-- this will get moved to `pace_plans_controller` once it has been merged. It's also worth noting that no frontend tests are included with this change-- the existing tests were written with enzyme and are heavily snapshot-based, so we will be replacing those with @testing-library/react tests in later updates (in keeping with current testing best practices at Instructure). closes LS-2431, LS-2432, LS-2433, LS-2434, LS-2452 flag = pace_plans Test plan: - Set up a course with at least one module and several module items - Turn on the pace_plans feature flag in the account associated with that course - Turn on the "Enable pace plans" setting in course settings - Create a pace plan for the course via the Rails console: c = Course.find<id> pp = c.pace_plans.create! workflow_state: 'active' c.context_module_tags.each_with_index do |t, i| pp.pace_plan_module_items.create! module_item: t, duration: i*2 end - Go to the course as a teacher or admin - Expect to see a "Pace Plans" link in the course navigation - Click it, expect the pace plan you created earlier to load and render - Expect to be able to pick dates, change durations, and toggle checkboxes (although saves will fail, since there is no API yet). - Expect to not see the "Pace Plans" course nav link when the feature flag or course setting is off - Expect /courses/<id>/pace_plans to return a 404 when the feature flag or course setting is off - Expect to not see the "Pace Plans" course nav link as a student - Expect /courses/<id>/pace_plans to display an "Unauthorized" page as a student Change-Id: If4dc5d17f2c6a2109d4b4cb652c9e9ef00d7cc33 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271650 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Ed Schiebel <eschiebel@instructure.com> QA-Review: Ed Schiebel <eschiebel@instructure.com> Product-Review: Jeff Largent <jeff.largent@instructure.com>
2021-08-18 05:14:24 +08:00
{
args: 'all',
Initial pace plans import This change brings in the basic pace plans frontend with styled-components and several other smaller libraries replaced with InstUI 7 components. It also adds the 'reselect' library as a direct dependency (which we already had through @instructure/outcomes-ui) and 'tsc-files' for type-checking of staged TS files on commit. There were also some tweaks to typescript and eslint configs, mostly to get both up to speed with the typescript code. Finally, this also adds a `pace_plans` endpoint to `courses_controller` to bootstrap the frontend-- this will get moved to `pace_plans_controller` once it has been merged. It's also worth noting that no frontend tests are included with this change-- the existing tests were written with enzyme and are heavily snapshot-based, so we will be replacing those with @testing-library/react tests in later updates (in keeping with current testing best practices at Instructure). closes LS-2431, LS-2432, LS-2433, LS-2434, LS-2452 flag = pace_plans Test plan: - Set up a course with at least one module and several module items - Turn on the pace_plans feature flag in the account associated with that course - Turn on the "Enable pace plans" setting in course settings - Create a pace plan for the course via the Rails console: c = Course.find<id> pp = c.pace_plans.create! workflow_state: 'active' c.context_module_tags.each_with_index do |t, i| pp.pace_plan_module_items.create! module_item: t, duration: i*2 end - Go to the course as a teacher or admin - Expect to see a "Pace Plans" link in the course navigation - Click it, expect the pace plan you created earlier to load and render - Expect to be able to pick dates, change durations, and toggle checkboxes (although saves will fail, since there is no API yet). - Expect to not see the "Pace Plans" course nav link when the feature flag or course setting is off - Expect /courses/<id>/pace_plans to return a 404 when the feature flag or course setting is off - Expect to not see the "Pace Plans" course nav link as a student - Expect /courses/<id>/pace_plans to display an "Unauthorized" page as a student Change-Id: If4dc5d17f2c6a2109d4b4cb652c9e9ef00d7cc33 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271650 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Ed Schiebel <eschiebel@instructure.com> QA-Review: Ed Schiebel <eschiebel@instructure.com> Product-Review: Jeff Largent <jeff.largent@instructure.com>
2021-08-18 05:14:24 +08:00
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
Initial pace plans import This change brings in the basic pace plans frontend with styled-components and several other smaller libraries replaced with InstUI 7 components. It also adds the 'reselect' library as a direct dependency (which we already had through @instructure/outcomes-ui) and 'tsc-files' for type-checking of staged TS files on commit. There were also some tweaks to typescript and eslint configs, mostly to get both up to speed with the typescript code. Finally, this also adds a `pace_plans` endpoint to `courses_controller` to bootstrap the frontend-- this will get moved to `pace_plans_controller` once it has been merged. It's also worth noting that no frontend tests are included with this change-- the existing tests were written with enzyme and are heavily snapshot-based, so we will be replacing those with @testing-library/react tests in later updates (in keeping with current testing best practices at Instructure). closes LS-2431, LS-2432, LS-2433, LS-2434, LS-2452 flag = pace_plans Test plan: - Set up a course with at least one module and several module items - Turn on the pace_plans feature flag in the account associated with that course - Turn on the "Enable pace plans" setting in course settings - Create a pace plan for the course via the Rails console: c = Course.find<id> pp = c.pace_plans.create! workflow_state: 'active' c.context_module_tags.each_with_index do |t, i| pp.pace_plan_module_items.create! module_item: t, duration: i*2 end - Go to the course as a teacher or admin - Expect to see a "Pace Plans" link in the course navigation - Click it, expect the pace plan you created earlier to load and render - Expect to be able to pick dates, change durations, and toggle checkboxes (although saves will fail, since there is no API yet). - Expect to not see the "Pace Plans" course nav link when the feature flag or course setting is off - Expect /courses/<id>/pace_plans to return a 404 when the feature flag or course setting is off - Expect to not see the "Pace Plans" course nav link as a student - Expect /courses/<id>/pace_plans to display an "Unauthorized" page as a student Change-Id: If4dc5d17f2c6a2109d4b4cb652c9e9ef00d7cc33 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271650 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Ed Schiebel <eschiebel@instructure.com> QA-Review: Ed Schiebel <eschiebel@instructure.com> Product-Review: Jeff Largent <jeff.largent@instructure.com>
2021-08-18 05:14:24 +08:00
// allows `const {propIUse, propIDontUseButDontWantToPassOn, ...propsToPassOn} = this.props`
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
ignoreRestSiblings: true,
},
Initial pace plans import This change brings in the basic pace plans frontend with styled-components and several other smaller libraries replaced with InstUI 7 components. It also adds the 'reselect' library as a direct dependency (which we already had through @instructure/outcomes-ui) and 'tsc-files' for type-checking of staged TS files on commit. There were also some tweaks to typescript and eslint configs, mostly to get both up to speed with the typescript code. Finally, this also adds a `pace_plans` endpoint to `courses_controller` to bootstrap the frontend-- this will get moved to `pace_plans_controller` once it has been merged. It's also worth noting that no frontend tests are included with this change-- the existing tests were written with enzyme and are heavily snapshot-based, so we will be replacing those with @testing-library/react tests in later updates (in keeping with current testing best practices at Instructure). closes LS-2431, LS-2432, LS-2433, LS-2434, LS-2452 flag = pace_plans Test plan: - Set up a course with at least one module and several module items - Turn on the pace_plans feature flag in the account associated with that course - Turn on the "Enable pace plans" setting in course settings - Create a pace plan for the course via the Rails console: c = Course.find<id> pp = c.pace_plans.create! workflow_state: 'active' c.context_module_tags.each_with_index do |t, i| pp.pace_plan_module_items.create! module_item: t, duration: i*2 end - Go to the course as a teacher or admin - Expect to see a "Pace Plans" link in the course navigation - Click it, expect the pace plan you created earlier to load and render - Expect to be able to pick dates, change durations, and toggle checkboxes (although saves will fail, since there is no API yet). - Expect to not see the "Pace Plans" course nav link when the feature flag or course setting is off - Expect /courses/<id>/pace_plans to return a 404 when the feature flag or course setting is off - Expect to not see the "Pace Plans" course nav link as a student - Expect /courses/<id>/pace_plans to display an "Unauthorized" page as a student Change-Id: If4dc5d17f2c6a2109d4b4cb652c9e9ef00d7cc33 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271650 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Ed Schiebel <eschiebel@instructure.com> QA-Review: Ed Schiebel <eschiebel@instructure.com> Product-Review: Jeff Largent <jeff.largent@instructure.com>
2021-08-18 05:14:24 +08:00
],
semi: 'off',
'@typescript-eslint/semi': ['warn', 'never'],
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.json', '.ts', '.tsx', '.d.ts'], // add Typescript and CoffeeScript extensions
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
},
},
react: {
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
version: 'detect',
},
},
overrides: [
{
files: ['ui/**/*Spec.js', 'ui/**/*Spec.jsx'],
extends: ['plugin:qunit/recommended', 'plugin:qunit/two'],
plugins: ['qunit'],
globals: {
module: true,
test: true,
equal: true,
ok: true,
sandbox: true,
sinon: true,
deepEqual: true,
},
env: {
qunit: true,
},
rules: {
'func-names': 'off',
'prefer-arrow-callback': 'off',
'jest/no-identical-title': 'off',
'qunit/no-identical-names': 'off',
'qunit/no-setup-teardown': 'off',
'qunit/no-global-assertions': 'off',
'qunit/no-global-module-test': 'off',
'qunit/require-expect': 'off',
'qunit/no-assert-logical-expression': 'error',
'qunit/no-commented-tests': 'error',
'qunit/no-compare-relation-boolean': 'error',
},
},
{
files: require('./jest.config').testMatch,
plugins: ['jest'],
env: {
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
'jest/globals': true,
},
rules: {
'jest/prefer-to-be-null': 'error',
'jest/prefer-to-be-undefined': 'error',
'jest/prefer-to-contain': 'error',
'jest/no-test-return-statement': 'error',
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
'jest/no-large-snapshots': 'warn',
},
},
{
files: ['ui/**/*', 'spec/**/*', 'public/**/*', 'packages/**/*'],
rules: {
// Turn off the "absolute-first" rule. Until we get rid of the `compiled/` and `jsx/`
// stuff and use real realitive paths it will tell you to do the wrong thing
'import/first': ['error', 'disable-absolute-first'],
'import/no-amd': 'error',
'import/no-commonjs': 'warn',
'import/no-extraneous-dependencies': 'off', // allows 'i18n!webzip_exports' and 'compiled/foo/bar'
'import/no-nodejs-modules': 'error',
'import/order': 'off', // because it thinks 'jsx/whatever' and 'compiled/baz' should go in their groups. we don't want to encourage people to do that just so they move them back together once those everything is in same dir
'import/no-unresolved': 'off',
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
'import/no-webpack-loader-syntax': 'off',
'import/newline-after-import': 'warn',
'jest/no-jasmine-globals': 'error',
'no-constant-condition': 'error',
'react-hooks/exhaustive-deps': 'error',
'react/prefer-stateless-function': 'error',
'prefer-const': 'warn',
// TODO: resolve and remove these overrides
'react/no-string-refs': 'warn',
'react/no-this-in-sfc': 'warn',
'react/prop-types': 'warn',
'react/no-access-state-in-setstate': 'warn',
'react/no-find-dom-node': 'warn',
'react/no-unused-prop-types': 'warn',
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
},
modernize canvas_quizzes fixes FOO-1409 flag = none no more client_apps, canvas_quizzes now lives as part of canvas-lms proper inside app/jsx/, which makes the build leaner and leaves us with one less thing to reason about logical changes: - converted from AMD to ES modules - upgraded to recent react + react-router - dropped RSVP in favor of native Promises - used CanvasModal instead of home-grown Dialog - removed dead code; notifications in particular were fishy as there had no dependents at all and did not even show up in the graph - ported tests to Jest, added more unit ones and two integration ones - removed "config.onError" and now throws errors where appropriate - disabled console statements in non-dev :: test plan :: - create a (old-school) quiz containing all types of questions - as 3 distinct students, take the quiz and try to randomize your answers at this point it's helpful to have a reference to compare the screens; I replicated the quiz on my production sandbox for this - go to /courses/:id/quizzes/:id/submissions/:id/log - verify it looks OK - click on a specific question in the stream and verify the question inspector widget works OK - go back to stream and push "View table" - verify the table and its controls are OK - go to /courses/:id/quizzes/:id/statistics - verify it looks OK - click on ? in the discrimination index chart and verify it displays a dialog with help content - click on "X respondents" in one of the charts and verify it displays a dialog with the respondent names - verify the interactive charts do interact as expected (no logic changed here so just a quick glance) - link to "View in SpeedGrader" for essay-like questions works Change-Id: I79af5ff4f1479503b5e2528b613255dde5bc45d3 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256118 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Simon Williams <simon@instructure.com> QA-Review: Simon Williams <simon@instructure.com> Product-Review: Simon Williams <simon@instructure.com>
2021-01-02 07:58:12 +08:00
},
{
files: ['jest/**/*'],
rules: {
'import/extensions': 'off',
'import/no-commonjs': 'off',
'import/no-extraneous-dependencies': 'off',
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
'import/order': 'off',
},
},
modernize canvas_quizzes fixes FOO-1409 flag = none no more client_apps, canvas_quizzes now lives as part of canvas-lms proper inside app/jsx/, which makes the build leaner and leaves us with one less thing to reason about logical changes: - converted from AMD to ES modules - upgraded to recent react + react-router - dropped RSVP in favor of native Promises - used CanvasModal instead of home-grown Dialog - removed dead code; notifications in particular were fishy as there had no dependents at all and did not even show up in the graph - ported tests to Jest, added more unit ones and two integration ones - removed "config.onError" and now throws errors where appropriate - disabled console statements in non-dev :: test plan :: - create a (old-school) quiz containing all types of questions - as 3 distinct students, take the quiz and try to randomize your answers at this point it's helpful to have a reference to compare the screens; I replicated the quiz on my production sandbox for this - go to /courses/:id/quizzes/:id/submissions/:id/log - verify it looks OK - click on a specific question in the stream and verify the question inspector widget works OK - go back to stream and push "View table" - verify the table and its controls are OK - go to /courses/:id/quizzes/:id/statistics - verify it looks OK - click on ? in the discrimination index chart and verify it displays a dialog with help content - click on "X respondents" in one of the charts and verify it displays a dialog with the respondent names - verify the interactive charts do interact as expected (no logic changed here so just a quick glance) - link to "View in SpeedGrader" for essay-like questions works Change-Id: I79af5ff4f1479503b5e2528b613255dde5bc45d3 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256118 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Simon Williams <simon@instructure.com> QA-Review: Simon Williams <simon@instructure.com> Product-Review: Simon Williams <simon@instructure.com>
2021-01-02 07:58:12 +08:00
{
files: [
'ui/features/quiz_log_auditing/**/*',
'ui/features/quiz_statistics/**/*',
'ui/shared/quiz-legacy-client-apps/**/*',
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
'ui/shared/quiz-log-auditing/**/*',
],
modernize canvas_quizzes fixes FOO-1409 flag = none no more client_apps, canvas_quizzes now lives as part of canvas-lms proper inside app/jsx/, which makes the build leaner and leaves us with one less thing to reason about logical changes: - converted from AMD to ES modules - upgraded to recent react + react-router - dropped RSVP in favor of native Promises - used CanvasModal instead of home-grown Dialog - removed dead code; notifications in particular were fishy as there had no dependents at all and did not even show up in the graph - ported tests to Jest, added more unit ones and two integration ones - removed "config.onError" and now throws errors where appropriate - disabled console statements in non-dev :: test plan :: - create a (old-school) quiz containing all types of questions - as 3 distinct students, take the quiz and try to randomize your answers at this point it's helpful to have a reference to compare the screens; I replicated the quiz on my production sandbox for this - go to /courses/:id/quizzes/:id/submissions/:id/log - verify it looks OK - click on a specific question in the stream and verify the question inspector widget works OK - go back to stream and push "View table" - verify the table and its controls are OK - go to /courses/:id/quizzes/:id/statistics - verify it looks OK - click on ? in the discrimination index chart and verify it displays a dialog with help content - click on "X respondents" in one of the charts and verify it displays a dialog with the respondent names - verify the interactive charts do interact as expected (no logic changed here so just a quick glance) - link to "View in SpeedGrader" for essay-like questions works Change-Id: I79af5ff4f1479503b5e2528b613255dde5bc45d3 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256118 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Simon Williams <simon@instructure.com> QA-Review: Simon Williams <simon@instructure.com> Product-Review: Simon Williams <simon@instructure.com>
2021-01-02 07:58:12 +08:00
rules: {
'react/prop-types': 'off',
de-jqueryify enhanceUserContent: v2 reimplement enhanceUserContent without jquery in preparation for moving out of the canvas monolith. Some transformations to the DOM aren't necessary, but are there for backward compatibility (as I discovered getting all existing specs to pass) pass This is not going to be an easy review, since the new implementation is completely new and it will be difficult to ensure the previous functionality is all implemented correctly. What can I say? closes MAT-1011 flag=none test plan: - using the rce, create content with - external link - course link - canvas file link, default overlay preview - canvas file link, inline preview - canvas file link, inline preview, automatially expand - link to youtube content, end edit html and remove "inline_disabled" class name - save > expect > external link to have the external link icon w/in the link so you can click it and open the link in a new tab > nothing happens to the course link > clicking canvas file link 1, preview opens in the overlay > clicking canvas file link 2, preview opens inline > clicking again closes preview > canvas file link 3 inline preview opens automatically > clicking link closes preview > the youtube link gets a preview thumbnail next to it > click the thumbnail and it's replaced with a playable youtube video - have a student submit an assignment - create a media comment on the assignment > expect the media comment link to be replaced with a thumbnail that plays when clicked (I think) - PS29 and beyone - look at the DOM tree for external images > expect the text and icon each to be in their own span - have a link containing just an image. - tab through the saved content > expect the linked image's focus ring to be in your theme color TESTING JQUERY WIDGETS: this only works in canvas, probably not new quizzes - put something like the following in your content using the rce's html editor <div class="enhanceable_content draggable" style="width: 100px; height: 100px; border: 1px solid black; background-color: cyan;">drag me?</div> <div class="enhanceable_content resizable" style="width: 100px; height: 100px; border: 1px solid black; background-color: grey;">resize me?</div> <div class="enhanceable_content tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>I am tab 1 content</p> </div> <div id="tabs-2"> <p>This is tab 2 content</p> </div> <div id="tabs-3"> <p>tab 3 content has 2 paragraphs</p> <p>and this is that 2nd paragraph</p> </div> </div> <p><a href="#jquery_dialog">open the dialog</a></p> <div id="jquery_dialog" class="enhanceable_content dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <div>Drag items around to sort</div> <ul class="enhanceable_content sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> > expect to be able to drag "drag me" around the page > expect "resize me" to be resizeaable > expect tabs to work - click "open the doalog" > expect the dialog to open > expect to be able to close and reopen the dialog > expect to be able to drag list items around to reorder them Change-Id: I34418970870a1d34f8dabd9dd435ba058576b52a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300806 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Mysti Lilla <mysti@instructure.com> QA-Review: Mysti Lilla <mysti@instructure.com> Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-09-13 05:51:03 +08:00
'react/no-string-refs': 'warn',
},
},
],
}