Skip to content

Commit 5d9a4e2

Browse files
committed
decorator fixes for ember-update
1 parent 7ae5a64 commit 5d9a4e2

File tree

29 files changed

+809
-1795
lines changed

29 files changed

+809
-1795
lines changed

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.9.1
1+
10

app/pods/components/all-courses/component.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ export default class AllCoursesComponent extends Component {
5252
* Fetch courses on the 'All Courses' page
5353
*/
5454

55-
@restartableTask
56-
*fetchAllCourses () {
55+
@restartableTask fetchAllCourses = function* () {
5756
const organization = this.get('currentUser.organization') || this.org
5857
const extraWhere = {}
5958

app/pods/components/carousel-cards/component.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ export default class CarouselCards extends Component {
5555
this.get('getCarouselCardsTask').perform()
5656
}
5757

58-
@restartableTask
59-
*getCarouselCardsTask () {
58+
@restartableTask getCarouselCardsTask = function *() {
6059
const cards = yield this.get('store').query('carousel_card', {
6160
sort: 'order'
6261
})

app/pods/components/cart-dialog/component.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ export default class CartDialog extends Component {
88

99
dukaanUrl = env.dukaanUrl
1010

11-
@restartableTask
12-
*addCartTask() {
11+
@restartableTask addCartTask = function * () {
1312
yield this.get('api').request('/runs/clear_cart');
1413
const runId = this.get('run.id');
1514
yield this.get('api').request(`/runs/${runId}/buy`);

app/pods/components/code-editor/component.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ export default class EditorClass extends Component {
133133
this.sendAction('toggleModal', modalContentType);
134134
}
135135

136-
@restartableTask
137-
*setCollabModeTask (value) {
136+
@restartableTask setCollabModeTask = function *(value) {
138137
if (value) {
139138
yield this.firepad.connect()
140139
} else {

app/pods/components/course-search-box/component.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ export default class SearchBoxComponent extends Component {
1616

1717
@alias('searchTask.lastSuccessful.value') results
1818

19-
@restartableTask
20-
*searchTask () {
19+
@restartableTask searchTask = function* () {
2120
yield timeout (100)
2221
const searchQuery = this.get('qs').trim().toLowerCase()
2322

app/pods/components/csv-submission-success/component.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ export default class extends Component{
1212
this.pollingTask.perform()
1313
}
1414

15-
@restartableTask
16-
*pollingTask() {
15+
@restartableTask pollingTask = function *() {
1716
while (this.maxTries--) {
1817
yield timeout(this.gap)
1918
const result = yield this.submission.reload()

app/pods/components/discourse-topics-view/component.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ export default class DiscourseTopicsView extends Component {
2323
return `${env.discussBaseUrl}/c/${categoryId}/${subCategoryId}`
2424
}
2525

26-
@restartableTask
27-
*fetchTopicTasks () {
26+
@restartableTask fetchTopicTasks = function* () {
2827
const courseId = this.get('course.id')
2928
return yield this.get('api').request(`/courses/${courseId}/doubts`, {
3029
data: {

app/pods/components/doubt-feedback/component.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import { inject as service } from '@ember/service';
55
export default class DoubtFeedbackComponent extends Component {
66
@service store
77

8-
@restartableTask
9-
*submitFeedback() {
8+
@restartableTask submitFeedback = function *() {
109
let df = this.store.createRecord('doubt-feedback', {
1110
type: 'STUDENT',
1211
score: this.score,

app/pods/components/doubt-view-attempt/component.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ export default class DoubtViewAttemptComponent extends Component{
2929
return false
3030
}
3131

32-
@restartableTask
33-
*commentTask () {
32+
@restartableTask commentTask = function* () {
3433
if (this.get('commentBody.length') < 20) {
3534
return this.set('err', 'Comment length must be atleast 20 characters.')
3635
}

app/pods/components/doubt-view/component.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ export default class DoubtViewComponent extends Component {
2626
return env.discussBaseUrl + '/t/' + this.get('topicResponse.id')
2727
}
2828

29-
@restartableTask
30-
*fetchTopicTask () {
29+
@restartableTask fetchTopicTask = function* () {
3130
const topicResponse = yield this.get('api').request(`/courses/doubts/${this.get('topicId')}`)
3231
this.set('topic', topicResponse.post_stream.posts[0])
3332
this.set('topicResponse', topicResponse)

app/pods/components/doubts-view/component.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,16 @@ export default class DoubtsViewComponent extends Component {
2525
@filterBy('existingDoubts', 'status', 'RESOLVED')
2626
resolved
2727

28-
@filter('existingDoubts')
29-
unresolved (doubt) {
30-
return doubt.status != 'RESOLVED'
31-
}
28+
@filter('existingDoubts', doubt => doubt.status != 'RESOLVED')
29+
unresolved
3230

3331
@computed('existingDoubts', 'currentContent')
3432
get duplicatePendingDoubt () {
3533
const contentId = this.currentContent.getContentId()
3634
return this.existingDoubts.find(d => d.get('content.id') == contentId && d.status == 'PENDING')
3735
}
3836

39-
@restartableTask
40-
*askDoubtTask (){
37+
@restartableTask askDoubtTask = function* () {
4138
if (this.get('title.length') < 15) {
4239
return this.set('err', 'Title length must be atleast 15 characters.')
4340
}

app/pods/components/dukaan-dropdown/component.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ export default class DukaanDropdown extends Component {
2929

3030
@equal('activeTab', 'cart') showDialog
3131

32-
@restartableTask
33-
*fetchCart (){
32+
@restartableTask fetchCart = function* () {
3433
try {
3534
const cart = yield this.get('api').request('/runs/cart')
3635
const item = cart.cartItems[0]
@@ -43,8 +42,7 @@ export default class DukaanDropdown extends Component {
4342
}
4443
}
4544

46-
@restartableTask
47-
*clearCartTask() {
45+
@restartableTask clearCartTask = function *() {
4846
yield this.get('api').request('/runs/clear_cart')
4947
this.set('cartItem', false)
5048
}

app/pods/components/feedback-component/component.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ export default class FeedbackComponent extends Component {
2222
}
2323
}
2424

25-
@restartableTask
26-
*saveFeedbackTask () {
25+
@restartableTask saveFeedbackTask = function* () {
2726
const feedback = this.get('feedback')
2827
feedback.set("course", this.get('course'))
2928
feedback.set("user", this.get('currentUser.user'))

app/pods/components/my-courses/component.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ export default class MyCoursesTaskComponent extends Component {
4545
* Fetch courses on the 'My Courses' page
4646
*/
4747

48-
@restartableTask
49-
*fetchMyCoursesTask () {
48+
@restartableTask fetchMyCoursesTask = function* () {
5049
const results = yield this.get("store").query("run", {
5150
include: "course,run_attempts",
5251
enrolled: true,

app/pods/components/note-view/component.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@ export default class NoteViewComponent extends Component {
1111
isEditing = false
1212
deleted = false
1313

14-
@dropTask
15-
*saveNoteTask () {
14+
@dropTask saveNoteTask = function *() {
1615
yield this.get('note').save()
1716
this.set("isEditing", false)
1817
}
1918

20-
@dropTask
21-
*deleteNote () {
19+
@dropTask deleteNote = function *() {
2220
yield this.get('api').request('/notes/'+ this.get('note.id'), {
2321
method: 'DELETE',
2422
})

app/pods/components/notes-view/component.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ export default class NotesViewComponent extends Component {
1515

1616
requestErrored = false
1717

18-
@restartableTask
19-
*addNoteTask () {
18+
@restartableTask addNoteTask = function* () {
2019
const contentId = this.get('currentContent').getContentId()
2120
const store = this.get('store')
2221

app/pods/components/notification-dropdown/component.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ export default class NotificationDropdownComponent extends Component {
3939
})
4040
}
4141

42-
@restartableTask
43-
*loadNotifications () {
42+
@restartableTask loadNotifications = function *() {
4443
const notifications = yield this.get ('store').query ('notification', {
4544
page: {
4645
offset: this.get ('offset'),

app/pods/components/otp-enroll/component.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ export default class otpEnrollComponent extends Component {
1919
email = null
2020
errorString = null
2121

22-
@restartableTask
23-
*sendOtpTask() {
22+
@restartableTask sendOtpTask = function *() {
2423
return this.get('api').request('otp/request', {
2524
method: 'POST',
2625
data: {
@@ -43,8 +42,7 @@ export default class otpEnrollComponent extends Component {
4342
})
4443
}
4544

46-
@restartableTask
47-
*verifyOtpTask() {
45+
@restartableTask verifyOtpTask = function *() {
4846
return this.get('api').request('otp/verify', {
4947
method: "POST",
5048
data: {

app/pods/components/percent-complete/component.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ export default class PercentComplete extends Component {
77
percent = 0
88
classNames = ['w-100', 'd-flex', 'align-items-center', 'justify-content-between']
99

10-
@restartableTask
11-
*fetchPercentTask () {
10+
@restartableTask fetchPercentTask = function* () {
1211
const response = yield this.get('api').request(`run_attempts/${this.get('runAttemptId')}/progress`)
1312
this.set('percent', response.percent)
1413
}

app/pods/components/player-code-challenge/component.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ export default class CodeChallengeComponent extends Component {
113113
this.set('err', '')
114114
}
115115

116-
@restartableTask
117-
*runCodeTask (config) {
116+
@restartableTask runCodeTask = function *(config) {
118117
this.set('api.headers.hackJwt', this.get('currentUser.user.hackJwt'))
119118
return yield this.get("api").request("code_challenges/submit", {
120119
method: "POST",
@@ -126,8 +125,7 @@ export default class CodeChallengeComponent extends Component {
126125
});
127126
}
128127

129-
@restartableTask
130-
*submitCodeTask (config) {
128+
@restartableTask submitCodeTask = function *(config) {
131129
this.set('api.headers.hackJwt', this.get('currentUser.user.hackJwt'))
132130
const code = this.get("code");
133131
const run = this.get("run");
@@ -191,8 +189,7 @@ export default class CodeChallengeComponent extends Component {
191189

192190
}
193191

194-
@restartableTask
195-
*fetchEditorialTestcases (which) {
192+
@restartableTask fetchEditorialTestcases = function *(which) {
196193
try{
197194
this.set('api.headers.hackJwt', this.get('currentUser.user.hackJwt'))
198195
const run = this.get("run")

app/pods/components/player-csv/component.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ export default class PlayerCsvComponent extends Component {
2828
this.set('url', link)
2929
}
3030

31-
@restartableTask
32-
*submissionTask () {
31+
@restartableTask submissionTask = function* () {
3332
if (!this.get('url')) {
3433
return alert('You must upload your solution first')
3534
}

app/pods/components/recommended-courses/component.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ export default class RecommendedTaskComponent extends Component {
2020
this.get('fetchRecommendedCoursesTask').perform()
2121
}
2222

23-
@restartableTask
24-
*fetchRecommendedCoursesTask () {
23+
@restartableTask fetchRecommendedCoursesTask = function* () {
2524
const filter = {
2625
recommended: true,
2726
unlisted: false

app/pods/components/search-box/component.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ export default class SearchBoxComponent extends Component {
1919
@alias('searchTask.lastSuccessful.value') results
2020
@alias('currentUser.organization') organization
2121

22-
@restartableTask
23-
*searchTask () {
22+
@restartableTask searchTask = function* () {
2423
yield timeout (1000)
2524
const searchQuery = this.get('qs')
2625
const extraWhere = {}

lib/hiring-blocks/addon/pods/components/job-cards-view/component.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ export default class JobCardsViewComponent extends Component {
1717
this.fetchJobsTask.perform(true)
1818
}
1919

20-
@restartableTask
21-
*fetchJobsTask (truncate = false) {
20+
@restartableTask fetchJobsTask = function *(truncate = false) {
2221
const filter = {
2322
deadline: {
2423
$gt: new Date()

lib/hiring-blocks/addon/pods/components/recommended-jobs/component.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ export default class RecommendedJobsComponent extends Component {
88

99
@service store
1010

11-
@restartableTask
12-
*fetchJobs () {
11+
@restartableTask fetchJobs = function* () {
1312
return this.store.query('job', {
1413
page: {
1514
limit: 2

lib/hiring-blocks/addon/pods/listing/job/controller.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ export default class ListingJobController extends Controller {
1818
return this.get('job.myApplication')
1919
}
2020

21-
@dropTask
22-
*applyForJob (extra) {
21+
@dropTask applyForJob = function *(extra) {
2322
yield this.store.createRecord('application', {
2423
job: this.job,
2524
resumeLink: this.resumeLink,

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"ember-concurrency": "^0.10.0",
4747
"ember-concurrency-decorators": "^1.0.0-beta.2",
4848
"ember-data": "~3.10.0",
49+
"ember-decorators": "^6.0.0",
4950
"ember-engines": "^0.5.26",
5051
"ember-export-application-global": "^2.0.0",
5152
"ember-form-for": "^2.0.1",

0 commit comments

Comments
 (0)