fix: all auto fixable eslint issues (#31900)
* fix: eslint operator-linebreak issue * fix: eslint quotes issue * fix: react jsx indent and props issues * fix: eslint trailing spaces issues * fix: eslint line around directives issue * fix: eslint prefer template issue * fix: eslint semi rule * fix: eslint newline per chain rule * fix: eslint space infix ops rule * fix: eslint space-in-parens issue * fix: eslint space before function paren issue * fix: eslint space before blocks issue * fix: eslint arrow body style issue * fix: eslint dot-location issue * fix: eslint quotes issue * fix: eslint quote props issue * fix: eslint operator assignment issue * fix: eslint new line after import issue * fix: indent issues * fix: operator assignment issue
This commit is contained in:
committed by
GitHub
parent
118ea3a024
commit
228180b1ef
@@ -109,7 +109,7 @@
|
||||
|
||||
navigateToThread: function(threadId) {
|
||||
var thread = this.discussion.get(threadId);
|
||||
return this.navigate('' + (thread.get('commentable_id')) + '/threads/' + threadId, {
|
||||
return this.navigate(`${thread.get('commentable_id')}/threads/${threadId}`, {
|
||||
trigger: true
|
||||
});
|
||||
},
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
},
|
||||
|
||||
url: function() {
|
||||
var url = '/certificates/search?user=' + this.userFilter;
|
||||
var url = `/certificates/search?user=${this.userFilter}`;
|
||||
if (this.courseFilter) {
|
||||
url += '&course_id=' + this.courseFilter;
|
||||
url += `&course_id=${this.courseFilter}`;
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
@@ -63,11 +63,11 @@ define([
|
||||
|
||||
searchFor = function(user_filter, course_filter, requests, response) {
|
||||
// Enter the search term and submit
|
||||
var url = '/certificates/search?user=' + user_filter;
|
||||
var url = `/certificates/search?user=${user_filter}`;
|
||||
view.setUserFilter(user_filter);
|
||||
if (course_filter) {
|
||||
view.setCourseFilter(course_filter);
|
||||
url += '&course_id=' + course_filter;
|
||||
url += `&course_id=${course_filter}`;
|
||||
}
|
||||
view.triggerSearch();
|
||||
|
||||
@@ -77,12 +77,12 @@ define([
|
||||
},
|
||||
|
||||
regenerateCerts = function(username, courseKey) {
|
||||
var sel = '.btn-cert-regenerate[data-course-key="' + courseKey + '"]';
|
||||
var sel = `.btn-cert-regenerate[data-course-key="${courseKey}"]`;
|
||||
$(sel).click();
|
||||
},
|
||||
|
||||
generateCerts = function(username, courseKey) {
|
||||
var sel = '.btn-cert-generate[data-course-key="' + courseKey + '"]';
|
||||
var sel = `.btn-cert-generate[data-course-key="${courseKey}"]`;
|
||||
$(sel).click();
|
||||
};
|
||||
|
||||
|
||||
@@ -30,16 +30,16 @@ define([
|
||||
|
||||
it('can render itself', function() {
|
||||
expect($('.enrollment-modal h1').text()).toContain(
|
||||
'Change enrollment for ' + EnrollmentHelpers.TEST_COURSE
|
||||
`Change enrollment for ${EnrollmentHelpers.TEST_COURSE}`
|
||||
);
|
||||
expect($('.enrollment-change-field p').first().text()).toContain('Current enrollment mode: audit');
|
||||
|
||||
_.each(['verified', 'audit'], function(mode) {
|
||||
expect($('.enrollment-new-mode').html()).toContain('<option value="' + mode + '">');
|
||||
expect($('.enrollment-new-mode').html()).toContain(`<option value="${mode}">`);
|
||||
});
|
||||
|
||||
_.each(['', 'Financial Assistance', 'Stampeding Buffalo', 'Angry Customer'], function(reason) {
|
||||
expect($('.enrollment-reason').html()).toContain('<option value="' + reason + '">');
|
||||
expect($('.enrollment-reason').html()).toContain(`<option value="${reason}">`);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -55,11 +55,11 @@
|
||||
|
||||
search: function(event) {
|
||||
// Fetch the certificate collection for the given user
|
||||
var url = '/support/certificates?user=' + this.getUserFilter();
|
||||
var url = `/support/certificates?user=${this.getUserFilter()}`;
|
||||
|
||||
// course id is optional.
|
||||
if (this.getCourseFilter()) {
|
||||
url += '&course_id=' + this.getCourseFilter();
|
||||
url += `&course_id=${this.getCourseFilter()}`;
|
||||
}
|
||||
|
||||
// Prevent form submission, since we're handling it ourselves.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { formActions, entitlementActions } from '../constants/actionTypes';
|
||||
import { formTypes } from '../constants/formTypes';
|
||||
|
||||
const clearFormState = {
|
||||
formType: '',
|
||||
isOpen: false,
|
||||
|
||||
@@ -53,7 +53,7 @@ define([
|
||||
language: 'en',
|
||||
country: 'US',
|
||||
membership: membership,
|
||||
url: '/api/team/v0/teams/' + editTeamID
|
||||
url: `/api/team/v0/teams/${editTeamID}`
|
||||
};
|
||||
},
|
||||
createEditTeamMembersView = function(membership) {
|
||||
|
||||
@@ -58,9 +58,9 @@ define([
|
||||
|
||||
_.each(fieldsData, function(fieldData) {
|
||||
if (fieldData[2] === 'error') {
|
||||
expect(teamEditView.$(fieldData[0].split(' ')[0] + '.error').length).toBe(1);
|
||||
expect(teamEditView.$(`${fieldData[0].split(' ')[0]}.error`).length).toBe(1);
|
||||
} else if (fieldData[2] === 'success') {
|
||||
expect(teamEditView.$(fieldData[0].split(' ')[0] + '.error').length).toBe(0);
|
||||
expect(teamEditView.$(`${fieldData[0].split(' ')[0]}.error`).length).toBe(0);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -80,7 +80,7 @@ define([
|
||||
language: 'en',
|
||||
country: 'US',
|
||||
membership: [],
|
||||
url: '/api/team/v0/teams/' + editTeamID
|
||||
url: `/api/team/v0/teams/${editTeamID}`
|
||||
},
|
||||
{
|
||||
parse: true
|
||||
@@ -239,7 +239,7 @@ define([
|
||||
|
||||
it('can create a team', function() {
|
||||
assertTeamCreateUpdateInfo(
|
||||
this, createTeamData, teamsUrl, 'teams/' + TeamSpecHelpers.testTopicID + '/123'
|
||||
this, createTeamData, teamsUrl, `teams/${TeamSpecHelpers.testTopicID}/123`
|
||||
);
|
||||
});
|
||||
|
||||
@@ -260,7 +260,7 @@ define([
|
||||
});
|
||||
|
||||
it('changes route on cancel click', function() {
|
||||
assertRedirectsToCorrectUrlOnCancel('topics/' + TeamSpecHelpers.testTopicID);
|
||||
assertRedirectsToCorrectUrlOnCancel(`topics/${TeamSpecHelpers.testTopicID}`);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -279,8 +279,8 @@ define([
|
||||
copyTeamsData.language = 'fr';
|
||||
|
||||
assertTeamCreateUpdateInfo(
|
||||
this, copyTeamsData, teamsUrl + editTeamID + '?expand=user',
|
||||
'teams/' + TeamSpecHelpers.testTopicID + '/' + editTeamID
|
||||
this, copyTeamsData, `${teamsUrl + editTeamID}?expand=user`,
|
||||
`teams/${TeamSpecHelpers.testTopicID}/${editTeamID}`
|
||||
);
|
||||
});
|
||||
|
||||
@@ -293,15 +293,15 @@ define([
|
||||
});
|
||||
|
||||
it('shows an error message for HTTP 500', function() {
|
||||
assertShowMessageOnError(this, editTeamData, teamsUrl + editTeamID + '?expand=user', 500);
|
||||
assertShowMessageOnError(this, editTeamData, `${teamsUrl + editTeamID}?expand=user`, 500);
|
||||
});
|
||||
|
||||
it('shows correct error message when server returns an error', function() {
|
||||
assertShowMessageOnError(this, editTeamData, teamsUrl + editTeamID + '?expand=user', 400);
|
||||
assertShowMessageOnError(this, editTeamData, `${teamsUrl + editTeamID}?expand=user`, 400);
|
||||
});
|
||||
|
||||
it('changes route on cancel click', function() {
|
||||
assertRedirectsToCorrectUrlOnCancel('teams/' + TeamSpecHelpers.testTopicID + '/' + editTeamID);
|
||||
assertRedirectsToCorrectUrlOnCancel(`teams/${TeamSpecHelpers.testTopicID}/${editTeamID}`);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -30,7 +30,7 @@ define([
|
||||
},
|
||||
expectSuccessMessage = function(team) {
|
||||
expect(TeamUtils.showMessage).toHaveBeenCalledWith(
|
||||
'Team "' + team.get('name') + '" successfully deleted.',
|
||||
`Team "${team.get('name')}" successfully deleted.`,
|
||||
'success'
|
||||
);
|
||||
};
|
||||
@@ -56,7 +56,7 @@ define([
|
||||
AjaxHelpers.expectJsonRequest(requests, 'DELETE', view.team.url, null);
|
||||
AjaxHelpers.respondWithNoContent(requests);
|
||||
expect(Backbone.history.navigate).toHaveBeenCalledWith(
|
||||
'topics/' + view.team.get('topic_id'),
|
||||
`topics/${view.team.get('topic_id')}`,
|
||||
{trigger: true}
|
||||
);
|
||||
expect(view.teamEvents.trigger).toHaveBeenCalledWith(
|
||||
@@ -85,7 +85,7 @@ define([
|
||||
it('can trigger the edit membership view', function() {
|
||||
view.$('.action-edit-members').click();
|
||||
expect(Backbone.history.navigate).toHaveBeenCalledWith(
|
||||
'teams/' + view.team.get('topic_id') + '/' + view.team.id + '/edit-team/manage-members',
|
||||
`teams/${view.team.get('topic_id')}/${view.team.id}/edit-team/manage-members`,
|
||||
{trigger: true}
|
||||
);
|
||||
});
|
||||
|
||||
@@ -16,7 +16,7 @@ define([
|
||||
mockGetTopic = function(topicId) {
|
||||
return $.Deferred().resolve(TeamSpecHelpers.createMockTopic({
|
||||
id: topicId,
|
||||
name: 'teamset-name-' + topicId,
|
||||
name: `teamset-name-${topicId}`,
|
||||
}));
|
||||
};
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ function($, _, moment, TeamSpecHelpers, TeamCardView, Team, Topic) {
|
||||
});
|
||||
|
||||
it('navigates to the associated team page when its action button is clicked', function() {
|
||||
expect(view.$('.action').attr('href')).toEqual('#teams/' + teamsetID + '/' + teamID);
|
||||
expect(view.$('.action').attr('href')).toEqual(`#teams/${teamsetID}/${teamID}`);
|
||||
});
|
||||
|
||||
describe('Profile Image Thumbnails', function() {
|
||||
|
||||
@@ -13,7 +13,7 @@ define([
|
||||
ACCOUNTS_API_URL = '/api/user/v1/accounts/';
|
||||
|
||||
createTeamsUrl = function(teamId) {
|
||||
return TeamSpecHelpers.testContext.teamsUrl + teamId + '?expand=user';
|
||||
return `${TeamSpecHelpers.testContext.teamsUrl + teamId}?expand=user`;
|
||||
};
|
||||
|
||||
createTeamModelData = function(teamId, teamName, membership) {
|
||||
@@ -116,11 +116,11 @@ define([
|
||||
AjaxHelpers.expectRequest(
|
||||
requests,
|
||||
'GET',
|
||||
TeamSpecHelpers.testContext.teamMembershipsUrl + '?' + $.param({
|
||||
`${TeamSpecHelpers.testContext.teamMembershipsUrl}?${$.param({
|
||||
username: currentUsername,
|
||||
course_id: TeamSpecHelpers.testCourseID,
|
||||
teamset_id: 'topic-id'
|
||||
})
|
||||
})}`
|
||||
);
|
||||
|
||||
// current user is not a member of any team so we should see the Join Team button
|
||||
@@ -164,11 +164,11 @@ define([
|
||||
AjaxHelpers.expectRequest(
|
||||
requests,
|
||||
'GET',
|
||||
TeamSpecHelpers.testContext.teamMembershipsUrl + '?' + $.param({
|
||||
`${TeamSpecHelpers.testContext.teamMembershipsUrl}?${$.param({
|
||||
username: currentUsername,
|
||||
course_id: TeamSpecHelpers.testCourseID,
|
||||
teamset_id: 'topic-id'
|
||||
})
|
||||
})}`
|
||||
);
|
||||
|
||||
// current user is a member of another team so we should see the correct message
|
||||
@@ -213,11 +213,11 @@ define([
|
||||
AjaxHelpers.expectRequest(
|
||||
requests,
|
||||
'GET',
|
||||
TeamSpecHelpers.testContext.teamMembershipsUrl + '?' + $.param({
|
||||
`${TeamSpecHelpers.testContext.teamMembershipsUrl}?${$.param({
|
||||
username: currentUsername,
|
||||
course_id: TeamSpecHelpers.testCourseID,
|
||||
teamset_id: 'topic-id'
|
||||
})
|
||||
})}`
|
||||
);
|
||||
|
||||
// User is not a member of any teams
|
||||
@@ -246,11 +246,11 @@ define([
|
||||
AjaxHelpers.expectRequest(
|
||||
requests,
|
||||
'GET',
|
||||
TeamSpecHelpers.testContext.teamMembershipsUrl + '?' + $.param({
|
||||
`${TeamSpecHelpers.testContext.teamMembershipsUrl}?${$.param({
|
||||
username: currentUsername,
|
||||
course_id: TeamSpecHelpers.testCourseID,
|
||||
teamset_id: 'topic-id'
|
||||
})
|
||||
})}`
|
||||
);
|
||||
|
||||
// User is not a member of any teams
|
||||
@@ -277,11 +277,11 @@ define([
|
||||
AjaxHelpers.expectRequest(
|
||||
requests,
|
||||
'GET',
|
||||
TeamSpecHelpers.testContext.teamMembershipsUrl + '?' + $.param({
|
||||
`${TeamSpecHelpers.testContext.teamMembershipsUrl}?${$.param({
|
||||
username: currentUsername,
|
||||
course_id: TeamSpecHelpers.testCourseID,
|
||||
teamset_id: 'topic-id'
|
||||
})
|
||||
})}`
|
||||
);
|
||||
|
||||
// Mock the response so that current user is not a member of any team
|
||||
|
||||
@@ -105,7 +105,7 @@ define([
|
||||
|
||||
// expect a request to DELETE the team membership
|
||||
AjaxHelpers.expectJsonRequest(
|
||||
requests, 'DELETE', '/api/team/v0/team_membership/test-team,' + TeamSpecHelpers.testUser
|
||||
requests, 'DELETE', `/api/team/v0/team_membership/test-team,${TeamSpecHelpers.testUser}`
|
||||
);
|
||||
AjaxHelpers.respondWithNoContent(requests);
|
||||
|
||||
@@ -234,10 +234,10 @@ define([
|
||||
if (members === 1) {
|
||||
expectedMemberMsg = '1 Member';
|
||||
} else {
|
||||
expectedMemberMsg = members + ' Members';
|
||||
expectedMemberMsg = `${members} Members`;
|
||||
}
|
||||
} else {
|
||||
expectedMemberMsg = members + ' / 6 Members';
|
||||
expectedMemberMsg = `${members} / 6 Members`;
|
||||
}
|
||||
expect(view.$('.team-capacity').text()).toContain(expectedMemberMsg);
|
||||
expect(view.$('.team-member').length).toBe(members);
|
||||
@@ -280,7 +280,7 @@ define([
|
||||
// assert tooltip text.
|
||||
expect(view.$('.member-profile p').text()).toBe(TeamSpecHelpers.testUser);
|
||||
// assert user profile page url.
|
||||
expect(view.$('.member-profile').attr('href')).toBe('/u/' + TeamSpecHelpers.testUser);
|
||||
expect(view.$('.member-profile').attr('href')).toBe(`/u/${TeamSpecHelpers.testUser}`);
|
||||
|
||||
// Verify that the leave team link is present
|
||||
expect(view.$(leaveTeamLinkSelector).text()).toContain('Leave Team');
|
||||
|
||||
@@ -19,7 +19,7 @@ define([
|
||||
getTopic: function(topicId) {
|
||||
return $.Deferred().resolve(TeamSpecHelpers.createMockTopic({
|
||||
id: topicId,
|
||||
name: 'teamset-name-' + topicId,
|
||||
name: `teamset-name-${topicId}`,
|
||||
}));
|
||||
},
|
||||
});
|
||||
|
||||
@@ -96,7 +96,7 @@ define([
|
||||
|
||||
it('displays and focuses an error message when trying to navigate to a nonexistent team', function() {
|
||||
var teamsTabView = createTeamsTabView();
|
||||
teamsTabView.router.navigate('teams/' + TeamSpecHelpers.testTopicID + '/no_such_team', {trigger: true});
|
||||
teamsTabView.router.navigate(`teams/${TeamSpecHelpers.testTopicID}/no_such_team`, {trigger: true});
|
||||
AjaxHelpers.expectRequest(requests, 'GET', '/api/team/v0/teams/no_such_team?expand=user', null);
|
||||
AjaxHelpers.respondWithError(requests, 404);
|
||||
expectError(teamsTabView, 'The team "no_such_team" could not be found.');
|
||||
@@ -105,7 +105,7 @@ define([
|
||||
|
||||
it('displays and focuses an error message when it receives a 401 AJAX response', function() {
|
||||
var teamsTabView = createTeamsTabView().render();
|
||||
teamsTabView.router.navigate('topics/' + TeamSpecHelpers.testTopicID, {trigger: true});
|
||||
teamsTabView.router.navigate(`topics/${TeamSpecHelpers.testTopicID}`, {trigger: true});
|
||||
AjaxHelpers.respondWithError(requests, 401);
|
||||
expectError(teamsTabView, 'Your request could not be completed. Reload the page and try again.');
|
||||
expectFocus(teamsTabView.$('.warning'));
|
||||
@@ -113,7 +113,7 @@ define([
|
||||
|
||||
it('displays and focuses an error message when it receives a 500 AJAX response', function() {
|
||||
var teamsTabView = createTeamsTabView().render();
|
||||
teamsTabView.router.navigate('topics/' + TeamSpecHelpers.testTopicID, {trigger: true});
|
||||
teamsTabView.router.navigate(`topics/${TeamSpecHelpers.testTopicID}`, {trigger: true});
|
||||
AjaxHelpers.respondWithError(requests, 500);
|
||||
expectError(
|
||||
teamsTabView,
|
||||
@@ -139,7 +139,7 @@ define([
|
||||
describe('Analytics Events', function() {
|
||||
SpecHelpers.withData({
|
||||
'fires a page view event for the topic page': [
|
||||
'topics/' + TeamSpecHelpers.testTopicID,
|
||||
`topics/${TeamSpecHelpers.testTopicID}`,
|
||||
{
|
||||
page_name: 'single-topic',
|
||||
topic_id: TeamSpecHelpers.testTopicID,
|
||||
@@ -147,7 +147,7 @@ define([
|
||||
}
|
||||
],
|
||||
'fires a page view event for the team page': [
|
||||
'teams/' + TeamSpecHelpers.testTopicID + '/test_team_id',
|
||||
`teams/${TeamSpecHelpers.testTopicID}/test_team_id`,
|
||||
{
|
||||
page_name: 'single-team',
|
||||
topic_id: TeamSpecHelpers.testTopicID,
|
||||
@@ -155,7 +155,7 @@ define([
|
||||
}
|
||||
],
|
||||
'fires a page view event for the search team page': [
|
||||
'topics/' + TeamSpecHelpers.testTopicID + '/search',
|
||||
`topics/${TeamSpecHelpers.testTopicID}/search`,
|
||||
{
|
||||
page_name: 'search-teams',
|
||||
topic_id: TeamSpecHelpers.testTopicID,
|
||||
@@ -163,7 +163,7 @@ define([
|
||||
}
|
||||
],
|
||||
'fires a page view event for the new team page': [
|
||||
'topics/' + TeamSpecHelpers.testTopicID + '/create-team',
|
||||
`topics/${TeamSpecHelpers.testTopicID}/create-team`,
|
||||
{
|
||||
page_name: 'new-team',
|
||||
topic_id: TeamSpecHelpers.testTopicID,
|
||||
@@ -171,7 +171,7 @@ define([
|
||||
}
|
||||
],
|
||||
'fires a page view event for the edit team page': [
|
||||
'teams/' + TeamSpecHelpers.testTopicID + '/test_team_id/edit-team',
|
||||
`teams/${TeamSpecHelpers.testTopicID}/test_team_id/edit-team`,
|
||||
{
|
||||
page_name: 'edit-team',
|
||||
topic_id: TeamSpecHelpers.testTopicID,
|
||||
@@ -358,7 +358,7 @@ define([
|
||||
AjaxHelpers.respondWithJson(requests, { count: 0 });
|
||||
expect(teamsTabView.$('.page-title').text()).toBe('Team Search');
|
||||
expect(teamsTabView.$('.page-description').text()).toBe(
|
||||
'Showing results for "' + newString + '"'
|
||||
`Showing results for "${newString}"`
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ define([
|
||||
spyOn(Backbone.history, 'navigate');
|
||||
teamsView.$('a.create-team').click();
|
||||
expect(Backbone.history.navigate.calls.mostRecent().args[0]).toBe(
|
||||
'topics/' + TeamSpecHelpers.testTopicID + '/create-team'
|
||||
`topics/${TeamSpecHelpers.testTopicID}/create-team`
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ define([
|
||||
var currentCard = topicCards.eq(index);
|
||||
expect(currentCard.text()).toMatch(topic.name);
|
||||
expect(currentCard.text()).toMatch(topic.description);
|
||||
expect(currentCard.text()).toMatch(topic.team_count + ' Teams');
|
||||
expect(currentCard.text()).toMatch(`${topic.team_count} Teams`);
|
||||
});
|
||||
expect(footerEl.text()).toMatch('1\\s+out of\\s+\/\\s+2'); // eslint-disable-line no-useless-escape
|
||||
expect(footerEl).not.toHaveClass('hidden');
|
||||
|
||||
@@ -31,16 +31,16 @@ define([
|
||||
|
||||
var createMockTeamData = function(startIndex, stopIndex) {
|
||||
return _.map(_.range(startIndex, stopIndex + 1), function(i) {
|
||||
var id = 'id' + i;
|
||||
var id = `id${i}`;
|
||||
return {
|
||||
name: 'team ' + i,
|
||||
name: `team ${i}`,
|
||||
id: id,
|
||||
language: testLanguages[i % 4][0],
|
||||
country: testCountries[i % 4][0],
|
||||
membership: [],
|
||||
last_activity_at: '',
|
||||
topic_id: 'topic_id' + i,
|
||||
url: 'api/team/v0/teams/' + id
|
||||
topic_id: `topic_id${i}`,
|
||||
url: `api/team/v0/teams/${id}`
|
||||
};
|
||||
});
|
||||
};
|
||||
@@ -91,7 +91,7 @@ define([
|
||||
return {
|
||||
user: {
|
||||
username: testUser,
|
||||
url: 'https://openedx.example.com/api/user/v1/accounts/' + testUser,
|
||||
url: `https://openedx.example.com/api/user/v1/accounts/${testUser}`,
|
||||
profile_image: {
|
||||
image_url_small: 'test_profile_image'
|
||||
}
|
||||
@@ -127,7 +127,7 @@ define([
|
||||
var teamCards = view.$('.team-card');
|
||||
_.each(teams, function(team, index) {
|
||||
var currentCard = teamCards.eq(index);
|
||||
var teamsetString = 'teamset-name-' + team.topic_id;
|
||||
var teamsetString = `teamset-name-${team.topic_id}`;
|
||||
expect(currentCard.text()).toMatch(team.name);
|
||||
expect(currentCard.text()).toMatch(_.object(testLanguages)[team.language]);
|
||||
expect(currentCard.text()).toMatch(_.object(testCountries)[team.country]);
|
||||
@@ -266,9 +266,9 @@ define([
|
||||
createMockTopicData = function(startIndex, stopIndex) {
|
||||
return _.map(_.range(startIndex, stopIndex + 1), function(i) {
|
||||
return {
|
||||
description: 'Test description ' + i,
|
||||
name: 'Test Topic ' + i,
|
||||
id: 'test-topic-' + i,
|
||||
description: `Test description ${i}`,
|
||||
name: `Test Topic ${i}`,
|
||||
id: `test-topic-${i}`,
|
||||
team_count: 0
|
||||
};
|
||||
});
|
||||
@@ -301,12 +301,12 @@ define([
|
||||
courseMaxTeamSize: 6,
|
||||
languages: testLanguages,
|
||||
countries: testCountries,
|
||||
topicUrl: '/api/team/v0/topics/topic_id,' + testCourseID,
|
||||
topicUrl: `/api/team/v0/topics/topic_id,${testCourseID}`,
|
||||
teamsUrl: '/api/team/v0/teams/',
|
||||
teamsAssignmentsUrl: '/api/team/v0/teams/team_id/assignments',
|
||||
teamsDetailUrl: '/api/team/v0/teams/team_id',
|
||||
teamMembershipsUrl: '/api/team/v0/team_memberships/',
|
||||
teamMembershipDetailUrl: '/api/team/v0/team_membership/team_id,' + testUser,
|
||||
teamMembershipDetailUrl: `/api/team/v0/team_membership/team_id,${testUser}`,
|
||||
myTeamsUrl: '/api/team/v0/teams/',
|
||||
userInfo: createMockUserInfo()
|
||||
};
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
this.primaryButtonTitle = gettext('Create');
|
||||
} else if (this.action === 'edit') {
|
||||
this.teamModel = options.model;
|
||||
this.teamModel.url = this.context.teamsDetailUrl.replace('team_id', options.model.get('id'))
|
||||
+ '?expand=user';
|
||||
this.teamModel.url = `${this.context.teamsDetailUrl.replace('team_id', options.model.get('id'))
|
||||
}?expand=user`;
|
||||
this.primaryButtonTitle = gettext('Update');
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
team: result
|
||||
});
|
||||
Backbone.history.navigate(
|
||||
'teams/' + view.topic.id + '/' + view.teamModel.id,
|
||||
`teams/${view.topic.id}/${view.teamModel.id}`,
|
||||
{trigger: true}
|
||||
);
|
||||
})
|
||||
@@ -212,9 +212,9 @@
|
||||
var url;
|
||||
event.preventDefault();
|
||||
if (this.action === 'create') {
|
||||
url = 'topics/' + this.topic.id;
|
||||
url = `topics/${this.topic.id}`;
|
||||
} else if (this.action === 'edit') {
|
||||
url = 'teams/' + this.topic.id + '/' + this.teamModel.get('id');
|
||||
url = `teams/${this.topic.id}/${this.teamModel.get('id')}`;
|
||||
}
|
||||
Backbone.history.navigate(url, {trigger: true});
|
||||
}
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
// The URL ends with team_id,request_username. We want to replace
|
||||
// the last occurrence of team_id with the actual team_id, and remove request_username
|
||||
// as the actual user to be removed from the team will be added on before calling DELETE.
|
||||
this.teamMembershipDetailUrl = options.context.teamMembershipDetailUrl.substring(
|
||||
this.teamMembershipDetailUrl = `${options.context.teamMembershipDetailUrl.substring(
|
||||
0, this.options.context.teamMembershipDetailUrl.lastIndexOf('team_id')
|
||||
) + this.model.get('id') + ',';
|
||||
) + this.model.get('id')},`;
|
||||
|
||||
this.teamEvents = options.teamEvents;
|
||||
},
|
||||
@@ -38,7 +38,7 @@
|
||||
if (this.model.get('membership').length === 0) {
|
||||
this.$el.html( // xss-lint: disable=javascript-jquery-html
|
||||
// eslint-disable-next-line max-len
|
||||
'<p>' + gettext('This team does not have any members.') + '</p>'); // xss-lint: disable=javascript-concat-html
|
||||
`<p>${gettext('This team does not have any members.')}</p>`); // xss-lint: disable=javascript-concat-html
|
||||
} else {
|
||||
this.$el.html('<ul class="edit-members"></ul>'); // xss-lint: disable=javascript-jquery-html
|
||||
this.renderTeamMembers();
|
||||
@@ -76,7 +76,7 @@
|
||||
self.$('.edit-members').append(self.teamMemberTemplate({ // xss-lint: disable=javascript-jquery-append
|
||||
imageUrl: membership.user.profile_image.image_url_medium,
|
||||
username: membership.user.username,
|
||||
memberProfileUrl: '/u/' + membership.user.username,
|
||||
memberProfileUrl: `/u/${membership.user.username}`,
|
||||
dateJoined: dateJoined,
|
||||
lastActive: lastActivity
|
||||
}));
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
editMembership: function(event) {
|
||||
event.preventDefault();
|
||||
Backbone.history.navigate(
|
||||
'teams/' + this.team.get('topic_id') + '/' + this.team.id + '/edit-team/manage-members',
|
||||
`teams/${this.team.get('topic_id')}/${this.team.id}/edit-team/manage-members`,
|
||||
{trigger: true}
|
||||
);
|
||||
},
|
||||
@@ -53,7 +53,7 @@
|
||||
action: 'delete',
|
||||
team: self.team
|
||||
});
|
||||
Backbone.history.navigate('topics/' + self.team.get('topic_id'), {trigger: true});
|
||||
Backbone.history.navigate(`topics/${self.team.get('topic_id')}`, {trigger: true});
|
||||
TeamUtils.showMessage(
|
||||
StringUtils.interpolate(
|
||||
gettext('Team "{team}" successfully deleted.'),
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
);
|
||||
},
|
||||
actionUrl: function() {
|
||||
return '#teams/' + this.model.get('topic_id') + '/' + this.model.get('id');
|
||||
return `#teams/${this.model.get('topic_id')}/${this.model.get('id')}`;
|
||||
},
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
getTopic: function(topicId) {
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
HtmlUtils.template(teamMemberTemplate)({
|
||||
imageUrl: membership.user.profile_image.image_url_medium,
|
||||
username: membership.user.username,
|
||||
memberProfileUrl: '/u/' + membership.user.username
|
||||
memberProfileUrl: `/u/${membership.user.username}`
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
editTeam: function(event) {
|
||||
event.preventDefault();
|
||||
Backbone.history.navigate(
|
||||
'teams/' + this.topic.id + '/' + this.model.get('id') + '/edit-team',
|
||||
`teams/${this.topic.id}/${this.model.get('id')}/edit-team`,
|
||||
{trigger: true}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
return StringUtils.interpolate(
|
||||
// Translators: The following message displays the number of members on a team.
|
||||
ngettext(
|
||||
formatString + ' Member',
|
||||
formatString + ' Members',
|
||||
`${formatString} Member`,
|
||||
`${formatString} Members`,
|
||||
maxMemberCount || memberCount
|
||||
),
|
||||
parameters, true
|
||||
|
||||
@@ -230,7 +230,7 @@
|
||||
searchTeams: function(topicID) {
|
||||
var view = this;
|
||||
if (!this.teamsCollection) {
|
||||
this.router.navigate('topics/' + topicID, {trigger: true});
|
||||
this.router.navigate(`topics/${topicID}`, {trigger: true});
|
||||
} else {
|
||||
this.getTopic(topicID).done(function(topic) {
|
||||
view.mainView = view.createTeamsListView({
|
||||
@@ -408,7 +408,7 @@
|
||||
description: options.description,
|
||||
breadcrumbs: options.breadcrumbs
|
||||
}),
|
||||
searchUrl = 'topics/' + topic.get('id') + '/search';
|
||||
searchUrl = `topics/${topic.get('id')}/search`;
|
||||
// Listen to requests to sync the collection and redirect it as follows:
|
||||
// 1. If the collection includes a search, show the search results page
|
||||
// 2. If we're already on the search page, show the regular
|
||||
@@ -429,7 +429,7 @@
|
||||
// xss-lint: disable=javascript-jquery-html
|
||||
this.$el.find('.page-description').html(this.searchDescription());
|
||||
} else if (Backbone.history.getFragment() === searchUrl) {
|
||||
Backbone.history.navigate('topics/' + topic.get('id'), {trigger: true});
|
||||
Backbone.history.navigate(`topics/${topic.get('id')}`, {trigger: true});
|
||||
}
|
||||
}, this)
|
||||
);
|
||||
@@ -550,12 +550,12 @@
|
||||
if (topic) {
|
||||
breadcrumbs.push({
|
||||
title: topic.get('name'),
|
||||
url: '#topics/' + topic.id
|
||||
url: `#topics/${topic.id}`
|
||||
});
|
||||
if (team) {
|
||||
breadcrumbs.push({
|
||||
title: team.get('name'),
|
||||
url: '#teams/' + topic.id + '/' + team.id
|
||||
url: `#teams/${topic.id}/${team.id}`
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
},
|
||||
|
||||
actionUrl: function() {
|
||||
return '#topics/' + this.model.get('id');
|
||||
return `#topics/${this.model.get('id')}`;
|
||||
},
|
||||
|
||||
configuration: 'square_card',
|
||||
@@ -58,7 +58,7 @@
|
||||
{topic_name: this.model.get('name')}, true
|
||||
));
|
||||
// eslint-disable-next-line max-len
|
||||
return '<span class="sr">' + screenReaderText + '</span><span class="icon fa fa-arrow-right" aria-hidden="true"></span>'; // xss-lint: disable=javascript-concat-html
|
||||
return `<span class="sr">${screenReaderText}</span><span class="icon fa fa-arrow-right" aria-hidden="true"></span>`; // xss-lint: disable=javascript-concat-html
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
showCreateTeamForm: function(event) {
|
||||
event.preventDefault();
|
||||
Backbone.history.navigate(
|
||||
'topics/' + this.model.id + '/create-team',
|
||||
`topics/${this.model.id}/create-team`,
|
||||
{trigger: true}
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user