This reverts commit 228180b1ef.
This commit is contained in:
committed by
GitHub
parent
228180b1ef
commit
adf879e8b2
@@ -15,11 +15,11 @@ class AnnouncementSkipLink extends React.Component {
|
||||
this.setState({
|
||||
count: data.count
|
||||
});
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
return (<div>{`Skip to list of ${this.state.count} announcements`}</div>);
|
||||
return (<div>{'Skip to list of ' + this.state.count + ' announcements'}</div>)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ class AnnouncementList extends React.Component {
|
||||
}
|
||||
|
||||
retrievePage(page) {
|
||||
$.get(`/announcements/page/${page}`)
|
||||
$.get('/announcements/page/' + page)
|
||||
.then(data => {
|
||||
this.setState({
|
||||
announcements: data.announcements,
|
||||
@@ -66,7 +66,7 @@ class AnnouncementList extends React.Component {
|
||||
end_index: data.end_index,
|
||||
page: page
|
||||
});
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
renderPrevPage() {
|
||||
@@ -93,7 +93,7 @@ class AnnouncementList extends React.Component {
|
||||
onClick={() => this.renderPrevPage()}
|
||||
label="← previous"
|
||||
/>
|
||||
<span className="sr-only">{`${this.state.start_index} - ${this.state.end_index}) of ${this.state.count}`}</span>
|
||||
<span className="sr-only">{this.state.start_index + ' - ' + this.state.end_index + ') of ' + this.state.count}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -105,7 +105,7 @@ class AnnouncementList extends React.Component {
|
||||
onClick={() => this.renderNextPage()}
|
||||
label="next →"
|
||||
/>
|
||||
<span className="sr-only">{`${this.state.start_index} - ${this.state.end_index}) of ${this.state.count}`}</span>
|
||||
<span className="sr-only">{this.state.start_index + ' - ' + this.state.end_index + ') of ' + this.state.count}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -132,4 +132,4 @@ export default class AnnouncementsView {
|
||||
}
|
||||
}
|
||||
|
||||
export {AnnouncementsView, AnnouncementList, AnnouncementSkipLink};
|
||||
export {AnnouncementsView, AnnouncementList, AnnouncementSkipLink}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import React from 'react';
|
||||
import renderer from 'react-test-renderer';
|
||||
import testAnnouncements from './test-announcements.json';
|
||||
import testAnnouncements from './test-announcements.json'
|
||||
|
||||
import {AnnouncementSkipLink, AnnouncementList} from './Announcements';
|
||||
import {AnnouncementSkipLink, AnnouncementList} from './Announcements'
|
||||
|
||||
describe('Announcements component', () => {
|
||||
test('render skip link', () => {
|
||||
const component = renderer.create(
|
||||
<AnnouncementSkipLink />,
|
||||
);
|
||||
component.root.instance.setState({count: 10});
|
||||
component.root.instance.setState({'count': 10})
|
||||
const tree = component.toJSON();
|
||||
expect(tree).toMatchSnapshot();
|
||||
});
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
},
|
||||
|
||||
blockUrl: function() {
|
||||
return `/courses/${this.get('course_id')}/jump_to/${this.get('usage_id')}`;
|
||||
return '/courses/' + this.get('course_id') + '/jump_to/' + this.get('usage_id');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -62,7 +62,7 @@ function(Backbone, $, _, AjaxHelpers, TemplateHelpers, BookmarkButtonView) {
|
||||
handler: 'removeBookmark',
|
||||
event: 'bookmark:remove',
|
||||
method: 'DELETE',
|
||||
url: `${API_URL}bilbo,usage_1/`,
|
||||
url: API_URL + 'bilbo,usage_1/',
|
||||
body: null
|
||||
};
|
||||
var removeBookmarkData = {
|
||||
|
||||
@@ -21,10 +21,10 @@ define(
|
||||
for (i = 0; i < options.numBookmarksToCreate; i++) {
|
||||
bookmarkInfo = {
|
||||
id: i,
|
||||
display_name: `UNIT_DISPLAY_NAME_${i}`,
|
||||
display_name: 'UNIT_DISPLAY_NAME_' + i,
|
||||
created: new Date().toISOString(),
|
||||
course_id: 'COURSE_ID',
|
||||
usage_id: `UNIT_USAGE_ID_${i}`,
|
||||
usage_id: 'UNIT_USAGE_ID_' + i,
|
||||
block_type: 'vertical',
|
||||
path: [
|
||||
{display_name: 'SECTION_DISPLAY_NAME', usage_id: 'SECTION_USAGE_ID'},
|
||||
@@ -39,13 +39,13 @@ define(
|
||||
};
|
||||
|
||||
var createBookmarkUrl = function(courseId, usageId) {
|
||||
return `/courses/${courseId}/jump_to/${usageId}`;
|
||||
return '/courses/' + courseId + '/jump_to/' + usageId;
|
||||
};
|
||||
|
||||
var breadcrumbTrail = function(path, unitDisplayName) {
|
||||
return _.pluck(path, 'display_name')
|
||||
.concat([unitDisplayName])
|
||||
.join(' <span class="icon fa fa-caret-right" aria-hidden="true"></span><span class="sr">-</span> ');
|
||||
return _.pluck(path, 'display_name').
|
||||
concat([unitDisplayName]).
|
||||
join(' <span class="icon fa fa-caret-right" aria-hidden="true"></span><span class="sr">-</span> ');
|
||||
};
|
||||
|
||||
var verifyBookmarkedData = function(view, expectedData) {
|
||||
@@ -71,7 +71,7 @@ define(
|
||||
.toBe(breadcrumbTrail(results[i].path, results[i].display_name));
|
||||
|
||||
expect($bookmark.find('.list-item-date').text().trim())
|
||||
.toBe(`Bookmarked on ${view.humanFriendlyDate(results[i].created)}`);
|
||||
.toBe('Bookmarked on ' + view.humanFriendlyDate(results[i].created));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
removeBookmark: function() {
|
||||
var view = this;
|
||||
var deleteUrl = `${view.apiUrl + view.bookmarkId}/`;
|
||||
var deleteUrl = view.apiUrl + view.bookmarkId + '/';
|
||||
|
||||
$.ajax({
|
||||
type: 'DELETE',
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
dispatcher.listenTo(form, 'search', function(query) {
|
||||
results.showLoadingMessage();
|
||||
collection.performSearch(query);
|
||||
router.navigate(`search/${query}`, {replace: true});
|
||||
router.navigate('search/' + query, {replace: true});
|
||||
});
|
||||
|
||||
dispatcher.listenTo(form, 'clear', function() {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
dispatcher.listenTo(form, 'search', function(query) {
|
||||
results.showLoadingMessage();
|
||||
collection.performSearch(query);
|
||||
router.navigate(`search/${query}`, {replace: true});
|
||||
router.navigate('search/' + query, {replace: true});
|
||||
});
|
||||
|
||||
dispatcher.listenTo(form, 'clear', function() {
|
||||
|
||||
@@ -248,8 +248,8 @@ define([
|
||||
it('rendersItem', function() {
|
||||
expect(this.item.$el).toHaveAttr('role', 'region');
|
||||
expect(this.item.$el).toHaveAttr('aria-label', 'search result');
|
||||
expect(this.item.$el).toContainElement(`a[href="${this.model.get('url')}"]`);
|
||||
expect(this.item.$el.find('.result-type i')).toHaveClass(`fa-${this.item.unitIcon()}`);
|
||||
expect(this.item.$el).toContainElement('a[href="' + this.model.get('url') + '"]');
|
||||
expect(this.item.$el.find('.result-type i')).toHaveClass('fa-' + this.item.unitIcon());
|
||||
expect(this.item.$el.find('.result-excerpt')).toContainHtml(this.model.get('excerpt'));
|
||||
expect(this.item.$el.find('.result-link')).toContainHtml('section / subsection / unit');
|
||||
});
|
||||
@@ -257,8 +257,8 @@ define([
|
||||
it('rendersSequentialItem', function() {
|
||||
expect(this.seqItem.$el).toHaveAttr('role', 'region');
|
||||
expect(this.seqItem.$el).toHaveAttr('aria-label', 'search result');
|
||||
expect(this.seqItem.$el).toContainElement(`a[href="${this.seqModel.get('url')}"]`);
|
||||
expect(this.seqItem.$el.find('.result-type i')).toHaveClass(`fa-${this.seqItem.unitIcon()}`);
|
||||
expect(this.seqItem.$el).toContainElement('a[href="' + this.seqModel.get('url') + '"]');
|
||||
expect(this.seqItem.$el.find('.result-type i')).toHaveClass('fa-' + this.seqItem.unitIcon());
|
||||
expect(this.seqItem.$el.find('.result-excerpt')).toBeEmpty();
|
||||
expect(this.seqItem.$el.find('.result-link')).toContainHtml('section / subsection');
|
||||
});
|
||||
@@ -385,9 +385,9 @@ define([
|
||||
expect(this.resultsView.$el.find('ol')[0]).toExist();
|
||||
expect(this.resultsView.$el.find('li').length).toEqual(1);
|
||||
expect(this.resultsView.$el).toContainHtml(
|
||||
`${this.collection.totalCount
|
||||
} result found for "${
|
||||
this.collection.searchTerm}"`
|
||||
this.collection.totalCount
|
||||
+ ' result found for "'
|
||||
+ this.collection.searchTerm + '"'
|
||||
);
|
||||
expect(this.resultsView.$el).toContainHtml('this is a short excerpt');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user