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

[Fix] AllowedReaction code #9518

Conversation

6543
Copy link
Member

@6543 6543 commented Dec 27, 2019

fix/optimize code from #8886

before: AllowedReaction was piped throu multible templates in the worst case
now: just exec func AllowedReaction

Fix:

if you change reactions you are not able anymore to add it by this UI element:
Bildschirmfoto zu 2019-12-27 18-38-15

@@ -81,6 +81,9 @@ func NewFuncMap() []template.FuncMap {
"LoadTimes": func(startTime time.Time) string {
return fmt.Sprint(time.Since(startTime).Nanoseconds()/1e6) + "ms"
},
"AllowedReactions": func() []string {
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm... Maybe if we're going to do this we should just allow templates to query setting?

Copy link
Member Author

Choose a reason for hiding this comment

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

would be a solution ... but then we can refactor a lot :)

Copy link
Member

Choose a reason for hiding this comment

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

I also agree that we could just name function "Settings" and use it here and later in other places where needed

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 27, 2019
@6543
Copy link
Member Author

6543 commented Dec 27, 2019

@zeripath #9518 (comment) is in this case a general discusion ... but this PR fixes a bug (wich I'm searching for the issue Nr right now)

@6543 6543 changed the title Imprufe AllowedReaction code [Fix] AllowedReaction code Dec 27, 2019
@GiteaBot GiteaBot 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 Dec 27, 2019
@zeripath zeripath added this to the 1.11.0 milestone Dec 27, 2019
@codecov-io
Copy link

codecov-io commented Dec 27, 2019

Codecov Report

Merging #9518 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9518      +/-   ##
==========================================
- Coverage   41.61%   41.59%   -0.03%     
==========================================
  Files         573      573              
  Lines       75673    75674       +1     
==========================================
- Hits        31493    31478      -15     
- Misses      40270    40287      +17     
+ Partials     3910     3909       -1
Impacted Files Coverage Δ
routers/repo/issue.go 37.61% <ø> (-0.05%) ⬇️
routers/repo/pull.go 30.77% <ø> (-0.09%) ⬇️
modules/templates/helper.go 40.33% <100%> (+0.37%) ⬆️
services/pull/check.go 53.52% <0%> (-5.64%) ⬇️
modules/task/migrate.go 25% <0%> (-3.95%) ⬇️
modules/process/manager.go 74.69% <0%> (-3.62%) ⬇️
services/pull/temp_repo.go 31.62% <0%> (-2.57%) ⬇️
models/error.go 33.02% <0%> (-1.12%) ⬇️
models/repo.go 47.97% <0%> (-0.11%) ⬇️
modules/migrations/gitea.go 9.66% <0%> (+0.63%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e64880e...ab04266. Read the comment docs.

@GiteaBot GiteaBot 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 Dec 27, 2019
@techknowlogick techknowlogick merged commit 4ee9746 into go-gitea:master Dec 27, 2019
@6543 6543 deleted the reactions-optimize-setting-to-template-handeling branch December 27, 2019 23:46
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 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/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants