Commit Graph

898 Commits

Author SHA1 Message Date
Catalin Pit
f520e0a7a6 chore: converting to kysely 2024-03-29 17:23:42 +02:00
Catalin Pit
462e1348a8 chore: test queries 2024-03-28 12:02:51 +02:00
Lucas Smith
7a689aecae feat: document super delete (#1023)
Added a dialog button at the bottom of the admin/documents/[id] page
with confirmation popup.

Confirmation popup have validation for reason to input.

On confirmation document is deleted, and an email is triggred to the
owner of document with the reason stated.

Let me know if there is any more requirement or correction is needed in
this pr. :) #1020
2024-03-28 14:15:06 +07:00
Lucas Smith
1c54f69a5a fix: build error from renaming 2024-03-28 07:01:57 +00:00
Lucas Smith
a56bf6a192 fix: update email template and tidy code 2024-03-28 06:55:01 +00:00
David Nguyen
a54eb54ef7 feat: add document auth (#1029) 2024-03-28 13:13:29 +08:00
Mythie
956562d3b4 fix: change flattening order 2024-03-27 23:05:40 +07:00
Mythie
b491bd4db9 fix: normalize and flatten annotations 2024-03-27 17:20:52 +07:00
Lucas Smith
ba30d4368d fix: build error 2024-03-27 03:37:13 +00:00
Lucas Smith
899205dde8 Merge branch 'main' into main 2024-03-27 10:11:53 +07:00
Rohit Saluja
9eaecfcef2 Merge branch 'main' of https://github.com/documenso/documenso into document-super-delete#1020 2024-03-26 20:44:47 +05:30
Rohit Saluja
26141050b7 fix: document super delete function calling 2024-03-26 20:42:33 +05:30
Rohit Saluja
5b4152ffc5 fix: updated the super delete file 2024-03-26 20:36:45 +05:30
David Nguyen
006b732edb fix: update document flow fetch logic (#1039)
## Description

**Fixes issues with mismatching state between document steps.**

For example, editing a recipient and proceeding to the next step may not
display the updated recipient. And going back will display the old
recipient instead of the updated values.

**This PR also improves mutation and query speeds by adding logic to
bypass query invalidation.**

```ts
export const trpc = createTRPCReact<AppRouter>({
  unstable_overrides: {
    useMutation: {
      async onSuccess(opts) {
        await opts.originalFn();

        // This forces mutations to wait for all the queries on the page to reload, and in
        // this case one of the queries is `searchDocument` for the command overlay, which
        // on average takes ~500ms. This means that every single mutation must wait for this.
        await opts.queryClient.invalidateQueries(); 
      },
    },
  },
});
```

I've added workarounds to allow us to bypass things such as batching and
invalidating queries. But I think we should instead remove this and
update all the mutations where a query is required for a more optimised
system.

## Example benchmarks

Using stg-app vs this preview there's an average 50% speed increase
across mutations.

**Set signer step:**
Average old speed: ~1100ms
Average new speed: ~550ms

**Set recipient step:**
Average old speed: ~1200ms
Average new speed: ~600ms

**Set fields step:**
Average old speed: ~1200ms
Average new speed: ~600ms

## Related Issue

This will resolve #470

## Changes Made

- Added ability to skip batch queries
- Added a state to store the required document data.
- Refetch the data between steps if/when required
- Optimise mutations and queries

## Checklist

- [X] I have tested these changes locally and they work as expected.
- [X] I have followed the project's coding style guidelines.

---------

Co-authored-by: Lucas Smith <me@lucasjamessmith.me>
2024-03-26 21:12:41 +08:00
David Nguyen
5210fe2963 feat: add passkeys (#989)
## Description

Add support to login with passkeys.

Passkeys can be added via the user security settings page.

Note: Currently left out adding the type of authentication method for
the 'user security audit logs' because we're using the `signIn`
next-auth event which doesn't appear to provide the context. Will look
into it at another time.

## Changes Made

- Add passkeys to login
- Add passkeys feature flag
- Add page to manage passkeys
- Add audit logs relating to passkeys
- Updated prisma schema to support passkeys & anonymous verification
tokens

## Testing Performed

To be done.

MacOS:
- Safari  
- Chrome  
- Firefox 

Windows:
- Chrome [Untested] 
- Firefox [Untested]

Linux:
- Chrome [Untested]
- Firefox [Untested]

iOS:
- Safari 

## Checklist

<!--- Please check the boxes that apply to this pull request. -->
<!--- You can add or remove items as needed. -->

- [X] I have tested these changes locally and they work as expected.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Introduced Passkey authentication, including creation, sign-in, and
management of passkeys.
- Added a Passkeys section in Security Settings for managing user
passkeys.
- Implemented UI updates for Passkey authentication, including a new
dialog for creating passkeys and a data table for managing them.
- Enhanced security settings with server-side feature flags to
conditionally display new security features.
- **Bug Fixes**
	- Improved UI consistency in the Settings Security Activity Page.
- Updated button styling in the 2FA Recovery Codes component for better
visibility.
- **Refactor**
- Streamlined authentication options to include WebAuthn credentials
provider.
- **Chores**
- Updated database schema to support passkeys and related functionality.
	- Added new audit log types for passkey-related activities.
- Enhanced server-only authentication utilities for passkey registration
and management.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-03-26 21:11:59 +08:00
Lucas Smith
3eddfcc805 chore: add test for multiple recipient (#1045) 2024-03-25 13:57:32 +07:00
David Nguyen
43400c07de feat: remove 2FA password requirement (#1053) 2024-03-25 11:34:50 +08:00
Valentin Lestoille
c71347aeb9 S3Client: Add forcePathStyle 2024-03-22 15:46:22 +01:00
Ephraim Duncan
72fd1eead2 fix: use correct date format (#1046)
### Before
![CleanShot 2024-03-21 at 17 23
09@2x](https://github.com/documenso/documenso/assets/55143799/d1cd22ca-399b-4ba2-bb82-b4dc869605c8)

### After
![CleanShot 2024-03-21 at 17 23
17@2x](https://github.com/documenso/documenso/assets/55143799/cdb814ea-01be-4bcb-9bad-df41030f320a)
2024-03-22 14:25:12 +08:00
Ephraim Atta-Duncan
5289ae2fbc Merge branch 'main' into test/sign-redirect-url 2024-03-21 16:36:48 +00:00
Ephraim Atta-Duncan
1cd7dd236b chore: test signing a document 2024-03-21 16:15:29 +00:00
Catalin Pit
6b73899ecc chore: re-arrange stuff 2024-03-21 15:46:53 +02:00
Catalin Pit
fdbac9fc03 feat: update next-auth-options to use the kysely adapter 2024-03-21 15:07:05 +02:00
Ephraim Atta-Duncan
a8752098f6 fix: invalid datetime on graph 2024-03-21 00:48:49 +00:00
Ephraim Atta-Duncan
2facc0e331 feat: add completed documents per month graph 2024-03-20 10:17:31 +00:00
Lucas Smith
8de8139b85 chore: send email to document owner (#1031)
**Description:**

This PR sends an email to the document owner once the signing has been
completed
2024-03-16 22:29:28 +11:00
Lucas Smith
a7594c9b3c fix: update sending logic 2024-03-16 11:06:33 +00:00
Adithya Krishna
f012826b6b chore: send document owner email
Signed-off-by: Adithya Krishna <aadithya794@gmail.com>
2024-03-15 22:26:31 +05:30
Rohit Saluja
487bc026f9 feat: reason is added to the component props 2024-03-13 11:06:35 +05:30
Rohit Saluja
3fb57c877e feat: send delete email is added 2024-03-13 10:54:53 +05:30
Adithya Krishna
52afae331e chore: updated to send email to doc owners
Signed-off-by: Adithya Krishna <aadithya794@gmail.com>
2024-03-13 09:50:37 +05:30
Adithya Krishna
bbcb90d8a5 chore: updated url regex
Signed-off-by: Adithya Krishna <aadithya794@gmail.com>
2024-03-11 15:00:58 +05:30
Lucas Smith
c2cf25b138 fix: templates incorrectly linking when in a team 2024-03-11 01:46:19 +00:00
Mythie
cffb7907b5 chore: remove bcrypt 2024-03-07 18:30:22 +11:00
Lucas Smith
927cb1a934 fix: incorrect download filename logic 2024-03-05 23:05:32 +00:00
David Nguyen
70494fa5bb feat: add offline development support (#987)
## Description

Add support to develop without network access since TRPC by default will
prevent network requests when offline.

https://tanstack.com/query/v4/docs/framework/react/guides/network-mode#network-mode-always

## Changes Made

- Add dynamic logic to toggle offline development
- Removed teams feature flag
2024-03-05 22:06:48 +11:00
Mythie
a17d4a2a39 fix: handle signature annotations 2024-03-03 11:36:28 +11:00
Mythie
73aae6f1e3 feat: improve admin panel 2024-03-03 01:55:33 +11:00
Mythie
5cc4204788 fix: add early return to webhook trigger 2024-03-01 14:12:06 +11:00
Catalin Pit
ebe23335f8 fix: return the recipient as an array to match other formats from zapier (#971)
Return the recipient as an array to match the other formats for Zapier.
Otherwise, Zaps with the "DOCUMENT_OPENED" hooks won't work.

All the other webhooks return the "Recipient" field as an array.
2024-02-29 08:37:01 +02:00
Lucas Smith
5576cdc2b0 Merge branch 'main' into feat/public-profile-1 2024-02-29 14:08:19 +11:00
Mythie
ecc9dc63ea feat: the rest of the owl 2024-02-29 13:22:21 +11:00
Catalin Pit
00a7389af3 chore: implemented feedback 2024-02-28 08:13:28 +02:00
Mythie
e3e2cfbcfd fix: refactor and implement design 2024-02-28 14:43:09 +11:00
Catalin Pit
f0a511e238 chore: refactor code 2024-02-27 15:22:02 +02:00
Adithya Krishna
b498f8edb7 feat: update ui
Signed-off-by: Adithya Krishna <adithya@documenso.com>
2024-02-27 20:40:42 +11:00
Adithya Krishna
65d762dd4b feat: update signin signup ui
Signed-off-by: Adithya Krishna <adithya@documenso.com>
2024-02-27 20:39:19 +11:00
Mythie
a4b1f7c983 feat: support team webhooks 2024-02-27 16:56:32 +11:00
Mythie
7dd2bbd8ab feat: update webhook handling and triggering 2024-02-27 15:16:14 +11:00
Mythie
c2daa964c0 chore: use cuids for webhooks 2024-02-27 12:13:56 +11:00