-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
sort username for issue comments #1964
base: master
Are you sure you want to change the base?
Conversation
val issue = getIssue(owner, repo, num).get | ||
a: Account => | ||
{ | ||
val typeStr = if (Some(a.userName) == context.loginAccount.map(_.userName)) { |
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.
context.loginAccount.contains(a.userName)
is much simpler.
@@ -194,18 +195,62 @@ trait IndexControllerBase extends ControllerBase { | |||
contentType = formats("json") | |||
val user = params("user").toBoolean | |||
val group = params("group").toBoolean | |||
|
|||
val issueRe = (context.baseUrl + """/(\w+)/(\w+)/(?:issues|pull)/(\d+)""").r | |||
val sortByFunc: Account => String = context.request.referrer match { |
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.
Getting repository and issue (or pull request) identifier from referrer is nice idea, but I think it's little tricky. It might be better to pass these information as optional query string parameters.
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.
As I know, this request is called from helper/attached.scala.html
through helper/preview.scala.html
. preview.scala.html
called from issue/pulls comment, wiki edit and release message edit. So it is complicated to add optional query string.
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.
Ah... Okay. It wasn't so easy. Anyway, I don't prefer kind of ad-hoc solution. I will try to find an another way. Sorry for keeping this pull request reviewing.
Sort usernames for useful order.
Before submitting a pull-request to GitBucket I have first: