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

Issue due date #3794

Merged
merged 54 commits into from
May 1, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
406cd5a
Started adding deadline to ui
kolaente Mar 22, 2018
859cd47
Implemented basic issue due date managing
kolaente Mar 23, 2018
02415f7
Improved UI for due date managing
kolaente Mar 23, 2018
bfef995
Merge branch 'master' of https://github.com/go-gitea/gitea into issue…
kolaente Mar 25, 2018
74c9e07
Added at least write access to the repo in order to modify issue due …
kolaente Mar 25, 2018
aeb3db9
Ui improvements
kolaente Mar 25, 2018
211b2ed
Added issue comments creation when adding/modifying/removing a due date
kolaente Mar 25, 2018
82d7bf0
Show due date in issue list
kolaente Apr 14, 2018
13a12c3
merge with master
kolaente Apr 14, 2018
c1ada01
Added api support for issue due dates
kolaente Apr 14, 2018
6663012
Fixed lint suggestions
kolaente Apr 14, 2018
f4baf19
Added deadline to sdk
kolaente Apr 14, 2018
06d9649
Updated css
kolaente Apr 14, 2018
3bf2227
Added support for adding/modifiying deadlines for pull requests via api
kolaente Apr 14, 2018
60bbb23
Fixed comments not created when updating or removing a deadline
kolaente Apr 14, 2018
192f31e
update sdk (will do properly once go-gitea/go-sdk#103 is merged)
kolaente Apr 14, 2018
f766101
enhanced updateIssueDeadline
kolaente Apr 15, 2018
a1b79fe
Removed unnessecary Issue.DeadlineString
kolaente Apr 15, 2018
e659699
UI improvements
kolaente Apr 15, 2018
bdec65a
Small improvments to comment creation
kolaente Apr 16, 2018
38e1180
merge with gitea-master
kolaente Apr 16, 2018
51d3e4f
merge with gitea-master
kolaente Apr 16, 2018
5c93fe0
Check if an issue is overdue is now a seperate function
kolaente Apr 17, 2018
7292c30
Updated go-sdk with govendor as it was merged
kolaente Apr 17, 2018
6fb31d6
fmt
kolaente Apr 17, 2018
3ae5b7a
Merge branch 'master' of https://github.com/go-gitea/gitea into issue…
kolaente Apr 17, 2018
0b18607
Simplified isOverdue method
kolaente Apr 18, 2018
2efba88
removed unessecary deadline to 0 set
kolaente Apr 18, 2018
d8ba5ab
Merge with gitea-master
kolaente Apr 20, 2018
674d2ed
Merge branch 'master' of https://github.com/go-gitea/gitea into issue…
kolaente Apr 21, 2018
b8760ba
Update swagger definitions
kolaente Apr 21, 2018
c88a59d
Added missing return
kolaente Apr 22, 2018
7c0e537
Added an explanary comment
kolaente Apr 23, 2018
30a2c70
Improved updateIssueDeadline method so it'll only update `deadline_unix`
kolaente Apr 23, 2018
bf2d849
Merge branch 'master' of https://github.com/go-gitea/gitea into issue…
kolaente Apr 23, 2018
30dbda4
Small changes and improvements
kolaente Apr 27, 2018
b9f193a
Added check if a deadline was modified before updating it
kolaente Apr 27, 2018
3c8216f
Moved comment creating logic into its own function
kolaente Apr 27, 2018
fb7463f
Code cleanup for creating deadline comment
kolaente Apr 27, 2018
1c47d90
locale improvement
kolaente Apr 27, 2018
81c93d6
When modifying a deadline, the old deadline is saved with the comment
kolaente Apr 27, 2018
d02d09c
fmt
kolaente Apr 27, 2018
253d48f
Merge branch 'master' into issue-due-date
lunny Apr 29, 2018
c17c95b
Merge branch 'master' of https://github.com/go-gitea/gitea into issue…
kolaente Apr 29, 2018
d7f4798
small improvments to xorm session handling when updating an issue dea…
kolaente Apr 29, 2018
f35fec0
small improvments to xorm session handling when updating an issue dea…
kolaente Apr 29, 2018
1412580
style nitpicks
kolaente Apr 29, 2018
fe68965
Moved checking for if the user has write acces to middleware
kolaente Apr 29, 2018
65e841d
Merge branch 'master' of https://github.com/go-gitea/gitea into issue…
kolaente Apr 29, 2018
311dc73
Merge with gitea-master
kolaente May 1, 2018
8d3fff2
Merge with gitea-master
kolaente May 1, 2018
3f570d4
renamed remove deadline url
kolaente May 1, 2018
a7a9529
Deleting a deadline is now possible via get
kolaente May 1, 2018
d49dd2f
Reverted deleting a deadline back to using a post request
kolaente May 1, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Moved checking for if the user has write acces to middleware
  • Loading branch information
kolaente committed Apr 29, 2018
commit fe6896590189a318ce24e4d9df042be5506b11d3
14 changes: 0 additions & 14 deletions routers/repo/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -1480,13 +1480,6 @@ func UpdateDeadline(ctx *context.Context, form auth.DeadlineForm) {
return
}

// Check if the user has at least write access to the repo
if !ctx.Repo.IsWriter() {
ctx.Flash.Error(ctx.Tr("repo.issues.due_date_not_writer"))
ctx.Redirect(fmt.Sprintf("%s/issues/%d", ctx.Repo.RepoLink, issue.Index))
return
}

// Make unix of deadline string
deadline, err := time.ParseInLocation("2006-01-02", form.DateString, time.Local)
if err != nil {
Expand Down Expand Up @@ -1515,13 +1508,6 @@ func RemoveDeadline(ctx *context.Context) {
return
}

// Check if the user has at least write access to the repo
if !ctx.Repo.IsWriter() {
ctx.Flash.Error(ctx.Tr("repo.issues.due_date_not_writer"))
ctx.Redirect(fmt.Sprintf("%s/issues/%d", ctx.Repo.RepoLink, issue.Index))
return
}

if err := models.UpdateIssueDeadline(issue, 0, ctx.User); err != nil {
ctx.Flash.Error(ctx.Tr("repo.issues.error_removing_due_date"))
}
Expand Down
4 changes: 2 additions & 2 deletions routers/routes/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,8 @@ func RegisterRoutes(m *macaron.Macaron) {
})
})
m.Post("/reactions/:action", bindIgnErr(auth.ReactionForm{}), repo.ChangeIssueReaction)
m.Post("/deadline/update", bindIgnErr(auth.DeadlineForm{}), repo.UpdateDeadline)
m.Post("/deadline/remove", repo.RemoveDeadline)
m.Post("/deadline/update", reqRepoWriter, bindIgnErr(auth.DeadlineForm{}), repo.UpdateDeadline)
m.Post("/deadline/remove", reqRepoWriter, repo.RemoveDeadline)
Copy link
Member

Choose a reason for hiding this comment

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

For consistency, this endpoint should be called /delete.

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 that.

})

m.Post("/labels", reqRepoWriter, repo.UpdateIssueLabel)
Expand Down