Skip to content

Commit b2182ef

Browse files
committed
fix
1 parent 9adf175 commit b2182ef

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

routers/web/repo/commit.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,13 @@ func Graph(ctx *context.Context) {
169169
ctx.Data["Username"] = ctx.Repo.Owner.Name
170170
ctx.Data["Reponame"] = ctx.Repo.Repository.Name
171171

172+
divOnly := ctx.FormBool("div-only")
173+
queryParams := ctx.Req.URL.Query()
174+
queryParams.Del("div-only")
172175
paginator := context.NewPagination(int(graphCommitsCount), setting.UI.GraphMaxCommitNum, page, 5)
173-
paginator.AddParamFromRequest(ctx.Req)
176+
paginator.AddParamFromQuery(queryParams)
174177
ctx.Data["Page"] = paginator
175-
if ctx.FormBool("div-only") {
178+
if divOnly {
176179
ctx.HTML(http.StatusOK, tplGraphDiv)
177180
return
178181
}

services/context/pagination.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ func (p *Pagination) WithCurRows(n int) *Pagination {
3333
return p
3434
}
3535

36-
func (p *Pagination) AddParamFromRequest(req *http.Request) {
37-
for key, values := range req.URL.Query() {
36+
func (p *Pagination) AddParamFromQuery(q url.Values) {
37+
for key, values := range q {
3838
if key == "page" || len(values) == 0 || (len(values) == 1 && values[0] == "") {
3939
continue
4040
}
@@ -45,6 +45,10 @@ func (p *Pagination) AddParamFromRequest(req *http.Request) {
4545
}
4646
}
4747

48+
func (p *Pagination) AddParamFromRequest(req *http.Request) {
49+
p.AddParamFromQuery(req.URL.Query())
50+
}
51+
4852
// GetParams returns the configured URL params
4953
func (p *Pagination) GetParams() template.URL {
5054
return template.URL(strings.Join(p.urlParams, "&"))

web_src/css/features/gitgraph.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,13 @@
7171

7272
#git-graph-container li .author {
7373
color: var(--color-text-light);
74+
flex-shrink: 0;
7475
}
7576

7677
#git-graph-container li .time {
7778
color: var(--color-text-light-3);
7879
font-size: 80%;
80+
flex-shrink: 0;
7981
}
8082

8183
#git-graph-container li a:not(.ui):hover {
@@ -109,6 +111,10 @@
109111
background-color: var(--color-secondary-alpha-30);
110112
}
111113

114+
#git-graph-container #rev-list .commit-refs {
115+
flex-shrink: 0;
116+
}
117+
112118
#git-graph-container #rev-list .commit-refs .button {
113119
padding: 2px 4px;
114120
margin-right: 0.25em;

web_src/js/features/repo-graph.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ export function initRepoGraphGit() {
8484

8585
const flowSelectRefsDropdown = document.querySelector('#flow-select-refs-dropdown');
8686
const $dropdown = fomanticQuery(flowSelectRefsDropdown);
87+
$dropdown.dropdown({clearable: true});
88+
$dropdown.dropdown('set selected', dropdownSelected);
8789
$dropdown.dropdown({
88-
clearable: true,
89-
fullTextSeach: 'exact',
9090
onRemove(toRemove: string) {
9191
if (toRemove === '...flow-hide-pr-refs') {
9292
params.delete('hide-pr-refs');
@@ -110,7 +110,6 @@ export function initRepoGraphGit() {
110110
updateGraph();
111111
},
112112
});
113-
$dropdown.dropdown('set selected', dropdownSelected);
114113

115114
graphContainer.addEventListener('mouseenter', (e: DOMEvent<MouseEvent>) => {
116115
if (e.target.matches('#rev-list li')) {

0 commit comments

Comments
 (0)