Skip to content

Commit 4400beb

Browse files
authored
sorted form responses (#973)
1 parent 48ab179 commit 4400beb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

app/components/form/responses-table-card.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</div>
2323
</div>
2424
<div class='table-responsive responses-table'>
25-
<Form::ResponsesTable @form={{@form}} @responses={{@form.responses}} @showAllergyInfo={{this.showAllergyInfo}} />
25+
<Form::ResponsesTable @form={{@form}} @responses={{@form.sortedResponses}} @showAllergyInfo={{this.showAllergyInfo}} />
2626
</div>
2727
</div>
2828
{{else}}

app/models/form/form.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ export default class Form extends Model {
3131
return this.questions.sortBy('position');
3232
}
3333

34+
get sortedResponses() {
35+
return this.responses.sortBy('user.id');
36+
}
37+
3438
get currentUserCanRespond() {
3539
return !this.currentUserResponseCompleted && this.canRespond;
3640
}

0 commit comments

Comments
 (0)