Compare commits

..

6 Commits

Author SHA1 Message Date
Giteabot
a254c26df9
Fix issue due date edit toggle bug (#23723) (#23758)
Backport #23723 by @wxiaoguang

Use `toggleElem` instead of jQuery's `fadeToggle`, which can't be caught
by eslint jquery plugin.

Hopefully this could be the last bug for the jQuery show/hide
refactoring.

Need to backport.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-03-27 21:13:11 -05:00
Giteabot
1fed0e1adc
Fix profile page email display, respect settings (#23747) (#23756)
Backport #23747 by @wxiaoguang

Always respect the `setting.UI.ShowUserEmail` and `KeepEmailPrivate`
setting.

* It doesn't make sense to show user's own E-mail to themself.
* Always hide the E-mail if KeepEmailPrivate=true, then the user could
know how their profile page looks like for others.
* Revert the `setting.UI.ShowUserEmail` change from #4981 . This setting
is used to control the E-mail display, not only for the user list page.

ps: the incorrect `<div .../>` tag on the profile page has been fixed by
#23748 together, so this PR becomes simpler.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-03-28 07:55:20 +08:00
zeripath
88a652fa92
Improve commit graph page UI alignment (#23751) (#23754)
Backport #23751

Fix the UI alignment by the way (adding some `gt-mr-xx`)

Before:


![image](https://user-images.githubusercontent.com/2114189/228034794-7a6ac8d6-01fa-4dd2-97d4-0df0368f8ee0.png)

After:


![image](https://user-images.githubusercontent.com/2114189/228034938-64edeadf-7c99-4e74-b658-0ca62b72d596.png)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-03-27 17:27:08 -04:00
Giteabot
35039b8563
Use GitHub Actions compatible globbing for branches, tag, path filter (#22804) (#23740)
Backport #22804 by @ChristopherHX

Replaces the current globbing library with a
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
compatible one.

This adds support for
- `paths-ignore`, `tags-ignore` and `branches-ignore` filters.
- negative patterns in `paths`, `tags` and `branches` filters
- using both `tags` and `paths` filter on the push event

Original PR https://gitea.com/gitea/act/pulls/13.
nektos/act PR https://github.com/nektos/act/pull/1618 for the
workflowpattern package (It can take some months for it to appear in
https://gitea.com/gitea/act)

Related to https://github.com/go-gitea/gitea/issues/13539

Co-authored-by: ChristopherHX <christopher.homberger@web.de>
2023-03-27 14:01:46 -04:00
Giteabot
62afc0a727
Redirect to project again after editing it (#23326) (#23739)
Backport #23326 by @yp05327

A part of https://github.com/go-gitea/gitea/pull/22865

We have edit buttons in projects list page and project view page.
But after user edit a project, it will always redirect to the projects
list page.

Co-authored-by: yp05327 <576951401@qq.com>
2023-03-27 21:42:47 +08:00
Zettat123
b6a2323981
Check LFS/Packages settings in dump and doctor command (#23631) (#23730)
Backport #23631 
Close #23622

As described in the issue, disabling the LFS/Package settings will cause
errors when running `gitea dump` or `gitea doctor`. We need to check the
settings and the related operations should be skipped if the settings
are disabled.
2023-03-27 16:28:22 +08:00
13 changed files with 178 additions and 70 deletions

View File

@ -250,6 +250,8 @@ func runDump(ctx *cli.Context) error {
if ctx.IsSet("skip-lfs-data") && ctx.Bool("skip-lfs-data") { if ctx.IsSet("skip-lfs-data") && ctx.Bool("skip-lfs-data") {
log.Info("Skip dumping LFS data") log.Info("Skip dumping LFS data")
} else if !setting.LFS.StartServer {
log.Info("LFS isn't enabled. Skip dumping LFS data")
} else if err := storage.LFS.IterateObjects(func(objPath string, object storage.Object) error { } else if err := storage.LFS.IterateObjects(func(objPath string, object storage.Object) error {
info, err := object.Stat() info, err := object.Stat()
if err != nil { if err != nil {
@ -364,6 +366,8 @@ func runDump(ctx *cli.Context) error {
if ctx.IsSet("skip-package-data") && ctx.Bool("skip-package-data") { if ctx.IsSet("skip-package-data") && ctx.Bool("skip-package-data") {
log.Info("Skip dumping package data") log.Info("Skip dumping package data")
} else if !setting.Packages.Enabled {
log.Info("Packages isn't enabled. Skip dumping package data")
} else if err := storage.Packages.IterateObjects(func(objPath string, object storage.Object) error { } else if err := storage.Packages.IterateObjects(func(objPath string, object storage.Object) error {
info, err := object.Stat() info, err := object.Stat()
if err != nil { if err != nil {

View File

@ -16,6 +16,7 @@ import (
"github.com/gobwas/glob" "github.com/gobwas/glob"
"github.com/nektos/act/pkg/jobparser" "github.com/nektos/act/pkg/jobparser"
"github.com/nektos/act/pkg/model" "github.com/nektos/act/pkg/model"
"github.com/nektos/act/pkg/workflowpattern"
) )
func ListWorkflows(commit *git.Commit) (git.Entries, error) { func ListWorkflows(commit *git.Commit) (git.Entries, error) {
@ -136,40 +137,94 @@ func matchPushEvent(commit *git.Commit, pushPayload *api.PushPayload, evt *jobpa
} }
matchTimes := 0 matchTimes := 0
hasBranchFilter := false
hasTagFilter := false
refName := git.RefName(pushPayload.Ref)
// all acts conditions should be satisfied // all acts conditions should be satisfied
for cond, vals := range evt.Acts { for cond, vals := range evt.Acts {
switch cond { switch cond {
case "branches", "tags": case "branches":
refShortName := git.RefName(pushPayload.Ref).ShortName() hasBranchFilter = true
for _, val := range vals { if !refName.IsBranch() {
if glob.MustCompile(val, '/').Match(refShortName) { break
matchTimes++ }
break patterns, err := workflowpattern.CompilePatterns(vals...)
} if err != nil {
break
}
if !workflowpattern.Skip(patterns, []string{refName.ShortName()}, &workflowpattern.EmptyTraceWriter{}) {
matchTimes++
}
case "branches-ignore":
hasBranchFilter = true
if !refName.IsBranch() {
break
}
patterns, err := workflowpattern.CompilePatterns(vals...)
if err != nil {
break
}
if !workflowpattern.Filter(patterns, []string{refName.ShortName()}, &workflowpattern.EmptyTraceWriter{}) {
matchTimes++
}
case "tags":
hasTagFilter = true
if !refName.IsTag() {
break
}
patterns, err := workflowpattern.CompilePatterns(vals...)
if err != nil {
break
}
if !workflowpattern.Skip(patterns, []string{refName.ShortName()}, &workflowpattern.EmptyTraceWriter{}) {
matchTimes++
}
case "tags-ignore":
hasTagFilter = true
if !refName.IsTag() {
break
}
patterns, err := workflowpattern.CompilePatterns(vals...)
if err != nil {
break
}
if !workflowpattern.Filter(patterns, []string{refName.ShortName()}, &workflowpattern.EmptyTraceWriter{}) {
matchTimes++
} }
case "paths": case "paths":
filesChanged, err := commit.GetFilesChangedSinceCommit(pushPayload.Before) filesChanged, err := commit.GetFilesChangedSinceCommit(pushPayload.Before)
if err != nil { if err != nil {
log.Error("GetFilesChangedSinceCommit [commit_sha1: %s]: %v", commit.ID.String(), err) log.Error("GetFilesChangedSinceCommit [commit_sha1: %s]: %v", commit.ID.String(), err)
} else { } else {
for _, val := range vals { patterns, err := workflowpattern.CompilePatterns(vals...)
matched := false if err != nil {
for _, file := range filesChanged { break
if glob.MustCompile(val, '/').Match(file) { }
matched = true if !workflowpattern.Skip(patterns, filesChanged, &workflowpattern.EmptyTraceWriter{}) {
break matchTimes++
} }
} }
if matched { case "paths-ignore":
matchTimes++ filesChanged, err := commit.GetFilesChangedSinceCommit(pushPayload.Before)
break if err != nil {
} log.Error("GetFilesChangedSinceCommit [commit_sha1: %s]: %v", commit.ID.String(), err)
} else {
patterns, err := workflowpattern.CompilePatterns(vals...)
if err != nil {
break
}
if !workflowpattern.Filter(patterns, filesChanged, &workflowpattern.EmptyTraceWriter{}) {
matchTimes++
} }
} }
default: default:
log.Warn("push event unsupported condition %q", cond) log.Warn("push event unsupported condition %q", cond)
} }
} }
// if both branch and tag filter are defined in the workflow only one needs to match
if hasBranchFilter && hasTagFilter {
matchTimes++
}
return matchTimes == len(evt.Acts) return matchTimes == len(evt.Acts)
} }
@ -221,30 +276,47 @@ func matchPullRequestEvent(commit *git.Commit, prPayload *api.PullRequestPayload
} }
} }
case "branches": case "branches":
refShortName := git.RefName(prPayload.PullRequest.Base.Ref).ShortName() refName := git.RefName(prPayload.PullRequest.Base.Ref)
for _, val := range vals { patterns, err := workflowpattern.CompilePatterns(vals...)
if glob.MustCompile(val, '/').Match(refShortName) { if err != nil {
matchTimes++ break
break }
} if !workflowpattern.Skip(patterns, []string{refName.ShortName()}, &workflowpattern.EmptyTraceWriter{}) {
matchTimes++
}
case "branches-ignore":
refName := git.RefName(prPayload.PullRequest.Base.Ref)
patterns, err := workflowpattern.CompilePatterns(vals...)
if err != nil {
break
}
if !workflowpattern.Filter(patterns, []string{refName.ShortName()}, &workflowpattern.EmptyTraceWriter{}) {
matchTimes++
} }
case "paths": case "paths":
filesChanged, err := commit.GetFilesChangedSinceCommit(prPayload.PullRequest.Base.Ref) filesChanged, err := commit.GetFilesChangedSinceCommit(prPayload.PullRequest.Base.Ref)
if err != nil { if err != nil {
log.Error("GetFilesChangedSinceCommit [commit_sha1: %s]: %v", commit.ID.String(), err) log.Error("GetFilesChangedSinceCommit [commit_sha1: %s]: %v", commit.ID.String(), err)
} else { } else {
for _, val := range vals { patterns, err := workflowpattern.CompilePatterns(vals...)
matched := false if err != nil {
for _, file := range filesChanged { break
if glob.MustCompile(val, '/').Match(file) { }
matched = true if !workflowpattern.Skip(patterns, filesChanged, &workflowpattern.EmptyTraceWriter{}) {
break matchTimes++
} }
} }
if matched { case "paths-ignore":
matchTimes++ filesChanged, err := commit.GetFilesChangedSinceCommit(prPayload.PullRequest.Base.Ref)
break if err != nil {
} log.Error("GetFilesChangedSinceCommit [commit_sha1: %s]: %v", commit.ID.String(), err)
} else {
patterns, err := workflowpattern.CompilePatterns(vals...)
if err != nil {
break
}
if !workflowpattern.Filter(patterns, filesChanged, &workflowpattern.EmptyTraceWriter{}) {
matchTimes++
} }
} }
default: default:

View File

@ -16,6 +16,7 @@ import (
"code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/log"
packages_module "code.gitea.io/gitea/modules/packages" packages_module "code.gitea.io/gitea/modules/packages"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/storage" "code.gitea.io/gitea/modules/storage"
"code.gitea.io/gitea/modules/util" "code.gitea.io/gitea/modules/util"
) )
@ -111,6 +112,10 @@ func checkStorage(opts *checkStorageOptions) func(ctx context.Context, logger lo
} }
if opts.LFS || opts.All { if opts.LFS || opts.All {
if !setting.LFS.StartServer {
logger.Info("LFS isn't enabled (skipped)")
return nil
}
if err := commonCheckStorage(ctx, logger, autofix, if err := commonCheckStorage(ctx, logger, autofix,
&commonStorageCheckOptions{ &commonStorageCheckOptions{
storer: storage.LFS, storer: storage.LFS,
@ -173,6 +178,10 @@ func checkStorage(opts *checkStorageOptions) func(ctx context.Context, logger lo
} }
if opts.Packages || opts.All { if opts.Packages || opts.All {
if !setting.Packages.Enabled {
logger.Info("Packages isn't enabled (skipped)")
return nil
}
if err := commonCheckStorage(ctx, logger, autofix, if err := commonCheckStorage(ctx, logger, autofix,
&commonStorageCheckOptions{ &commonStorageCheckOptions{
storer: storage.Packages, storer: storage.Packages,

View File

@ -234,6 +234,7 @@ func EditProject(ctx *context.Context) {
ctx.Data["title"] = p.Title ctx.Data["title"] = p.Title
ctx.Data["content"] = p.Description ctx.Data["content"] = p.Description
ctx.Data["redirect"] = ctx.FormString("redirect")
ctx.HTML(http.StatusOK, tplProjectsNew) ctx.HTML(http.StatusOK, tplProjectsNew)
} }
@ -274,7 +275,11 @@ func EditProjectPost(ctx *context.Context) {
} }
ctx.Flash.Success(ctx.Tr("repo.projects.edit_success", p.Title)) ctx.Flash.Success(ctx.Tr("repo.projects.edit_success", p.Title))
ctx.Redirect(ctx.Repo.RepoLink + "/projects") if ctx.FormString("redirect") == "project" {
ctx.Redirect(p.Link())
} else {
ctx.Redirect(ctx.ContextUser.HomeLink() + "/-/projects")
}
} }
// ViewProject renders the project board for a project // ViewProject renders the project board for a project

View File

@ -235,6 +235,7 @@ func EditProject(ctx *context.Context) {
ctx.Data["title"] = p.Title ctx.Data["title"] = p.Title
ctx.Data["content"] = p.Description ctx.Data["content"] = p.Description
ctx.Data["card_type"] = p.CardType ctx.Data["card_type"] = p.CardType
ctx.Data["redirect"] = ctx.FormString("redirect")
ctx.HTML(http.StatusOK, tplProjectsNew) ctx.HTML(http.StatusOK, tplProjectsNew)
} }
@ -275,7 +276,11 @@ func EditProjectPost(ctx *context.Context) {
} }
ctx.Flash.Success(ctx.Tr("repo.projects.edit_success", p.Title)) ctx.Flash.Success(ctx.Tr("repo.projects.edit_success", p.Title))
ctx.Redirect(ctx.Repo.RepoLink + "/projects") if ctx.FormString("redirect") == "project" {
ctx.Redirect(p.Link())
} else {
ctx.Redirect(ctx.Repo.RepoLink + "/projects")
}
} }
// ViewProject renders the project board for a project // ViewProject renders the project board for a project

View File

@ -292,7 +292,7 @@ func Profile(ctx *context.Context) {
ctx.Data["IsPackageEnabled"] = setting.Packages.Enabled ctx.Data["IsPackageEnabled"] = setting.Packages.Enabled
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
ctx.Data["ShowUserEmail"] = len(ctx.ContextUser.Email) > 0 && ctx.IsSigned && (!ctx.ContextUser.KeepEmailPrivate || ctx.ContextUser.ID == ctx.Doer.ID) ctx.Data["ShowUserEmail"] = setting.UI.ShowUserEmail && ctx.ContextUser.Email != "" && ctx.IsSigned && !ctx.ContextUser.KeepEmailPrivate
ctx.HTML(http.StatusOK, tplProfile) ctx.HTML(http.StatusOK, tplProfile)
} }

View File

@ -21,6 +21,7 @@
<form class="ui form grid" action="{{.Link}}" method="post"> <form class="ui form grid" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<div class="eleven wide column"> <div class="eleven wide column">
<input type="hidden" id="redirect" name="redirect" value="{{.redirect}}">
<div class="field {{if .Err_Title}}error{{end}}"> <div class="field {{if .Err_Title}}error{{end}}">
<label>{{.locale.Tr "repo.projects.title"}}</label> <label>{{.locale.Tr "repo.projects.title"}}</label>
<input name="title" placeholder="{{.locale.Tr "repo.projects.title"}}" value="{{.title}}" autofocus required> <input name="title" placeholder="{{.locale.Tr "repo.projects.title"}}" value="{{.title}}" autofocus required>

View File

@ -46,7 +46,7 @@
{{if $.CanWriteProjects}} {{if $.CanWriteProjects}}
<div class="column right aligned"> <div class="column right aligned">
<div class="ui compact right small menu"> <div class="ui compact right small menu">
<a class="item" href="{{$.Link}}/edit" data-id={{$.Project.ID}} data-title={{$.Project.Title}}> <a class="item" href="{{$.Link}}/edit?redirect=project" data-id={{$.Project.ID}} data-title={{$.Project.Title}}>
{{svg "octicon-pencil"}} {{svg "octicon-pencil"}}
<span class="gt-mx-3">{{$.locale.Tr "repo.issues.label_edit"}}</span> <span class="gt-mx-3">{{$.locale.Tr "repo.issues.label_edit"}}</span>
</a> </a>

View File

@ -28,10 +28,10 @@
{{- end -}} {{- end -}}
</a> </a>
</span> </span>
<span class="message gt-dib gt-ellipsis gt-mr-2"> <span class="message gt-dib gt-ellipsis gt-mr-3">
<span>{{RenderCommitMessage $.Context $commit.Subject $.RepoLink $.Repository.ComposeMetas}}</span> <span>{{RenderCommitMessage $.Context $commit.Subject $.RepoLink $.Repository.ComposeMetas}}</span>
</span> </span>
<span class="tags gt-df gt-ac"> <span class="tags gt-df gt-ac gt-mr-2">
{{range $commit.Refs}} {{range $commit.Refs}}
{{$refGroup := .RefGroup}} {{$refGroup := .RefGroup}}
{{if eq $refGroup "pull"}} {{if eq $refGroup "pull"}}
@ -54,20 +54,20 @@
{{svg "octicon-git-branch" 16 "gt-mr-2"}}{{.ShortName}} {{svg "octicon-git-branch" 16 "gt-mr-2"}}{{.ShortName}}
</a> </a>
{{else}} {{else}}
<!-- Unknown ref type {{.Name}} --> <!-- Unknown ref type .Name -->
{{end}} {{end}}
{{end}} {{end}}
</span> </span>
<span class="author gt-df gt-ac gt-mr-2"> <span class="author gt-df gt-ac gt-mr-3">
{{$userName := $commit.Commit.Author.Name}} {{$userName := $commit.Commit.Author.Name}}
{{if $commit.User}} {{if $commit.User}}
{{if $commit.User.FullName}} {{if $commit.User.FullName}}
{{$userName = $commit.User.FullName}} {{$userName = $commit.User.FullName}}
{{end}} {{end}}
{{avatar $.Context $commit.User}} <span class="gt-mr-2">{{avatar $.Context $commit.User}}</span>
<a href="{{$commit.User.HomeLink}}">{{$userName}}</a> <a href="{{$commit.User.HomeLink}}">{{$userName}}</a>
{{else}} {{else}}
{{avatarByEmail $.Context $commit.Commit.Author.Email $userName}} <span class="gt-mr-2">{{avatarByEmail $.Context $commit.Commit.Author.Email $userName}}</span>
{{$userName}} {{$userName}}
{{end}} {{end}}
</span> </span>

View File

@ -24,6 +24,7 @@
<form class="ui form grid" action="{{.Link}}" method="post"> <form class="ui form grid" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<div class="eleven wide column"> <div class="eleven wide column">
<input type="hidden" id="redirect" name="redirect" value="{{.redirect}}">
<div class="field {{if .Err_Title}}error{{end}}"> <div class="field {{if .Err_Title}}error{{end}}">
<label>{{.locale.Tr "repo.projects.title"}}</label> <label>{{.locale.Tr "repo.projects.title"}}</label>
<input name="title" placeholder="{{.locale.Tr "repo.projects.title"}}" value="{{.title}}" autofocus required> <input name="title" placeholder="{{.locale.Tr "repo.projects.title"}}" value="{{.title}}" autofocus required>

View File

@ -50,7 +50,7 @@
{{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}} {{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}}
<div class="column right aligned"> <div class="column right aligned">
<div class="ui compact right small menu"> <div class="ui compact right small menu">
<a class="item" href="{{$.RepoLink}}/projects/{{.Project.ID}}/edit" data-id={{$.Project.ID}} data-title={{$.Project.Title}}> <a class="item" href="{{$.RepoLink}}/projects/{{.Project.ID}}/edit?redirect=project" data-id={{$.Project.ID}} data-title={{$.Project.Title}}>
{{svg "octicon-pencil"}} {{svg "octicon-pencil"}}
<span class="gt-mx-3">{{$.locale.Tr "repo.issues.label_edit"}}</span> <span class="gt-mx-3">{{$.locale.Tr "repo.issues.label_edit"}}</span>
</a> </a>

View File

@ -45,38 +45,49 @@ func TestSettingShowUserEmailProfile(t *testing.T) {
defer tests.PrepareTestEnv(t)() defer tests.PrepareTestEnv(t)()
showUserEmail := setting.UI.ShowUserEmail showUserEmail := setting.UI.ShowUserEmail
// user1: keep_email_private = false, user2: keep_email_private = true
setting.UI.ShowUserEmail = true setting.UI.ShowUserEmail = true
session := loginUser(t, "user2") // user1 can see self
req := NewRequest(t, "GET", "/user2") session := loginUser(t, "user1")
req := NewRequest(t, "GET", "/user1")
resp := session.MakeRequest(t, req, http.StatusOK) resp := session.MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body) htmlDoc := NewHTMLParser(t, resp.Body)
assert.Contains(t, assert.Contains(t, htmlDoc.doc.Find(".user.profile").Text(), "user1@example.com")
htmlDoc.doc.Find(".user.profile").Text(),
"user2@example.com", // user1 can not see user2
) req = NewRequest(t, "GET", "/user2")
resp = session.MakeRequest(t, req, http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body)
// Should not contain even if the user visits their own profile page
assert.NotContains(t, htmlDoc.doc.Find(".user.profile").Text(), "user2@example.com")
// user2 can see user1
session = loginUser(t, "user2")
req = NewRequest(t, "GET", "/user1")
resp = session.MakeRequest(t, req, http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body)
assert.Contains(t, htmlDoc.doc.Find(".user.profile").Text(), "user1@example.com")
// user2 can not see self
session = loginUser(t, "user2")
req = NewRequest(t, "GET", "/user2")
resp = session.MakeRequest(t, req, http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body)
assert.NotContains(t, htmlDoc.doc.Find(".user.profile").Text(), "user2@example.com")
setting.UI.ShowUserEmail = false setting.UI.ShowUserEmail = false
req = NewRequest(t, "GET", "/user2") // user1 can not see self
session = loginUser(t, "user1")
req = NewRequest(t, "GET", "/user1")
resp = session.MakeRequest(t, req, http.StatusOK) resp = session.MakeRequest(t, req, http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body) htmlDoc = NewHTMLParser(t, resp.Body)
// Should contain since this user owns the profile page assert.NotContains(t, htmlDoc.doc.Find(".user.profile").Text(), "user1@example.com")
assert.Contains(t,
htmlDoc.doc.Find(".user.profile").Text(),
"user2@example.com",
)
setting.UI.ShowUserEmail = showUserEmail setting.UI.ShowUserEmail = showUserEmail
session = loginUser(t, "user4")
req = NewRequest(t, "GET", "/user2")
resp = session.MakeRequest(t, req, http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body)
assert.NotContains(t,
htmlDoc.doc.Find(".user.profile").Text(),
"user2@example.com",
)
} }
func TestSettingLandingPage(t *testing.T) { func TestSettingLandingPage(t *testing.T) {

View File

@ -78,7 +78,7 @@ function updateDeadline(deadlineString) {
export function initRepoIssueDue() { export function initRepoIssueDue() {
$(document).on('click', '.issue-due-edit', () => { $(document).on('click', '.issue-due-edit', () => {
$('#deadlineForm').fadeToggle(150); toggleElem('#deadlineForm');
}); });
$(document).on('click', '.issue-due-remove', () => { $(document).on('click', '.issue-due-remove', () => {
updateDeadline(''); updateDeadline('');