-
Notifications
You must be signed in to change notification settings - Fork 8
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
Custom diffs #138
base: master
Are you sure you want to change the base?
Custom diffs #138
Conversation
submissionId: payload.submissionId, | ||
filename | ||
}, | ||
result: result.find((diff) => diff.toFile == filename) |
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.
Diff now is fetched only once, since diff endpoint returns a diff for the whole submission.
} else if (isType(action, capabilitiesFetch.done)) { | ||
let diffModePreference: DiffModePreference | ||
|
||
if (!action.payload.result.permissions.tags && |
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.
User cannot see tags => user cannot know which sub has "checked" tag.
{" "} | ||
<Radio | ||
name="repo-type" | ||
value="mercurial" |
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.
Poshutili i hvatit =)
@@ -38,6 +38,13 @@ fun ProjectOwnerOrTeacherForFilter(vertx: Vertx, path: String = "project_id"): B | |||
fun SubmissionOwnerOrTeacher(vertx: Vertx, path: String = "submission_id"): BridgeEventFilter = | |||
ShouldBeSubmissionOwner(vertx, path) or AuthorityRequired(Authority.Teacher) | |||
|
|||
fun DiffFilter(vertx: Vertx): BridgeEventFilter { | |||
val shouldBeTeacher = AuthorityRequired(Authority.Teacher) | |||
val ownerWithCondition = ShouldBeSubmissionOwner(vertx) and ShouldNotRequestLastChecked(vertx) |
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.
Again, cannot see tags => cannot request a diff in "last checked" mode.
return ListResponse( | ||
root = buildCodeTree( | ||
innerResp.files, | ||
diff.contents.flatMap { listOf(it.fromFile, it.toFile) } |
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.
We do not return diff from here anymore, handleSubmissionCodeDiff
is now used everywhere.
kotoed-server/src/main/kotlin/org/jetbrains/research/kotoed/data/api/Data.kt
Outdated
Show resolved
Hide resolved
kotoed-server/src/main/kotlin/org/jetbrains/research/kotoed/api/SubmissionCodeVerticle.kt
Outdated
Show resolved
Hide resolved
name="diff-mode" | ||
value="PREVIOUS_CLOSED" | ||
checked={this.props.denizen.diffModePreference == "PREVIOUS_CLOSED" || | ||
!this.props.permissions.tags && this.props.denizen.diffModePreference == "PREVIOUS_CHECKED" } |
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.
Looks like this is incorrect state but maybe it's ok to handle it in a such way
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.
Trying to handle a situation which probably will never happen. If user was a teacher and chosen PREVIOUS_CHECKED
and then his teacher permission is revoked, the preference might not be changed. Here we are trying to handle it.
Trying to enhance code diff by allowing to select a base submission to compare from some reasonable choices.