-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Javalab: show appropriate options in comment options menu #41715
Conversation
…de-dot-org/code-dot-org into ben/javalab-explicit-peer-review-mode
@@ -45,7 +46,7 @@ export default class Comment extends Component { | |||
}; | |||
|
|||
renderFormattedTimestamp = timestampString => | |||
moment.utc(timestampString).format('M/D/YYYY [at] h:mm A'); | |||
moment(timestampString).format('M/D/YYYY [at] h:mm A'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated fix to show timestamps in local time instead of UTC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -136,6 +136,7 @@ Javalab.prototype.init = function(config) { | |||
channelId: config.channel, | |||
isProjectLevel: !!config.level.isProjectLevel, | |||
isEditingStartSources: this.isStartMode, | |||
isCodeReviewing: !!config.isCodeReviewing, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious how this gets set - will config.isCodeReviewing
be updated every time a user switches to another student's project via the review dropdown?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It gets passed in from the controller here and is set as a page constant (I believe such that it cannot be changed once the page is loaded):
view_options(is_code_reviewing: true) |
As far as I know, we'll be fully reloading the page for one student to view another student's work, so we'd be setting isCodeReviewing
to true on page load after a student selects another student from the dropdown.
@@ -8,7 +10,9 @@ import * as codeReviewDataApi from './codeReview/codeReviewDataApi'; | |||
|
|||
const FLASH_ERROR_TIME_MS = 5000; | |||
|
|||
export default class ReviewTab extends Component { | |||
class ReviewTab extends Component { | |||
static propTypes = {viewAsCodeReviewer: PropTypes.bool.isRequired}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add // populated by redux
?
The "comment options" menu is an ellipsis that appear on each comment to show the option to delete a comment (only for teachers) and to resolve/re-open a comment (only for project owner). This PR:
isPeerReviewing
that is passed from the back end when one student is viewing another student's code.Student reviewing another student's work
Student looking at their own project
Teacher looking at student work
Testing story
Tested manually with two students in the same section and a teacher. Also added unit tests.