Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit e1ee927

Browse files
author
vikasrohit
committed
SUP-1447, Peer review updates
Cherry picked changes for following commits into peer-review app 1) Added support for comment in review scorecard Commit: b98faebde93fa8a4d55ea26f594370966ed2b2f8 [b98faeb] Parents: 85a1d5da43 Author: vikasrohit <[email protected]> Date: 28 July 2015 6:23:02 pm IST 2) adapting for array of comments in api requests and responses Commit: deac3d7b57b8627f9fccb97af2034671ca8ddf87 [deac3d7] Parents: b98faebde9 Author: vikasrohit <[email protected]> Date: 29 July 2015 5:06:34 pm IST Labels: vikas-scorecard-comment-support
1 parent 1b58f12 commit e1ee927

File tree

5 files changed

+38
-5
lines changed

5 files changed

+38
-5
lines changed

app/peer-review/completed-review/completed-review.jade

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@
3131
p.guidelines(ng-if="q.questionTypeId === 5", ng-repeat="guideline in q.guidelines track by $index") {{guideline}}
3232

3333
p.answer(ng-if="q.questionTypeId === 5") Your Response: {{q.answer}}
34+
35+
p.comment(ng-if="q.comment") Comment: {{q.comment}}
36+

app/peer-review/edit-review/edit-review.jade

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
ng-class="{required: editForm.$submitted && optionForm.select.$error.required}")
4141

4242
p.required-message(ng-show="editForm.$submitted && optionForm.select.$error.required") Required
43+
.comment
44+
.label Comment
45+
textarea.text(ng-bind="q.comment")
46+
4347

4448
button(type="submit") Save and Mark Complete
4549

app/services/helpers.service.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@
100100
questions[questionId].answer = answerObject.answer;
101101
questions[questionId].reviewItemId = answerObject.id;
102102

103+
if (answerObject.comments && answerObject.comments.length > 0) {
104+
// pick first comment for peer review challenges
105+
questions[questionId].comment = answerObject.comments[0];
106+
}
107+
// TODO remove following line once api has the support
108+
questions[questionId].comment = 'mock comment';
109+
103110
if (answerObject.answer !== '') {
104111
saved = true;
105112
}
@@ -118,7 +125,8 @@
118125
reviewId: review.id,
119126
scorecardQuestionId: parseInt(qId),
120127
uploadId: review.uploadId,
121-
answer: '' + q.answer
128+
answer: '' + q.answer,
129+
comments: [q.comment]
122130
};
123131

124132
if (updating) {

assets/css/peer-review/completed.scss

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
@import '../partials/combined';
22

33
.completed-review-container {
4-
form .scorecard .answer {
5-
@include source-sans-italic;
6-
margin: 25px 0;
7-
padding-left: 30px;
4+
5+
form .scorecard {
6+
.answer {
7+
@include source-sans-italic;
8+
margin: 25px 0;
9+
padding-left: 30px;
10+
}
11+
.comment {
12+
margin: 25px 0;
13+
padding-left: 30px;
14+
}
815
}
916
}

assets/css/peer-review/edit.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@
1818

1919
.required-message {
2020
color: red;
21+
}
22+
}
23+
24+
.scorecard .comment {
25+
margin-top: 15px;
26+
margin-bottom: 20px;
27+
.label {
28+
margin: 10px 30px;
29+
}
30+
.text {
31+
width: 60%;
2132
margin-left: 30px;
2233
}
2334
}

0 commit comments

Comments
 (0)