Commit Graph

199 Commits

Author SHA1 Message Date
Mohamed ELIDRISSI
0976e85a1a refactor: add server side validation schema for authProviders (#4876)
* refactor: move files to subfolder

* refactor: schema for authenticationProviders.info

* refactor: schema for authenticationProviders.update

* refactor: use validated body
2023-02-14 14:49:24 -08:00
Tom Moor
60101c507a Move bulk of webhook logic to plugin (#4866)
* Move bulk of webhook logic to plugin

* Re-enable cleanup task

* cron tasks
2023-02-12 16:28:11 -08:00
Tom Moor
33afa2f029 Plugin architecture (#4861)
* wip

* Refactor, tasks, processors, routes loading

* Move Slack settings config to plugin

* Fix translations in plugins

* Move Slack auth to plugin

* test

* Move other slack-related files into plugin

* Forgot to save

* refactor
2023-02-12 10:11:30 -08:00
Mohamed ELIDRISSI
492beedf00 refactor: add server side validation schema for apiKeys (#4859)
* refactor: add tests for apiKey api routes

* refactor: move files to subfolder

* refactor: schema for apiKeys.create and apiKeys.delete
2023-02-11 15:02:52 -08:00
Tom Moor
bb6f4b1c1e fix: Attachment converted to links when AWS ACL is public-read, closes #4853 2023-02-10 17:42:09 -05:00
Tom Moor
534eeacc97 fix: Documents with images exported as HTML have broken images
closes #4822
2023-02-04 14:04:38 -05:00
dependabot[bot]
8f166ca775 chore(deps-dev): bump jest-cli from 28.1.3 to 29.4.1 (#4805)
* chore(deps-dev): bump jest-cli from 28.1.3 to 29.4.1

Bumps [jest-cli](https://github.com/facebook/jest/tree/HEAD/packages/jest-cli) from 28.1.3 to 29.4.1.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v29.4.1/packages/jest-cli)

---
updated-dependencies:
- dependency-name: jest-cli
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Snapshots

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom.moor@gmail.com>
2023-01-30 20:17:09 -08:00
Tom Moor
f39487d25b fix: PaginatedList does not always load more (#4811) 2023-01-30 19:53:14 -08:00
Tom Moor
075555a867 fix: Do not show actively disabled auth providers in self-hosted install (#4794)
* fix: Do not show actively disabled auth providers in self-hosted installation

* self review

* Refactor for easier mocking
2023-01-28 10:02:25 -08:00
Apoorv Mishra
6b286d82b8 Ability to choose publish location for a document (#4582)
* feat: initial base structure

* feat: utils for constructing and flattening collection tree

* feat: basic demo to display tree-like structure with virtualization

* feat: make it searchable

* feat: row component

* fix: handle row selection

* fix: scroll jitter

* fix: popover max-height to eliminate extra scroll

* fix: position scrollbar correctly

* fix: do not sort to maintain correct tree-like view

* feat: footer

* fix: scroll to selected item

* fix: deselect item

* fix: display selected location in footer

* fix: deselect item if any upon search trigger

* fix: create draft without collection

* fix: pass down collectionId to all the nodes

* feat: publish document under selected location

* fix: move the doc post publish in case it is supposed to be a nested doc

* fix: wrap text for selected location

* fix: footer background in dark mode and unused css

* fix: popover height in small devices

* fix: no need to spread

* refactor: remove outline

* refactor: border-radius is common

* refactor: remove active and focus

* fix: do not shrink spacer

* fix: scroll list padding with correctly adjusted scrolling

* refactor: use constants

* fix: use padding in favor of spacer

* refactor: border attrs not needed

* refactor: control title padding and icon size centrally

* fix: rename param

* fix: import path

* fix: refactor styles, avoid magic numbers

* fix: type err

* feat: make rows collapsible

* fix: fully expanded without disclosure upon search

* fix: use modal in place of popover

* fix: collapse descendants

* fix: rename PublishPopover to PublishModal

* fix: adjust collapse icon as part of tree view

* fix: enable keyboard navigation

* not sure why collapse and expand shortcuts are not working

* fix: row expansion and search box focus and blur

* fix: remove css hover, handle it via active prop

* fix: discard tree like view for search results

* fix: minor tweaks

* refactor: no need to pass onPublish

* refactor: remove unnecessary attrs from search component

* fix: publish button text

* fix: reset intial scroll offset to 0 on search

* fix: remove search highlights

* fix: clean up search component

* refactor: search and row collapse

* refactor: PublishLocation

* fix: show emoji or star icon if present

* fix: shift focus only from top item

* fix: leading emoji

* fix: baseline text

* fix: make path tertiary

* fix: do not show path for collections

* fix: path text color upon selection

* fix: deleted collection case

* fix: no results found

* fix: space around slash

* Refinement, some small refactors

* fix: Publish shortcut, use Button action

* Allow new document creation from command menu without active collection

* fix: duplicate

* fix: Unneccessary truncation

* fix: Scroll on expand/collapse
Remove wraparound

* fix: tsc

* fix: Horizontal overflow on PublishLocation
Remove pointless moveTo method

* fix: Missing translation

* Remove method indirection
Show expanded collection icon in tree when expanded

* Shrink font size a point

* Remove feature flag

* fix: Path color contrast in light mode
Remove unused expanded/show attributes

* shrink -> collapse, fix expanded disclosure without items after searching

* Mobile styles

* fix: scroll just into view

Co-authored-by: Tom Moor <tom.moor@gmail.com>
2023-01-23 17:38:24 -08:00
Tom Moor
788450136e test: documents.update apiVersion 2 response 2023-01-15 09:43:56 -05:00
Tom Moor
0c269081d9 fix: Sidebar jumps when publish or unpublish document (#4706)
* Return updated collection in API response for documents.unpublish and documents.update
Allows for improved UX on clientside

* test

* tsc

* tsc
2023-01-15 06:01:06 -08:00
Tom Moor
e347404502 chore: Improvements to document move behavior (#4689)
* chore: Improvements to document move behavior

* test
2023-01-12 18:48:09 -08:00
Tom Moor
17a8dbb3f0 fix: Prevent moving documents into drafts 2023-01-12 11:15:54 -05:00
Tom Moor
785b9888dd Respond to slack url verification challenge with JSON instead of raw body 2023-01-11 09:07:15 -05:00
Tom Moor
53414ec3ba feat: Server side translation setup (#4657)
* Server side translation setup

* docs
2023-01-07 11:52:09 -08:00
Tom Moor
9f825b9adf fix: Allow sort by title in documents.list 2023-01-06 16:58:39 -05:00
Apoorv Mishra
b6141442b7 Validate API request query (#4642)
* fix: refactor to accommodate authentication, transaction and pagination together into ctx.state

* feat: allow passing response type to APIContext

* feat: preliminary work for initial review

* fix: use unknown for base types

* fix: api/attachments

* fix: api/documents

* fix: jsdoc comment for input

* fix: replace at() with index access for compatibility

* fix: validation err message

* fix: error handling

* fix: remove unnecessary extend
2023-01-05 20:24:03 +05:30
Tom Moor
445d19f43e chore: Extract product name from translation strings (#4646) 2023-01-04 19:00:57 -08:00
Apoorv Mishra
f4461573de Refactor to accommodate authentication, transaction and pagination states together (#4636)
* fix: refactor to accommodate authentication, transaction and pagination together into ctx.state

* feat: allow passing response type to APIContext
2023-01-04 23:51:44 +05:30
Tom Moor
eb50c9e1f1 test: Remove tests associated with exporting documents from shareId 2023-01-03 22:49:02 -05:00
Tom Moor
1c9eee2134 fix: Search on shared documents with custom slug not working
fix: Should not be able to export a document with shareId
2023-01-03 19:28:04 -05:00
Tom Moor
8e4270c321 feat: Add GA integration, support for GA4 (#4626)
* GA integration settings

* trackingId -> measurementId
Hook up script

* Public page GA tracking
Correct layout of settings

* Remove multiple codepaths for loading GA measurementID, add missing db index

* Remove unneccessary changes, tsc

* test
2023-01-01 07:29:08 -08:00
Mohamed ELIDRISSI
dc795604a4 refactor: add server-side validation schema for events (#4622)
* refactor: move files to subfolder

* refactor: schema for events.list

* refactor: update nullable fields in Event model

* fix: event actor not nullable

* fix: team not nullable
2022-12-31 13:56:37 -08:00
Tom Moor
05a4f050bb chore: Improve graceful server shutdown (#4625)
* chore: Improve graceful server shutdown

* Replace node timers with custom promise timeout
2022-12-31 13:56:27 -08:00
Tom Moor
7a1e6a1b73 feat: Bulk HTML export for collection 2022-12-30 20:13:29 -05:00
Mohamed ELIDRISSI
318e1df13b refactor: add server side validation schema for attachments (#4606)
* refactor: schema for attachments.create

* refactor: schema for attachments.delete

* refactor: remove deprecated "public" request param
2022-12-30 09:49:01 -08:00
Tom Moor
f3469d25fe feat: Bulk HTML export (#4620)
* wip

* Working bulk html export

* Refactor

* test

* test
2022-12-30 09:42:20 -08:00
Tom Moor
1b8dd9399c chore: Export improvements (#4617)
* wip

* i18n
2022-12-27 09:51:39 -08:00
Tom Moor
82c565f1d4 Add additional filters to search_titles endpoint (#4563)
* Add additional filters to search_titles endpoint

* tests, fixes for drafts

* fix: dateFilter results in 500

* fix: Draft documents returned in collection-only search
2022-12-24 03:44:22 -08:00
Apoorv Mishra
79829a3129 Ability to create share url slug (#4550)
* feat: share url slug

* feat: add col urlId

* feat: allow updating urlId

* fix: typo

* fix: migrations

* fix: urlId model validation

* fix: input label

* fix: debounce slug request

* feat: link preview

* fix: send slug variant in response if available

* fix: temporary redirect to slug variant if available

* fix: move up the custom link field

* fix: process and display backend err

* fix: reset custom link state on popover close and remove isCopied

* fix: document link preview

* fix: set urlId when available

* fix: keep unique(urlId, teamId)

* fix: codeql

* fix: get rid of preview type

* fix: width not needed for block elem

* fix: migrations

* fix: array not required

* fix: use val

* fix: validation on shareId and test

* fix: allow clearing urlId

* fix: do not escape

* fix: unique error text

* fix: keep team
2022-12-13 17:26:36 -08:00
Tom Moor
7e22526cc7 Improve error handling 2022-12-11 11:27:54 -05:00
Apoorv Mishra
5c842087a5 feat(server): rate limit all routes (#4561) 2022-12-10 05:47:18 -08:00
Apoorv Mishra
053d10d893 Enhance server side error handling (#4537)
* fix: server side error handling

* fix: push only unknown 500 errors to sentry

* fix: use in-house onerror in favor of errorHandling middleware

* fix: split error template into dev and prod envs

* fix: check Error instance

* fix: error routes in test env

* fix: review comments

* Remove koa-onerror

Co-authored-by: Tom Moor <tom.moor@gmail.com>
2022-12-09 21:51:42 +05:30
Tom Moor
4ce8ea8cd6 fix: Cannot create document from selection in root of collection 2022-12-06 09:10:45 -05:00
Tom Moor
b0b7c7d647 fix: Document import schema 2022-12-04 22:31:54 -05:00
Tom Moor
08a471f230 Add 'members' filter to user details page, closes #4529 2022-12-03 09:36:28 -05:00
Tom Moor
63cef45284 fix: documents endpoints allow slug as id parameter 2022-11-29 22:16:46 -05:00
Apoorv Mishra
d09c583c72 Allow document to be dragged to the top of a collection (#4489) 2022-11-28 05:42:58 -08:00
Tom Moor
d22b44dcff Further improved search matches 2022-11-27 10:46:54 -05:00
Apoorv Mishra
a6125be6f1 Introduce zod for server-side validations (#4397)
* chore(server): use zod for validations

* fix(server): use ctx.input for documents.list

* fix(server): schema for documents.archived

* fix(server): documents.deleted, documents.viewed & documents.drafts

* fix(server): documents.info

* fix(server): documents.export & documents.restore

* fix(server): documents.search_titles & documents.search

* fix(server): documents.templatize

* fix(server): replace nullish() with optional()

* fix(server): documents.update

* fix(server): documents.move

* fix(server): remaining

* fix(server): add validation for snippet min and max words

* fix(server): fix update types

* fix(server): remove DocumentSchema

* fix(server): collate duplicate schemas

* fix: typos

* fix: reviews

* chore: Fixed case of Metrics import

* fix: restructure /api

* fix: loosen validation for id as it can be a slug too

* Add test for query by slug
Simplify import

Co-authored-by: Tom Moor <tom.moor@gmail.com>
2022-11-24 10:11:43 +05:30
Tom Moor
09f5462068 Enable viewers to upload attachments for documents in collections where they have edit permission (#4468) 2022-11-22 19:05:08 -08:00
Tom Moor
e605961e23 feat: Optional branding on shared documents (#4450)
* feat: Optional branding on shared documents

* Refactor
Remove unneccessarily exposed team id
Remove top-level collapsible document on publicly shared urls

* fix: Branding disappears when revising document
fix: Clicking title should go back to main app when logged in
2022-11-21 16:20:50 -08:00
Tom Moor
6e36ffb706 feat: Allow data imports larger than the standard attachment size (#4449)
* feat: Allow data imports larger than the standard attachment size

* Use correct preset for data imports

* Cleanup of expired attachments

* lint
2022-11-20 09:22:57 -08:00
Tom Moor
f43f253286 Refactoring endpoints to transaction middleware 2022-11-15 22:22:35 -05:00
Tom Moor
01a482552a fix: Unable to subscribe to fileOperation webhook events 2022-11-15 20:03:20 -05:00
Tom Moor
762341a4ec feat: Track attachments access (#4416) 2022-11-12 08:41:59 -08:00
Tom Moor
622f464b9f Store import<->document relationship (#4415)
* Store import<->document relationship

* Update 20221112152649-import-document-relationship.js

* Store importId on collection, UI tweaks on import screen
2022-11-12 08:22:41 -08:00
Tom Moor
587f062677 Remove usage of tiley (#4406)
* First pass

* Mooarrr

* lint

* snapshots
2022-11-08 17:12:22 -08:00
Tom Moor
f2fb5dd1e5 fix: Team creation with private avatar. Do not attempt to copy, closes #4378 2022-11-03 08:58:33 -04:00