Commit Graph

775 Commits

Author SHA1 Message Date
Tom Moor 7dd0616b8c fix: Remote table modifications cause CellSelection to be lost (#9596)
* fix: Table modifications lose any existing CellSelection

* tsc

* doc

* Remove unused imports
2025-07-10 08:46:08 -04:00
Tom Moor 6dfc75f090 perf: Some small performance improvements in SearchHelper (#9580) 2025-07-08 22:19:02 +00:00
Tom Moor a6b0fcff48 feat: Add OTP sign-in for PWA (#9556)
* wip

* wip

* wip

* Only use code for desktop and PWA
2025-07-07 18:36:43 -04:00
Newton d36f98bc9e disable search engine indexing for documents by default (#9551) 2025-07-05 22:17:55 -04:00
Tom Moor 0589f62bde fix: Make shared document content available to screenreaders (#9549) 2025-07-04 16:45:21 -04:00
Andy Copland 50fe0bb746 fix: Add OAuth support to search query source enum (#9511)
- Add 'oauth' to SearchQuery enum in server and client models
- Add database migration to include 'oauth' in enum_search_queries_source
- Fixes 400 validation error when OAuth users search with parameters

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-07-01 03:37:25 -04:00
codegen-sh[bot] 879c568a2c Upgrade Prettier to v3.6.2 (#9500)
* Upgrade Prettier to v3.6.2 and eslint-plugin-prettier to v5.5.1

- Upgraded prettier from ^2.8.8 to ^3.6.2 (latest version)
- Upgraded eslint-plugin-prettier from ^4.2.1 to ^5.5.1 for compatibility
- Applied automatic formatting changes from new Prettier version
- All existing ESLint and Prettier configurations remain compatible

* Applied automatic fixes

* Trigger CI

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
2025-06-28 10:22:28 -04:00
Tom Moor ca5c51a712 fix: Client and server validation differ for subdomains (#9468)
* fix: Client and server validation differ for subdomains

* Validation message

* Lower min subdomain length to 2
2025-06-18 16:50:17 -04:00
Tom Moor 75f173c6ff Add option to publish but not persist events (#9448)
* Add option to publish but not persist events

* tsc
2025-06-14 10:46:01 -04:00
Tom Moor a9c4dd43d6 fix: options vs rest usage (#9431)
No functional difference here, just avoid extra passed attributes
2025-06-11 20:04:43 -04:00
Tom Moor e4917cc4bd fix: Ensure notification relationships are loaded in EmailProcessor (#9426) 2025-06-10 21:19:28 -04:00
Tom Moor 0f4c1d7db5 fix: Regression in collections.info endpoint disallowed find by urlId (#9423) 2025-06-10 18:21:39 -04:00
codegen-sh[bot] c2069db882 Migrate Backlink model to Relationship (#9370)
* Migrate Backlink model to generic Relationship model

- Create new Relationship model with type field to support different relationship types
- Add database migration to create relationships table and migrate existing backlinks
- Update Backlink model to delegate to Relationship model for backward compatibility
- Update BacklinksProcessor to use Relationship model with backlink type
- Update API routes to use new Relationship model
- Update test files to use Relationship model
- Maintain backward compatibility through database view and model delegation

Fixes #9366

* Update migration to rename table instead of creating new one

- Rename existing backlinks table to relationships instead of creating new table
- Add type column with default value to existing table
- Update existing rows to have type='backlink'
- Avoid expensive data migration by keeping existing data in place
- Maintain backward compatibility with database view
- Update rollback to reverse table rename and column addition

This approach is much more efficient for large datasets as it avoids copying millions of rows.

* Remove unnecessary UPDATE statement from migration

The UPDATE statement is not needed since defaultValue automatically
applies to existing rows when adding a column with a default value.

Thanks @tommoor for catching this!

* Wrap up migration in transaction

- Wrap all migration operations in a transaction for atomicity
- Add transaction parameter to all queryInterface calls
- Follow the same pattern as other migrations in the codebase
- Ensures all operations succeed or fail together

* Remove Backlink class entirely and use Relationship everywhere

- Delete server/models/Backlink.ts
- Remove Backlink export from server/models/index.ts
- Remove Backlink import and association from Document model
- All functionality now uses Relationship model with RelationshipType.Backlink
- Maintains same API through Relationship model methods
- Cleaner architecture with single relationship model

* Update documents.test.ts to use RelationshipType enum instead of string

- Import RelationshipType from Relationship model
- Replace type: "backlink" with type: RelationshipType.Backlink
- Improves type safety and consistency with enum usage

* Address code review feedback

- Add transaction wrapper to migration down method for safer rollback
- Remove unused findByTypeForUser method from Relationship model
- Method wasn't used and won't work for all relationship types (e.g., user mentions)
- Clean up code structure and improve safety

* Restore imports

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
2025-06-07 15:50:33 -04:00
codegen-sh[bot] 758d4edbb9 Upgrade @typescript-eslint dependencies to v8.33.0 (#9363)
* Upgrade @typescript-eslint dependencies from v6.21.0 to v8.33.0

- Updated @typescript-eslint/eslint-plugin from ^6.21.0 to ^8.33.0
- Updated @typescript-eslint/parser from ^6.21.0 to ^8.33.0
- Tested linting functionality to ensure compatibility
- This brings the latest TypeScript ESLint features and bug fixes

* lint

* tsc

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
2025-06-01 11:01:15 -04:00
codegen-sh[bot] 76bd503581 Add description setting for workspaces (#9345)
* Add team description column and settings

- Add database migration to add description column to teams table
- Update server-side Team model with description field and validation
- Update client-side Team model to include description field
- Add description input field to team settings page
- Update renderApp to use team description in HTML metadata when public branding is enabled

* Applied automatic fixes

* tweaks

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
2025-05-31 13:53:42 -04:00
codegen-sh[bot] 7a5480f12f Add option to show modified timestamp on shared docs (#9347)
* Add showLastModified option to Share models

- Add showLastModified column to shares table with migration
- Add showLastModified field to client and server Share models
- Add 'Show last modified' toggle in share popover (PublicAccess component)
- Update shares.update API route to handle showLastModified field
- Include share data in documents.info API response for shared documents
- Modify DocumentMeta visibility logic to show timestamp when showLastModified is enabled
- Add proper type definitions across component hierarchy
- Follow existing patterns used by allowIndexing option

* Applied automatic fixes

* refactor

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
2025-05-31 11:29:55 -04:00
codegen-sh[bot] caaff1c3d6 Add order parameter to addDocumentToStructure function (#9342)
* Add order parameter to addDocumentToStructure function

- Add 'order' parameter with 'prepend' | 'append' options to Collection.addDocumentToStructure
- Update import logic to use 'append' order to preserve document sorting during import
- Fixes issue where exported documents lose their sorting when re-imported
- Maintains backward compatibility by defaulting to append behavior

Fixes #7532

* Fix TypeScript error: rename order parameter to insertOrder

The 'order' parameter in addDocumentToStructure was conflicting with
Sequelize's FindOptions.order property, causing a type intersection
error. Renamed it to 'insertOrder' to avoid the conflict.

Fixes TypeScript compilation errors in:
- server/queues/processors/ImportsProcessor.ts
- server/queues/tasks/ImportTask.ts

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
2025-05-30 20:45:11 -04:00
codegen-sh[bot] 2686e059a0 Fix URL duplication in shared documents with custom static URLs (#9340)
Fixes issue where internal document links in shared documents with custom
static URLs would have their share path duplicated, causing malformed URLs.

The bug was in ProsemirrorHelper.replaceInternalUrls() where the replaceUrl
function would replace ALL occurrences of '/doc/' with 'basePath/doc/',
even when the URL already contained the correct share path structure.

Now only URLs that start with '/doc/' get the basePath prepended, preventing
duplication for URLs that already have the share path.

Fixes #9338

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
2025-05-30 19:05:21 -04:00
codegen-sh[bot] 11cff77162 Add installation.create API endpoint (#9324)
* Add installation.create API endpoint

- Add new endpoint that accepts teamName, userName, userEmail
- Use accountProvisioner to create team and user
- Only allow when no existing teams exist (unauthenticated)
- Add comprehensive tests for success, failure, and validation cases
- Add schema validation with Zod
- Include rate limiting (5 per hour)
- Follow existing API patterns and conventions

* Remove changes to .env.test

* fix

* Centralize validation

* test

* test

* test

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
2025-05-29 22:52:49 -04:00
codegen-sh[bot] c02a33a74c feat: Disable commenting per collection (#9295)
* Address PR feedback: Move commenting logic to Collection model

- Update openDocumentComments action to use collection.canCreateComment
- Update AuthenticatedLayout to check collection-level commenting setting
- Update DocumentMeta to use collection commenting preference
- Add commenting field to CollectionForm with proper UI
- Maintain backward compatibility with team-level preferences

* Applied automatic fixes

* Disable comment creation UI when collection commenting is disabled

- Update Editor component to use collection-level commenting setting
- Pass onCreateCommentMark as undefined when commenting is disabled
- This removes the shortcut and toolbar icon for comment creation
- Maintains backward compatibility with team-level preferences

* Fix TypeScript error in Editor component

- Fix props destructuring to avoid variable shadowing
- Ensure all required props are properly destructured
- Maintain correct property order from original implementation

* Fix TypeScript error: add missing activeCollectionId parameter

- Add activeCollectionId to import document action perform function
- This parameter was being used but not declared in the function signature
- Fixes TS2304 error: Cannot find name 'activeCollectionId'

* fix form

* docs

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
2025-05-24 18:35:50 -04:00
Tom Moor 5b7a5d751c Fix: Properly escape backslashes in search queries (#9297)
* Fix: Properly escape backslashes in search queries

This commit fixes a bug where backslashes in search queries were not properly escaped, leading to database errors.
The `escapeQuery` method is now applied to quoted queries and URLs to ensure that all parts of the search query are correctly escaped.

A test case has been added to verify that searching with backslashes works as expected.

* Fix: Properly escape backslashes in search query URLs

This commit fixes a bug where backslashes in URLs within search queries were not properly escaped, leading to database errors.
The `escapeQuery` method is now applied to `likelyUrls` before they are used in `iLike` conditions.

Quoted queries were found to be already escaped and are no longer double-escaped.
The existing test case for searching with backslashes remains relevant for verifying URL escaping.

* lint

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-05-24 11:30:00 -04:00
Tom Moor 3ffee1239b Add revision deletion endpoints (#9240) 2025-05-21 22:57:02 -04:00
codegen-sh[bot] 3bc566915e Fix document URL generation for titles with only special characters (#9258)
* Fix document URL generation for titles with only special characters

* Refactor: Update instance path method to use static getPath method

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
2025-05-20 07:32:07 -04:00
Tom Moor 201fbb56eb perf: Add cache for document structure (#9196)
* Normalize Collection.findByPk

* Add caching of documentStructure

* fix: Do not set cache before transaction is flushed

* Mock Redis
2025-05-18 18:45:00 -04:00
codegen-sh[bot] e5ded0a6a5 Fix misalignment between email and comment mentions (#9234)
* Fix misalignment between email and comment mentions

* Add test

* Update ProsemirrorHelper.tsx

* Optimize user mention processing with batch loading

* Add test for multiple mentions

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
2025-05-17 12:45:45 -04:00
Hemachandar 052924d816 Resolve index collision when restoring collection (#9229)
* Resolve index collision when restoring collection

* use beforeUpdate hook
2025-05-16 23:56:46 -04:00
Hemachandar 610721eed6 fix: Ensure collection withUser scope is not overriden (#9226) 2025-05-16 08:16:25 -04:00
Tom Moor 08b7c11461 Normalize Collection.findByPk (#9193) 2025-05-14 00:05:45 -04:00
Tom Moor 2d6167e933 fix: Add encoding meta tag to exported HTML (#9207)
closes #9194
2025-05-13 22:47:48 -04:00
Tom Moor 68b07eb466 fix: withoutState scope should include state as fallback (#9145) 2025-05-07 18:49:33 -04:00
Tom Moor 06a149407a fix: withoutState scope should include state as fallback (#9144) 2025-05-07 09:00:42 -04:00
Tom Moor b9387734c7 perf: Remove documentStructure from default query select (#9141)
* perf: Remove documentStructure from default query select

* test
2025-05-07 07:47:57 -04:00
Tom Moor 3f8bdf7ac2 Refactor withMembershipScope (#9134) 2025-05-04 18:37:01 -04:00
Tom Moor 9c4b4f4989 fix: Chained scopes overwrite (#9133) 2025-05-04 22:16:38 +00:00
Tom Moor a06671e8ce OAuth provider (#8884)
This PR contains the necessary work to make Outline an OAuth provider including:

- OAuth app registration
- OAuth app management
- Private / public apps (Public in cloud only)
- Full OAuth 2.0 spec compatible authentication flow
- Granular scopes
- User token management screen in settings
- Associated API endpoints for programatic access
2025-05-03 19:40:18 -04:00
Tom Moor fd3c21d28b Remove withCollectionPermissions scope (#9124)
* Remove withCollectionPermissions scope

* defaultScopeWithUser -> withUserScope

* fix: Include withDrafts in groupMemberships.list

* rename
2025-05-03 12:00:54 -04:00
codegen-sh[bot] a226889143 Update task scheduling to use instance method (#9092)
* Update task scheduling to use instance method

* Delete update_task_schedule.sh

* Applied automatic fixes

* tsc

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
2025-04-29 06:47:51 -04:00
Tom Moor 347f033802 fix: Notifications received for draft with access but no subscription (#9099) 2025-04-29 06:45:15 -04:00
Tom Moor 7e05fc1017 Revert "Add recency boost to search results (#9038)" (#9065)
This reverts commit 2bc47cfcef.
2025-04-26 16:44:49 +00:00
Tom Moor 2bc47cfcef Add recency boost to search results (#9038)
* Add recency boost to search helpers

* Restore tests

* Use boost
2025-04-26 08:27:45 -04:00
Tom Moor 01db19a0b1 fix: Cannot load avatars in some instances (#9025) 2025-04-22 21:23:51 -04:00
Hemachandar 51cb5bffce Cache issueSources for embed integrations (#8952)
* Cache `issueSources` for embed integrations

* lock model before update
2025-04-22 09:59:39 -04:00
Tom Moor 09a4b76aae fix: Users subscribed to document and collection may be notified twice (#8997)
fix: Create notifications in transaction
2025-04-17 08:08:09 -04:00
Hemachandar bf6a56849e Show GitHub issues and pull requests as mentions (#8870)
* mention issue works

* pr and loading works

* error node

* tweak mention display

* handle multiple creation error

* tidy

* store unfurl in mention attrs

* simplify mention code creation

* test fix

* base feedback

* update node when pos is available

* delete local UnfurlsStore

* use unfurl from store

* Optimize lodash isMatch import statement

* fix: Copy/paste of issue mentions
fix: Icon alignment
fix: Error and loading mentions are unselectable

* Switch order in paste menu

---------

Co-authored-by: Tom Moor <tom@getoutline.com>
2025-04-13 06:09:13 -07:00
Hemachandar e499881110 fix: Update collection 'documentStructure' when archived document is deleted (#8922) 2025-04-10 18:11:30 -07:00
Tom Moor fe8e50da92 fix: Remove url->embed mapping in Markdown import (#8891) 2025-04-07 00:43:18 +00:00
Tom Moor ca0f0638c9 fix: Handle deleted user in NotificationHelper (#8835) 2025-03-29 19:11:04 -07:00
Hemachandar dcb7b86df8 Store import error in DB (#8811) 2025-03-29 06:08:07 -07:00
Tom Moor 66fae19034 fix: Improve performance of notification queries (#8809)
* Remove onlySubscribers

* refactor

* perf
2025-03-27 19:10:32 -07:00
Hemachandar 877b7ad0df fix: Handle index collision when creating a collection (#8803)
* fix: Handle index collision when creating a collection

* move to sequelize hooks

* index maxLen parity between api and model

* remove beforeUpdate hook

* use common indexLen in model

* beforeUpdate hook..

* test
2025-03-27 02:50:40 -07:00