Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kounoike
Copy link
Contributor

Sort usernames for useful order.

20180419-225236

Before submitting a pull-request to GitBucket I have first:

  • read the contribution guidelines
  • rebased my branch over master
  • verified that project is compiling
  • verified that tests are passing
  • squashed my commits as appropriate (keep several commits if it is relevant to understand the PR)
  • marked as closed using commit message all issue ID that this PR should correct

val issue = getIssue(owner, repo, num).get
a: Account =>
{
val typeStr = if (Some(a.userName) == context.loginAccount.map(_.userName)) {
Copy link
Member

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 {
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

2 participants