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

Batch updates for issues #926

Merged
merged 3 commits into from
Mar 15, 2017
Merged

Conversation

ethantkoenig
Copy link
Member

@ethantkoenig ethantkoenig commented Feb 14, 2017

#868

Updates the

  • :reponame/issues/:index/label
  • :reponame/issues/:index/milestone
  • :reponame/issues/:index/assignee

endpoints to allow for multiple issues.

Also adds a front-end for opening/closing/assigning/labelling/milestoning multiple issues at once.

Screenshot

I am by no means a front-end expert, so any feedback is welcome 😄

@lunny lunny added this to the 1.2.0 milestone Feb 14, 2017
@lunny lunny added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Feb 14, 2017
@ethantkoenig ethantkoenig force-pushed the actions_on_issues branch 2 times, most recently from b5b37a4 to 89c354b Compare February 14, 2017 01:42
@bkcsoft
Copy link
Member

bkcsoft commented Feb 14, 2017

I don't like having Add Label and Remove Label split... Otherwise I have no comments on the design, L-G-T-M :)

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 14, 2017
Copy link
Member

@bkcsoft bkcsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't do this 😢

return
}
// UpdateIssues perform update on collection of issues
func UpdateIssues(ctx *context.Context) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh god please no 😱

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So do you want

  • separate functions for milestones/labels/assignees, each of which can handle both a single or multiple issues?
  • keep the pre-existing functions milestones/labels/assignees (which can only handle a single issue), and introduce 3 new milestones/labels/assignees for multiple issues?

Also, what is wrong with what I did? I don't mean to argue, I just want to learn.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preferably the first one. I'm not read up on the specific functions to give any advice, but I could have a look sometime during the week if you need pointers 🙂

The part that was wrong (in my opinion), was taking 3 small and clean functions, and turning them into one huge, hard to read switch-statement 🙂

@ethantkoenig ethantkoenig force-pushed the actions_on_issues branch 4 times, most recently from 08ab657 to a422be7 Compare February 15, 2017 20:34
@ethantkoenig
Copy link
Member Author

@bkcsoft I have addressed your concerns (combine Add Labels and Remove Labels menus, split UpdateIssues back into multiple functions)

Copy link
Contributor

@andreynering andreynering left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just two little sintax issues.

"_csrf": csrf,
"action": action,
"issue_ids": issueIds,
"id": elementId
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing indentation of data object

@@ -119,13 +125,15 @@ function initCommentForm() {
$(this).removeClass('checked');
$(this).find('.octicon').removeClass('octicon-check');
if (hasLabelUpdateAction) {
updateIssueMeta($labelMenu.data('update-url'), "detach", $(this).data('id'));
updateIssuesMeta($labelMenu.data('update-url'), "detach",
$labelMenu.data('issue-id'), $(this).data('id'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, or keep function call on a single line, or keep each param in a line, like this:

updateIssuesMeta(
  $labelMenu.data('update-url'),
  "detach",
  $labelMenu.data('issue-id'),
  $(this).data('id')
);

Same for similar cases below.

@andreynering
Copy link
Contributor

Useful feature. LGTM

Ref: gogs/gogs#2049

@tboerger tboerger added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 18, 2017
@ethantkoenig
Copy link
Member Author

ethantkoenig commented Mar 1, 2017

Rebasing to resolve conflicts.

@lunny
Copy link
Member

lunny commented Mar 10, 2017

conflicted.

@ethantkoenig
Copy link
Member Author

Rebased.

if len(commaSeparatedIssueIDs) == 0 {
return nil
}
stringIssueIDs := strings.Split(commaSeparatedIssueIDs, ",")
Copy link
Member

@lunny lunny Mar 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use x.In().Find()? It's better performance?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

log.Warn("Unrecognized action: %s", action)
}

for _, issue := range issues {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IssueList(issues).LoadRepositories()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@lunny
Copy link
Member

lunny commented Mar 11, 2017

otherwise LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 11, 2017
@ethantkoenig
Copy link
Member Author

@bkcsoft I've addressed your concerns from a few weeks ago; please re-review when you get the chance 😄

@lunny
Copy link
Member

lunny commented Mar 13, 2017

but seems you changed index.css file and not index.less ?

@ethantkoenig
Copy link
Member Author

Oh, didn't realize there was a .less file. Will update.

@ethantkoenig
Copy link
Member Author

@lunny Updated to use _repository.less.

@lunny
Copy link
Member

lunny commented Mar 14, 2017

build failed and need @bkcsoft confirmation.

@bkcsoft
Copy link
Member

bkcsoft commented Mar 15, 2017

LGTM

@bkcsoft bkcsoft merged commit 09fe4a2 into go-gitea:master Mar 15, 2017
@ethantkoenig ethantkoenig deleted the actions_on_issues branch March 15, 2017 01:10
ethantkoenig added a commit to ethantkoenig/gitea that referenced this pull request Apr 29, 2017
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants