Commit Graph
938 Commits
Author SHA1 Message Date
CuriousCorrelation 9782f6ea21 Rename Data suffix to Options for readability 2022-07-13 15:52:19 +05:30
CuriousCorrelation 2ad2dbc69e Move mount useEffect to top, convention 2022-07-13 15:51:31 +05:30
CuriousCorrelation 2cbe07fc6a fix: Search box not filling all space horizontally 2022-07-12 23:40:59 +05:30
CuriousCorrelation 6a0d1de57a Remove generic qualifiers (used for testing) 2022-07-12 17:34:45 +05:30
CuriousCorrelation 4efa4103c3 Move filteredData to top level for readability 2022-07-11 23:34:25 +05:30
CuriousCorrelation 87ac604344 Change options to be generic
Now function expects `options` to impl `PaginatedList`
2022-07-11 23:12:54 +05:30
CuriousCorrelation 25acbe04f5 Change paginateFetch type
`paginateFetch` now has concrete types
2022-07-11 23:11:19 +05:30
CuriousCorrelation 1d39359e36 Fix handleFilter dependency 2022-07-11 22:26:47 +05:30
CuriousCorrelation bbfcc7f96c Change searchable to be optional 2022-07-11 19:30:27 +05:30
CuriousCorrelation 0fe220164e Add filter clear action on blank search
This fixes stale search persisting when
clearing search characters.
2022-07-11 19:20:06 +05:30
CuriousCorrelation e51468f50b Add ability to populate filteredData on mount 2022-07-11 18:14:55 +05:30
CuriousCorrelation 11018578b7 Fix clicking on menu not clearing previous search 2022-07-11 18:14:39 +05:30
CuriousCorrelation 63622c2f66 Add searchable and paginateFetch var 2022-07-11 18:14:03 +05:30
CuriousCorrelation 2b790cdc2f Implement options filter 2022-07-11 18:13:30 +05:30
CuriousCorrelation 06360fd7c2 Add PaginatedItem type req to TFilterOption
For use with `PaginatedList`
2022-07-11 18:11:30 +05:30
CuriousCorrelation a72700b408 [WIP] Change map with MenuItem to PaginatedList 2022-07-11 18:10:21 +05:30
CuriousCorrelation 5972eb2232 Add InputSearch styling 2022-07-11 18:07:17 +05:30
CuriousCorrelation 1201bd85a9 Remove PaginatedDropdown in favor of merge with FilterOptions 2022-07-11 17:56:18 +05:30
CuriousCorrelation 734e752b76 Made default item component dependency
Now parent component can set a default value,
instead of it being hardcoded "Any authors".
2022-07-10 22:17:27 +05:30
CuriousCorrelation 3941474191 Fix dropdown button label not setting 2022-07-10 21:48:01 +05:30
CuriousCorrelation 3becb00102 Use user.id as PaginatedItem id 2022-07-10 21:01:47 +05:30
CuriousCorrelation dac60cd4a0 Remove onFocus
Has no adverse effects so far, fingers crossed
2022-07-10 20:07:21 +05:30
CuriousCorrelation 966f449156 Impl Paginated list
Pagination seems to work fine.
`onFocus` isn't useful because
mount is handled already.

TODO: Try removing `onFocus`
2022-07-10 20:06:01 +05:30
CuriousCorrelation 5e0893ebc9 Add memoized options
TODO: Use `options` to create filtered data
2022-07-10 20:03:56 +05:30
CuriousCorrelation 3ad1187977 Add users param to PaginatedDropdown
Not sure what `users` type should be.

TODO: Use `users` to calculate `options`
2022-07-10 20:01:45 +05:30
CuriousCorrelation 324f4b133d Impl author filter and mount set
TODO: Limit user display using pagination.
- Limit user display
- Scroll limited users
- Query for more

Because data would be provided by parent component,
`PaginatedDropdown` might need to use a callback
to fetch additional data.
2022-07-10 18:49:54 +05:30
CuriousCorrelation b0ca6b5567 Add static positioning for search box
Now search box doesn't scroll away with the content

TODO: Impl `handleOnChange`
2022-07-10 17:53:11 +05:30
CuriousCorrelation c80a490340 Add PaginatedDropdown component
Based on `FilterOptions.tsx`

TODO: Replace `FilterOptions` with `PaginatedDropdown`
in `UserFilter.tsx`
2022-07-10 16:55:07 +05:30
Tom Moor 465a8bd505 fix: Version tag should open new tab, related type improvements
closes #3737
2022-07-10 11:22:45 +02:00
Tom Moor 831df67358 feat: Adds route-level role filtering. (#3734)
* feat: Adds route-level role filtering. Another layer in the onion of security and performance

* fix: Regression in authentication middleware
2022-07-05 12:26:49 -07:00
Tom Moor 5d498632c6 fix: Models are not all removed from local store upon access change (#3729)
* fix: Clean data from stores correctly on 401/403 response

* Convert DataLoader from class component, remove observables and caching

* types
2022-07-03 13:48:50 -07:00
Tom MoorandCorey Alexander 10f86ed218 feat: Webhooks (#3691)
* Webhooks (#3607)

* Get the migration and the model setup. Also make the sample env file a bit easier to use. Now just requires setting a SECRET_KEY and besides that will boot up from the sample

* WIP: Start getting a Webhook page created. Just the skeleton state right now

* WIP: Getting a form created to create webhooks, need to bring in react-hook-forms now

* WIP: Get library installed and make TS happy

* Get a few checkboxes ready to go

* Get creating and destroying working with a decent start to a frontend

* Didn't mean to enable this

* Remove eslint and fix other random typescript issue

* Rename some events to be more realistic

* Revert these changes

* PR review comments around policies. Also make sure this inherits from IdModel so it actually gets an id

* Allow any admin on the team to edit webhooks

* Start sending some webhooks for some User events

* Make sure the URL is valid

* Start recording webhook deliveries

* Make sure to verify if the subscription is for the type of event we are looking at

* Refactor sending Webhooks and follow better webhook schema

This creates a presenter to unify the format of webhooks. We also
extract the sending of webhooks and recording their deliveries to a
method than can be used by each of the different event type methods

We also add a status to WebhookDelivery since we need to save the record
before we make the HTTP request to get its id. Then once we make the
request and get a response we can update the delivery with the HTTP info

* Turn off a subscription that has failed for the last 25 deliveries

* Get a first spec passing. Found a bug in my returning of promises so good to patch that up now

* This looks nicer

* Get some tests added for the processor

* Add cron task to delete older webhooks

* Add Document Events to the Processor

* Revisions, FileOperations and Collections

* Get all the server side events added to the processor and make Typescript make sure they are all accounted for

* Get all the events added to the Frontend and work on styling them a bit, still needs some love though

* Get UI styled up a bit

* Get events wired up for webhook subscriptions

* Get delete events working and test at least one variant of them

* Get deletes working and actually make sure to send the model id in the webhook

* Remove webhook secrets from this slice

* Add disabled label for subscriptions that are disabled

* Make sure to cascade the delete

* Reorg this file a bit

* Fix association

* I removed secret for the moment

* Apply Copy changes from PR Review

Co-authored-by: Tom Moor <tom.moor@gmail.com>

* Actually apply the copy changes

TIL that if you Resolve a conversation it _also_ removes the 'staged suggestion' from your list on Github

Co-authored-by: Tom Moor <tom.moor@gmail.com>

* Update app/scenes/Settings/Webhooks.tsx

Missed this copy change before

Co-authored-by: Tom Moor <tom.moor@gmail.com>

* Add disabled as yellow badge

* Resolve frontend comments

* Fixup Schema a bit and remove the dependency on the subscription

* Add test to make sure we don't disable until there are enough failures, and fix code to actually do that. Also some test fixes from the json response shape changes

* Fix WebhookDeliveries to store the responses as Text instead of blobs

* Switch to text better for response bodies, this is using the helpers better and makes the code read better

* Move the logic to a task but run in through the processor cause the tests expect that right now, moving the tests over next

* Split up the tests and actually enqueue the events from the WebhookProcessor instead of doing them inline

* Allow any team admin to see any webhook subscription for the team

* Add the indexes based on our lookup patterns

* Run eslint --fix to fix auto correct issues from when I tried to use Github to merge copy changes

* Allow subscriptions to be edited after creation

* Types caught that I didn't add the new event to the webhook processor, also added it to the frontend here

* I think this will get these into the translations file

* Catch a few more translations, use styled components better and remove usage of webhook subscription in the copy

Co-authored-by: Tom Moor <tom.moor@gmail.com>

* fix: tsc
fix: Document model payload empty

* fix: Revision webhook payload
Add custom UA for hooks

* Add webhooks icon, move under Integrations settings
Some spacing fixes

* Add actorId to webhook payloads

* Add View and ApiKey event types

* Spacing tweaks, fix team payload

* fix: Webhook not disabled after 25 failures

* fix: Enable webhook when editing if previously disabled

* fix: Correctly store response headers

* fix: Error in json/parsing/presentation results in hanging 'pending' webhook delivery

* fix: Awkward payload for users.invite webhook

* Add BaseEvent, ShareEvent

* fix: Add share events to form

* fix: Move webhook delivery cleanup to single DB call
Remove some unused abstraction

* Add user, collection, group context to membership webhook events
Some associated refactoring

Co-authored-by: Corey Alexander <coreyja@gmail.com>
2022-06-28 22:44:50 -07:00
Tom Moor 118e5da345 fix: Unpublished does not appear in document history
closes #3429
2022-06-09 21:16:37 +02:00
Tom Moor 32cdb3f961 fix: Do not error when moving document into alphabetically ordered collection
closes #3649
2022-06-09 20:33:44 +02:00
Tom Moor ac07724f21 chore: Synchronizing refactor and small fixes from enterprise codebase (#3634)
* chore: Syncronizing refactor and small fixes from enterprise codebase

* fix
2022-06-05 00:59:41 -07:00
Tom Moor 4eb3b61c7a fix: Lazily polyfill ResizeObserver for old iOS (#3629)
* fix: Lazily polyfill ResizeObserver for old iOS

* fix: Prevent child rendering until polyfills are loaded

* tsc
2022-06-04 09:06:07 -07:00
Tom Moor 2dc930bfe2 fix: Context menus not scrollable on iOS (#3626)
closes #3588
2022-06-04 08:15:43 -07:00
Tom Moor bf233b209b fix: Alternative fix to #3583, addresses some bugs that were introduced 2022-06-03 11:03:44 +02:00
Nan Yu fa1ce950e8 fix: infinite redirects when hosted subdomain is changed back and forth between two values (#3615) 2022-06-02 09:30:13 -07:00
Nan Yu 41e425756d chore: refactor domain parsing to be more general (#3448)
* change the api of domain parsing to just parseDomain and getCookieDomain
* adds getBaseDomain as the method to get the domain after any official subdomains
2022-05-31 18:48:23 -07:00
Tom Moor da87fd422d Remove hover styles on mobile context menus 2022-05-28 10:05:17 +02:00
Tom Moor c4006cef7b perf: Remove markdown serialize from editor render path (#3567)
* perf: Remove markdown serialize from editor render path

* fix: Simplify heading equality check

* perf: Add cache for slugified headings

* tsc
2022-05-21 12:50:27 -07:00
Tom Moor bf0ff6c823 chore: Casing of logger -> Logger as it's an instantiated class 2022-05-21 13:59:23 +01:00
Tom Moor 6c8b127ff9 chore: isHosted -> isCloudHosted for clarity 2022-05-21 13:34:52 +01:00
rusakovdenis 67049a7868 fix: simplify transformation (#3548)
* fix: simplify transformation

Functions (isDragging, isOver, canDrop) always return a boolean value

* fix: type

In browserslist must be either an array or an object
2022-05-21 05:14:53 -07:00
Tom Moor 468478d06d fix: Another timestamp crash 2022-05-21 10:05:41 +01:00
Tom Moor 5c741e3d98 fix: Crash render timestamp on some languages 2022-05-20 18:58:23 +01:00
Tom Moor 3c002f82cc chore: Centralize env parsing, validation, defaults, and deprecation notices (#3487)
* chore: Centralize env parsing, defaults, deprecation

* wip

* test

* test

* tsc

* docs, more validation

* fix: Allow empty REDIS_URL (defaults to localhost)

* test

* fix: SLACK_MESSAGE_ACTIONS not bool

* fix: Add SMTP port validation
2022-05-19 08:05:11 -07:00
Limezy 5658090d7e Trying to chase missing translations (#3441) 2022-05-17 13:01:00 -07:00
Tom Moor 19de348c85 fix: null ref usage, closes #3456 2022-05-16 22:58:59 +01:00