canvas-lms/app/jsx
Ryan Shaw 7ed276c5ba fix instUI deprecation in gb StatusesModal
closes: CORE-1944

test plan:
As a teacher, open the Status Modal in New Gradebook.
You shouldn’t see:
Warning: [Modal] `closeButtonLabel` was deprecated in 5.0.0.

the header of the modal should look the same as it did before
the “X” button should have “Close” screenreader text
Clicking it should close the modal

Change-Id: Ibc91e83e532f565c48fae5e30973fcfeb03e9f98
Reviewed-on: https://gerrit.instructure.com/166021
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-10-01 15:28:21 +00:00
..
__tests__ add custom grade entry to moderation page 2018-06-19 19:00:16 +00:00
account_course_user_search spec: make searchMessageSpec work w/ react 16 2018-09-18 23:01:43 +00:00
actAs [react codemod] React-PropTypes-to-prop-types 2018-08-24 21:37:50 +00:00
add_people Spec: make MissingPeopleSection.spec work w/ React 16 2018-09-18 22:36:27 +00:00
announcements fix instUI deprecation in ExternalFeedsTray 2018-09-28 01:39:01 +00:00
assignments rename method to avoid conflict with react 16 2018-09-19 20:23:01 +00:00
authentication_providers rename AccountAuthorizationConfig* to AuthenticationProvider* 2018-04-26 16:03:47 +00:00
blueprint_courses fix instUI deprecation in BlueprintModal 2018-10-01 15:27:25 +00:00
bundles refactor saml debugging 2018-09-29 04:27:17 +00:00
calendar replace react-modal with instui in calendar 2018-09-21 20:41:19 +00:00
canvas_cropper Update `react-crop` dependency 2018-09-14 17:08:42 +00:00
choose_mastery_path Upgrade React, instructure-ui and instructure-icons 2017-05-16 21:15:44 +00:00
collaborations remove react-modal from collaborations 2018-09-20 20:34:28 +00:00
conditional_release_stats spec: fix some JS specs so they work w/ react 16 2018-09-19 15:18:53 +00:00
context_cards fix instUI deprecation in studentContextTray 2018-09-27 15:42:38 +00:00
context_modules use relative paths to jsx/* in app/jsx 2017-12-19 16:45:46 +00:00
course_link_validator react 16: Convert some React.createClass to es6 2018-09-12 15:27:31 +00:00
course_settings upgrade remaining <PopoverMenu>s to instui5 <Menu> 2018-06-13 22:15:00 +00:00
course_wizard Fix a spec to work with react 16 2018-09-20 19:22:23 +00:00
courses fix fancy midnight on todo sidebar 2018-09-06 17:16:51 +00:00
custom_help_link_settings Handle custom help menu name field errors better 2018-08-02 20:21:27 +00:00
dashboard fix fancy midnight on todo sidebar 2018-09-06 17:16:51 +00:00
dashboard_card fix instUI deprecation in DashboardCardMenu 2018-09-27 15:47:35 +00:00
developer_keys Tool Config Customization Form 2018-09-28 17:09:19 +00:00
discussion_topics Fix keyboardShortcutModal to work w/ react 16 2018-09-18 21:00:15 +00:00
discussions remove last posted non replied discussions 2018-09-24 18:56:34 +00:00
due_dates upgrade react-token-input so it supports react 16 2018-09-14 19:27:28 +00:00
editor Make focus remain on the editor toggle button 2018-09-24 21:57:57 +00:00
eportfolios react 16: Convert some React.createClass to es6 2018-09-12 15:27:31 +00:00
epub_exports react 16: Convert some React.createClass to es6 2018-09-12 15:27:31 +00:00
external_apps Add 1.3 Indicator to Installed App Index 2018-09-27 22:03:46 +00:00
files remove new_file_tree feature flag 2018-09-26 21:38:35 +00:00
grade_summary style(Grades): breathing room below 'arrange by' dropdown 2018-09-27 21:05:35 +00:00
gradebook react 16: Convert some React.createClass to es6 2018-09-12 15:27:31 +00:00
gradebook-history style(Gradebook History): remove italics within results message 2018-08-16 18:46:36 +00:00
gradezilla fix instUI deprecation in gb StatusesModal 2018-10-01 15:28:21 +00:00
grading upgrade react-token-input so it supports react 16 2018-09-14 19:27:28 +00:00
groups react 16: use createReactClass for things that can’t be es6 classes 2018-09-12 16:03:38 +00:00
help_dialog react 16: Convert some React.createClass to es6 2018-09-12 15:27:31 +00:00
login Update the parent sign up form to use a pairing code 2018-06-18 20:02:39 +00:00
mediaelement Add Copyright to jsx files 2018-03-14 14:38:18 +00:00
modules Add a spinner for module duplication. 2018-06-07 19:54:43 +00:00
move_item hide Nav tray <hr> from screen readers 2018-07-30 21:26:14 +00:00
navigation_header style(Account Profile Tray) Allow initials in avatar 2018-09-12 16:30:27 +00:00
new_user_tutorial fix <IconMoveLeft /> is deprecated. Please use <IconMoveStart /> instead 2018-09-27 15:46:20 +00:00
notification_preferences instUI5 upgrade: random stuff 2018-05-30 21:40:47 +00:00
outcomes fix outcomes aligned to banks showing raw score 2018-09-28 20:45:03 +00:00
permissions Fix Permissions page so it works in react 16 2018-09-26 15:14:40 +00:00
profiles Make pairing codes more complex 2018-08-09 21:29:21 +00:00
quizzes use relative paths to jsx/* in app/jsx 2017-12-19 16:45:46 +00:00
rubrics Enable NSR feature flag and fix Selenium spec failures 2018-09-26 19:53:41 +00:00
shared [spec] ensure MutationObserver exists to fix flaky jest test 2018-09-27 16:16:03 +00:00
speed_grader Add Progress widget 2018-09-26 22:25:01 +00:00
student_last_attended instUI5 upgrade: random stuff 2018-05-30 21:40:47 +00:00
subnav_menu da licença part 42 2017-04-28 21:21:27 +00:00
theme_editor replace react-addons-transition-group 2018-09-17 18:45:07 +00:00
views don't load the stream items on dashboard until needed 2018-08-23 19:11:21 +00:00
webzip_export instUI5 upgrade: random stuff 2018-05-30 21:40:47 +00:00
.eslintrc.js da licença part 42 2017-04-28 21:21:27 +00:00
README.md Start using Babel to compile files in the JSX folder 2015-10-23 20:54:35 +00:00
appBootstrap.js Fix high contrast mode for instUI components 2018-09-05 22:12:45 +00:00
canvas-apollo.js add canvas-apollo 2018-09-21 20:28:59 +00:00
canvasCssVariablesPolyfill.js Fix CORS issue for cssVarsPolyfill in Edge 2017-09-27 14:55:07 +00:00
fakeRequireJSFallback.js use relative paths to jsx/* in app/jsx 2017-12-19 16:45:46 +00:00
railsFlashNotificationsHelper.js fix a11y grading period filter polite announcement 2017-06-26 16:12:56 +00:00

README.md

This directory is temporary until we rework the front-end build This is where we are headed.

Stuff you can do in Canvas JSX files

BUT WAIT!

Your file needs to:

  1. Have a file name with the .jsx extension.

JSX

function foo(paths) {
  return <svg>{paths}</svg>;
}

Arrow Functions

Arrow Function Reference

var arr = ['hydrogen', 'helium', 'lithium'];

// es5
var a = arr.map(function(s){ return s.length });

// es6
var b = arr.map( s => s.length );

// with curlies requires normal return
var b = arr.map( (s) => {
  return s.length
});

// lexical `this`
var obj = {
  multiplier: 3,

  multiplyStuff (stuff) {
    return stuff.map((x) =>
      // no bind!
      return this.multiplier * x;
    )
  }
};

Classes

Class Reference

class EventEmitter {
  constructor() {
    // called when created
  }
  emit() {
    // ...
  }
  on() {
    // ...
  }
  once() {
    // ...
  }
  removeListener() {
    // ...
  }
  removeAllListeners() {
    // ...
  }
}

Extending and calling super.

class Domain extends EventEmitter {
  constructor() {
    super();
    this.members = [];
  }
}

Creating instances

var domain = new Domain();

Destructuring

// es5
var map = _.map;
var each = _.each;

// es6
var {map, each} = _;

Concise Object Methods

// es5
var obj = {
  foo: function() {}
  bar: function() {}
};

// es6
var obj = {
  foo() {}
  bar() {}
};

Object Short Notation

// es5
function() {
  // ...
  return {foo: foo, bar: bar, x: 10};
}

// es6
function() {
  // ...
  return {foo, bar, x: 10};
}

Rest Parameters

Rest Parameters Reference

// es5
function multiply(multiplier) {
  var numbers = Array.prototype.slice.call(arguments, 0);
  return number.map(function(n) { return multiplier * n; });
}

// es6
function multiply(multiplier, ...numbers) {
  return numbers.map( n => multiplier * n);
}

String Templates

String Template Reference

Multiline strings:

// es5
console.log("string text line 1" +
"string text line 2");

// es6
console.log(`string text line 1
string text line 2`);

Interpolated strings

var a = 5;
var b = 10;

// es5
console.log("Fifteen is " + (a + b) + " and not " + (2 * a + b) + ".");

// es6
console.log(`Fifteen is ${a + b} and not ${2 * a + b}.`);