Skip to content

Commit 95718bd

Browse files
neilguptajunyper
authored andcommitted
Upgrade InstUI to 0.14.4
fixes CNVS-31926 Also note: we no longer want to load all of InstUI at once, and instead prefer to load components as we need them. Test plan: * automated tests pass Change-Id: Ia3b73bd68c94901da64c432ab88f3b7a1634a77f Reviewed-on: https://gerrit.instructure.com/90271 Reviewed-by: Michael Brewer-Davis <mbd@instructure.com> Tested-by: Jenkins Product-Review: Colleen Palmer <colleen@instructure.com> QA-Review: Colleen Palmer <colleen@instructure.com>
1 parent 20739b1 commit 95718bd

18 files changed

Lines changed: 82 additions & 68 deletions

File tree

app/jsx/conditional_release_stats/components/breakdown-graphs.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
define([
22
'react',
3-
'instructure-ui',
3+
'instructure-ui/Spinner',
44
'i18n!cyoe_assignment_sidebar',
55
'./breakdown-graph-bar',
66
'../helpers/score',
7-
], (React, { Spinner }, I18n, BarGraph, scoreHelpers) => {
7+
], (React, { default: Spinner }, I18n, BarGraph, scoreHelpers) => {
88
const { object, array, func, number, bool } = React.PropTypes
99

1010
class BreakdownGraphs extends React.Component {

app/jsx/conditional_release_stats/components/student-details-view.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
define([
22
'react',
33
'classnames',
4-
'instructure-ui',
4+
'instructure-ui/Spinner',
55
'i18n!cyoe_assignment_sidebar',
66
'./student-assignment-item',
77
'../shapes/index',
8-
], (React, classNames, { Spinner }, I18n, StudentAssignmentItem, { assignmentShape, studentShape }) => {
8+
], (React, classNames, { default: Spinner }, I18n, StudentAssignmentItem, { assignmentShape, studentShape }) => {
99
const { shape, string, number, arrayOf, func, bool } = React.PropTypes
1010

1111
return class StudentDetailsView extends React.Component {

app/jsx/conditional_release_stats/components/student-ranges-view.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
define([
22
'react',
3-
'instructure-ui',
3+
'instructure-ui/TabList',
4+
'instructure-ui/ApplyTheme',
45
'i18n!cyoe_assignment_sidebar',
56
'./student-range',
67
'../helpers/score',
7-
], (React, { TabList, TabPanel, Tab, ApplyTheme }, I18n, StudentRange, scoreHelpers) => {
8+
], (React, { default: TabList, TabPanel, Tab }, { default: ApplyTheme }, I18n, StudentRange, scoreHelpers) => {
89
const { array, func, object } = React.PropTypes
910

1011
const tabsTheme = {
@@ -58,7 +59,7 @@ define([
5859
<h4>{I18n.t('Mastery Paths Breakdown')}</h4>
5960
</header>
6061
<ApplyTheme theme={tabsTheme}>
61-
<TabList style='accordion' selectedIndex={this.props.selectedPath.range} onChange={this.props.selectRange}>
62+
<TabList variant='accordion' selectedIndex={this.props.selectedPath.range} onChange={this.props.selectRange}>
6263
{this.renderTabs()}
6364
</TabList>
6465
</ApplyTheme>

app/jsx/course_settings/components/CourseImagePicker.jsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ define([
44
'underscore',
55
'./UploadArea',
66
'../../shared/FlickrSearch',
7-
'instructure-ui'
8-
], (React, I18n, _, UploadArea, FlickrSearch, InstUI) => {
9-
10-
const Spinner = InstUI.Spinner;
7+
'instructure-ui/Spinner'
8+
], (React, I18n, _, UploadArea, FlickrSearch, { default: Spinner }) => {
119

1210
class CourseImagePicker extends React.Component {
1311
constructor (props) {
@@ -92,7 +90,7 @@ define([
9290
</div>
9391
</div>
9492
<div className="CourseImagePicker__Content">
95-
<UploadArea
93+
<UploadArea
9694
courseId={this.props.courseId}
9795
handleFileUpload={this.props.handleFileUpload}/>
9896
<FlickrSearch selectImage={(flickrUrl) => this.props.handleFlickrUrlUpload(flickrUrl)} />
@@ -104,4 +102,4 @@ define([
104102

105103
return CourseImagePicker;
106104

107-
});
105+
});

app/jsx/course_settings/components/CourseImageSelector.jsx

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ define([
44
'i18n!course_images',
55
'../actions',
66
'./CourseImagePicker',
7-
'instructure-ui'
8-
], (React, Modal, I18n, Actions, CourseImagePicker, InstUI) => {
9-
10-
const Spinner = InstUI.Spinner;
7+
'instructure-ui/Spinner'
8+
], (React, Modal, I18n, Actions, CourseImagePicker, { default: Spinner }) => {
119

1210
const modalOverrides = {
1311
content : {
@@ -70,34 +68,34 @@ define([
7068
</a>
7169

7270
<ul id="courseImage-editDropdown-1"
73-
ref="editDropdown"
74-
className="al-options"
75-
role="menu"
76-
tabIndex="0"
77-
aria-hidden="true"
78-
aria-expanded="false"
71+
ref="editDropdown"
72+
className="al-options"
73+
role="menu"
74+
tabIndex="0"
75+
aria-hidden="true"
76+
aria-expanded="false"
7977
aria-activedescendant="courseImage-editDropdown-2"
8078
>
8179
<li role="presentation">
82-
<a href="#"
80+
<a href="#"
8381
onClick={() => this.changeImage()}
84-
className="icon-compose"
82+
className="icon-compose"
8583
id="courseImage-editDropdown-2"
8684
tabIndex="-1"
87-
ref="changeImage"
88-
role="menuitem"
85+
ref="changeImage"
86+
role="menuitem"
8987
>
9088
{I18n.t('Change image')}
9189
</a>
9290
</li>
9391
<li role="presentation">
9492
<a href="#"
95-
onClick={() => this.removeImage()}
96-
className="icon-trash"
93+
onClick={() => this.removeImage()}
94+
className="icon-trash"
9795
id="courseImage-editDropdown-3"
9896
tabIndex="-1"
99-
ref="removeImage"
100-
role="menuitem"
97+
ref="removeImage"
98+
role="menuitem"
10199
>
102100
{I18n.t('Remove image')}
103101
</a>
@@ -160,4 +158,4 @@ define([
160158

161159
return CourseImageSelector;
162160

163-
});
161+
});

app/jsx/notification_preferences/PolicyCell.jsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,20 @@ define([
22
'jquery',
33
'react',
44
'react-dom',
5-
'instructure-ui',
6-
], ($, React, ReactDOM, InstUI) => {
5+
'instructure-ui/RadioInput',
6+
'instructure-ui/RadioInputGroup',
7+
'instructure-ui/ScreenReaderContent',
8+
], (
9+
$,
10+
React,
11+
ReactDOM,
12+
{ default: RadioInput },
13+
{ default: RadioInputGroup },
14+
{ default: ScreenReaderContent }
15+
) => {
716

817
const PropTypes = React.PropTypes
918

10-
const RadioInputGroup = InstUI.RadioInputGroup
11-
const RadioInput = InstUI.RadioInput
12-
const ScreenReaderContent = InstUI.ScreenReaderContent
13-
1419
return class PolicyCell extends React.Component {
1520
static renderAt (elt, props) {
1621
ReactDOM.render(<PolicyCell {...props} />, elt)

app/jsx/shared/FlickrSearch.jsx

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ define([
55
'./stores/FlickrStore',
66
'./FlickrImage',
77
'./SVGWrapper',
8-
'instructure-ui'
9-
], (React, I18n, FlickrActions, FlickrStore, FlickrImage, SVGWrapper, InstUI) => {
10-
11-
const Spinner = InstUI.Spinner;
8+
'instructure-ui/Spinner'
9+
], (React, I18n, FlickrActions, FlickrStore, FlickrImage, SVGWrapper, { default: Spinner }) => {
1210

1311
class FlickrSearch extends React.Component {
1412

@@ -27,7 +25,7 @@ define([
2725
}
2826

2927
componentWillUnmount() {
30-
this.unsubscribe();
28+
this.unsubscribe();
3129
}
3230

3331
handleChange() {
@@ -45,7 +43,7 @@ define([
4543
this.searchFlickr(value, 1);
4644
}
4745
}
48-
46+
4947
searchFlickr (value, page) {
5048
FlickrStore.dispatch(FlickrActions.searchFlickr(value, page));
5149
}
@@ -74,30 +72,30 @@ define([
7472
<div className="ic-Input-group__add-on" role="presentation" aria-hidden="true" tabIndex="-1">
7573
<i className="icon-search"></i>
7674
</div>
77-
<input className="ic-Input"
78-
placeholder={I18n.t('Search flickr')}
79-
aria-label="Search widgets"
80-
value={this.state.searchTerm}
75+
<input className="ic-Input"
76+
placeholder={I18n.t('Search flickr')}
77+
aria-label="Search widgets"
78+
value={this.state.searchTerm}
8179
type="search"
8280
onChange={this.handleInput} />
8381
</div>
8482

8583
{!this.state.searching ?
8684
<div className="FlickrSearch__images">
8785
{photos ? photos.photo.map( (photo) => {
88-
return <FlickrImage key={photo.id}
86+
return <FlickrImage key={photo.id}
8987
url={photo.url_m}
90-
searchTerm={this.state.searchTerm}
88+
searchTerm={this.state.searchTerm}
9189
selectImage={this.props.selectImage} />
9290
}) : null }
9391
</div>
94-
:
92+
:
9593
<div className="FlickrSearch__loading">
9694
<Spinner title="Loading"/>
9795
</div>
9896
}
9997

100-
{photos ?
98+
{photos ?
10199
<span className="FlickrSearch__pageNavigation">
102100
{(this.state.page > 1 && !this.state.searching) ?
103101
<a className="FlickrSearch__control" ref="flickrSearchControlPrev" href="#" onClick={this.decrementPageCount}>
@@ -124,4 +122,4 @@ define([
124122

125123
return FlickrSearch;
126124

127-
});
125+
});

app/stylesheets/bundles/common.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
// Variables (including Bootstrap and jQuery UI), mixins, and functions
55
@import "base/environment";
6-
@import "../../../node_modules/instructure-ui/dist/instructure-ui";
76

87
// Heavily customized vendor styles
98
@import "vendor/jqueryui/jquery.ui.all";

lib/canvas/require_js.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ def app_bundles
4040
def paths(cache_busting = false)
4141
@paths ||= {
4242
:common => 'compiled/bundles/common',
43-
:jqueryui => 'vendor/jqueryui'
43+
:jqueryui => 'vendor/jqueryui',
44+
:instructureui => 'instructure-ui/'
4445
}.update(cache_busting ? cache_busting_paths : {}).
4546
update(plugin_paths).
4647
update(Canvas::RequireJs::PluginExtension.paths).

lib/tasks/canvas.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def check_syntax(files)
1919
Array(files).each do |js_file|
2020
js_file.strip!
2121
# only lint things in public/javascripts that are not in /vendor, /compiled, etc.
22-
if js_file.match /public\/javascripts\/(?!vendor|compiled|i18n.js|InstUI.js|translations|old_unsupported_dont_use_react)/
22+
if js_file.match /public\/javascripts\/(?!vendor|compiled|instructure\-ui|i18n.js|translations|old_unsupported_dont_use_react)/
2323
file_path = File.join(Rails.root, js_file)
2424

2525
unless quick

0 commit comments

Comments
 (0)