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 WebHookEditor regression from jQuery removal #29692

Merged
merged 3 commits into from
Mar 9, 2024

Conversation

yardenshoham
Copy link
Member

Make these calls optional

Signed-off-by: Yarden Shoham <[email protected]>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 9, 2024
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 9, 2024
@yardenshoham yardenshoham added type/bug skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. labels Mar 9, 2024
@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 Mar 9, 2024
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Mar 9, 2024

Maybe it's clearer to do so:

const httpMedhodInput = getElementById()
if (httpMedhodInput) {
    const updateContentType = () {
        httpMedhodInput.value == ...
    }
    httpMedhodInput.addEventListener(....)
}

Signed-off-by: Yarden Shoham <[email protected]>
@pull-request-size pull-request-size bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 9, 2024
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Mar 9, 2024

Now, another JS error:

dom.js:9 Uncaught TypeError: Cannot read properties of undefined (reading 'length')
    at elementsCall (dom.js:9:17)
    at toggleElem (dom.js:44:3)
    at updateContentType (WebHookEditor.js:27:15)
    at initCompWebHookEditor (WebHookEditor.js:29:3)
    at HTMLDocument.<anonymous> (index.js:109:24)

Update: oops, rebuild JS (4d1ffda) and no error now. The errors only occur in 4af858f)

@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 Mar 9, 2024
@wxiaoguang wxiaoguang mentioned this pull request Mar 9, 2024
@wxiaoguang wxiaoguang merged commit 1dc7f53 into go-gitea:main Mar 9, 2024
26 checks passed
@wxiaoguang wxiaoguang deleted the fix-webhookeditor-regression branch March 9, 2024 11:59
@GiteaBot GiteaBot added this to the 1.23.0 milestone Mar 9, 2024
@wxiaoguang wxiaoguang modified the milestones: 1.23.0, 1.22.0 Mar 9, 2024
zjjhot added a commit to zjjhot/gitea that referenced this pull request Mar 9, 2024
* upstream/main:
  Fix action runner offline label padding (go-gitea#29691)
  Update allowed attachment types (go-gitea#29688)
  Completely style the webkit autofill (go-gitea#29683)
  Include go files in tailwind processing (go-gitea#29686)
  Fix WebHookEditor regression from jQuery removal (go-gitea#29692)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2024
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. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants