Commit Graph

369 Commits

Author SHA1 Message Date
Tom Moor
4e189b8970 Improved sanitization of href's in editor 2022-07-05 10:14:16 +02:00
Tom Moor
863f22750f feat: Add optional notification email when invite is accepted (#3718)
* feat: Add optional notification email when invite is accepted

* Refactor to use beforeSend
2022-07-02 05:40:40 -07:00
Tom Moor
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
9a6e09bafa feat: Add mermaidjs integration (#3679)
* feat: Add mermaidjs integration (#3523)

* Add mermaidjs to dependencies and CodeFenceNode

* Fix diagram id for mermaidjs diagrams

* Fix typescript compiler errors on mermaid integration

* Fix id generation for mermaid diagrams

* Refactor mermaidjs integration into prosemirror plugin

* Remove unnecessary class attribute in mermaidjs integration

* Change mermaidjs label to singular

* Change decorator.inline to decorator.node for mermaid diagram id

* Fix diagram toggle state

* Add border and background to mermaid diagrams

* Stop mermaidjs from overwriting fontFamily inside diagrams

* Add stable diagramId to mermaid diagrams

* Separate text for hide/show diagram
Use uuid as diagramId, avoid storing in state
Fix cursor on diagrams

* fix: Base diagram visibility off presence of source

* fix: More cases where our font-family is ignored

* Disable HTML labels

* fix: Button styling – not technically required but now we have a third button this felt all the more needed

closes #3116

* named chunks

* Upgrade mermaid 9.1.3

Co-authored-by: Jan Niklas Richter <5812215+ArcticXWolf@users.noreply.github.com>
2022-06-28 22:44:36 -07:00
Tom Moor
88b3b50333 Enable turning off collaborative editing when self-hosted with warning 2022-06-22 09:15:14 +02:00
Tom Moor
118e5da345 fix: Unpublished does not appear in document history
closes #3429
2022-06-09 21:16:37 +02:00
Tom Moor
c4c5b6289e fix: Gap and grammar in Notification settings 2022-06-05 11:47:40 +02:00
Tom Moor
39e146b4e6 fix: Minor usability improves to team domain management 2022-05-19 18:28:19 +01:00
Corey Alexander
51001cfac1 feat: Migrate allowedDomains to a Team Level Settings (#3489)
Fixes #3412

Previously the only way to restrict the domains for a Team were with the ALLOWED_DOMAINS environment variable for self hosted instances.
This PR migrates this to be a database backed setting on the Team object. This is done through the creation of a TeamDomain model that is associated with the Team and contains the domain name

This settings is updated on the Security Tab. Here domains can be added or removed from the Team.

On the server side, we take the code paths that previously were using ALLOWED_DOMAINS and switched them to use the Team allowed domains instead
2022-05-17 20:26:29 -04:00
Limezy
5658090d7e Trying to chase missing translations (#3441) 2022-05-17 13:01:00 -07:00
Tom Moor
4c15f27bb2 fix: Focus submit button by default in confirmation dialogs
fix: Move collection delete to use confirmation dialog
closes #3446
2022-05-15 16:21:42 +01:00
Tom Moor
b152b9f17b fix: Possible extra separator in filtered context menus
Todo: We need to combine this logic with the menus in the editor, but not today
closes #3506
2022-05-15 15:40:49 +01:00
Tom Moor
06d966ad0c fix: Spacing on login form
fix: signup query params overridden unneccessarily
closes #3516
2022-05-15 06:57:35 +01:00
Tom Moor
2a11a23d5b fix: Updated design of api tokens to clarify, closes #3422 2022-04-25 21:34:36 -07:00
Tom Moor
0cdf1f791e fix: Permission select should have border 2022-04-23 18:33:14 -07:00
Tom Moor
33ce49cc33 chore: Refactor data import (#3434)
* Complete refactor of import

* feat: Notion data import (#3442)
2022-04-23 10:07:35 -07:00
Nan Yu
233f3af667 feat: allow admins to require invites before user accounts can be created (#3381)
* allow admins to require invites before user accounts can be created
* use new dialog component for general confirmation dialogs
2022-04-19 12:27:23 -07:00
Tom Moor
48893f727e fix: Tabs on document references don't show active state
'Referenced by' -> 'Backlinks'
2022-04-17 11:42:55 -07:00
Tom Moor
5c1888b0a4 feat: Adds menu item to resend outstanding invites (#3348)
* feat: Adds menu item to resend outstanding invites

* i18n

* snapshots
2022-04-09 11:34:27 -07:00
Nan Yu
75a868e5e8 feat: Search shared documents (#3126)
* provide a type-ahead search input on shared document pages that allow search of child document tree
* improve keyboard navigation handling of all search views
* improve coloring on dark mode list selection states
* refactor PaginatedList component to eliminate edge cases
2022-04-08 10:40:51 -07:00
Tom Moor
1f93027c97 feat: Add date and time slash commands to block menu 2022-04-07 18:50:50 -07:00
Tom Moor
b50c7beba3 fix: Migrations should account for old rows 2022-04-03 20:16:09 -07:00
Tom Moor
84d6bf8ddf feat: Add ability to star collection (#3327)
* Migrations, models, commands

* ui

* Move starred hint to location state

* lint

* tsc

* refactor

* Add collection empty state in expanded sidebar

* Add empty placeholder within starred collections

* Drag and drop improves, Relative refactor

* fix: Starring untitled draft leaves empty space

* fix: Creating draft in starred collection shouldnt open main

* fix: Dupe drop cursor

* Final fixes

* fix: Canonical redirect replaces starred location state

* fix: Don't show reorder cursor at the top of collection with no permission to edit when dragging
2022-04-03 18:51:01 -07:00
Tom Moor
1b89959fc1 fix: Clarify language on magic link success message
closes #3242
2022-04-01 19:59:25 -07:00
Tom Moor
aa05b483fd i18n 2022-04-01 18:40:03 -07:00
Tom Moor
6c25f8fc72 feat: Small confirmation dialogs (#3293)
* wip

* refinement
2022-03-30 17:11:19 -07:00
Tom Moor
6af9246f26 feat: Allow disabling collection creation for members (#3270) 2022-03-24 16:02:50 -07:00
Tom Moor
203980c845 fix: ARIA fixes, missing button labels 2022-03-16 23:41:06 -07:00
Tom Moor
adb7e99321 i18n 2022-03-16 23:04:25 -07:00
Tom Moor
76e1869ebf fix: Catch error when emoji combinations cause document to be unable to persist (#3250)
* fix: Catch and warn of rare error when emoji combinations cause document to be unable to persist changes
closes #3230

* addEventListener -> removeEventListener
2022-03-16 15:18:16 -07:00
Tom Moor
d63326066f feat: Improve settings layout (#3234)
* Setup, and security settings

* Settings -> Details

* Settings -> Notifications

* Profile

* lint

* fix: Flash of loading on members screen

* align language input

* feat: Move share links management to sortable table

* Add account menu to sidebar on settings page

* Aesthetic tweaks, light borders between settings and slight column offset
2022-03-14 17:44:56 -07:00
Tom Moor
40e84ed481 i18n 2022-03-14 16:15:20 -07:00
Saumya Pandey
c979d003e4 fix: navigate to all the pages of settings through command bar (#3226)
* fix: create useAuthorizedSettingsConfig

* use config to render routes

* translations and icon

* mount in CommandBar

* memo

* Update app/hooks/useSettingsAction.tsx

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

* fix: add actions into settings action

* remove comment

* fix: update shares

* fix: Remove Slack/Zapier from translations

Co-authored-by: Tom Moor <tom.moor@gmail.com>
2022-03-13 09:38:36 +05:30
Tom Moor
f44b5708c3 fix: Show error when auth.config fails rather than blank screen, useful as part of self-hosted setup in particular 2022-03-12 16:17:29 -08:00
Tom Moor
631d600920 feat: File attachments (#3031)
* stash

* refactor, working in non-collab + collab editor

* attachment styling

* Avoid crypto require in browser

* AttachmentIcon, handling unknown types

* Do not allow attachment creation for file sizes over limit

* Allow image as file attachment

* Upload placeholder styling

* lint

* Refactor: Do not use placeholder for file attachmentuploads

* Add loading spinner

* fix: Extra paragraphs around attachments on insert

* Bump editor

* fix build error

* Remove attachment placeholder when upload fails

* Remove unused styles

* fix: Attachments on shared pages

* Merge fixes
2022-03-06 13:58:58 -08:00
Tom Moor
c2889950d5 i18n 2022-03-02 21:12:44 -08:00
Tom Moor
4c138ed585 feat: Add "new doc" button on collections in sidebar (#3174)
* feat: Add new icon button on collections in sidebar, move sort into menu

* Remove unused menu, add warning when dragging in a-z collection

* fix: Add hover background to sidebar actions, add tooltip to new doc button

* Retain 'active' state on buttons when related context menu is open

* fix: Two more spots that deserve active background
2022-02-26 11:48:32 -08:00
Saumya Pandey
4c95674ef0 fix: Add ability to collapse and expand collections that are not active (#3102)
* fix: add disclosure and transition

* fix: keep collections expanded

* fix: tune transition and collapsing conditions

* fix: collectionIcon expanded props is no longer driven by expanded state

* fix: sync issue

* fix: managing state together

* fix: remove comment

* fix: simplify expanded state

* fix: remove extra state

* fix: remove animation and retain expanded state

* fix: remove isCollectionDropped

* fix: don't use ref

* review suggestions

* fix many functional and design issues

* don't render every single document in the sidebar, just ones that the user has seen before

* chore: Sidebar refinement (#3154)

* stash

* wip: More sidebar tweaks

* Simplify draft bubble

* disclosure refactor

* wip wip

* lint

* tweak menu position

* Use document emoji for starred docs where available

* feat: Trigger cmd+k from sidebar (#3149)

* feat: Trigger cmd+k from sidebar

* Add hint when opening command bar from sidebar

* fix: Clicking internal links in shared documents sometimes reroutes to Login

* fix: Spacing issues on connected slack channels list

* Merge

* fix: Do not prefetch JS bundles on public share links

* fix: Buttons show on collection empty state when user does not have permission to edit

* fix: the hover area for the "collections" subheading was being obfuscated by the initial collection drop cursor

* fix: top-align disclosures

* fix: Disclosure color PR feedback
fix: Starred no longer draggable

* fix: Overflow on sidebar button

* fix: Scrollbar in sidebar when command menu is open

* Minor alignment issues, clarify back in settings sidebar

* fix: Fade component causes SidebarButton missizing

Co-authored-by: Nan Yu <thenanyu@gmail.com>

Co-authored-by: Tom Moor <tom.moor@gmail.com>
Co-authored-by: Nan Yu <thenanyu@gmail.com>
2022-02-23 21:26:38 -08:00
Tom Moor
a24cb9987c fix: Do not prefetch JS bundles on public share links 2022-02-22 21:02:38 -08:00
Tom Moor
f244e864e1 fix: Clicking internal links in shared documents sometimes reroutes to Login 2022-02-22 20:14:07 -08:00
Tom Moor
63265b49ea feat: Trigger cmd+k from sidebar (#3149)
* feat: Trigger cmd+k from sidebar

* Add hint when opening command bar from sidebar
2022-02-22 20:13:56 -08:00
Saumya Pandey
5db73726f7 fix: create a generic notice component (#3144)
* fix: use unstable_fixed option

* fix: add icons in notice

* fix: create generic Notice component

* Refactor: Pull document notices into component

Co-authored-by: Tom Moor <tom.moor@gmail.com>
2022-02-19 11:05:56 -08:00
Tom Moor
34c5b60656 i18n 2022-02-18 18:23:26 -08:00
Tom Moor
6815269372 fix: Regular clipping of metadata on pinned documents #critfeedback 2022-02-18 16:55:29 -08:00
Tom Moor
b9c7694b21 Updated placeholders, minor editor tweaks 2022-02-18 08:42:24 -08:00
Tom Moor
d7ee801fe4 feat: Show icon on external links (#3100)
* feat: External links get treatment

* cache decorations
2022-02-16 18:05:02 -08:00
Saumya Pandey
42061edbd1 feat: add the ability to choose default collection (#3029)
Co-authored-by: Tom Moor <tom@getoutline.com>
Co-authored-by: Tom Moor <tom.moor@gmail.com>
2022-02-10 10:06:10 +05:30
Tom Moor
d643c9453e feat: Import improvements (#3064)
* feat: Split and simplify import/export pages in prep for more options

* minor fixes

* File operations for imports

* test

* icons
2022-02-06 22:29:24 -08:00
Nan Yu
735aaa668a fix: add toc to mobile views and account for branding on shared view layouts (#2997)
* fix: add toc to mobile views and center the branding

* add padding to bottom of sidebar

* put the mobile branding inline

* finesse the padding

* make spelling of sign-in email less crazy looking

* move mobile sidebar button into header

* adds scene to search and 404 pages

* fix title alignment

* make filter buttons tight

* clean up unused imports

* lint

Co-authored-by: Tom Moor <tom.moor@gmail.com>
2022-02-01 20:58:24 -08:00
Tom Moor
26c73116b0 fix: Prevent navigation of document history in trash, closes #2995 2022-01-28 21:44:42 -08:00