* 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
* tidy
* Add title to HTML export
* fix: Add compatability for documents without collab state
* Add HTML download option to UI
* docs
* fix nodes that required document to render
* Refactor to allow for styling of HTML export
* div>article for easier programatic content extraction
* Allow DocumentHelper to be used with Revisions
* Add revisions.diff endpoint, first version
* Allow arbitrary revisions to be compared
* test
* HTML driven revision viewer
* fix: Dark mode styles for document diffs
* Add revision restore button to header
* test
* Support RTL languages in revision history viewer
* fix: RTL support
Remove unneccessary API requests
* Prefetch revision data
* Animate history sidebar
* fix: Cannot toggle history from timestamp
fix: Animation on each revision click
* Clarify currently editing history item
* Improving the urls utils to not break dynamic protocols and testing the utils
Signed-off-by: iifawzi <iifawzie@gmail.com>
* Adding a list of blocked protocols
Signed-off-by: iifawzi <iifawzie@gmail.com>
* Update the way of sanitizing blocked protocols
Signed-off-by: iifawzi <iifawzie@gmail.com>
* Update shared/utils/urls.ts
Javascript pseudo protocol does not require the //
Co-authored-by: Tom Moor <tom.moor@gmail.com>
* updating the javascript protocol sanitizing tests
Signed-off-by: iifawzi <iifawzie@gmail.com>
* Update shared/utils/urls.test.ts
Co-authored-by: Apoorv Mishra <apoorvmishra101092@gmail.com>
* Update shared/utils/urls.ts
Co-authored-by: Apoorv Mishra <apoorvmishra101092@gmail.com>
* Using toBe instead of toEqual in tests
Signed-off-by: iifawzi <iifawzie@gmail.com>
* Sanitizing data: and vbscript:
Signed-off-by: iifawzi <iifawzie@gmail.com>
* Using toBeUndefined instead of toEqual in tests
Signed-off-by: iifawzi <iifawzie@gmail.com>
* Using URL to check the protocols
Signed-off-by: iifawzi <iifawzie@gmail.com>
* Allowing sms, fax, and tel protocols
Signed-off-by: iifawzi <iifawzie@gmail.com>
* Update shared/utils/urls.ts
inlining the protocols in the same file
Co-authored-by: Tom Moor <tom.moor@gmail.com>
* removing unused protocols constant
Signed-off-by: iifawzi <iifawzie@gmail.com>
Signed-off-by: iifawzi <iifawzie@gmail.com>
Co-authored-by: Tom Moor <tom.moor@gmail.com>
Co-authored-by: Apoorv Mishra <apoorvmishra101092@gmail.com>
* wip
* stash
* fix: make authenticationId nullable fk
* fix: apply generics to resolve compile time type errors
* fix: loosen integration settings
* chore: refactor into functional component
* feat: pass integrations all the way to embeds
* perf: avoid re-fetching integrations
* fix: change attr name to avoid type overlap
* feat: use hostname from embed settings in matcher
* Revert "feat: use hostname from embed settings in matcher"
This reverts commit e7485d9cda4dcf45104e460465ca104a56c67ddc.
* feat: refactor into a class
* chore: refactor url regex formation as a util
* fix: escape regex special chars
* fix: remove in-house escapeRegExp in favor of lodash's
* fix: sanitize url
* perf: memoize embeds
* fix: rename hostname to url and allow spreading entire settings instead of just url
* fix: replace diagrams with drawio
* fix: rename
* fix: support self-hosted and saas both
* fix: assert on settings url
* fix: move embed integrations loading to hook
* fix: address review comments
* fix: use observer in favor of explicit state setters
* fix: refactor useEmbedIntegrations into useEmbeds
* fix: use translations for toasts
Co-authored-by: Tom Moor <tom.moor@gmail.com>
* make the user lookup in user creator sensitive to team
* add team specific logic to oidc strat
* factor out slugifyDomain
* change type of req during auth to Koa.Context
* feat: allow personal gmail accounts to be used to sign into teams with an existing invite
* address comments
* add comment for appDomain
* address comments
* change the api of domain parsing to just parseDomain and getCookieDomain
* adds getBaseDomain as the method to get the domain after any official subdomains
* Allow Document to be fetched without Slug
Fixes#3423
This PR refactors the `Document.findByPk` method to not require the
`slug` portion of the urlID.
Before this function accepted two different 'formats' for the ID.
- The `uuid` ID of the Document
- The full `urlID` which looked something like
`some-document-1234567890`
However the `some-document` slug portion of this identifier wasn't
actually used when looking for a document.
We now allow searching by JUST the postfix of the `urlID`, in the above
example that is `1234567890`.
We do this via a new Regex pattern to match on that just looks for the
right looking id alone, without the prefix.
This codepath looks the same as when we find it by the full `urlID`
besides the different regex that we match on.
The issue #3423 mentions that this should apply to all the API
endpoints. I believe that this `findByPk` method is all that should be
needed for that change. But if this is incorrect, OR you would like more
test coverage on the API endpoints as a more 'end to end test' please
let me know!
* Change original regex to make the slug optional
This has the, I believe to be good, side-effect of making the same logic
apply to `Collection` as well. Since `Collection` was always doing the
same stripping of the slug before the lookup I believe it should be just
as safe to do there.
We don't have to touch the code in Collections but we add a test of this
behavior there as well.
* No reason to rename this now that we aren't doing two matches
Remove menu hover styles on mobile
Fixed duplicate hover+active behavior on editor menus
Fixed editor menus visibly scroll to the top when reopened
Fixed some minor editor spacing issues
Renamed shred routeHelpers -> urlHelpers
This PR moves the entire project to Typescript. Due to the ~1000 ignores this will lead to a messy codebase for a while, but the churn is worth it – all of those ignore comments are places that were never type-safe previously.
closes#1282