You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
forgejo/modules/structs
Aaron F 3963625b6e
Webhook for Wiki changes (#20219)
Add support for triggering webhook notifications on wiki changes.

This PR contains frontend and backend for webhook notifications on wiki actions (create a new page, rename a page, edit a page and delete a page). The frontend got a new checkbox under the Custom Event -> Repository Events section. There is only one checkbox for create/edit/rename/delete actions, because it makes no sense to separate it and others like releases or packages follow the same schema.

![image](https://user-images.githubusercontent.com/121972/177018803-26851196-831f-4fde-9a4c-9e639b0e0d6b.png)

The actions itself are separated, so that different notifications will be executed (with the "action" field). All the webhook receivers implement the new interface method (Wiki) and the corresponding tests.

When implementing this, I encounter a little bug on editing a wiki page. Creating and editing a wiki page is technically the same action and will be handled by the ```updateWikiPage``` function. But the function need to know if it is a new wiki page or just a change. This distinction is done by the ```action``` parameter, but this will not be sent by the frontend (on form submit). This PR will fix this by adding the ```action``` parameter with the values ```_new``` or ```_edit```, which will be used by the ```updateWikiPage``` function.

I've done integration tests with matrix and gitea (http).

![image](https://user-images.githubusercontent.com/121972/177018795-eb5cdc01-9ba3-483e-a6b7-ed0e313a71fb.png)

Fix #16457

Signed-off-by: Aaron Fischer <mail@aaron-fischer.net>
2 years ago
..
activitypub.go User keypairs and HTTP signatures for ActivityPub federation using go-ap (#19133) 2 years ago
admin_user.go Respect DefaultUserIsRestricted system default when creating new user (#19310) 2 years ago
attachment.go Fix wrong hint when status checking is running on pull request view (#9886) 5 years ago
commit_status.go [Refactor] CombinedStatus and CommitStatus related functions & structs (#14026) 4 years ago
cron.go Add cron running API (#12421) 4 years ago
doc.go Move sdk structs to modules/structs (#6905) 5 years ago
fork.go - name: new parameter in CreateForkOption to give the forked repository (#18066) 3 years ago
git_blob.go Move sdk structs to modules/structs (#6905) 5 years ago
git_hook.go Move sdk structs to modules/structs (#6905) 5 years ago
hook.go Webhook for Wiki changes (#20219) 2 years ago
issue.go Support Issue forms and PR forms (#20987) 2 years ago
issue_comment.go Add API to get issue/pull comments and events (timeline) (#17403) 3 years ago
issue_label.go [API] Fix inconsistent label color format (#10129) 4 years ago
issue_milestone.go Add Created & Updated to Milestone (#12662) 4 years ago
issue_reaction.go [API] Fix 9544 | return 200 when reaction already exist (#9550) 5 years ago
issue_stopwatch.go Display current stopwatch in navbar (#14122) 3 years ago
issue_tracked_time.go [API] Extend times API (#9200) 5 years ago
lfs_lock.go Move sdk structs to modules/structs (#6905) 5 years ago
mirror.go Add new API endpoints for push mirrors management (#19841) 2 years ago
miscellaneous.go API method to list all commits of a repository (#6408) 5 years ago
nodeinfo.go Add nodeinfo endpoint for federation purposes (#16953) 3 years ago
notifications.go API: add html urls to notification subjects (#17178) 3 years ago
org.go Fix various typos (#18219) 3 years ago
org_member.go Move sdk structs to modules/structs (#6905) 5 years ago
org_team.go Team permission allow different unit has different permission (#17811) 3 years ago
org_type.go Add more linters to improve code readability (#19989) 2 years ago
package.go Add Package Registry (#16510) 2 years ago
pull.go Add "Allow edits from maintainer" feature (#18002) 2 years ago
pull_review.go Dismiss prior pull reviews if done via web in review dismiss (#20197) 2 years ago
release.go Add single release page and latest redirect (#11102) 4 years ago
repo.go Add allow_rebase_update, default_delete_branch_after_merge to repository api response (#20079) 2 years ago
repo_branch.go Support unprotected file patterns (#16395) 3 years ago
repo_collaborator.go Add API to query collaborators permission for a repository (#18761) 2 years ago
repo_commit.go More commit info from API (#19252) 2 years ago
repo_file.go Add latest commit's SHA to content response (#20398) 2 years ago
repo_key.go Move sdk structs to modules/structs (#6905) 5 years ago
repo_note.go Add an api endpoint to fetch git notes (#15373) (#16649) 3 years ago
repo_refs.go Move sdk structs to modules/structs (#6905) 5 years ago
repo_tag.go [API] Add repoCreateTag (#16165) 3 years ago
repo_topic.go Add API endpoint for accessing repo topics (#7963) 5 years ago
repo_tree.go Move sdk structs to modules/structs (#6905) 5 years ago
repo_watch.go Move sdk structs to modules/structs (#6905) 5 years ago
repo_wiki.go Add API to get/edit wiki (#17278) 3 years ago
settings.go Add custom emoji support (#16004) 3 years ago
status.go [Refactor] CombinedStatus and CommitStatus related functions & structs (#14026) 4 years ago
task.go Move migrating repository from frontend to backend (#6200) 5 years ago
user.go Include login_name in adminCreateUser response (#20283) 2 years ago
user_app.go Remove Unused Functions (#10516) 4 years ago
user_email.go Move sdk structs to modules/structs (#6905) 5 years ago
user_gpgkey.go Add option to provide signature for a token to verify key ownership (#14054) 3 years ago
user_key.go Move sdk structs to modules/structs (#6905) 5 years ago