49 Commits

Author SHA1 Message Date
Will Hunt
c6f975b390
Refactor oauth response page and show a pending state for GitHub installations (#666)
* Show a sensible message for pending GitHub installations

* Clean up grammar

* changelog

* Update Webhooks.ts
2023-03-21 10:46:08 +00:00
Justin Carlson
8071243696
Fix add instance link grammar (#664)
* Fix add instance link grammar

* Add changelog
2023-03-20 14:48:18 -04:00
Tadeusz Sośnierz
7cd59f3774
Add a go-neb migrator (#647)
* Add a go-neb migrator, capable of migrating RSS/Atom feeds to hookshot (so far)

* Add forgotten file

* Fix useCallback() usage

* Gracefully handle go-neb not being configured

* Make Feed URLs not editable when they're being migrated over from go-neb

https://github.com/matrix-org/matrix-hookshot/pull/647#discussion_r1131615944

* Changelog

* Linting

* Add the ability to migrate Github repo connections from go-neb (#651)

* Add the ability to migrate Github repo connections from go-neb

* Gracefully handle the lack of go-neb migrator

---------

Co-authored-by: Tadeusz Sośnierz <tadeusz@sosnierz.com>

* Handle Scalar-style go-neb service IDs (#656)

* Add the ability to migrate Github repo connections from go-neb

* Handle Scalar-style go-neb service IDs

* Make service type in service ID match the Scalar-generated one

https://github.com/matrix-org/matrix-hookshot/pull/656#discussion_r1131647595

* Safeguard against undefined hardcoded service IDs

https://github.com/matrix-org/matrix-hookshot/pull/656#discussion_r1131646578

* Rename a variable

https://github.com/matrix-org/matrix-hookshot/pull/656#discussion_r1131710225

---------

Co-authored-by: Tadeusz Sośnierz <tadeusz@sosnierz.com>

* Linting

---------

Co-authored-by: Tadeusz Sośnierz <tadeusz@sosnierz.com>
2023-03-17 14:25:35 +01:00
Will Hunt
55529d7128
Add support for OAuth login to GitHub via widget (including adding new installations) (#661)
* WIP

* Update vite

* Add oauth landing page

* Add API support for GitHub oauthing

* Remove console.logs

* Add support for logging and and out of GitHub

* Add bridge API methods

* Add base link styling

* Sugar syntax main get

* Update vite

* changelog

* Review changes

* Use instance to match UI

* lint

---------

Co-authored-by: Justin Carlson <justinc@element.io>
2023-03-14 10:50:46 +00:00
Justin Carlson
7575f93f67
Improve widget style (#652)
* Add widget card style and background

* Add padding and header based on embed type parameter

* Add changelog

* Add loading spinner component

* Add loading spinners
2023-03-08 09:20:13 -05:00
Will Hunt
88273a249b
New project picker component for room configs (#624)
* Implement new Dropdown component

* Apply field styling to search too

* General improvements to GitLabClient

* Add support for storing small base64 files in the storage provider

* Refactor GitLab repo to use new connection provider

* Start trying to deduplicate code

* Begin refactor to support ConnectionSearch

* Add support for GitHub searching

* Refactor GitLab/GitHub into components

* Port Jira to ConnectionSearch

* Drop unused functions

* Hide connection list if no connections are present.

* Cleanups

* Cleanup abort controller

* changelog

* Update JIRA for search powers
2023-01-20 13:16:11 +00:00
Christian Paul
46467ac810
Correctly apply CSS for recent RSS feed changes (#604)
* Button: Extend HTMLButton prop types
* Use className prop instad of styles
* Move style prop into scss file
2023-01-13 14:44:07 +01:00
Will Hunt
1e8a112a28
Drop ignoreHooks configuration. (#592)
* Refactor HookFilter to only support enabledEvents (and add a function to convert)

* Convert connections to deprecate ignoreHooks

* Update documentation

* Split out EventHookCheckbox

* Refactor frontend to support enableHooks only mode

* drop old field name

* changelog

* Fix enabledHooks for widgets

* Fixes across the board

* Update test description

* Cleanup

* Fix HookFilter

* Fixup checkboxes

* Cleanup
2023-01-10 17:08:50 +00:00
Christian Paul
188eb4004e
A11y: Add alt tags to all images (#602)
* A11y: Add alt tags to all images

* Add newsfile
2023-01-08 12:04:40 +01:00
Christian Paul
8eab1ff750
Improve webhook code editor performance (#601)
* Improve webhook code editor performance

* Add newsfile
2023-01-06 12:02:13 +00:00
Will Hunt
b6ae8f9106
Split out GitHub release events into created and drafted (#582)
* Support published events

* Changelog

* Improve comments

* Add frontend support

* Change func names
2022-12-08 02:48:56 +00:00
Christian Paul
caf545f1a4
Misspelling: occured -> occurred (#576)
* Typo: occured -> occurred

* Add newsfile 576
2022-11-22 15:17:43 +01:00
Christian Paul
80010f7b9b
Misspelling: to setup -> to set up (#572)
* Typo: to setup -> to set up

* Add newsfile
2022-11-21 18:38:50 +01:00
Andrew Ferrazzutti
db8221b60a
Allow GitLab connections without hook permissions (#567)
* Allow GitLab connections without hook permissions

Warn instead of fail when connecting a GitLab project that Hookshot
cannot provision a webhook for.

* Mention manual "Secret token" for GitLab webhooks

* Refactor warning pane into a separate component

* Recolour warning pane for better contrast
2022-11-08 10:19:41 -05:00
Will Hunt
0c9bbf6410 Disable GitHub workflow events by default (#528)
* Add a HookFilter class

* Use the HookFilter class

* Support default hooks in the web UI

* Update documentation

* changelog

* Allow all GitLab events by default

* bits of cleanup
2022-10-21 11:30:16 -04:00
Andrew Ferrazzutti
505c083f5f
Add support for Jira version events (#534)
- Support version created/updated/released events
- Look up project ID if missing when subscribing to version events
- Properly format version event notices
- Prioritize project URL over ID in debug strings
2022-10-21 09:24:35 -04:00
Andrew Ferrazzutti
d82e0d7d91
Fix & refactor Jira issue event handling (#543)
- Refactor Jira event handling to be more like GitHub & GitLab
- Fix silently-ignored Jira events due to expecting wrong type strings
- Update UI for Jira events
2022-10-21 09:16:00 -04:00
Will Hunt
3263565cac
Add checkboxes for workflow run statues in UI (#524)
* Add a note to use `help`

* Add event checkboxes for the workflow run hooks

* Create 524.bugfix

* Fix padding issue

* Fix a specific error edge case
2022-10-10 10:40:58 +00:00
Andrew Ferrazzutti
31aa5e90ad
Don't send empty query string in widget API reqs (#518) 2022-10-04 18:04:28 -04:00
Andrew Ferrazzutti
4d3567b05a
Add label to GitLab widget's comment body toggle (#517)
* Add label to GitLab widget's comment body toggle

Also ensure that the label is part of the click region

* Add changelog

Copied from #500's changelog
2022-10-04 18:02:21 -04:00
Andrew Ferrazzutti
c29c67fc2b
Fix command prefix field in widgets (#515)
* Read-your-writes consistency on connection update

Allow updates to connections made via config widgets to be reflected
immediately upon save in the widget UI.

* Use HTML elements as `ref`s in widgets

Fixes #422

* Add changelog

* Let widgets use new connection config on save

After a connection config is updated, but before a widget requests the
latest config from the bridge, make the widget display the just-saved
config instead of what the config was before being updated.

* Use input placeholder as prefix default

Otherwise, leaving the prefix field blank would apply no prefix, and
violate prefix length requirements.
2022-10-04 17:19:21 -04:00
Andrew Ferrazzutti
3ca61b9e02
Reorganize the GitHub config widget (#508)
- Group repos by org
- Paginate repo requests
- Remove redundant label next to chosen repo
- Remove redundant repo field below connected repo
- Include repos that user has doesn't have admin permissions for, to
  achieve parity with results from provisioning API
2022-10-03 10:43:16 -04:00
Andrew Ferrazzutti
50fa037d9a
Fix Jira widget request loop for logged-out users (#507)
* Fix Jira widget request loop for logged-out users

* Add changelog file

(copied from #502)
2022-10-03 10:30:11 -04:00
Andrew Ferrazzutti
80a26283e9
Make various typechecking improvements (#505)
* Make various typechecking improvements

* Use `Record<never, never>` to cover `{}`
2022-09-30 13:50:38 -04:00
Andrew Ferrazzutti
911a73abba
Move web tsconfig to let TS language server work (#506)
* Move `web` tsconfig to let TS language server work

* Assign typing to images

This removes type errors on imported images.
2022-09-30 12:35:53 -04:00
Andrew Ferrazzutti
0111f4bfa3
Add Jira widget (#502)
* Add Jira widget

* Jira widget UI for no login vs no instances

* Update changelog wording
2022-09-30 11:52:31 -04:00
Will Hunt
4c33c60d7a
Support GitLab MR comment bodies (optionally) (#500)
* Add backend support

* Add frontend support

* Update docs

* changelog

* Update src/Connections/GitlabRepo.ts

Co-authored-by: Christian Paul <christianp@matrix.org>

* Update docs/usage/room_configuration/gitlab_project.md

Co-authored-by: Christian Paul <christianp@matrix.org>

* Tweak functions

Co-authored-by: Christian Paul <christianp@matrix.org>
2022-09-30 16:33:09 +01:00
Will Hunt
5ee267f013
Update codemirror, remove opensans (#489)
* Update codemirror, remove opensans

* changelog

* Remove our one usage of sans

* Update JS dependency too
2022-09-16 13:23:43 +00:00
Will Hunt
23eae91737
Support notifying when a GitLab MR is ready for review (#480)
* Support ready for review GitLab

* Create 480.feature

* Change event name

* Fix name

* Fix typo
2022-09-12 11:51:04 +01:00
Will Hunt
63ab457b45
Refactor feed errors and error presentation (#459)
* Add support for setting a global feed timeout

* Track failures, and don't show the first non-serious error

* Tidy up error reporting

* Make a prettier error pane

* Use the prettier event pane

* Show failed feed attempts in the widget

* Ensure we catch connection resets

* Add styling file

* Ensure we only track one result per fetch

* changelog

* Refactor to use better status codes

* Make feed results cheaper

* splice
2022-08-31 14:01:43 +01:00
Justin Carlson
49bc94e9ad
Add query parameter to scope room config widget to a particular service (#441)
* Add query parameter to scope room config widget to a particular service

* Add changelog
2022-08-18 10:47:03 -04:00
Andrew Ferrazzutti
e9613225be
Add GitHub widget (#420)
* Add GitHub widget

Also make assorted fixes to help push this along

* Remove unused import

* Resolve new linter warnings

* Undo testing-only change

Didn't mean to commit this

* Use "org/repo" as GitHub repo names in widget

* Update src/ConnectionManager.ts

Co-authored-by: Will Hunt <will@half-shot.uk>

* Don't use null assertions

* Use block scope in switch cases

* Fix some BridgeAPI imports

* Actually validate connection state

* Return only GitHub repos with admin permissions

Co-authored-by: Will Hunt <will@half-shot.uk>
2022-07-29 10:05:21 -04:00
Will Hunt
8cf8c8eff3
Add requireClient capability to widgets (#370)
* Add requireClient

* changelog
2022-06-07 14:12:01 +01:00
Tadeusz Sośnierz
d1494ff373
Add Feed configuration widget (#345)
* Refactor RoomConfigView slightly to reduce duplication

* Add Feed configuration widget

* Drop an unused parameter in FeedConnection

Co-authored-by: Will Hunt <will@half-shot.uk>

* Add a key to connection listing in RoomConfigView

Co-authored-by: Will Hunt <will@half-shot.uk>

* Be more explicit when checking for feeds enabledness

Co-authored-by: Will Hunt <will@half-shot.uk>

* Erase state when removing FeedConnection

* Tone down logging in FeedReader

* Strenghten validation of feed URLs

* Drop an unnecessary non-null assertion

* Allow adding labels to feeds

* Add changelog for #345

* Fix lint-found errors

* Improve feed setup widget changelog

Co-authored-by: Will Hunt <will@half-shot.uk>

* Validate feed URLs with HEAD if possible

* Don't log.error feed validation failures in SetupConnection

* Remove extra space

Co-authored-by: Will Hunt <will@half-shot.uk>

* Wrap errors from FeedConnection.provisionConnection in ApiErrors

Co-authored-by: Tadeusz Sośnierz <tadeusz@sosnierz.com>
Co-authored-by: Will Hunt <will@half-shot.uk>
2022-05-12 12:06:20 +01:00
Half-Shot
f3ad4a0d7d Fix broken headerImgs 2022-05-06 15:59:46 +01:00
Will Hunt
b23e516aa5
Statically define connection creation and provisioing (#330)
* Statically define connection creation and provisioing

* Tidy up

* Drop JIRA

* Convert other connections to new system

* Small linting fixes

* Fixes

* changelog

* Fix bridge

* Fix JIRA instance naming

* Fix JIRA config

* Drop unnessacery check
2022-05-06 13:58:39 +00:00
Tadeusz Sośnierz
2008f2cae0
Fix ErrorPane importing (#337)
Co-authored-by: Tadeusz Sośnierz <tadeusz@sosnierz.com>
2022-05-06 14:53:06 +01:00
Will Hunt
e87030487e
Move components from root to elements (#332)
* Move components from root to elements

* Revert change

* Fix import

* changelog
2022-05-06 10:25:10 +01:00
Will Hunt
f5eefaa381
Replace snowpack with vite (#334)
* Replace snowpack with vite

* changelog

* Drop old snowpack setting

* Fix
2022-05-06 09:57:18 +01:00
Will Hunt
8808385b6d
Add support for GitLab connection configuration via widgets (#320)
* Refactors to support multiple services in the widget UI

* Add GitLabRepo web component view

* Support searching and adding a GitLab repository on the frontend

* Add final bits to supporting adding and removing connections from rooms

* lint

* changelog

* Lots of changes based upon review feedback

* linting

* Add warnings

* Withdraw openid overrides change for this PR

* Drop unused

* Remove async function syntax

* Tiny bug fixes
2022-04-30 06:08:13 +01:00
Will Hunt
8f22f0d851
Use png over webp for browser compatibility (#285)
* Use png over webp for browser compatibility

* changelog
2022-04-11 09:38:57 +01:00
Half-Shot
e6467465ca Linting 2022-04-08 16:20:40 +01:00
Will Hunt
aa9e066530
Add Generic Webhooks Widget interface (#140)
* Start work on improved widget interface for admin room

* Add changes needed for InviteView

* More widget bits

* Lots more work to support setup widgets

* Redesign work

* Fix build order for web

* Remove unused invite code

* Update configs

* Cleanup

* Support widget branding

* Tidy up web app

* Support generic service config lookup

* Stronger typings for configuration

* Improve error text

* fix patch

* changelog

* First pass on documentation

* Fix tests

* fixes

* Don't require room state / admin rooms for room config requests

* Fix no render when secrets isn't provided

* rework if logic

* Fixes after feedback

* more review fixes

* Cleanup unused code

* fix indent

* Update matrix-appservice-bridge to 4.0.1

* Update widget API
2022-04-08 16:16:12 +01:00
Christian Paul
7df772cda5
Made ESLint lint all TypeScript files and fix a few linter errors (#273)
* Remove unused import of preact/h

* Remove unused imports

* Create 273.misc

* Lint all TypeScript files

* Re-add preact/h import

* Fix a few ESLint errors

* Update 273.misc

* Readd eslint:recommended

* Update .eslintrc.js

Co-authored-by: Will Hunt <will@half-shot.uk>
2022-04-06 15:25:10 +01:00
Christian Paul
88ae482a2b Only set Content-Type if we send a body 2022-04-04 00:03:57 +02:00
Will Hunt
745f628e7a Update dependencies 2021-04-11 15:18:49 +01:00
Will Hunt
368962c627 Show notification state 2020-12-12 20:39:23 +00:00
Will Hunt
5c278a2b53 Add skeleton for admin room widget 2020-12-12 20:29:49 +00:00
Will Hunt
4abf02da2a Add web configuration 2020-12-12 13:19:55 +00:00