Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a84b0d9

Browse files
author
vikasrohit
committedSep 22, 2015
SUP-1447, Peer review updates
Cherry picked changes for following commits into peer-review app 1) integrating with api Commit: da21a311e76083e8a2cc35b4135c9e16c3c1247d [da21a31] Parents: deac3d7b57 Author: Mauricio Desiderio <[email protected]> Date: 1 August 2015 1:36:12 am IST Labels: origin/vikas-scorecard-comment-support
1 parent e1ee927 commit a84b0d9

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed
 

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
p.required-message(ng-show="editForm.$submitted && optionForm.select.$error.required") Required
4343
.comment
4444
.label Comment
45-
textarea.text(ng-bind="q.comment")
45+
textarea.text(ng-model="q.comment")
4646

4747

4848
button(type="submit") Save and Mark Complete

‎app/services/helpers.service.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@
102102

103103
if (answerObject.comments && answerObject.comments.length > 0) {
104104
// pick first comment for peer review challenges
105-
questions[questionId].comment = answerObject.comments[0];
105+
questions[questionId].comment = answerObject.comments[0].content;
106+
questions[questionId].comments = answerObject.comments;
106107
}
107108
// TODO remove following line once api has the support
108109
questions[questionId].comment = 'mock comment';
@@ -126,8 +127,18 @@
126127
scorecardQuestionId: parseInt(qId),
127128
uploadId: review.uploadId,
128129
answer: '' + q.answer,
129-
comments: [q.comment]
130+
comments: q.comments
130131
};
132+
133+
if (reviewItem.comments && reviewItem.comments.length > 0) {
134+
reviewItem.comments[0].content = q.comment;
135+
} else {
136+
reviewItem.comments = [{
137+
content: '' + q.comment,
138+
resourceId: review.resourceId,
139+
commentTypeId: 1
140+
}];
141+
}
131142

132143
if (updating) {
133144
reviewItem.id = q.reviewItemId;

0 commit comments

Comments
 (0)
This repository has been archived.