-
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
Add issue completion #2513
Add issue completion #2513
Conversation
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.
Really excited about this! 😄
@@ -31,6 +31,9 @@ trait IssuesService { | |||
Issues filter (_.byPrimaryKey(owner, repository, issueId.toInt)) firstOption | |||
else None | |||
|
|||
def getAllIssues(owner: String, repository: String)(implicit s: Session): List[Issue] = | |||
Issues filter (_.byRepository(owner, repository)) sortBy (_.issueId desc) list |
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.
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.
@SIkebe Thx for your review! Showing all Issues and PR is because of GitHub. They actually show everything. And I thought it make sense because jquery completion show only 10 issues and PR at once and ordered by issue id so from new to old. In many case new id is still open. And by contrary it could be inconvenient if closed issue can not be show up. What do you think?
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.
Or maybe we can change color by status (open or close)...
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.
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.
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.
I also agree with showing only open issues/PR as completion proposals.
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.
@SIkebe @takezoe
Ok! So I will fix PR to show only Opened issues/PRs.
About this method ( getAllIssues
), I think it might be better preserved because it's more general than getting only opened isssues/PRs.
And filter at IssueController like fllowing code.
What do you think?
getAllIssues(repository.owner, repository.name)
.filterNot(_.closed)
.map { t =>
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.
In terms of performance, it would be better to narrow down at the SQL layer. You can implement getAllIssues
any time you really need it.
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.
Yeah. It would be slow to get all... ok! So I will fix sql layer! I mean this method!
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.
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.
This looks good to me!
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.
Cool!
Before submitting a pull-request to GitBucket I have first:
This PR add issue completion to resolve #568 .
And it includes s change in base trait
SuggestionProvider
.RepositoryInfo
toadditionalScript
method to generate dynamic url path.Screen gif