Compare commits
763 Commits
chore/next
...
v1.3.0-rc.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1831084970 | ||
|
|
935601ad16 | ||
|
|
7b4e38a032 | ||
|
|
2c5d547cdf | ||
|
|
c313da5028 | ||
|
|
5b98bac53b | ||
|
|
d7e44fc068 | ||
|
|
e03db5c6b3 | ||
|
|
d58433c8a0 | ||
|
|
419f27536b | ||
|
|
9a7e5d333d | ||
|
|
39b97a97fe | ||
|
|
328b2e7604 | ||
|
|
43b1a89c76 | ||
|
|
cd6184406d | ||
|
|
1a34f9fa7a | ||
|
|
3ff7b188d7 | ||
|
|
684e5272d2 | ||
|
|
b39a42ecd2 | ||
|
|
e81183f324 | ||
|
|
bfc630aa6a | ||
|
|
2068d980ff | ||
|
|
0baa2696b4 | ||
|
|
741201822a | ||
|
|
8ab1b0cf6b | ||
|
|
bfedabdc10 | ||
|
|
859b789018 | ||
|
|
340c929806 | ||
|
|
43b1a14415 | ||
|
|
40a4ec4436 | ||
|
|
eccf63dcfd | ||
|
|
a98b429052 | ||
|
|
c46a69f865 | ||
|
|
b903de983b | ||
|
|
6b519a67c2 | ||
|
|
39d18e93c5 | ||
|
|
7dac5072f7 | ||
|
|
fbfaca190b | ||
|
|
486b1cbf62 | ||
|
|
16fb90f4d2 | ||
|
|
53cb38a394 | ||
|
|
073a050587 | ||
|
|
39c01f4e8d | ||
|
|
335684d0b7 | ||
|
|
792158c2cb | ||
|
|
83153cee32 | ||
|
|
2d2bdc536e | ||
|
|
c16c36a1fc | ||
|
|
1d79ebbda3 | ||
|
|
252dd0008c | ||
|
|
35d0fed8b3 | ||
|
|
dad56b4929 | ||
|
|
7e4c44e820 | ||
|
|
adc97802ea | ||
|
|
0e40658201 | ||
|
|
d347359d2f | ||
|
|
fdf5b3908d | ||
|
|
8048c29480 | ||
|
|
84b958d5b7 | ||
|
|
d8688692f7 | ||
|
|
8230349114 | ||
|
|
c054fc78a4 | ||
|
|
5de0c464f0 | ||
|
|
9444e0cc67 | ||
|
|
be0fe079a3 | ||
|
|
fbbc3b89c3 | ||
|
|
6c73453542 | ||
|
|
17eeaa2d25 | ||
|
|
a8d49bb8b8 | ||
|
|
e077c36fe4 | ||
|
|
7ce4cf8381 | ||
|
|
cebdf5fd8e | ||
|
|
8adc44802f | ||
|
|
06714a2aeb | ||
|
|
1c9cec1e93 | ||
|
|
b4f1a5abce | ||
|
|
e838a07bf9 | ||
|
|
8722e4de74 | ||
|
|
f7d8ebb9de | ||
|
|
67f3b2de45 | ||
|
|
0da080aa41 | ||
|
|
fe25239a4e | ||
|
|
5ea4a16e36 | ||
|
|
5002a475d1 | ||
|
|
ca9c0d7bf0 | ||
|
|
3f0341c7d4 | ||
|
|
c3fe98b05f | ||
|
|
608a4eaaa6 | ||
|
|
d6ae0b44e6 | ||
|
|
aec0d2ae97 | ||
|
|
86160136aa | ||
|
|
3490e2a3a8 | ||
|
|
574539d6dd | ||
|
|
f5cba75355 | ||
|
|
2a4ada8294 | ||
|
|
7b8fc65836 | ||
|
|
623257ff13 | ||
|
|
6646533965 | ||
|
|
d1fc7ea217 | ||
|
|
b0e3abffd6 | ||
|
|
ee3614f10e | ||
|
|
2e9180acf5 | ||
|
|
d27880b56b | ||
|
|
2af100ef6d | ||
|
|
9edf88692c | ||
|
|
f9a0ec99dc | ||
|
|
3ebb30090c | ||
|
|
4af3d05a24 | ||
|
|
803ab7a7da | ||
|
|
2065a0debc | ||
|
|
f841683d82 | ||
|
|
8ae860432d | ||
|
|
ba7d92d255 | ||
|
|
31eece8926 | ||
|
|
746c97b64f | ||
|
|
d6e3b2b5dc | ||
|
|
223a5cc9d0 | ||
|
|
c2b078335e | ||
|
|
bbb7c6e0c7 | ||
|
|
1e5adb59cd | ||
|
|
02cbf3dfa0 | ||
|
|
d177dd7c56 | ||
|
|
7fd5f8da67 | ||
|
|
df4cda8a1b | ||
|
|
5de5d8b0fb | ||
|
|
a65db4f668 | ||
|
|
ec1f61faa0 | ||
|
|
9b5af329a8 | ||
|
|
b9daf6219c | ||
|
|
4aa43bcfa2 | ||
|
|
c95171bbc9 | ||
|
|
7fa61c6bb6 | ||
|
|
4f99b58795 | ||
|
|
67fcb154f5 | ||
|
|
9e5bfa543e | ||
|
|
165432c37c | ||
|
|
fcd2024132 | ||
|
|
9d9b1a6681 | ||
|
|
b0bf69450a | ||
|
|
717ca8cdb2 | ||
|
|
a975509923 | ||
|
|
f68b65fe5f | ||
|
|
687ce66e41 | ||
|
|
1d604fff2c | ||
|
|
2f2079e020 | ||
|
|
457e73342b | ||
|
|
284a2870c2 | ||
|
|
e8f08f4083 | ||
|
|
603cc1cb0d | ||
|
|
c162cb3b2c | ||
|
|
6de14ab0ac | ||
|
|
dec587e39e | ||
|
|
89102bd221 | ||
|
|
b7950cf042 | ||
|
|
19f1ddb8fe | ||
|
|
2ac0d79051 | ||
|
|
5445b85aae | ||
|
|
04fc9eb187 | ||
|
|
f1732fab29 | ||
|
|
5bc18d4c73 | ||
|
|
56914bf604 | ||
|
|
3d44821bff | ||
|
|
05fd01c72d | ||
|
|
c343e8a221 | ||
|
|
f75f191a9a | ||
|
|
1d291e8e03 | ||
|
|
cff547d0d8 | ||
|
|
4b2fec305f | ||
|
|
352e4f81fd | ||
|
|
5f15721535 | ||
|
|
95a60331f8 | ||
|
|
17b43caa5c | ||
|
|
6d7fc32075 | ||
|
|
81eea4213c | ||
|
|
f45cd81b5f | ||
|
|
2856cd9c15 | ||
|
|
5a79535080 | ||
|
|
9fa7505061 | ||
|
|
39c2bf77c2 | ||
|
|
9932d805b7 | ||
|
|
afd7dcd992 | ||
|
|
c7f69bafd0 | ||
|
|
dc1b8c3cb8 | ||
|
|
af73aee113 | ||
|
|
9151055936 | ||
|
|
ca51a926fb | ||
|
|
1bb47f98a1 | ||
|
|
c00f06a0c5 | ||
|
|
3cbd4a2680 | ||
|
|
c30695f2b8 | ||
|
|
434c4a6957 | ||
|
|
7942057c50 | ||
|
|
9afe8731b1 | ||
|
|
7d21f607df | ||
|
|
00546c1290 | ||
|
|
702df60076 | ||
|
|
38960c459b | ||
|
|
6d0e8f6dd8 | ||
|
|
ec11686709 | ||
|
|
2340528d2e | ||
|
|
e8c1e70714 | ||
|
|
3778fc8d00 | ||
|
|
2faca32427 | ||
|
|
51f8554ce8 | ||
|
|
4c8a62a8ab | ||
|
|
f621e60c16 | ||
|
|
4ed467693f | ||
|
|
0e77faee3f | ||
|
|
c78632870e | ||
|
|
35087f551c | ||
|
|
f569361e57 | ||
|
|
d2263a6d72 | ||
|
|
c9a71beb81 | ||
|
|
0d6efba3cf | ||
|
|
9d9faffc2f | ||
|
|
f9a3a53c5b | ||
|
|
fc876a41d9 | ||
|
|
6fd72321b3 | ||
|
|
1b7c887101 | ||
|
|
2e90eee4c2 | ||
|
|
bdf31625a2 | ||
|
|
e556db0386 | ||
|
|
7a8f5b8422 | ||
|
|
fa06038950 | ||
|
|
66eda3321d | ||
|
|
6ec04c5df3 | ||
|
|
e0662ce024 | ||
|
|
78d2401d44 | ||
|
|
02bb7e4d68 | ||
|
|
8fba1c43d3 | ||
|
|
911cdcf170 | ||
|
|
07fb6fa0e1 | ||
|
|
1d97c0898f | ||
|
|
4132e45a9b | ||
|
|
b190802f65 | ||
|
|
830f10ac6f | ||
|
|
82f13e0ac3 | ||
|
|
efa0505276 | ||
|
|
27287cd1d5 | ||
|
|
a5e087f209 | ||
|
|
85924f49f7 | ||
|
|
6d8c29c5c1 | ||
|
|
051c96c92b | ||
|
|
0aaf65266e | ||
|
|
5bb2f183c1 | ||
|
|
8c8bcb694a | ||
|
|
2e12893e0c | ||
|
|
8fb5fdc058 | ||
|
|
0c607e6b39 | ||
|
|
a622fd402f | ||
|
|
a219588287 | ||
|
|
5cba913c55 | ||
|
|
adf1359527 | ||
|
|
187485678a | ||
|
|
48f4289c09 | ||
|
|
e09c076241 | ||
|
|
7ec8ce2a56 | ||
|
|
cca1bb4639 | ||
|
|
5e00df1fba | ||
|
|
e14f96485c | ||
|
|
c107608aeb | ||
|
|
704306fd21 | ||
|
|
a164fd1256 | ||
|
|
ef0ad8761c | ||
|
|
d4c23455d8 | ||
|
|
eeb0d7b60c | ||
|
|
c0edac317e | ||
|
|
5fa7f447cd | ||
|
|
c035e9ce0b | ||
|
|
e982c85e9a | ||
|
|
d79981b4b2 | ||
|
|
1b57b6027b | ||
|
|
75de3f26b9 | ||
|
|
6a5c5f7dd8 | ||
|
|
c911253be0 | ||
|
|
f1898b24fc | ||
|
|
fcf586f24d | ||
|
|
34ce0d084e | ||
|
|
127dc42dc5 | ||
|
|
016ae6ec6f | ||
|
|
ac3b4080c0 | ||
|
|
df9c603a37 | ||
|
|
9c8eb5e13b | ||
|
|
da64c9af0d | ||
|
|
990a7da940 | ||
|
|
dc5cc74db9 | ||
|
|
8bb90494d8 | ||
|
|
adc0c31462 | ||
|
|
7385abae25 | ||
|
|
6c4fc6b2b4 | ||
|
|
0c16e0339f | ||
|
|
779289ccd8 | ||
|
|
bac7cf464a | ||
|
|
e77fd92d13 | ||
|
|
97f995b00a | ||
|
|
5904f6c5a8 | ||
|
|
9164d301fd | ||
|
|
f0f67be624 | ||
|
|
1536634fc6 | ||
|
|
0e486c7b58 | ||
|
|
0f6298cc8b | ||
|
|
b26bba8329 | ||
|
|
350c02ae98 | ||
|
|
80c9ab5d8c | ||
|
|
965b5c0afd | ||
|
|
341c0df231 | ||
|
|
0ff044978f | ||
|
|
d20ad4217c | ||
|
|
ebebceea1f | ||
|
|
a9a719cd37 | ||
|
|
db1d6478a1 | ||
|
|
34232c79e5 | ||
|
|
cdae3a9a45 | ||
|
|
60ae674984 | ||
|
|
986bab2ba4 | ||
|
|
ded4f03e05 | ||
|
|
4306fbc0f3 | ||
|
|
8fc53d5dac | ||
|
|
e97de71811 | ||
|
|
8c23bea985 | ||
|
|
a92624b255 | ||
|
|
8b5d0f445e | ||
|
|
f09638a4de | ||
|
|
e5871da7b5 | ||
|
|
73a9213088 | ||
|
|
4879d2360b | ||
|
|
5aff50b13b | ||
|
|
b747334383 | ||
|
|
abfa0812f0 | ||
|
|
4072e2a200 | ||
|
|
4ec2bd7536 | ||
|
|
5dad463877 | ||
|
|
fe4b3e0450 | ||
|
|
401311acd9 | ||
|
|
7823100272 | ||
|
|
826a901c10 | ||
|
|
164aa1cc03 | ||
|
|
22f9400932 | ||
|
|
345343f4b5 | ||
|
|
da16f1ee07 | ||
|
|
a3baf2ed8b | ||
|
|
9521d1df4c | ||
|
|
1e294fc933 | ||
|
|
fd4602faf8 | ||
|
|
c947c7d761 | ||
|
|
c58006b2d9 | ||
|
|
f18010e1e1 | ||
|
|
94215fffbb | ||
|
|
b17e73003e | ||
|
|
49ce09f49b | ||
|
|
53db1a5d19 | ||
|
|
15fd819132 | ||
|
|
8df5304b8e | ||
|
|
794e575ae9 | ||
|
|
57ff77b920 | ||
|
|
c43843d226 | ||
|
|
d0cedc489f | ||
|
|
b12f5b62f1 | ||
|
|
f2da49d0e8 | ||
|
|
96264f67e4 | ||
|
|
ebcd7c78e4 | ||
|
|
1bce169228 | ||
|
|
023a91832a | ||
|
|
0a035f8b60 | ||
|
|
7659c51980 | ||
|
|
3377b55341 | ||
|
|
f938db25d0 | ||
|
|
db50dc71aa | ||
|
|
b2ea5f0e47 | ||
|
|
32a21999ef | ||
|
|
0321f8505d | ||
|
|
90225574de | ||
|
|
92b5111d7e | ||
|
|
15a1c1da3f | ||
|
|
d54710ca07 | ||
|
|
9682f8ea36 | ||
|
|
02b6f6a7b7 | ||
|
|
214dd7a7c8 | ||
|
|
ff58735153 | ||
|
|
82c1ca13be | ||
|
|
eef720bf8c | ||
|
|
550b7e1655 | ||
|
|
32b41386e5 | ||
|
|
1db0d2eae6 | ||
|
|
7a1dd47537 | ||
|
|
eec48e48ef | ||
|
|
1ec91f6c68 | ||
|
|
fbb8e887a8 | ||
|
|
6778d2a0da | ||
|
|
0ec5976397 | ||
|
|
8f03782fe3 | ||
|
|
6e791b6e91 | ||
|
|
34c652ab54 | ||
|
|
dec7a9cb38 | ||
|
|
1e0cde850a | ||
|
|
9b025f0c9f | ||
|
|
dabeead57f | ||
|
|
84bc6eb4f3 | ||
|
|
9ef50f356e | ||
|
|
38e8611159 | ||
|
|
8c12789c03 | ||
|
|
ca165c8141 | ||
|
|
729d0c93fe | ||
|
|
3544e44c31 | ||
|
|
b3a312df98 | ||
|
|
8ba9a761d4 | ||
|
|
c4282ded57 | ||
|
|
352720a6ae | ||
|
|
a948adfbb7 | ||
|
|
77833ba895 | ||
|
|
f700016440 | ||
|
|
771042c9ce | ||
|
|
95a40400af | ||
|
|
7d4bb09170 | ||
|
|
269f97fa6b | ||
|
|
666d682536 | ||
|
|
2e5d5bb462 | ||
|
|
0835da45ef | ||
|
|
5a99a0b5eb | ||
|
|
3afc35c40c | ||
|
|
72bec7bc34 | ||
|
|
0f38be4e41 | ||
|
|
706909107f | ||
|
|
48ff16876b | ||
|
|
a72248e871 | ||
|
|
48e58d4675 | ||
|
|
41d46c82d1 | ||
|
|
a849c6431f | ||
|
|
399826a6f5 | ||
|
|
632b3bd1f4 | ||
|
|
4f40ce6003 | ||
|
|
e752c0c60b | ||
|
|
31ae6591dd | ||
|
|
d8bbfae30d | ||
|
|
f42f2b1aa0 | ||
|
|
a2635851cf | ||
|
|
a94b80d07d | ||
|
|
766fc6410b | ||
|
|
61df56c21e | ||
|
|
fdb542765a | ||
|
|
dcde3317b8 | ||
|
|
6be4a1d3e4 | ||
|
|
9c26faba0d | ||
|
|
1a48d194f7 | ||
|
|
cb5df80a26 | ||
|
|
661dfe8368 | ||
|
|
90bacea7ed | ||
|
|
0f3db459cb | ||
|
|
9e4f1dfe1e | ||
|
|
d5753dfbb3 | ||
|
|
a644e0134b | ||
|
|
6ad10f6317 | ||
|
|
05c7ac4c20 | ||
|
|
0f9ce3b5c7 | ||
|
|
45d6181042 | ||
|
|
d3529374a6 | ||
|
|
a7fa9daada | ||
|
|
4267456857 | ||
|
|
d7f4f2b8eb | ||
|
|
07580b4640 | ||
|
|
c2fe7192fa | ||
|
|
0961246834 | ||
|
|
383f8d6e3c | ||
|
|
d1db20ff4a | ||
|
|
4146d71f9d | ||
|
|
e05eaffb61 | ||
|
|
6b250b88ec | ||
|
|
8a271ff8bc | ||
|
|
930a80ae18 | ||
|
|
2aabe7ec60 | ||
|
|
f64885d2c3 | ||
|
|
3546155aab | ||
|
|
95886d67a6 | ||
|
|
8980274f7a | ||
|
|
64b399043c | ||
|
|
d536305c1c | ||
|
|
991411c9f5 | ||
|
|
bc2da7834e | ||
|
|
00143052fd | ||
|
|
ef79eb3ca4 | ||
|
|
63b21a8206 | ||
|
|
e243ba2564 | ||
|
|
fd43ebb7c0 | ||
|
|
a7e43c5d77 | ||
|
|
5ca4a7e117 | ||
|
|
a23e3c6068 | ||
|
|
cf799e63ca | ||
|
|
2b53f796bd | ||
|
|
ebdb6442c6 | ||
|
|
c29d1463b0 | ||
|
|
a8a6e40174 | ||
|
|
81e612040a | ||
|
|
7f5ef8690b | ||
|
|
d7bd8fcd37 | ||
|
|
c3f11afaf9 | ||
|
|
5cba252627 | ||
|
|
cd1b4796fc | ||
|
|
9524875e98 | ||
|
|
fba95a4402 | ||
|
|
2ba7df4881 | ||
|
|
7811035384 | ||
|
|
98c980a5c4 | ||
|
|
7b2d3356f2 | ||
|
|
dfe04018a0 | ||
|
|
62c4a89521 | ||
|
|
a99efdc916 | ||
|
|
6959307f5e | ||
|
|
b512343bbb | ||
|
|
5100a61ab7 | ||
|
|
e6790d3a19 | ||
|
|
778ac63272 | ||
|
|
e2fe7e900c | ||
|
|
c098c58b2e | ||
|
|
9c763e864b | ||
|
|
3ffee97e72 | ||
|
|
2ab0cd1308 | ||
|
|
989146f98e | ||
|
|
faa280c02b | ||
|
|
942d4bf905 | ||
|
|
84c6a40815 | ||
|
|
ce67f8cc11 | ||
|
|
44f59b07c5 | ||
|
|
b97a0380df | ||
|
|
289e3776fd | ||
|
|
36b3b36ac8 | ||
|
|
7a74f3c77e | ||
|
|
d0def823c8 | ||
|
|
c902fb8412 | ||
|
|
b733defcd9 | ||
|
|
0cc05052fa | ||
|
|
166271ac4b | ||
|
|
7cfc525ddf | ||
|
|
3ea0ff6b81 | ||
|
|
97c7bd9792 | ||
|
|
215eaebc1a | ||
|
|
039cd11c49 | ||
|
|
617c738e5b | ||
|
|
77ab168c03 | ||
|
|
a0abf56833 | ||
|
|
98862a6356 | ||
|
|
077bb4ac3c | ||
|
|
399cf78508 | ||
|
|
857a48b3d9 | ||
|
|
371f0947fb | ||
|
|
aa2969fd50 | ||
|
|
64eefbd340 | ||
|
|
769a374cf6 | ||
|
|
96ae622f95 | ||
|
|
10330872e1 | ||
|
|
3a77a50d56 | ||
|
|
122e1dffc3 | ||
|
|
256f1c6c84 | ||
|
|
56aea04b80 | ||
|
|
6e7deca0cb | ||
|
|
7975eb7a8d | ||
|
|
105eeec5df | ||
|
|
efc2102b90 | ||
|
|
46bd501835 | ||
|
|
759b864b14 | ||
|
|
94b9b1060b | ||
|
|
6c06337f6e | ||
|
|
0b5a550cd1 | ||
|
|
cd1af7b5d3 | ||
|
|
bc87986a3d | ||
|
|
a948441956 | ||
|
|
1f75342b91 | ||
|
|
d36ca59b77 | ||
|
|
1f79ca0a70 | ||
|
|
d4b130a731 | ||
|
|
77ad1d1b0b | ||
|
|
ab4d70ced1 | ||
|
|
3632a5aef5 | ||
|
|
8fa31c8f05 | ||
|
|
7fda1d2010 | ||
|
|
fac1d34d24 | ||
|
|
c841c989aa | ||
|
|
7a705e3b81 | ||
|
|
c6327c77ea | ||
|
|
258477fd8d | ||
|
|
baa7236864 | ||
|
|
201b88544d | ||
|
|
ee595056ac | ||
|
|
331944f34a | ||
|
|
01c88065ee | ||
|
|
784188ff51 | ||
|
|
58d765924f | ||
|
|
9783e16656 | ||
|
|
e164fabb04 | ||
|
|
2d9f996630 | ||
|
|
7c0c082a40 | ||
|
|
57e9f88b93 | ||
|
|
64ffa37ea7 | ||
|
|
1503536334 | ||
|
|
f3e8c62fad | ||
|
|
f66934551e | ||
|
|
739599810e | ||
|
|
58e291bcf1 | ||
|
|
7e2b351390 | ||
|
|
900a51ff06 | ||
|
|
dcd275fa6b | ||
|
|
c5f35fb66d | ||
|
|
89bf7b6651 | ||
|
|
51e55148c7 | ||
|
|
4bfbe039e8 | ||
|
|
769b51c531 | ||
|
|
07492100d2 | ||
|
|
3407952a5e | ||
|
|
d59045c419 | ||
|
|
b3a52c4aec | ||
|
|
b3969f0614 | ||
|
|
0da6e93a6a | ||
|
|
fdd3d7c6fe | ||
|
|
a78ed42f6c | ||
|
|
63d4216fd1 | ||
|
|
d5e7f6f4df | ||
|
|
145abc0e51 | ||
|
|
63f37732cd | ||
|
|
27b42814d8 | ||
|
|
f882be4338 | ||
|
|
dc58f77c61 | ||
|
|
0fca2e9f4e | ||
|
|
664357d166 | ||
|
|
a1cb595f25 | ||
|
|
d986a3cf77 | ||
|
|
71e9f016b6 | ||
|
|
96fc2fb850 | ||
|
|
3f322d1d0c | ||
|
|
79684c9970 | ||
|
|
fcf9720a1e | ||
|
|
822624bc02 | ||
|
|
154ef26465 | ||
|
|
bc425abe35 | ||
|
|
0de4fe5883 | ||
|
|
a94f447e9e | ||
|
|
e1d57e6d29 | ||
|
|
71c689eae8 | ||
|
|
208e028226 | ||
|
|
00a15124be | ||
|
|
12d8cebd4c | ||
|
|
5e3752cdbf | ||
|
|
ca0f4eefd2 | ||
|
|
0b1c4fadc6 | ||
|
|
56b6bc68c4 | ||
|
|
3c73f030ac | ||
|
|
115cae8365 | ||
|
|
814a6174e3 | ||
|
|
5442e82ae7 | ||
|
|
6253c42ca1 | ||
|
|
3377e29c72 | ||
|
|
4ea316a077 | ||
|
|
feefeea0c4 | ||
|
|
40115d33b4 | ||
|
|
cc182649c2 | ||
|
|
159bcade7b | ||
|
|
76b2fb5edd | ||
|
|
7df83cc0ad | ||
|
|
f9d96c67d3 | ||
|
|
beb9946f3b | ||
|
|
822b018eb0 | ||
|
|
d702710cb4 | ||
|
|
a9ed9c0316 | ||
|
|
1ea231e9af | ||
|
|
dfd28f4441 | ||
|
|
fee107ff7a | ||
|
|
19ea119009 | ||
|
|
aea20019bd | ||
|
|
3177a07d25 | ||
|
|
0a1603b147 | ||
|
|
82ccdd5104 | ||
|
|
2d5727cab2 | ||
|
|
8862edfd3e | ||
|
|
2c9644ce9c | ||
|
|
6b45e8ce3a | ||
|
|
a98eca3bf1 | ||
|
|
e1772da491 | ||
|
|
9f1e0257e7 | ||
|
|
4f4725f166 | ||
|
|
eb7d89a0cd | ||
|
|
4a57f75228 | ||
|
|
adf92bb53d | ||
|
|
adf3a11c5f | ||
|
|
652951ed7f | ||
|
|
40db5baa17 | ||
|
|
4cdfa2d1f0 | ||
|
|
ba82b1fca8 | ||
|
|
6b3696d879 | ||
|
|
ca1522a31e | ||
|
|
201c0ac22a | ||
|
|
c573e15ac2 | ||
|
|
e5a80a701f | ||
|
|
f8aebbc484 | ||
|
|
4e60d4ac09 | ||
|
|
b5328eebde | ||
|
|
e87c57c97c | ||
|
|
cef5c8e33f | ||
|
|
b03dd1553f | ||
|
|
f6d1b8c8a1 | ||
|
|
cb29ffef37 | ||
|
|
f7d0bb9823 | ||
|
|
fc2809c4cf | ||
|
|
14536bda1e | ||
|
|
5fcd54ae09 | ||
|
|
35fecfffa9 | ||
|
|
da07bf135c | ||
|
|
1a06dd261c | ||
|
|
9c3fbbdb3a | ||
|
|
c20123ec75 | ||
|
|
4c25e85f01 | ||
|
|
ed3dbefbd7 | ||
|
|
7d8f83750b | ||
|
|
fda3472e67 | ||
|
|
2dd89b1bc1 | ||
|
|
cc87eeb8e0 | ||
|
|
6c78332258 | ||
|
|
5922725e1a | ||
|
|
36232c7817 | ||
|
|
723339f812 | ||
|
|
f279b41b89 | ||
|
|
3d0836c39c | ||
|
|
fcaa59699c | ||
|
|
5063b60a8a | ||
|
|
1322f7333f | ||
|
|
0278495896 | ||
|
|
ef34c4fe5d | ||
|
|
6dad379943 | ||
|
|
d3f82e1eb0 | ||
|
|
6838b953a8 | ||
|
|
fdd5a6114e | ||
|
|
b05ab9fbb4 | ||
|
|
e34be16d3d | ||
|
|
9fd9bc2893 | ||
|
|
3f14d8007a | ||
|
|
e3bc41934c | ||
|
|
13a840ff78 | ||
|
|
fe6561f596 | ||
|
|
9cfbb1dec9 | ||
|
|
9dd8c2842c | ||
|
|
54a965e2b4 | ||
|
|
7cc1ae2de0 | ||
|
|
f08836216e | ||
|
|
7184c47ac4 | ||
|
|
79bd410687 | ||
|
|
3a0648c85d | ||
|
|
2b9a2ff250 | ||
|
|
4136811e32 | ||
|
|
e9cee23c15 | ||
|
|
5d2349086d | ||
|
|
c47e01b2b8 | ||
|
|
7c30ee0c3e | ||
|
|
6e2b05f835 | ||
|
|
8dc9c9d72d | ||
|
|
66b529a841 | ||
|
|
8293b50195 | ||
|
|
002b22b1a8 | ||
|
|
447bf0cb76 | ||
|
|
37c4e68aac | ||
|
|
a07febef46 | ||
|
|
79c037216d | ||
|
|
aa584c1495 | ||
|
|
8b9738f6d5 | ||
|
|
19e960f593 | ||
|
|
37ded07a92 | ||
|
|
df2294b43b |
@@ -2,6 +2,11 @@
|
|||||||
NEXTAUTH_URL="http://localhost:3000"
|
NEXTAUTH_URL="http://localhost:3000"
|
||||||
NEXTAUTH_SECRET="secret"
|
NEXTAUTH_SECRET="secret"
|
||||||
|
|
||||||
|
# [[CRYPTO]]
|
||||||
|
# Application Key for symmetric encryption and decryption
|
||||||
|
# This should be a random string of at least 32 characters
|
||||||
|
NEXT_PRIVATE_ENCRYPTION_KEY="CAFEBABE"
|
||||||
|
|
||||||
# [[AUTH OPTIONAL]]
|
# [[AUTH OPTIONAL]]
|
||||||
NEXT_PRIVATE_GOOGLE_CLIENT_ID=""
|
NEXT_PRIVATE_GOOGLE_CLIENT_ID=""
|
||||||
NEXT_PRIVATE_GOOGLE_CLIENT_SECRET=""
|
NEXT_PRIVATE_GOOGLE_CLIENT_SECRET=""
|
||||||
|
|||||||
50
.github/ISSUE_TEMPLATE/bug-report.md
vendored
@@ -1,50 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug Report
|
|
||||||
about: Create a bug report to help us improve
|
|
||||||
---
|
|
||||||
|
|
||||||
<!--- Please provide a general summary of the issue in the Title above -->
|
|
||||||
|
|
||||||
## Issue Description
|
|
||||||
|
|
||||||
<!--- Please provide a clear and concise description of the problem. -->
|
|
||||||
|
|
||||||
## Steps to Reproduce
|
|
||||||
|
|
||||||
<!--- Please provide step-by-step instructions to reproduce the issue. -->
|
|
||||||
<!--- Include code snippets, error messages, and any other relevant information. -->
|
|
||||||
|
|
||||||
1. Step 1
|
|
||||||
2. Step 2
|
|
||||||
3. ...
|
|
||||||
|
|
||||||
## Expected Behavior
|
|
||||||
|
|
||||||
<!--- Describe what you expected to happen. -->
|
|
||||||
|
|
||||||
## Current Behavior
|
|
||||||
|
|
||||||
<!--- Describe what is currently happening. -->
|
|
||||||
|
|
||||||
## Screenshots (optional)
|
|
||||||
|
|
||||||
<!--- If applicable, add screenshots to help explain the issue. -->
|
|
||||||
|
|
||||||
## Environment
|
|
||||||
|
|
||||||
<!--- Please provide information about your environment, such as operating system, browser, version, etc. -->
|
|
||||||
|
|
||||||
- OS: [e.g., Windows 10]
|
|
||||||
- Browser: [e.g., Chrome, Firefox]
|
|
||||||
- Version: [e.g., 2.0.1]
|
|
||||||
|
|
||||||
## Checklist
|
|
||||||
|
|
||||||
<!--- Please check the boxes that apply to this issue report. -->
|
|
||||||
<!--- You can add or remove items as needed. -->
|
|
||||||
|
|
||||||
- [ ] I have searched the existing issues to make sure this is not a duplicate.
|
|
||||||
- [ ] I have provided steps to reproduce the issue.
|
|
||||||
- [ ] I have included relevant environment information.
|
|
||||||
- [ ] I have included any relevant screenshots.
|
|
||||||
- [ ] I understand that this is a voluntary contribution and that there is no guarantee of resolution.
|
|
||||||
48
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
name: "Bug Report"
|
||||||
|
labels: ["bug"]
|
||||||
|
description: Create a bug report to help us improve
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value:
|
||||||
|
Thank you for reporting an issue.
|
||||||
|
Please fill in as much of the form below as you're able to.
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Issue Description
|
||||||
|
description: Please provide a clear and concise description of the problem.
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Steps to Reproduce
|
||||||
|
description: Please provide step-by-step instructions to reproduce the issue. Include code snippets, error messages, and any other relevant information.
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Expected Behavior
|
||||||
|
description: Describe what you expected to happen.
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Current Behavior
|
||||||
|
description: Describe what is currently happening.
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Screenshots (optional)
|
||||||
|
description: If applicable, add screenshots to help explain the issue.
|
||||||
|
- type: input
|
||||||
|
attributes:
|
||||||
|
label: Operating System [e.g., Windows 10]
|
||||||
|
- type: input
|
||||||
|
attributes:
|
||||||
|
label: Browser [e.g., Chrome, Firefox]
|
||||||
|
- type: input
|
||||||
|
attributes:
|
||||||
|
label: Version [e.g., 2.0.1]
|
||||||
|
- type: checkboxes
|
||||||
|
attributes:
|
||||||
|
label: Please check the boxes that apply to this issue report.
|
||||||
|
options:
|
||||||
|
- label: I have searched the existing issues to make sure this is not a duplicate.
|
||||||
|
- label: I have provided steps to reproduce the issue.
|
||||||
|
- label: I have included relevant environment information.
|
||||||
|
- label: I have included any relevant screenshots.
|
||||||
|
- label: I understand that this is a voluntary contribution and that there is no guarantee of resolution.
|
||||||
|
- label: I want to work on creating a PR for this issue if approved
|
||||||
41
.github/ISSUE_TEMPLATE/feature-request.md
vendored
@@ -1,41 +0,0 @@
|
|||||||
---
|
|
||||||
name: Feature Request
|
|
||||||
about: Suggest a new idea or enhancement for this project
|
|
||||||
---
|
|
||||||
|
|
||||||
<!--- Please provide a clear and concise title for your feature request -->
|
|
||||||
|
|
||||||
## Feature Description
|
|
||||||
|
|
||||||
<!--- Describe the feature you are requesting in detail. -->
|
|
||||||
<!--- Explain what problem it solves or what value it adds to the project. -->
|
|
||||||
|
|
||||||
## Use Case
|
|
||||||
|
|
||||||
<!--- Provide a scenario or use case where this feature would be beneficial. -->
|
|
||||||
<!--- Explain how users would interact with this feature and why it's important. -->
|
|
||||||
|
|
||||||
## Proposed Solution
|
|
||||||
|
|
||||||
<!--- If you have an idea of how this feature could be implemented, describe it here. -->
|
|
||||||
<!--- Include any technical details, UI/UX considerations, or design suggestions. -->
|
|
||||||
|
|
||||||
## Alternatives (optional)
|
|
||||||
|
|
||||||
<!--- Are there any alternative ways to achieve the same goal? -->
|
|
||||||
<!--- Describe other approaches that could be considered if this feature is not implemented. -->
|
|
||||||
|
|
||||||
## Additional Context
|
|
||||||
|
|
||||||
<!--- Add any additional context or information that might be relevant to the feature request. -->
|
|
||||||
|
|
||||||
## Checklist
|
|
||||||
|
|
||||||
<!--- Please check the boxes that apply to this feature request. -->
|
|
||||||
<!--- You can add or remove items as needed. -->
|
|
||||||
|
|
||||||
- [ ] I have searched the existing feature requests to make sure this is not a duplicate.
|
|
||||||
- [ ] I have provided a detailed description of the requested feature.
|
|
||||||
- [ ] I have explained the use case or scenario for this feature.
|
|
||||||
- [ ] I have included any relevant technical details or design suggestions.
|
|
||||||
- [ ] I understand that this is a suggestion and that there is no guarantee of implementation.
|
|
||||||
35
.github/ISSUE_TEMPLATE/feature-request.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
name: "Feature Request"
|
||||||
|
description: Suggest a new idea or enhancement for this project
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: Please provide a clear and concise title for your feature request
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Feature Description
|
||||||
|
description: Describe the feature you are requesting in detail. Explain what problem it solves or what value it adds to the project.
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Use Case
|
||||||
|
description: Provide a scenario or use case where this feature would be beneficial. Explain how users would interact with this feature and why it's important.
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Proposed Solution
|
||||||
|
description: If you have an idea of how this feature could be implemented, describe it here. Include any technical details, UI/UX considerations, or design suggestions.
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Alternatives (optional)
|
||||||
|
description: Are there any alternative ways to achieve the same goal? Describe other approaches that could be considered if this feature is not implemented.
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Additional Context
|
||||||
|
description: Add any additional context or information that might be relevant to the feature request.
|
||||||
|
- type: checkboxes
|
||||||
|
attributes:
|
||||||
|
label: Please check the boxes that apply to this feature request.
|
||||||
|
options:
|
||||||
|
- label: I have searched the existing feature requests to make sure this is not a duplicate.
|
||||||
|
- label: I have provided a detailed description of the requested feature.
|
||||||
|
- label: I have explained the use case or scenario for this feature.
|
||||||
|
- label: I have included any relevant technical details or design suggestions.
|
||||||
|
- label: I understand that this is a suggestion and that there is no guarantee of implementation.
|
||||||
41
.github/ISSUE_TEMPLATE/improvement.md
vendored
@@ -1,41 +0,0 @@
|
|||||||
---
|
|
||||||
name: General Improvement
|
|
||||||
about: Suggest a minor enhancement or improvement for this project
|
|
||||||
---
|
|
||||||
|
|
||||||
<!--- Please provide a clear and concise title for your improvement suggestion -->
|
|
||||||
|
|
||||||
## Improvement Description
|
|
||||||
|
|
||||||
<!--- Describe the improvement you are suggesting in detail. -->
|
|
||||||
<!--- Explain what specific aspect of the project it addresses or enhances. -->
|
|
||||||
|
|
||||||
## Rationale
|
|
||||||
|
|
||||||
<!--- Explain why this improvement would be beneficial. -->
|
|
||||||
<!--- Share any context, pain points, or reasons for suggesting this change. -->
|
|
||||||
|
|
||||||
## Proposed Solution
|
|
||||||
|
|
||||||
<!--- If you have a suggestion for how this improvement could be implemented, describe it here. -->
|
|
||||||
<!--- Include any technical details, design suggestions, or other relevant information. -->
|
|
||||||
|
|
||||||
## Alternatives (optional)
|
|
||||||
|
|
||||||
<!--- Are there any alternative approaches to achieve the same improvement? -->
|
|
||||||
<!--- Describe other ways to address the issue or enhance the project. -->
|
|
||||||
|
|
||||||
## Additional Context
|
|
||||||
|
|
||||||
<!--- Add any additional context or information that might be relevant to the improvement suggestion. -->
|
|
||||||
|
|
||||||
## Checklist
|
|
||||||
|
|
||||||
<!--- Please check the boxes that apply to this improvement suggestion. -->
|
|
||||||
<!--- You can add or remove items as needed. -->
|
|
||||||
|
|
||||||
- [ ] I have searched the existing issues and improvement suggestions to avoid duplication.
|
|
||||||
- [ ] I have provided a clear description of the improvement being suggested.
|
|
||||||
- [ ] I have explained the rationale behind this improvement.
|
|
||||||
- [ ] I have included any relevant technical details or design suggestions.
|
|
||||||
- [ ] I understand that this is a suggestion and that there is no guarantee of implementation.
|
|
||||||
35
.github/ISSUE_TEMPLATE/improvement.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
name: "General Improvement"
|
||||||
|
description: Suggest a minor enhancement or improvement for this project
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: Please provide a clear and concise title for your improvement suggestion
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Improvement Description
|
||||||
|
description: Describe the improvement you are suggesting in detail. Explain what specific aspect of the project it addresses or enhances.
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Rationale
|
||||||
|
description: Explain why this improvement would be beneficial. Share any context, pain points, or reasons for suggesting this change.
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Proposed Solution
|
||||||
|
description: If you have a suggestion for how this improvement could be implemented, describe it here. Include any technical details, design suggestions, or other relevant information.
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Alternatives (optional)
|
||||||
|
description: Are there any alternative approaches to achieve the same improvement? Describe other ways to address the issue or enhance the project.
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Additional Context
|
||||||
|
description: Add any additional context or information that might be relevant to the improvement suggestion.
|
||||||
|
- type: checkboxes
|
||||||
|
attributes:
|
||||||
|
label: Please check the boxes that apply to this improvement suggestion.
|
||||||
|
options:
|
||||||
|
- label: I have searched the existing issues and improvement suggestions to avoid duplication.
|
||||||
|
- label: I have provided a clear description of the improvement being suggested.
|
||||||
|
- label: I have explained the rationale behind this improvement.
|
||||||
|
- label: I have included any relevant technical details or design suggestions.
|
||||||
|
- label: I understand that this is a suggestion and that there is no guarantee of implementation.
|
||||||
6
.github/dependabot.yml
vendored
@@ -5,7 +5,7 @@ updates:
|
|||||||
directory: '/'
|
directory: '/'
|
||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: "weekly"
|
||||||
target-branch: "feat/refresh"
|
target-branch: "main"
|
||||||
labels:
|
labels:
|
||||||
- "ci dependencies"
|
- "ci dependencies"
|
||||||
- "ci"
|
- "ci"
|
||||||
@@ -15,7 +15,7 @@ updates:
|
|||||||
directory: "/apps/marketing"
|
directory: "/apps/marketing"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: "weekly"
|
||||||
target-branch: "feat/refresh"
|
target-branch: "main"
|
||||||
labels:
|
labels:
|
||||||
- "npm dependencies"
|
- "npm dependencies"
|
||||||
- "frontend"
|
- "frontend"
|
||||||
@@ -25,7 +25,7 @@ updates:
|
|||||||
directory: "/apps/web"
|
directory: "/apps/web"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: "weekly"
|
||||||
target-branch: "feat/refresh"
|
target-branch: "main"
|
||||||
labels:
|
labels:
|
||||||
- "npm dependencies"
|
- "npm dependencies"
|
||||||
- "frontend"
|
- "frontend"
|
||||||
|
|||||||
21
.github/workflows/ci.yml
vendored
@@ -2,9 +2,9 @@ name: "Continuous Integration"
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "feat/refresh" ]
|
branches: [ "main" ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "feat/refresh" ]
|
branches: [ "main" ]
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
@@ -14,8 +14,8 @@ env:
|
|||||||
HUSKY: 0
|
HUSKY: 0
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build_app:
|
||||||
name: Build
|
name: Build App
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -37,3 +37,16 @@ jobs:
|
|||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
|
build_docker:
|
||||||
|
name: Build Docker Image
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
|
||||||
|
- name: Build Docker Image
|
||||||
|
run: ./docker/build.sh
|
||||||
|
|
||||||
|
|||||||
4
.github/workflows/codeql-analysis.yml
vendored
@@ -3,9 +3,9 @@ name: "CodeQL"
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches: [ feat/refresh ]
|
branches: [ "main" ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ feat/refresh ]
|
branches: [ "main" ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
analyze:
|
analyze:
|
||||||
|
|||||||
26
.github/workflows/deploy.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
name: Deploy to Production
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: main
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Push to release branch
|
||||||
|
run: |
|
||||||
|
git config user.name "GitHub Actions"
|
||||||
|
git config user.email "actions@github.com"
|
||||||
|
|
||||||
|
git checkout release || git checkout -b release
|
||||||
|
git merge --ff-only main
|
||||||
|
git push origin release
|
||||||
36
.github/workflows/e2e-tests.yml
vendored
@@ -1,26 +1,14 @@
|
|||||||
name: Playwright Tests
|
name: Playwright Tests
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [feat/refresh]
|
branches: [ "main" ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [feat/refresh]
|
branches: [ "main" ]
|
||||||
jobs:
|
jobs:
|
||||||
e2e_tests:
|
e2e_tests:
|
||||||
|
name: "E2E Tests"
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services:
|
|
||||||
postgres:
|
|
||||||
image: postgres
|
|
||||||
env:
|
|
||||||
POSTGRES_USER: postgres
|
|
||||||
POSTGRES_PASSWORD: postgres
|
|
||||||
options: >-
|
|
||||||
--health-cmd pg_isready
|
|
||||||
--health-interval 10s
|
|
||||||
--health-timeout 5s
|
|
||||||
--health-retries 5
|
|
||||||
ports:
|
|
||||||
- 5432:5432
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
@@ -28,24 +16,34 @@ jobs:
|
|||||||
node-version: 18
|
node-version: 18
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Copy env
|
- name: Copy env
|
||||||
run: cp .env.example .env
|
run: cp .env.example .env
|
||||||
|
|
||||||
|
- name: Start Services
|
||||||
|
run: npm run dx:up
|
||||||
|
|
||||||
- name: Install Playwright Browsers
|
- name: Install Playwright Browsers
|
||||||
run: npx playwright install --with-deps
|
run: npx playwright install --with-deps
|
||||||
|
|
||||||
- name: Generate Prisma Client
|
- name: Generate Prisma Client
|
||||||
run: npm run prisma:generate -w @documenso/prisma
|
run: npm run prisma:generate -w @documenso/prisma
|
||||||
|
|
||||||
- name: Create the database
|
- name: Create the database
|
||||||
run: npm run prisma:migrate-dev
|
run: npm run prisma:migrate-dev
|
||||||
|
|
||||||
|
- name: Seed the database
|
||||||
|
run: npm run prisma:seed
|
||||||
|
|
||||||
- name: Run Playwright tests
|
- name: Run Playwright tests
|
||||||
run: npm run ci
|
run: npm run ci
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
if: always()
|
if: always()
|
||||||
with:
|
with:
|
||||||
name: playwright-report
|
name: test-results
|
||||||
path: playwright-report/
|
path: "packages/app-tests/**/test-results/*"
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
env:
|
env:
|
||||||
NEXT_PRIVATE_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/documenso
|
|
||||||
NEXT_PRIVATE_DIRECT_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/documenso
|
|
||||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||||
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
|
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
|
||||||
|
|||||||
16
.prettierignore
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
node_modules
|
||||||
|
.next
|
||||||
|
public
|
||||||
|
**/**/node_modules
|
||||||
|
**/**/.next
|
||||||
|
**/**/public
|
||||||
|
|
||||||
|
*.lock
|
||||||
|
*.log
|
||||||
|
*.test.ts
|
||||||
|
|
||||||
|
.gitignore
|
||||||
|
.npmignore
|
||||||
|
.prettierignore
|
||||||
|
.DS_Store
|
||||||
|
.eslintignore
|
||||||
5
.vscode/settings.json
vendored
@@ -6,5 +6,8 @@
|
|||||||
"eslint.validate": ["typescript", "typescriptreact", "javascript", "javascriptreact"],
|
"eslint.validate": ["typescript", "typescriptreact", "javascript", "javascriptreact"],
|
||||||
"javascript.preferences.importModuleSpecifier": "non-relative",
|
"javascript.preferences.importModuleSpecifier": "non-relative",
|
||||||
"javascript.preferences.useAliasesForRenames": false,
|
"javascript.preferences.useAliasesForRenames": false,
|
||||||
"typescript.enablePromptUseWorkspaceTsdk": true
|
"typescript.enablePromptUseWorkspaceTsdk": true,
|
||||||
|
"files.eol": "\n",
|
||||||
|
"editor.tabSize": 2,
|
||||||
|
"editor.insertSpaces": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ The development branch is <code>main</code>. All pull requests should be made ag
|
|||||||
- Create a new branch (include the issue id and something readable):
|
- Create a new branch (include the issue id and something readable):
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git checkout -b doc-999-my-feature-or-fix
|
git checkout -b feat/doc-999-somefeature-that-rocks
|
||||||
```
|
```
|
||||||
|
|
||||||
3. See the [Developer Setup](https://github.com/documenso/documenso/blob/main/README.md#developer-setup) for more setup details.
|
3. See the [Developer Setup](https://github.com/documenso/documenso/blob/main/README.md#developer-setup) for more setup details.
|
||||||
|
|||||||
6
MANIFEST.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# The Documenso Manifest
|
||||||
|
Signing documents is a fundamental building block of private, economic, and government interactions. Access to easy and secure signing to participate in society should therefore be a fundamental right for everyone. The technology to enable this should be accessible and widespread.
|
||||||
|
|
||||||
|
We know that open source is the key to solving this need once and for all to benefit all humankind. Using open source kickstarts innovation by putting the open sharing of ideas and solutions first. With Documenso, we will create an open and globally accessible signing platform to empower users, customers, and developers to fulfill their needs. Documenso is built by and for the global community, listening and implementing what is needed. Being transparent with the code and the processes that use it brings trust and security to the platform.
|
||||||
|
|
||||||
|
We build Documenso for longevity and scale by embracing the capital efficiency and inclusiveness of the Commercial Open Source (COSS) movement. We are building a global commodity for the world.
|
||||||
129
README.md
@@ -30,14 +30,6 @@
|
|||||||
<a href="code_of_conduct.md"><img src="https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg" alt="Contributor Covenant"></a>
|
<a href="code_of_conduct.md"><img src="https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg" alt="Contributor Covenant"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
> 🦺 Documenso 1.0 is deployed to our <a href="https://documen.so/staging" target="_blank">Staging Environment</a>.
|
|
||||||
>
|
|
||||||
> The code can be found on the [feat/refresh](https://github.com/documenso/documenso/tree/feat/refresh) branch.
|
|
||||||
>
|
|
||||||
> The new version will be released after the current testing phase.
|
|
||||||
|
|
||||||
# Join us in testing Documenso 1.0 during [MALFUNCTION MANIA](https://documenso.com/blog/malfunction-mania)
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<img style="display: block; height: 120px; width: 24%"
|
<img style="display: block; height: 120px; width: 24%"
|
||||||
src="https://github.com/documenso/documenso/assets/1309312/67e08c98-c153-4115-aa2d-77979bb12c94)">
|
src="https://github.com/documenso/documenso/assets/1309312/67e08c98-c153-4115-aa2d-77979bb12c94)">
|
||||||
@@ -70,14 +62,14 @@ Join us in creating the next generation of open trust infrastructure.
|
|||||||
|
|
||||||
## Community and Next Steps 🎯
|
## Community and Next Steps 🎯
|
||||||
|
|
||||||
We're currently working on a redesign of the application, including a revamp of the codebase so Documenso can be more intuitive to use and robust to develop upon.
|
We're currently working on a redesign of the application, including a revamp of the codebase, so Documenso can be more intuitive to use and robust to develop upon.
|
||||||
|
|
||||||
- Check out the first source code release in this repository and test it
|
- Check out the first source code release in this repository and test it.
|
||||||
- Tell us what you think in the [Discussions](https://github.com/documenso/documenso/discussions)
|
- Tell us what you think in the [Discussions](https://github.com/documenso/documenso/discussions).
|
||||||
- Join the [Discord server](https://documen.so/discord) for any questions and getting to know to other community members
|
- Join the [Discord server](https://documen.so/discord) for any questions and getting to know to other community members.
|
||||||
- ⭐ the repository to help us raise awareness
|
- ⭐ the repository to help us raise awareness.
|
||||||
- Spread the word on Twitter that Documenso is working towards a more open signing tool
|
- Spread the word on Twitter that Documenso is working towards a more open signing tool.
|
||||||
- Fix or create [issues](https://github.com/documenso/documenso/issues), that are needed for the first production release
|
- Fix or create [issues](https://github.com/documenso/documenso/issues), that are needed for the first production release.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
@@ -111,7 +103,7 @@ Contact us if you are interested in our Enterprise plan for large organizations
|
|||||||
|
|
||||||
### Requirements
|
### Requirements
|
||||||
|
|
||||||
To run Documenso locally you will need
|
To run Documenso locally, you will need
|
||||||
|
|
||||||
- Node.js
|
- Node.js
|
||||||
- Postgres SQL Database
|
- Postgres SQL Database
|
||||||
@@ -129,7 +121,7 @@ Want to get up and running quickly? Follow these steps:
|
|||||||
git clone https://github.com/documenso/documenso
|
git clone https://github.com/documenso/documenso
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Set up your `.env` file using the recommendations in the `.env.example` file. Alternatively just run `cp .env.example .env` to get started with our handpicked defaults.
|
2. Set up your `.env` file using the recommendations in the `.env.example` file. Alternatively, just run `cp .env.example .env` to get started with our handpicked defaults.
|
||||||
|
|
||||||
3. Run `npm run dx` in the root directory
|
3. Run `npm run dx` in the root directory
|
||||||
|
|
||||||
@@ -156,7 +148,7 @@ npm run d
|
|||||||
|
|
||||||
### Manual Setup
|
### Manual Setup
|
||||||
|
|
||||||
Follow these steps to setup documenso on you local machine:
|
Follow these steps to setup Documenso on your local machine:
|
||||||
|
|
||||||
1. [Clone the repository](https://help.github.com/articles/cloning-a-repository/) it to your local device.
|
1. [Clone the repository](https://help.github.com/articles/cloning-a-repository/) it to your local device.
|
||||||
|
|
||||||
@@ -164,11 +156,11 @@ Follow these steps to setup documenso on you local machine:
|
|||||||
git clone https://github.com/documenso/documenso
|
git clone https://github.com/documenso/documenso
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Run `npm i` in root directory
|
2. Run `npm i` in the root directory
|
||||||
|
|
||||||
3. Create your `.env` from the `.env.example`. You can use `cp .env.example .env` to get started with our handpicked defaults.
|
3. Create your `.env` from the `.env.example`. You can use `cp .env.example .env` to get started with our handpicked defaults.
|
||||||
|
|
||||||
4. Set the following environement variables.
|
4. Set the following environment variables:
|
||||||
|
|
||||||
- NEXTAUTH_URL
|
- NEXTAUTH_URL
|
||||||
- NEXTAUTH_SECRET
|
- NEXTAUTH_SECRET
|
||||||
@@ -181,15 +173,15 @@ git clone https://github.com/documenso/documenso
|
|||||||
|
|
||||||
5. Create the database schema by running `npm run prisma:migrate-dev`
|
5. Create the database schema by running `npm run prisma:migrate-dev`
|
||||||
|
|
||||||
6. Run `npm run dev` root directory to start
|
6. Run `npm run dev` in the root directory to start
|
||||||
|
|
||||||
7. Register a new user at http://localhost:3000/signup
|
7. Register a new user at http://localhost:3000/signup
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
- Optional: Seed the database using `npm run prisma:seed -w @documenso/prisma` to create a test user and document
|
- Optional: Seed the database using `npm run prisma:seed -w @documenso/prisma` to create a test user and document.
|
||||||
- Optional: Create your own signing certificate
|
- Optional: Create your own signing certificate.
|
||||||
- To generate your own using these steps and a Linux Terminal or Windows Subsystem for Linux (WSL) see **[Create your own signing certificate](./SIGNING.md)**.
|
- To generate your own using these steps and a Linux Terminal or Windows Subsystem for Linux (WSL), see **[Create your own signing certificate](./SIGNING.md)**.
|
||||||
|
|
||||||
### Run in Gitpod
|
### Run in Gitpod
|
||||||
|
|
||||||
@@ -201,15 +193,88 @@ git clone https://github.com/documenso/documenso
|
|||||||
|
|
||||||
We support DevContainers for VSCode. [Click here to get started.](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/documenso/documenso)
|
We support DevContainers for VSCode. [Click here to get started.](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/documenso/documenso)
|
||||||
|
|
||||||
|
### Video walkthrough
|
||||||
|
|
||||||
|
If you're a visual learner and prefer to watch a video walkthrough of setting up Documenso locally, check out this video:
|
||||||
|
|
||||||
|
[](https://youtu.be/Y0ppIQrEnZs)
|
||||||
|
|
||||||
## Docker
|
## Docker
|
||||||
|
|
||||||
🚧 Docker containers and images are current in progress. We are actively working on bringing a simple docker build and publish pipeline for Documenso.
|
🚧 Docker containers and images are current in progress. We are actively working on bringing a simple Docker build and publish pipeline for Documenso.
|
||||||
|
|
||||||
## Self Hosting
|
## Self Hosting
|
||||||
|
|
||||||
We support a variety of deployment methods, and are actively working on adding more. Stay tuned for updates!
|
We support a variety of deployment methods, and are actively working on adding more. Stay tuned for updates!
|
||||||
|
|
||||||
> Please note the below deployment methods are for v0.9, we will update these to v1.0 once it has been released.
|
> Please note that the below deployment methods are for v0.9, we will update these to v1.0 once it has been released.
|
||||||
|
|
||||||
|
### Fetch, configure, and build
|
||||||
|
|
||||||
|
First, clone the code from Github:
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone https://github.com/documenso/documenso.git
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, inside the `documenso` folder, copy the example env file:
|
||||||
|
|
||||||
|
```
|
||||||
|
cp .env.example .env
|
||||||
|
```
|
||||||
|
|
||||||
|
The following environment variables must be set:
|
||||||
|
|
||||||
|
* `NEXTAUTH_URL`
|
||||||
|
* `NEXTAUTH_SECRET`
|
||||||
|
* `NEXT_PUBLIC_WEBAPP_URL`
|
||||||
|
* `NEXT_PUBLIC_MARKETING_URL`
|
||||||
|
* `NEXT_PRIVATE_DATABASE_URL`
|
||||||
|
* `NEXT_PRIVATE_DIRECT_DATABASE_URL`
|
||||||
|
* `NEXT_PRIVATE_SMTP_FROM_NAME`
|
||||||
|
* `NEXT_PRIVATE_SMTP_FROM_ADDRESS`
|
||||||
|
|
||||||
|
> If you are using a reverse proxy in front of Documenso, don't forget to provide the public URL for both `NEXTAUTH_URL` and `NEXT_PUBLIC_WEBAPP_URL` variables!
|
||||||
|
|
||||||
|
Now you can install the dependencies and build it:
|
||||||
|
|
||||||
|
```
|
||||||
|
npm i
|
||||||
|
npm run build:web
|
||||||
|
npm run prisma:migrate-deploy
|
||||||
|
```
|
||||||
|
|
||||||
|
Finally, you can start it with:
|
||||||
|
|
||||||
|
```
|
||||||
|
npm run start
|
||||||
|
```
|
||||||
|
|
||||||
|
This will start the server on `localhost:3000`. For now, any reverse proxy can then do the frontend and SSL termination.
|
||||||
|
|
||||||
|
> If you want to run with another port than 3000, you can start the application with `next -p <ANY PORT>` from the `apps/web` folder.
|
||||||
|
|
||||||
|
### Run as a service
|
||||||
|
|
||||||
|
You can use a systemd service file to run the app. Here is a simple example of the service running on port 3500 (using 3000 by default):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
[Unit]
|
||||||
|
Description=documenso
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Environment=PATH=/path/to/your/node/binaries
|
||||||
|
Type=simple
|
||||||
|
User=www-data
|
||||||
|
WorkingDirectory=/var/www/documenso/apps/web
|
||||||
|
ExecStart=/usr/bin/next start -p 3500
|
||||||
|
TimeoutSec=15
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
```
|
||||||
|
|
||||||
### Railway
|
### Railway
|
||||||
|
|
||||||
@@ -221,15 +286,15 @@ We support a variety of deployment methods, and are actively working on adding m
|
|||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
### I'm not receiving any emails when using the developer quickstart
|
### I'm not receiving any emails when using the developer quickstart.
|
||||||
|
|
||||||
When using the developer quickstart an [Inbucket](https://inbucket.org/) server will be spun up in a docker container that will store all outgoing email locally for you to view.
|
When using the developer quickstart, an [Inbucket](https://inbucket.org/) server will be spun up in a docker container that will store all outgoing emails locally for you to view.
|
||||||
|
|
||||||
The Web UI can be found at http://localhost:9000 while the SMTP port will be on localhost:2500.
|
The Web UI can be found at http://localhost:9000, while the SMTP port will be on localhost:2500.
|
||||||
|
|
||||||
### Support IPv6
|
### Support IPv6
|
||||||
|
|
||||||
In case you are deploying to a cluster that uses only IPv6. You can use a custom command to pass a parameter to the Next.js start command
|
If you are deploying to a cluster that uses only IPv6, You can use a custom command to pass a parameter to the Next.js start command
|
||||||
|
|
||||||
For local docker run
|
For local docker run
|
||||||
|
|
||||||
@@ -254,7 +319,7 @@ containers:
|
|||||||
- '::'
|
- '::'
|
||||||
```
|
```
|
||||||
|
|
||||||
### I can't see environment variables in my package scripts
|
### I can't see environment variables in my package scripts.
|
||||||
|
|
||||||
Wrap your package script with the `with:env` script like such:
|
Wrap your package script with the `with:env` script like such:
|
||||||
|
|
||||||
@@ -262,7 +327,7 @@ Wrap your package script with the `with:env` script like such:
|
|||||||
npm run with:env -- npm run myscript
|
npm run with:env -- npm run myscript
|
||||||
```
|
```
|
||||||
|
|
||||||
The same can be done when using `npx` for one of bin scripts:
|
The same can be done when using `npx` for one of the bin scripts:
|
||||||
|
|
||||||
```
|
```
|
||||||
npm run with:env -- npx myscript
|
npm run with:env -- npx myscript
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ There weren’t any deeper reasons we choose WiseKey, other than they offered wh
|
|||||||
Do you have questions or thoughts about this? As always, let me know in the comments, on <a href="http://twitter.com/eltimuro" target="_blank">twitter.com/eltimuro</a>
|
Do you have questions or thoughts about this? As always, let me know in the comments, on <a href="http://twitter.com/eltimuro" target="_blank">twitter.com/eltimuro</a>
|
||||||
or directly: <a href="https://documen.so/timur" target="_blank">documen.so/timur</a>
|
or directly: <a href="https://documen.so/timur" target="_blank">documen.so/timur</a>
|
||||||
|
|
||||||
Join the self-hoster community here: <a href="https://documenso.slack.com/" target="_blank">https://documenso.slack.com/</a>
|
Join the self-hoster community here: <a href="https://documen.so/discord" target="_blank">https://documen.so/discord</a>
|
||||||
|
|
||||||
Best from Hamburg
|
Best from Hamburg
|
||||||
|
|
||||||
|
|||||||
75
apps/marketing/content/blog/live-roadmap-singleplayer.mdx
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
---
|
||||||
|
title: The 🔴 LIVE Roadmap
|
||||||
|
description: It's the Launch Week Day finale, Day 5! We are going out with a bang and introducing the 🔴 LIVE roadmap, featuring our next Product Hunt Launch - Free Singleplayer Documenso - Sign without creating an account!
|
||||||
|
authorName: 'Timur Ercan'
|
||||||
|
authorImage: '/blog/blog-author-timur.jpeg'
|
||||||
|
authorRole: 'Co-Founder'
|
||||||
|
date: 2023-09-29
|
||||||
|
tags:
|
||||||
|
- Free Plan
|
||||||
|
- Launch
|
||||||
|
- Roadmap
|
||||||
|
---
|
||||||
|
|
||||||
|
<figure>
|
||||||
|
<MdxNextImage
|
||||||
|
src="/blog/roadmap.png"
|
||||||
|
width="1260"
|
||||||
|
height="630"
|
||||||
|
alt="XKCD: Bug"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<figcaption className="text-center">
|
||||||
|
"Being early is, uh, good." -Unknown
|
||||||
|
</figcaption>
|
||||||
|
</figure>
|
||||||
|
|
||||||
|
> TLDR; We are launching a [🔴 LIVE roadmap](https://documen.so/launches), that gets updated regularly.\
|
||||||
|
> First upcoming launch: A free single signer experience.
|
||||||
|
|
||||||
|
## The Road Ahead
|
||||||
|
|
||||||
|
It's been quite a week, launching our [design system](https://documenso.com/blog/design-system), [kicking of a Malfunction Mania](https://documenso.com/blog/malfunction-mania), a [shiny new contributor perk](https://documenso.com/blog/shop) and our [early adopter deal](https://documenso.com/blog/early-adopters). After discussing Version 1.0 a lot, we want to close the week by looking ahead. As an open company, we want transparency about what we are working on and what to expect next. Especially for our Early Adopters, we want to paint a clear picture of what to expect in the near term.
|
||||||
|
|
||||||
|
Communicating software development progress and goals is historically tricky because of it's complex nature. Exact release dates are notoriously unreliable; if they are not, they force a particular style of development, forcing the team to make tradeoffs on scope and quality.
|
||||||
|
|
||||||
|
To give an appropriate insight into our work, we are launching our new [🔴 LIVE roadmap](https://documen.so/launches) today:
|
||||||
|
|
||||||
|
- A List of quarterly development and feature goals
|
||||||
|
- That gets updated regularly (bi-weekly)
|
||||||
|
- Has up-to-date insights from the team on where we stand
|
||||||
|
|
||||||
|
**While there are some great features planned, one stands out: Single Player Mode!**
|
||||||
|
|
||||||
|
## Announcing Documenso Singleplayer Mode
|
||||||
|
|
||||||
|
<a href="https://www.producthunt.com/products/documenso" target="_blank">
|
||||||
|
<figure>
|
||||||
|
<MdxNextImage
|
||||||
|
src="/blog/sp5.png"
|
||||||
|
width="1260"
|
||||||
|
height="630"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<figcaption className="text-center font-bold">
|
||||||
|
🚨 We are going back to Product Hunt! Are you ready, player one?
|
||||||
|
</figcaption>
|
||||||
|
</figure>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
Single Player Mode will be a free, loginless signing experience for single signers. If you hate creating an account to sign a single, once-in-a-while-document yourself as much as we do, we've got you. Our new free tier will accompany Singleplayer. While you don't HAVE to create an account to sign sth. quickly, you can. A free tier Documenso Account will give you the following:
|
||||||
|
|
||||||
|
- A place to store all your sent and received Documenso-signed documents
|
||||||
|
- Free forever
|
||||||
|
- Unlimited recipients
|
||||||
|
- 5 free signatures per month (for now, excluding third party types like QES)
|
||||||
|
- The use of templates, as soon as we [release](https://documen.so/launches) them
|
||||||
|
|
||||||
|
Singleplayer will launch in the first half of October, shortly after the release of 1.0, **[ON PRODUCT HUNT!](https://www.producthunt.com/products/documenso)** That's right, we are going back to Product Hunt to kick of this new phase of Documenso and you are invited to join us once again :)
|
||||||
|
|
||||||
|
**[Subscribe on PH](https://www.producthunt.com/products/documenso)** to be notified when we launch.
|
||||||
|
|
||||||
|
If you have any questions or comments, please reach out on [Twitter / X](https://twitter.com/eltimuro) (DM open) or [Discord](https://documen.so/discord).
|
||||||
|
|
||||||
|
Best from Hamburg\
|
||||||
|
Timur
|
||||||
@@ -14,9 +14,11 @@ tags:
|
|||||||
Today I'm happy to announce that we closed a \$1.25M Pre-Seed round for Documenso, bringing our total funding to \$1.54M. The round actually closed last month, we just were sneaky about it.
|
Today I'm happy to announce that we closed a \$1.25M Pre-Seed round for Documenso, bringing our total funding to \$1.54M. The round actually closed last month, we just were sneaky about it.
|
||||||
|
|
||||||
## Two more for the road (to open signing)
|
## Two more for the road (to open signing)
|
||||||
|
|
||||||
We're ecstatic to welcome [OSS Capital](https://twitter.com/osscapital) and especially [Joseph Jacks](https://twitter.com/JosephJacks_) to the inner circle of the open signing revolution. We're also fortunate to be joined by Orrick's very own [John Harrison](https://www.linkedin.com/in/john-harrison-a1213b9/) and his legal experience. For those who are wondering, yes, the round was, of course, signed using Documenso.
|
We're ecstatic to welcome [OSS Capital](https://twitter.com/osscapital) and especially [Joseph Jacks](https://twitter.com/JosephJacks_) to the inner circle of the open signing revolution. We're also fortunate to be joined by Orrick's very own [John Harrison](https://www.linkedin.com/in/john-harrison-a1213b9/) and his legal experience. For those who are wondering, yes, the round was, of course, signed using Documenso.
|
||||||
|
|
||||||
## Open Source, Open Metrics
|
## Open Source, Open Metrics
|
||||||
|
|
||||||
If you follow us, you know we're firmly committed to the open source values of openness and transparency. For us, this includes not only the code side of things but also the business. As we aim to build trust among our investors, customers, and partners, we want to be open about what's going on. We also want to allow everyone to learn from our data and choices, just as we did from so many other COSS (Commercial Open Source) startups. The term "Open Startup" isn't precisely defined (and probably will never be, just like startup). There is however a [great write-up](https://cal.com/blog/open-startup) about the basics by the founder of our favorite open source scheduling tool Cal.com.
|
If you follow us, you know we're firmly committed to the open source values of openness and transparency. For us, this includes not only the code side of things but also the business. As we aim to build trust among our investors, customers, and partners, we want to be open about what's going on. We also want to allow everyone to learn from our data and choices, just as we did from so many other COSS (Commercial Open Source) startups. The term "Open Startup" isn't precisely defined (and probably will never be, just like startup). There is however a [great write-up](https://cal.com/blog/open-startup) about the basics by the founder of our favorite open source scheduling tool Cal.com.
|
||||||
|
|
||||||
The two main takeaways are:
|
The two main takeaways are:
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ We’re an open-source project and focus on building a great developer experienc
|
|||||||
|
|
||||||
So, we’re switching all conversations, team and community-wide, to Discord.
|
So, we’re switching all conversations, team and community-wide, to Discord.
|
||||||
|
|
||||||
In this post, we won’t debate *why* we’re switching — Slack vs. Discord is a long-lasting debate with pros and cons, and fans on both sides. There are great [stories](https://blog.meilisearch.com/from-slack-to-discord-our-migration/) and [threads](https://twitter.com/McPizza0/status/1655519558600470528) on the topic. We just don’t want to write yet another story here.
|
In this post, we won’t debate _why_ we’re switching — Slack vs. Discord is a long-lasting debate with pros and cons, and fans on both sides. There are great [stories](https://blog.meilisearch.com/from-slack-to-discord-our-migration/) and [threads](https://twitter.com/McPizza0/status/1655519558600470528) on the topic. We just don’t want to write yet another story here.
|
||||||
|
|
||||||
Instead, we’ll focus on *how* we plan to make the switch.
|
Instead, we’ll focus on _how_ we plan to make the switch.
|
||||||
|
|
||||||
## Who is this story for?
|
## Who is this story for?
|
||||||
|
|
||||||
@@ -46,90 +46,91 @@ The detailed plan goes like this:
|
|||||||
- 2023-07-26 `t+1`: The team switches to Discord. The objective is to get used to the product and to customize it to feel at home and, when we’re ready to welcome the community, to make new members feel at home, too.
|
- 2023-07-26 `t+1`: The team switches to Discord. The objective is to get used to the product and to customize it to feel at home and, when we’re ready to welcome the community, to make new members feel at home, too.
|
||||||
- 2023-08-02 `t+8`: We announce to the community the upcoming changes in the different channels — GitHub, Twitter, and Slack.
|
- 2023-08-02 `t+8`: We announce to the community the upcoming changes in the different channels — GitHub, Twitter, and Slack.
|
||||||
|
|
||||||
- **GitHub**
|
- **GitHub**
|
||||||
- Create new Pull Request
|
|
||||||
- Add story to the blog
|
|
||||||
- Update link to the community
|
|
||||||
|
|
||||||
```
|
- Create new Pull Request
|
||||||
https://documen.so/discord
|
- Add story to the blog
|
||||||
```
|
- Update link to the community
|
||||||
|
```
|
||||||
|
https://documen.so/discord
|
||||||
|
```
|
||||||
|
- Start a new Discussion
|
||||||
|
|
||||||
- Start a new Discussion
|
```markdown
|
||||||
|
Happy Wednesday!
|
||||||
|
|
||||||
```markdown
|
TL,DR: We’re switching to Discord. [Join the fun!](https://documen.so/discord)
|
||||||
Happy Wednesday!
|
|
||||||
|
|
||||||
TL,DR: We’re switching to Discord. [Join the fun!](https://documen.so/discord)
|
We want to build a beautiful, open-source DocuSign alternative. As we're growing (reached 2.3K Stars), we feel the need to have a more community- and developer-friendly environment to share ideas, support, and memes.
|
||||||
|
|
||||||
We want to build a beautiful, open-source DocuSign alternative. As we're growing (reached 2.3K Stars), we feel the need to have a more community- and developer-friendly environment to share ideas, support, and memes.
|
Make sure to join the server to keep up to date on all things Documenso.
|
||||||
|
|
||||||
Make sure to join the server to keep up to date on all things Documenso.
|
Oh and, spoiler alert, there may be some swag there 👀
|
||||||
|
|
||||||
Oh and, spoiler alert, there may be some swag there 👀
|
See you there!
|
||||||
|
Flo
|
||||||
|
```
|
||||||
|
|
||||||
See you there!
|
- **Twitter**
|
||||||
Flo
|
|
||||||
```
|
|
||||||
|
|
||||||
- **Twitter**
|
- [Tweet the announcement](https://twitter.com/documenso/status/1686719482096766977)
|
||||||
- [Tweet the announcement](https://twitter.com/documenso/status/1686719482096766977)
|
- Pin Tweet
|
||||||
- Pin Tweet
|
- Update link in bio
|
||||||
- Update link in bio
|
|
||||||
|
|
||||||
```
|
```
|
||||||
The Open Source DocuSign Alternative.
|
The Open Source DocuSign Alternative.
|
||||||
|
|
||||||
http://documen.so/github
|
http://documen.so/github
|
||||||
http://documen.so/discord
|
http://documen.so/discord
|
||||||
http://documen.so/manifest
|
http://documen.so/manifest
|
||||||
ㅤ
|
ㅤ
|
||||||
```
|
```
|
||||||
|
|
||||||
- **Slack**
|
- **Slack**
|
||||||
- Post message in `#general`
|
|
||||||
|
|
||||||
```markdown
|
- Post message in `#general`
|
||||||
Happy Wednesday!
|
|
||||||
|
|
||||||
TL,DR: We’re switching to Discord. [Join the fun!](https://documen.so/discord)
|
```markdown
|
||||||
|
Happy Wednesday!
|
||||||
|
|
||||||
We want to build a beautiful, open-source DocuSign alternative. As we're growing (reached 2.3K Stars), we feel the need to have a more community- and developer-friendly environment to share ideas, support, and memes.
|
TL,DR: We’re switching to Discord. [Join the fun!](https://documen.so/discord)
|
||||||
|
|
||||||
Make sure to [join the server](https://documen.so/discord) to keep up to date on all things Documenso.
|
We want to build a beautiful, open-source DocuSign alternative. As we're growing (reached 2.3K Stars), we feel the need to have a more community- and developer-friendly environment to share ideas, support, and memes.
|
||||||
|
|
||||||
Oh and, spoiler alert, there may be some swag there 👀
|
Make sure to [join the server](https://documen.so/discord) to keep up to date on all things Documenso.
|
||||||
|
|
||||||
See you there!
|
Oh and, spoiler alert, there may be some swag there 👀
|
||||||
Flo
|
|
||||||
```
|
|
||||||
|
|
||||||
- Pin post
|
See you there!
|
||||||
- Set topic and description
|
Flo
|
||||||
|
```
|
||||||
|
|
||||||
```
|
- Pin post
|
||||||
We're switching to Discord. Join the fun: https://documen.so/discord
|
- Set topic and description
|
||||||
```
|
```
|
||||||
|
We're switching to Discord. Join the fun: https://documen.so/discord
|
||||||
- Archive channels: `#code-review` `#how-to` `#meet-and-greet` `#random-memes` `#self-hosting` `#support`
|
```
|
||||||
|
- Archive channels: `#code-review` `#how-to` `#meet-and-greet` `#random-memes` `#self-hosting` `#support`
|
||||||
|
|
||||||
- 2023-08-09 `t+15`: 7 days later, we send a reminder on Slack.
|
- 2023-08-09 `t+15`: 7 days later, we send a reminder on Slack.
|
||||||
- **Slack**
|
|
||||||
- Schedule reminder in `#general`
|
|
||||||
|
|
||||||
```
|
- **Slack**
|
||||||
Friendly reminder: we're switching to Discord and will soon disconnect this Slack workspace.
|
|
||||||
|
|
||||||
Join the fun! https://documen.so/discord
|
- Schedule reminder in `#general`
|
||||||
```
|
|
||||||
|
```
|
||||||
|
Friendly reminder: we're switching to Discord and will soon disconnect this Slack workspace.
|
||||||
|
|
||||||
|
Join the fun! https://documen.so/discord
|
||||||
|
```
|
||||||
|
|
||||||
- 2023-08-16 `t+22`: 15 days later, we’re making the final edits to the Slack workspace.
|
- 2023-08-16 `t+22`: 15 days later, we’re making the final edits to the Slack workspace.
|
||||||
- **Slack**
|
- **Slack**
|
||||||
- [Edit posting permissions](https://app.slack.com/slackhelp/en-US/360004635551) in `#general`
|
- [Edit posting permissions](https://app.slack.com/slackhelp/en-US/360004635551) in `#general`
|
||||||
- Disconnect Slack
|
- Disconnect Slack
|
||||||
|
|
||||||
## Final thoughts
|
## Final thoughts
|
||||||
|
|
||||||
- We’re at the very, early stage on our journey to building a beautiful, open-source DocuSign alternative. We want to build a great developer experience with the open-source community and, switching to Discord, we want to set up the foundations of an open, safe place for community members to get in touch, brainstorm ideas, and have fun.
|
- We’re at the very, early stage on our journey to building a beautiful, open-source DocuSign alternative. We want to build a great developer experience with the open-source community and, switching to Discord, we want to set up the foundations of an open, safe place for community members to get in touch, brainstorm ideas, and have fun.
|
||||||
- It doesn’t mean we won’t ever switch back to Slack. The tools of today aren’t the ones of tomorrow. We don’t delete the Slack workspace, we archive it, and keep the `documenso` handle. May it be just an *au revoir?*
|
- It doesn’t mean we won’t ever switch back to Slack. The tools of today aren’t the ones of tomorrow. We don’t delete the Slack workspace, we archive it, and keep the `documenso` handle. May it be just an _au revoir?_
|
||||||
- For now, we’re pushing forward and are eager to welcome you on Discord. Make sure to [join the server](https://documen.so/discord) in order to keep up to date on all things Documenso. See you there!
|
- For now, we’re pushing forward and are eager to welcome you on Discord. Make sure to [join the server](https://documen.so/discord) in order to keep up to date on all things Documenso. See you there!
|
||||||
|
|||||||
13
apps/marketing/content/careers.mdx
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
title: Careers at Documenso
|
||||||
|
---
|
||||||
|
|
||||||
|
# Careers at Documenso
|
||||||
|
|
||||||
|
So you love Documenso and all the things that we do and now you want to work with us to unlock the future of open signing?
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Open Positions
|
||||||
|
|
||||||
|
Unfortunately we have no open positions available at the moment. Our team has grown and so we must grow with it, please check back from time to time as now is not forever and we may be hiring again in the future.
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||||
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const { withContentlayer } = require('next-contentlayer');
|
const { withContentlayer } = require('next-contentlayer');
|
||||||
|
|
||||||
@@ -10,15 +11,31 @@ ENV_FILES.forEach((file) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// !: This is a temp hack to get caveat working without placing it back in the public directory.
|
||||||
|
// !: By inlining this at build time we should be able to sign faster.
|
||||||
|
const FONT_CAVEAT_BYTES = fs.readFileSync(
|
||||||
|
path.join(__dirname, '../../packages/assets/fonts/caveat.ttf'),
|
||||||
|
);
|
||||||
|
|
||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const config = {
|
const config = {
|
||||||
experimental: {
|
experimental: {
|
||||||
serverActionsBodySizeLimit: '10mb',
|
outputFileTracingRoot: path.join(__dirname, '../../'),
|
||||||
|
serverActions: {
|
||||||
|
bodySizeLimit: '50mb',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
reactStrictMode: true,
|
reactStrictMode: true,
|
||||||
transpilePackages: ['@documenso/lib', '@documenso/prisma', '@documenso/trpc', '@documenso/ui'],
|
transpilePackages: [
|
||||||
|
'@documenso/assets',
|
||||||
|
'@documenso/lib',
|
||||||
|
'@documenso/tailwind-config',
|
||||||
|
'@documenso/trpc',
|
||||||
|
'@documenso/ui',
|
||||||
|
],
|
||||||
env: {
|
env: {
|
||||||
NEXT_PUBLIC_PROJECT: 'marketing',
|
NEXT_PUBLIC_PROJECT: 'marketing',
|
||||||
|
FONT_CAVEAT_URI: `data:font/ttf;base64,${FONT_CAVEAT_BYTES.toString('base64')}`,
|
||||||
},
|
},
|
||||||
modularizeImports: {
|
modularizeImports: {
|
||||||
'lucide-react': {
|
'lucide-react': {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@documenso/marketing",
|
"name": "@documenso/marketing",
|
||||||
"version": "0.1.0",
|
"version": "1.2.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -8,10 +8,12 @@
|
|||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start -p 3001",
|
"start": "next start -p 3001",
|
||||||
"lint": "next lint",
|
"lint": "next lint",
|
||||||
|
"lint:fix": "next lint --fix",
|
||||||
"clean": "rimraf .next && rimraf node_modules",
|
"clean": "rimraf .next && rimraf node_modules",
|
||||||
"copy:pdfjs": "node ../../scripts/copy-pdfjs.cjs"
|
"copy:pdfjs": "node ../../scripts/copy-pdfjs.cjs"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@documenso/assets": "*",
|
||||||
"@documenso/lib": "*",
|
"@documenso/lib": "*",
|
||||||
"@documenso/tailwind-config": "*",
|
"@documenso/tailwind-config": "*",
|
||||||
"@documenso/trpc": "*",
|
"@documenso/trpc": "*",
|
||||||
@@ -20,9 +22,10 @@
|
|||||||
"contentlayer": "^0.3.4",
|
"contentlayer": "^0.3.4",
|
||||||
"framer-motion": "^10.12.8",
|
"framer-motion": "^10.12.8",
|
||||||
"lucide-react": "^0.279.0",
|
"lucide-react": "^0.279.0",
|
||||||
|
"luxon": "^3.4.0",
|
||||||
"micro": "^10.0.1",
|
"micro": "^10.0.1",
|
||||||
"next": "14.0.0",
|
"next": "14.0.3",
|
||||||
"next-auth": "4.24.3",
|
"next-auth": "4.24.5",
|
||||||
"next-contentlayer": "^0.3.4",
|
"next-contentlayer": "^0.3.4",
|
||||||
"next-plausible": "^3.10.1",
|
"next-plausible": "^3.10.1",
|
||||||
"perfect-freehand": "^1.2.0",
|
"perfect-freehand": "^1.2.0",
|
||||||
@@ -41,5 +44,13 @@
|
|||||||
"@types/node": "20.1.0",
|
"@types/node": "20.1.0",
|
||||||
"@types/react": "18.2.18",
|
"@types/react": "18.2.18",
|
||||||
"@types/react-dom": "18.2.7"
|
"@types/react-dom": "18.2.7"
|
||||||
|
},
|
||||||
|
"overrides": {
|
||||||
|
"next-auth": {
|
||||||
|
"next": "$next"
|
||||||
|
},
|
||||||
|
"next-contentlayer": {
|
||||||
|
"next": "$next"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
apps/marketing/public/blog/roadmap.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
apps/marketing/public/blog/sp5.png
Normal file
|
After Width: | Height: | Size: 47 KiB |
@@ -4,13 +4,13 @@ import { allBlogPosts } from 'contentlayer/generated';
|
|||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'edge';
|
||||||
|
|
||||||
export const size = {
|
export const contentType = 'image/png';
|
||||||
|
|
||||||
|
export const IMAGE_SIZE = {
|
||||||
width: 1200,
|
width: 1200,
|
||||||
height: 630,
|
height: 630,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const contentType = 'image/png';
|
|
||||||
|
|
||||||
type BlogPostOpenGraphImageProps = {
|
type BlogPostOpenGraphImageProps = {
|
||||||
params: { post: string };
|
params: { post: string };
|
||||||
};
|
};
|
||||||
@@ -25,23 +25,23 @@ export default async function BlogPostOpenGraphImage({ params }: BlogPostOpenGra
|
|||||||
// The long urls are needed for a compiler optimisation on the Next.js side, lifting this up
|
// The long urls are needed for a compiler optimisation on the Next.js side, lifting this up
|
||||||
// to a constant will break og image generation.
|
// to a constant will break og image generation.
|
||||||
const [interBold, interRegular, backgroundImage, logoImage] = await Promise.all([
|
const [interBold, interRegular, backgroundImage, logoImage] = await Promise.all([
|
||||||
fetch(new URL('./../../../../assets/inter-bold.ttf', import.meta.url)).then(async (res) =>
|
fetch(new URL('@documenso/assets/fonts/inter-bold.ttf', import.meta.url)).then(async (res) =>
|
||||||
res.arrayBuffer(),
|
res.arrayBuffer(),
|
||||||
),
|
),
|
||||||
fetch(new URL('./../../../../assets/inter-regular.ttf', import.meta.url)).then(async (res) =>
|
fetch(new URL('@documenso/assets/fonts/inter-regular.ttf', import.meta.url)).then(async (res) =>
|
||||||
res.arrayBuffer(),
|
res.arrayBuffer(),
|
||||||
),
|
),
|
||||||
fetch(new URL('./../../../../assets/background-blog-og.png', import.meta.url)).then(
|
fetch(new URL('@documenso/assets/images/background-blog-og.png', import.meta.url)).then(
|
||||||
async (res) => res.arrayBuffer(),
|
async (res) => res.arrayBuffer(),
|
||||||
),
|
),
|
||||||
fetch(new URL('./../../../../../public/logo.png', import.meta.url)).then(async (res) =>
|
fetch(new URL('@documenso/assets/logo.png', import.meta.url)).then(async (res) =>
|
||||||
res.arrayBuffer(),
|
res.arrayBuffer(),
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return new ImageResponse(
|
return new ImageResponse(
|
||||||
(
|
(
|
||||||
<div tw="relative h-full w-full flex flex-col items-center justify-center text-center">
|
<div tw="relative h-full w-full flex flex-col items-center justify-center text-center bg-white">
|
||||||
{/* @ts-expect-error Lack of typing from ImageResponse */}
|
{/* @ts-expect-error Lack of typing from ImageResponse */}
|
||||||
<img src={backgroundImage} alt="og-background" tw="absolute inset-0 w-full h-full" />
|
<img src={backgroundImage} alt="og-background" tw="absolute inset-0 w-full h-full" />
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ export default async function BlogPostOpenGraphImage({ params }: BlogPostOpenGra
|
|||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
{
|
{
|
||||||
...size,
|
...IMAGE_SIZE,
|
||||||
fonts: [
|
fonts: [
|
||||||
{
|
{
|
||||||
name: 'Inter',
|
name: 'Inter',
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export default function MarketingLayout({ children }: MarketingLayoutProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cn('relative max-w-[100vw] pt-20 md:pt-28', {
|
className={cn('relative flex min-h-[100vh] max-w-[100vw] flex-col pt-20 md:pt-28', {
|
||||||
'overflow-y-auto overflow-x-hidden': pathname !== '/singleplayer',
|
'overflow-y-auto overflow-x-hidden': pathname !== '/singleplayer',
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
@@ -41,7 +41,7 @@ export default function MarketingLayout({ children }: MarketingLayoutProps) {
|
|||||||
<Header className="mx-auto h-16 max-w-screen-xl px-4 md:h-20 lg:px-8" />
|
<Header className="mx-auto h-16 max-w-screen-xl px-4 md:h-20 lg:px-8" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="relative mx-auto max-w-screen-xl px-4 lg:px-8">{children}</div>
|
<div className="relative mx-auto max-w-screen-xl flex-1 px-4 lg:px-8">{children}</div>
|
||||||
|
|
||||||
<Footer className="bg-background border-muted mt-24 border-t" />
|
<Footer className="bg-background border-muted mt-24 border-t" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -40,9 +40,9 @@ export const BarMetric = <T extends Record<string, Record<keyof T[string], unkno
|
|||||||
<span>{extraInfo}</span>
|
<span>{extraInfo}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="border-border mt-2.5 flex flex-1 items-center justify-center rounded-2xl border pr-2 shadow-sm hover:shadow">
|
<div className="border-border mt-2.5 flex flex-1 items-center justify-center rounded-2xl border p-6 pl-2 pt-12 shadow-sm hover:shadow">
|
||||||
<ResponsiveContainer width="100%" height={chartHeight}>
|
<ResponsiveContainer width="100%" height={chartHeight}>
|
||||||
<BarChart data={formattedData} margin={{ top: 30, right: 20 }}>
|
<BarChart data={formattedData}>
|
||||||
<XAxis dataKey="month" />
|
<XAxis dataKey="month" />
|
||||||
<YAxis />
|
<YAxis />
|
||||||
<Tooltip
|
<Tooltip
|
||||||
@@ -55,7 +55,13 @@ export const BarMetric = <T extends Record<string, Record<keyof T[string], unkno
|
|||||||
formatter={(value) => [Number(value), label]}
|
formatter={(value) => [Number(value), label]}
|
||||||
cursor={{ fill: 'hsl(var(--primary) / 10%)' }}
|
cursor={{ fill: 'hsl(var(--primary) / 10%)' }}
|
||||||
/>
|
/>
|
||||||
<Bar dataKey={metricKey as string} fill="hsl(var(--primary))" label={label} />{' '}
|
<Bar
|
||||||
|
dataKey={metricKey as string}
|
||||||
|
maxBarSize={60}
|
||||||
|
fill="hsl(var(--primary))"
|
||||||
|
label={label}
|
||||||
|
radius={[4, 4, 0, 0]}
|
||||||
|
/>
|
||||||
</BarChart>
|
</BarChart>
|
||||||
</ResponsiveContainer>
|
</ResponsiveContainer>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export const FundingRaised = ({ className, data, ...props }: FundingRaisedProps)
|
|||||||
<div className={cn('flex flex-col', className)} {...props}>
|
<div className={cn('flex flex-col', className)} {...props}>
|
||||||
<h3 className="px-4 text-lg font-semibold">Total Funding Raised</h3>
|
<h3 className="px-4 text-lg font-semibold">Total Funding Raised</h3>
|
||||||
|
|
||||||
<div className="border-border mt-2.5 flex flex-1 flex-col items-center justify-center rounded-2xl border p-4 shadow-sm hover:shadow">
|
<div className="border-border mt-2.5 flex flex-1 flex-col items-center justify-center rounded-2xl border p-6 pl-2 pt-12 shadow-sm hover:shadow">
|
||||||
<ResponsiveContainer width="100%" height={400}>
|
<ResponsiveContainer width="100%" height={400}>
|
||||||
<BarChart data={formattedData} margin={{ top: 40, right: 40, bottom: 20, left: 40 }}>
|
<BarChart data={formattedData} margin={{ top: 40, right: 40, bottom: 20, left: 40 }}>
|
||||||
<XAxis dataKey="date" />
|
<XAxis dataKey="date" />
|
||||||
@@ -51,7 +51,13 @@ export const FundingRaised = ({ className, data, ...props }: FundingRaisedProps)
|
|||||||
]}
|
]}
|
||||||
cursor={{ fill: 'hsl(var(--primary) / 10%)' }}
|
cursor={{ fill: 'hsl(var(--primary) / 10%)' }}
|
||||||
/>
|
/>
|
||||||
<Bar dataKey="amount" fill="hsl(var(--primary))" label="Amount Raised" />
|
<Bar
|
||||||
|
dataKey="amount"
|
||||||
|
fill="hsl(var(--primary))"
|
||||||
|
label="Amount Raised"
|
||||||
|
maxBarSize={60}
|
||||||
|
radius={[4, 4, 0, 0]}
|
||||||
|
/>
|
||||||
</BarChart>
|
</BarChart>
|
||||||
</ResponsiveContainer>
|
</ResponsiveContainer>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { DateTime } from 'luxon';
|
||||||
|
import { Bar, BarChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
|
||||||
|
|
||||||
|
import { GetUserMonthlyGrowthResult } from '@documenso/lib/server-only/user/get-user-monthly-growth';
|
||||||
|
import { cn } from '@documenso/ui/lib/utils';
|
||||||
|
|
||||||
|
export type MonthlyNewUsersChartProps = {
|
||||||
|
className?: string;
|
||||||
|
data: GetUserMonthlyGrowthResult;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const MonthlyNewUsersChart = ({ className, data }: MonthlyNewUsersChartProps) => {
|
||||||
|
const formattedData = [...data].reverse().map(({ month, count }) => {
|
||||||
|
return {
|
||||||
|
month: DateTime.fromFormat(month, 'yyyy-MM').toFormat('LLL'),
|
||||||
|
count: Number(count),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={cn('flex flex-col', className)}>
|
||||||
|
<div className="flex items-center px-4">
|
||||||
|
<h3 className="text-lg font-semibold">Monthly New Users</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="border-border mt-2.5 flex flex-1 items-center justify-center rounded-2xl border p-6 pl-2 pt-12 shadow-sm hover:shadow">
|
||||||
|
<ResponsiveContainer width="100%" height={400}>
|
||||||
|
<BarChart data={formattedData}>
|
||||||
|
<XAxis dataKey="month" />
|
||||||
|
<YAxis />
|
||||||
|
|
||||||
|
<Tooltip
|
||||||
|
formatter={(value) => [Number(value).toLocaleString('en-US'), 'New Users']}
|
||||||
|
cursor={{ fill: 'hsl(var(--primary) / 10%)' }}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Bar
|
||||||
|
dataKey="count"
|
||||||
|
fill="hsl(var(--primary))"
|
||||||
|
radius={[4, 4, 0, 0]}
|
||||||
|
maxBarSize={60}
|
||||||
|
label="New Users"
|
||||||
|
/>
|
||||||
|
</BarChart>
|
||||||
|
</ResponsiveContainer>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { DateTime } from 'luxon';
|
||||||
|
import { Bar, BarChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
|
||||||
|
|
||||||
|
import { GetUserMonthlyGrowthResult } from '@documenso/lib/server-only/user/get-user-monthly-growth';
|
||||||
|
import { cn } from '@documenso/ui/lib/utils';
|
||||||
|
|
||||||
|
export type MonthlyTotalUsersChartProps = {
|
||||||
|
className?: string;
|
||||||
|
data: GetUserMonthlyGrowthResult;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const MonthlyTotalUsersChart = ({ className, data }: MonthlyTotalUsersChartProps) => {
|
||||||
|
const formattedData = [...data].reverse().map(({ month, cume_count: count }) => {
|
||||||
|
return {
|
||||||
|
month: DateTime.fromFormat(month, 'yyyy-MM').toFormat('LLL'),
|
||||||
|
count: Number(count),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={cn('flex flex-col', className)}>
|
||||||
|
<div className="flex items-center px-4">
|
||||||
|
<h3 className="text-lg font-semibold">Monthly Total Users</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="border-border mt-2.5 flex flex-1 items-center justify-center rounded-2xl border p-6 pl-2 pt-12 shadow-sm hover:shadow">
|
||||||
|
<ResponsiveContainer width="100%" height={400}>
|
||||||
|
<BarChart data={formattedData}>
|
||||||
|
<XAxis dataKey="month" />
|
||||||
|
<YAxis />
|
||||||
|
|
||||||
|
<Tooltip
|
||||||
|
formatter={(value) => [Number(value).toLocaleString('en-US'), 'Total Users']}
|
||||||
|
cursor={{ fill: 'hsl(var(--primary) / 10%)' }}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Bar
|
||||||
|
dataKey="count"
|
||||||
|
fill="hsl(var(--primary))"
|
||||||
|
radius={[4, 4, 0, 0]}
|
||||||
|
maxBarSize={60}
|
||||||
|
label="Total Users"
|
||||||
|
/>
|
||||||
|
</BarChart>
|
||||||
|
</ResponsiveContainer>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
|
import { getUserMonthlyGrowth } from '@documenso/lib/server-only/user/get-user-monthly-growth';
|
||||||
|
|
||||||
import { FUNDING_RAISED } from '~/app/(marketing)/open/data';
|
import { FUNDING_RAISED } from '~/app/(marketing)/open/data';
|
||||||
import { MetricCard } from '~/app/(marketing)/open/metric-card';
|
import { MetricCard } from '~/app/(marketing)/open/metric-card';
|
||||||
import { SalaryBands } from '~/app/(marketing)/open/salary-bands';
|
import { SalaryBands } from '~/app/(marketing)/open/salary-bands';
|
||||||
@@ -7,11 +9,23 @@ import { SalaryBands } from '~/app/(marketing)/open/salary-bands';
|
|||||||
import { BarMetric } from './bar-metrics';
|
import { BarMetric } from './bar-metrics';
|
||||||
import { CapTable } from './cap-table';
|
import { CapTable } from './cap-table';
|
||||||
import { FundingRaised } from './funding-raised';
|
import { FundingRaised } from './funding-raised';
|
||||||
|
import { MonthlyNewUsersChart } from './monthly-new-users-chart';
|
||||||
|
import { MonthlyTotalUsersChart } from './monthly-total-users-chart';
|
||||||
import { TeamMembers } from './team-members';
|
import { TeamMembers } from './team-members';
|
||||||
import { OpenPageTooltip } from './tooltip';
|
import { OpenPageTooltip } from './tooltip';
|
||||||
|
|
||||||
export const revalidate = 3600;
|
export const revalidate = 3600;
|
||||||
|
|
||||||
|
export const dynamic = 'force-dynamic';
|
||||||
|
|
||||||
|
const GITHUB_HEADERS: Record<string, string> = {
|
||||||
|
accept: 'application/vnd.github.v3+json',
|
||||||
|
};
|
||||||
|
|
||||||
|
if (process.env.NEXT_PRIVATE_GITHUB_TOKEN) {
|
||||||
|
GITHUB_HEADERS.authorization = `Bearer ${process.env.NEXT_PRIVATE_GITHUB_TOKEN}`;
|
||||||
|
}
|
||||||
|
|
||||||
const ZGithubStatsResponse = z.object({
|
const ZGithubStatsResponse = z.object({
|
||||||
stargazers_count: z.number(),
|
stargazers_count: z.number(),
|
||||||
forks_count: z.number(),
|
forks_count: z.number(),
|
||||||
@@ -22,6 +36,10 @@ const ZMergedPullRequestsResponse = z.object({
|
|||||||
total_count: z.number(),
|
total_count: z.number(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const ZOpenIssuesResponse = z.object({
|
||||||
|
total_count: z.number(),
|
||||||
|
});
|
||||||
|
|
||||||
const ZStargazersLiveResponse = z.record(
|
const ZStargazersLiveResponse = z.record(
|
||||||
z.object({
|
z.object({
|
||||||
stars: z.number(),
|
stars: z.number(),
|
||||||
@@ -42,45 +60,78 @@ const ZEarlyAdoptersResponse = z.record(
|
|||||||
export type StargazersType = z.infer<typeof ZStargazersLiveResponse>;
|
export type StargazersType = z.infer<typeof ZStargazersLiveResponse>;
|
||||||
export type EarlyAdoptersType = z.infer<typeof ZEarlyAdoptersResponse>;
|
export type EarlyAdoptersType = z.infer<typeof ZEarlyAdoptersResponse>;
|
||||||
|
|
||||||
export default async function OpenPage() {
|
const fetchGithubStats = async () => {
|
||||||
const {
|
return await fetch('https://api.github.com/repos/documenso/documenso', {
|
||||||
forks_count: forksCount,
|
|
||||||
open_issues: openIssues,
|
|
||||||
stargazers_count: stargazersCount,
|
|
||||||
} = await fetch('https://api.github.com/repos/documenso/documenso', {
|
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/vnd.github.v3+json',
|
...GITHUB_HEADERS,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(async (res) => res.json())
|
.then(async (res) => res.json())
|
||||||
.then((res) => ZGithubStatsResponse.parse(res));
|
.then((res) => ZGithubStatsResponse.parse(res));
|
||||||
|
};
|
||||||
|
|
||||||
const { total_count: mergedPullRequests } = await fetch(
|
const fetchOpenIssues = async () => {
|
||||||
|
return await fetch(
|
||||||
|
'https://api.github.com/search/issues?q=repo:documenso/documenso+type:issue+state:open&page=0&per_page=1',
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
...GITHUB_HEADERS,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.then(async (res) => res.json())
|
||||||
|
.then((res) => ZOpenIssuesResponse.parse(res));
|
||||||
|
};
|
||||||
|
|
||||||
|
const fetchMergedPullRequests = async () => {
|
||||||
|
return await fetch(
|
||||||
'https://api.github.com/search/issues?q=repo:documenso/documenso/+is:pr+merged:>=2010-01-01&page=0&per_page=1',
|
'https://api.github.com/search/issues?q=repo:documenso/documenso/+is:pr+merged:>=2010-01-01&page=0&per_page=1',
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/vnd.github.v3+json',
|
...GITHUB_HEADERS,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.then(async (res) => res.json())
|
.then(async (res) => res.json())
|
||||||
.then((res) => ZMergedPullRequestsResponse.parse(res));
|
.then((res) => ZMergedPullRequestsResponse.parse(res));
|
||||||
|
};
|
||||||
|
|
||||||
const STARGAZERS_DATA = await fetch('https://stargrazer-live.onrender.com/api/stats', {
|
const fetchStargazers = async () => {
|
||||||
|
return await fetch('https://stargrazer-live.onrender.com/api/stats', {
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/json',
|
accept: 'application/json',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(async (res) => res.json())
|
.then(async (res) => res.json())
|
||||||
.then((res) => ZStargazersLiveResponse.parse(res));
|
.then((res) => ZStargazersLiveResponse.parse(res));
|
||||||
|
};
|
||||||
|
|
||||||
const EARLY_ADOPTERS_DATA = await fetch('https://stargrazer-live.onrender.com/api/stats/stripe', {
|
const fetchEarlyAdopters = async () => {
|
||||||
|
return await fetch('https://stargrazer-live.onrender.com/api/stats/stripe', {
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/json',
|
accept: 'application/json',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(async (res) => res.json())
|
.then(async (res) => res.json())
|
||||||
.then((res) => ZEarlyAdoptersResponse.parse(res));
|
.then((res) => ZEarlyAdoptersResponse.parse(res));
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function OpenPage() {
|
||||||
|
const [
|
||||||
|
{ forks_count: forksCount, stargazers_count: stargazersCount },
|
||||||
|
{ total_count: openIssues },
|
||||||
|
{ total_count: mergedPullRequests },
|
||||||
|
STARGAZERS_DATA,
|
||||||
|
EARLY_ADOPTERS_DATA,
|
||||||
|
] = await Promise.all([
|
||||||
|
fetchGithubStats(),
|
||||||
|
fetchOpenIssues(),
|
||||||
|
fetchMergedPullRequests(),
|
||||||
|
fetchStargazers(),
|
||||||
|
fetchEarlyAdopters(),
|
||||||
|
]);
|
||||||
|
|
||||||
|
const MONTHLY_USERS = await getUserMonthlyGrowth();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mx-auto mt-6 max-w-screen-lg sm:mt-12">
|
<div className="mx-auto mt-6 max-w-screen-lg sm:mt-12">
|
||||||
@@ -122,7 +173,7 @@ export default async function OpenPage() {
|
|||||||
|
|
||||||
<TeamMembers className="col-span-12" />
|
<TeamMembers className="col-span-12" />
|
||||||
|
|
||||||
<SalaryBands className="col-span-12 lg:col-span-6" />
|
<SalaryBands className="col-span-12" />
|
||||||
|
|
||||||
<FundingRaised data={FUNDING_RAISED} className="col-span-12 lg:col-span-6" />
|
<FundingRaised data={FUNDING_RAISED} className="col-span-12 lg:col-span-6" />
|
||||||
|
|
||||||
@@ -172,6 +223,9 @@ export default async function OpenPage() {
|
|||||||
className="col-span-12 lg:col-span-6"
|
className="col-span-12 lg:col-span-6"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<MonthlyTotalUsersChart data={MONTHLY_USERS} className="col-span-12 lg:col-span-6" />
|
||||||
|
<MonthlyNewUsersChart data={MONTHLY_USERS} className="col-span-12 lg:col-span-6" />
|
||||||
|
|
||||||
<div className="col-span-12 mt-12 flex flex-col items-center justify-center">
|
<div className="col-span-12 mt-12 flex flex-col items-center justify-center">
|
||||||
<h2 className="text-2xl font-bold">Where's the rest?</h2>
|
<h2 className="text-2xl font-bold">Where's the rest?</h2>
|
||||||
|
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ export function OpenPageTooltip() {
|
|||||||
<path
|
<path
|
||||||
d="M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z"
|
d="M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z"
|
||||||
fill="currentColor"
|
fill="currentColor"
|
||||||
fill-rule="evenodd"
|
fillRule="evenodd"
|
||||||
clip-rule="evenodd"
|
clipRule="evenodd"
|
||||||
></path>
|
></path>
|
||||||
</svg>
|
</svg>
|
||||||
</TooltipTrigger>
|
</TooltipTrigger>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import Image from 'next/image';
|
|||||||
|
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
import backgroundPattern from '~/assets/background-pattern.png';
|
import backgroundPattern from '@documenso/assets/images/background-pattern.png';
|
||||||
|
|
||||||
import { OSSFriendsContainer } from './container';
|
import { OSSFriendsContainer } from './container';
|
||||||
import { TOSSFriendsSchema, ZOSSFriendsSchema } from './schema';
|
import { TOSSFriendsSchema, ZOSSFriendsSchema } from './schema';
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -117,10 +119,10 @@ export default function PricingPage() {
|
|||||||
and join our{' '}
|
and join our{' '}
|
||||||
<Link
|
<Link
|
||||||
className="text-documenso-700 font-bold"
|
className="text-documenso-700 font-bold"
|
||||||
href="https://join.slack.com/t/documenso/shared_invite/zt-1vibm8txi-DqsDFtdp44Hn2H5lc~RpPQ"
|
href="https://documen.so/discord"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
Slack Community
|
Discord Community
|
||||||
</Link>{' '}
|
</Link>{' '}
|
||||||
to keep up to date, on what the current priorities are. In any case, we are an open
|
to keep up to date, on what the current priorities are. In any case, we are an open
|
||||||
community and welcome all input, technical and non-technical ❤️
|
community and welcome all input, technical and non-technical ❤️
|
||||||
@@ -168,10 +170,10 @@ export default function PricingPage() {
|
|||||||
or{' '}
|
or{' '}
|
||||||
<a
|
<a
|
||||||
className="text-documenso-700 font-bold"
|
className="text-documenso-700 font-bold"
|
||||||
href="https://join.slack.com/t/documenso/shared_invite/zt-1vibm8txi-DqsDFtdp44Hn2H5lc~RpPQ"
|
href="https://documen.so/discord"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
in our Slack-Support-Channel
|
in our Discord-Support-Channel
|
||||||
</a>{' '}
|
</a>{' '}
|
||||||
please message either Lucas or Timur to get added to the channel if you are not
|
please message either Lucas or Timur to get added to the channel if you are not
|
||||||
already a member.
|
already a member.
|
||||||
|
|||||||
@@ -8,24 +8,23 @@ import { useRouter } from 'next/navigation';
|
|||||||
import { useAnalytics } from '@documenso/lib/client-only/hooks/use-analytics';
|
import { useAnalytics } from '@documenso/lib/client-only/hooks/use-analytics';
|
||||||
import { base64 } from '@documenso/lib/universal/base64';
|
import { base64 } from '@documenso/lib/universal/base64';
|
||||||
import { putFile } from '@documenso/lib/universal/upload/put-file';
|
import { putFile } from '@documenso/lib/universal/upload/put-file';
|
||||||
import { DocumentDataType, Field, Prisma, Recipient } from '@documenso/prisma/client';
|
import type { Field, Recipient } from '@documenso/prisma/client';
|
||||||
|
import { DocumentDataType, Prisma } from '@documenso/prisma/client';
|
||||||
|
import { trpc } from '@documenso/trpc/react';
|
||||||
import { Card, CardContent } from '@documenso/ui/primitives/card';
|
import { Card, CardContent } from '@documenso/ui/primitives/card';
|
||||||
import { DocumentDropzone } from '@documenso/ui/primitives/document-dropzone';
|
import { DocumentDropzone } from '@documenso/ui/primitives/document-dropzone';
|
||||||
import { AddFieldsFormPartial } from '@documenso/ui/primitives/document-flow/add-fields';
|
import { AddFieldsFormPartial } from '@documenso/ui/primitives/document-flow/add-fields';
|
||||||
import { TAddFieldsFormSchema } from '@documenso/ui/primitives/document-flow/add-fields.types';
|
import type { TAddFieldsFormSchema } from '@documenso/ui/primitives/document-flow/add-fields.types';
|
||||||
import { AddSignatureFormPartial } from '@documenso/ui/primitives/document-flow/add-signature';
|
import { AddSignatureFormPartial } from '@documenso/ui/primitives/document-flow/add-signature';
|
||||||
import { TAddSignatureFormSchema } from '@documenso/ui/primitives/document-flow/add-signature.types';
|
import type { TAddSignatureFormSchema } from '@documenso/ui/primitives/document-flow/add-signature.types';
|
||||||
import {
|
import { DocumentFlowFormContainer } from '@documenso/ui/primitives/document-flow/document-flow-root';
|
||||||
DocumentFlowFormContainer,
|
import type { DocumentFlowStep } from '@documenso/ui/primitives/document-flow/types';
|
||||||
DocumentFlowFormContainerHeader,
|
|
||||||
} from '@documenso/ui/primitives/document-flow/document-flow-root';
|
|
||||||
import { DocumentFlowStep } from '@documenso/ui/primitives/document-flow/types';
|
|
||||||
import { LazyPDFViewer } from '@documenso/ui/primitives/lazy-pdf-viewer';
|
import { LazyPDFViewer } from '@documenso/ui/primitives/lazy-pdf-viewer';
|
||||||
|
import { Stepper } from '@documenso/ui/primitives/stepper';
|
||||||
import { useToast } from '@documenso/ui/primitives/use-toast';
|
import { useToast } from '@documenso/ui/primitives/use-toast';
|
||||||
|
|
||||||
import { createSinglePlayerDocument } from '~/components/(marketing)/single-player-mode/create-single-player-document.action';
|
const SinglePlayerModeSteps = ['fields', 'sign'] as const;
|
||||||
|
type SinglePlayerModeStep = (typeof SinglePlayerModeSteps)[number];
|
||||||
type SinglePlayerModeStep = 'fields' | 'sign';
|
|
||||||
|
|
||||||
// !: This entire file is a hack to get around failed prerendering of
|
// !: This entire file is a hack to get around failed prerendering of
|
||||||
// !: the Single Player Mode page. This regression was introduced during
|
// !: the Single Player Mode page. This regression was introduced during
|
||||||
@@ -41,6 +40,9 @@ export const SinglePlayerClient = () => {
|
|||||||
const [step, setStep] = useState<SinglePlayerModeStep>('fields');
|
const [step, setStep] = useState<SinglePlayerModeStep>('fields');
|
||||||
const [fields, setFields] = useState<Field[]>([]);
|
const [fields, setFields] = useState<Field[]>([]);
|
||||||
|
|
||||||
|
const { mutateAsync: createSinglePlayerDocument } =
|
||||||
|
trpc.singleplayer.createSinglePlayerDocument.useMutation();
|
||||||
|
|
||||||
const documentFlow: Record<SinglePlayerModeStep, DocumentFlowStep> = {
|
const documentFlow: Record<SinglePlayerModeStep, DocumentFlowStep> = {
|
||||||
fields: {
|
fields: {
|
||||||
title: 'Add document',
|
title: 'Add document',
|
||||||
@@ -223,37 +225,35 @@ export const SinglePlayerClient = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-span-12 lg:col-span-6 xl:col-span-5">
|
<div className="col-span-12 lg:col-span-6 xl:col-span-5">
|
||||||
<DocumentFlowFormContainer className="top-24" onSubmit={(e) => e.preventDefault()}>
|
<DocumentFlowFormContainer
|
||||||
<DocumentFlowFormContainerHeader
|
className="top-24 lg:h-[calc(100vh-7rem)]"
|
||||||
title={currentDocumentFlow.title}
|
onSubmit={(e) => e.preventDefault()}
|
||||||
description={currentDocumentFlow.description}
|
>
|
||||||
/>
|
<Stepper
|
||||||
|
currentStep={currentDocumentFlow.stepIndex}
|
||||||
{/* Add fields to PDF page. */}
|
setCurrentStep={(step) => setStep(SinglePlayerModeSteps[step - 1])}
|
||||||
{step === 'fields' && (
|
>
|
||||||
|
{/* Add fields to PDF page. */}
|
||||||
<fieldset disabled={!uploadedFile} className="flex h-full flex-col">
|
<fieldset disabled={!uploadedFile} className="flex h-full flex-col">
|
||||||
<AddFieldsFormPartial
|
<AddFieldsFormPartial
|
||||||
documentFlow={documentFlow.fields}
|
documentFlow={documentFlow.fields}
|
||||||
hideRecipients={true}
|
hideRecipients={true}
|
||||||
recipients={uploadedFile ? [placeholderRecipient] : []}
|
recipients={uploadedFile ? [placeholderRecipient] : []}
|
||||||
numberOfSteps={Object.keys(documentFlow).length}
|
|
||||||
fields={fields}
|
fields={fields}
|
||||||
onSubmit={onFieldsSubmit}
|
onSubmit={onFieldsSubmit}
|
||||||
/>
|
/>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Enter user details and signature. */}
|
{/* Enter user details and signature. */}
|
||||||
{step === 'sign' && (
|
|
||||||
<AddSignatureFormPartial
|
<AddSignatureFormPartial
|
||||||
documentFlow={documentFlow.sign}
|
documentFlow={documentFlow.sign}
|
||||||
numberOfSteps={Object.keys(documentFlow).length}
|
|
||||||
fields={fields}
|
fields={fields}
|
||||||
onSubmit={onSignSubmit}
|
onSubmit={onSignSubmit}
|
||||||
requireName={Boolean(fields.find((field) => field.type === 'NAME'))}
|
requireName={Boolean(fields.find((field) => field.type === 'NAME'))}
|
||||||
requireSignature={Boolean(fields.find((field) => field.type === 'SIGNATURE'))}
|
requireSignature={Boolean(fields.find((field) => field.type === 'SIGNATURE'))}
|
||||||
/>
|
/>
|
||||||
)}
|
</Stepper>
|
||||||
</DocumentFlowFormContainer>
|
</DocumentFlowFormContainer>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,11 +7,10 @@ import { useRouter } from 'next/navigation';
|
|||||||
import { motion } from 'framer-motion';
|
import { motion } from 'framer-motion';
|
||||||
import { ChevronLeft } from 'lucide-react';
|
import { ChevronLeft } from 'lucide-react';
|
||||||
|
|
||||||
|
import backgroundPattern from '@documenso/assets/images/background-pattern.png';
|
||||||
import { cn } from '@documenso/ui/lib/utils';
|
import { cn } from '@documenso/ui/lib/utils';
|
||||||
import { Button } from '@documenso/ui/primitives/button';
|
import { Button } from '@documenso/ui/primitives/button';
|
||||||
|
|
||||||
import backgroundPattern from '~/assets/background-pattern.png';
|
|
||||||
|
|
||||||
export default function NotFound() {
|
export default function NotFound() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
|
|||||||
@@ -2,14 +2,13 @@ import { HTMLAttributes } from 'react';
|
|||||||
|
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
|
|
||||||
|
import backgroundPattern from '@documenso/assets/images/background-pattern.png';
|
||||||
|
import cardBeautifulFigure from '@documenso/assets/images/card-beautiful-figure.png';
|
||||||
|
import cardFastFigure from '@documenso/assets/images/card-fast-figure.png';
|
||||||
|
import cardSmartFigure from '@documenso/assets/images/card-smart-figure.png';
|
||||||
import { cn } from '@documenso/ui/lib/utils';
|
import { cn } from '@documenso/ui/lib/utils';
|
||||||
import { Card, CardContent } from '@documenso/ui/primitives/card';
|
import { Card, CardContent } from '@documenso/ui/primitives/card';
|
||||||
|
|
||||||
import backgroundPattern from '~/assets/background-pattern.png';
|
|
||||||
import cardBeautifulFigure from '~/assets/card-beautiful-figure.png';
|
|
||||||
import cardFastFigure from '~/assets/card-fast-figure.png';
|
|
||||||
import cardSmartFigure from '~/assets/card-smart-figure.png';
|
|
||||||
|
|
||||||
export type FasterSmarterBeautifulBentoProps = HTMLAttributes<HTMLDivElement>;
|
export type FasterSmarterBeautifulBentoProps = HTMLAttributes<HTMLDivElement>;
|
||||||
|
|
||||||
export const FasterSmarterBeautifulBento = ({
|
export const FasterSmarterBeautifulBento = ({
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { HTMLAttributes } from 'react';
|
import type { HTMLAttributes } from 'react';
|
||||||
|
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
|
||||||
import { Moon, Sun } from 'lucide-react';
|
|
||||||
import { useTheme } from 'next-themes';
|
|
||||||
import { FaXTwitter } from 'react-icons/fa6';
|
import { FaXTwitter } from 'react-icons/fa6';
|
||||||
import { LiaDiscord } from 'react-icons/lia';
|
import { LiaDiscord } from 'react-icons/lia';
|
||||||
import { LuGithub } from 'react-icons/lu';
|
import { LuGithub } from 'react-icons/lu';
|
||||||
|
|
||||||
|
import LogoImage from '@documenso/assets/logo.png';
|
||||||
import { cn } from '@documenso/ui/lib/utils';
|
import { cn } from '@documenso/ui/lib/utils';
|
||||||
|
import { ThemeSwitcher } from '@documenso/ui/primitives/theme-switcher';
|
||||||
|
|
||||||
export type FooterProps = HTMLAttributes<HTMLDivElement>;
|
export type FooterProps = HTMLAttributes<HTMLDivElement>;
|
||||||
|
|
||||||
@@ -26,23 +26,23 @@ const FOOTER_LINKS = [
|
|||||||
{ href: '/singleplayer', text: 'Singleplayer' },
|
{ href: '/singleplayer', text: 'Singleplayer' },
|
||||||
{ href: '/blog', text: 'Blog' },
|
{ href: '/blog', text: 'Blog' },
|
||||||
{ href: '/design-system', text: 'Design' },
|
{ href: '/design-system', text: 'Design' },
|
||||||
{ href: '/open', text: 'Open' },
|
{ href: '/open', text: 'Open Startup' },
|
||||||
{ href: 'https://shop.documenso.com', text: 'Shop', target: '_blank' },
|
{ href: 'https://shop.documenso.com', text: 'Shop', target: '_blank' },
|
||||||
{ href: 'https://status.documenso.com', text: 'Status', target: '_blank' },
|
{ href: 'https://status.documenso.com', text: 'Status', target: '_blank' },
|
||||||
{ href: 'mailto:support@documenso.com', text: 'Support', target: '_blank' },
|
{ href: 'mailto:support@documenso.com', text: 'Support', target: '_blank' },
|
||||||
|
{ href: '/oss-friends', text: 'OSS Friends' },
|
||||||
|
{ href: '/careers', text: 'Careers' },
|
||||||
{ href: '/privacy', text: 'Privacy' },
|
{ href: '/privacy', text: 'Privacy' },
|
||||||
];
|
];
|
||||||
|
|
||||||
export const Footer = ({ className, ...props }: FooterProps) => {
|
export const Footer = ({ className, ...props }: FooterProps) => {
|
||||||
const { setTheme } = useTheme();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn('border-t py-12', className)} {...props}>
|
<div className={cn('border-t py-12', className)} {...props}>
|
||||||
<div className="mx-auto flex w-full max-w-screen-xl flex-wrap items-start justify-between gap-8 px-8">
|
<div className="mx-auto flex w-full max-w-screen-xl flex-wrap items-start justify-between gap-8 px-8">
|
||||||
<div>
|
<div>
|
||||||
<Link href="/">
|
<Link href="/">
|
||||||
<Image
|
<Image
|
||||||
src="/logo.png"
|
src={LogoImage}
|
||||||
alt="Documenso Logo"
|
alt="Documenso Logo"
|
||||||
className="dark:invert"
|
className="dark:invert"
|
||||||
width={170}
|
width={170}
|
||||||
@@ -77,21 +77,13 @@ export const Footer = ({ className, ...props }: FooterProps) => {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="mx-auto mt-4 flex w-full max-w-screen-xl flex-wrap justify-between gap-4 px-8 md:mt-12 lg:mt-24">
|
<div className="mx-auto mt-4 flex w-full max-w-screen-xl flex-wrap items-center justify-between gap-4 px-8 md:mt-12 lg:mt-24">
|
||||||
<p className="text-muted-foreground text-sm">
|
<p className="text-muted-foreground text-sm">
|
||||||
© {new Date().getFullYear()} Documenso, Inc. All rights reserved.
|
© {new Date().getFullYear()} Documenso, Inc. All rights reserved.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div className="flex flex-wrap items-center gap-x-4 gap-y-2.5">
|
<div className="flex flex-wrap">
|
||||||
<button type="button" className="text-muted-foreground" onClick={() => setTheme('light')}>
|
<ThemeSwitcher />
|
||||||
<Sun className="h-5 w-5" />
|
|
||||||
<span className="sr-only">Light</span>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button type="button" className="text-muted-foreground" onClick={() => setTheme('dark')}>
|
|
||||||
<Moon className="h-5 w-5" />
|
|
||||||
<span className="sr-only">Dark</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { HTMLAttributes, useState } from 'react';
|
import type { HTMLAttributes } from 'react';
|
||||||
|
import { useState } from 'react';
|
||||||
|
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
|
||||||
|
import LogoImage from '@documenso/assets/logo.png';
|
||||||
import { useFeatureFlags } from '@documenso/lib/client-only/providers/feature-flag';
|
import { useFeatureFlags } from '@documenso/lib/client-only/providers/feature-flag';
|
||||||
import { cn } from '@documenso/ui/lib/utils';
|
import { cn } from '@documenso/ui/lib/utils';
|
||||||
|
|
||||||
@@ -25,7 +27,7 @@ export const Header = ({ className, ...props }: HeaderProps) => {
|
|||||||
<div className="flex items-center space-x-4">
|
<div className="flex items-center space-x-4">
|
||||||
<Link href="/" className="z-10" onClick={() => setIsHamburgerMenuOpen(false)}>
|
<Link href="/" className="z-10" onClick={() => setIsHamburgerMenuOpen(false)}>
|
||||||
<Image
|
<Image
|
||||||
src="/logo.png"
|
src={LogoImage}
|
||||||
alt="Documenso Logo"
|
alt="Documenso Logo"
|
||||||
className="dark:invert"
|
className="dark:invert"
|
||||||
width={170}
|
width={170}
|
||||||
@@ -62,7 +64,7 @@ export const Header = ({ className, ...props }: HeaderProps) => {
|
|||||||
href="/open"
|
href="/open"
|
||||||
className="text-muted-foreground hover:text-muted-foreground/80 text-sm font-semibold"
|
className="text-muted-foreground hover:text-muted-foreground/80 text-sm font-semibold"
|
||||||
>
|
>
|
||||||
Open
|
Open Startup
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
<Link
|
<Link
|
||||||
|
|||||||
@@ -8,12 +8,11 @@ import { usePlausible } from 'next-plausible';
|
|||||||
import { LuGithub } from 'react-icons/lu';
|
import { LuGithub } from 'react-icons/lu';
|
||||||
import { match } from 'ts-pattern';
|
import { match } from 'ts-pattern';
|
||||||
|
|
||||||
|
import backgroundPattern from '@documenso/assets/images/background-pattern.png';
|
||||||
import { useFeatureFlags } from '@documenso/lib/client-only/providers/feature-flag';
|
import { useFeatureFlags } from '@documenso/lib/client-only/providers/feature-flag';
|
||||||
import { cn } from '@documenso/ui/lib/utils';
|
import { cn } from '@documenso/ui/lib/utils';
|
||||||
import { Button } from '@documenso/ui/primitives/button';
|
import { Button } from '@documenso/ui/primitives/button';
|
||||||
|
|
||||||
import backgroundPattern from '~/assets/background-pattern.png';
|
|
||||||
|
|
||||||
import { Widget } from './widget';
|
import { Widget } from './widget';
|
||||||
|
|
||||||
export type HeroProps = {
|
export type HeroProps = {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { FaXTwitter } from 'react-icons/fa6';
|
|||||||
import { LiaDiscord } from 'react-icons/lia';
|
import { LiaDiscord } from 'react-icons/lia';
|
||||||
import { LuGithub } from 'react-icons/lu';
|
import { LuGithub } from 'react-icons/lu';
|
||||||
|
|
||||||
|
import LogoImage from '@documenso/assets/logo.png';
|
||||||
import { Sheet, SheetContent } from '@documenso/ui/primitives/sheet';
|
import { Sheet, SheetContent } from '@documenso/ui/primitives/sheet';
|
||||||
|
|
||||||
export type MobileNavigationProps = {
|
export type MobileNavigationProps = {
|
||||||
@@ -30,7 +31,7 @@ export const MENU_NAVIGATION_LINKS = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
href: '/open',
|
href: '/open',
|
||||||
text: 'Open',
|
text: 'Open Startup',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
href: 'https://status.documenso.com',
|
href: 'https://status.documenso.com',
|
||||||
@@ -63,7 +64,7 @@ export const MobileNavigation = ({ isMenuOpen, onMenuOpenChange }: MobileNavigat
|
|||||||
<SheetContent className="w-full max-w-[400px]">
|
<SheetContent className="w-full max-w-[400px]">
|
||||||
<Link href="/" className="z-10" onClick={handleMenuItemClick}>
|
<Link href="/" className="z-10" onClick={handleMenuItemClick}>
|
||||||
<Image
|
<Image
|
||||||
src="/logo.png"
|
src={LogoImage}
|
||||||
alt="Documenso Logo"
|
alt="Documenso Logo"
|
||||||
className="dark:invert"
|
className="dark:invert"
|
||||||
width={170}
|
width={170}
|
||||||
|
|||||||
@@ -2,14 +2,13 @@ import { HTMLAttributes } from 'react';
|
|||||||
|
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
|
|
||||||
|
import backgroundPattern from '@documenso/assets/images/background-pattern.png';
|
||||||
|
import cardBuildFigure from '@documenso/assets/images/card-build-figure.png';
|
||||||
|
import cardOpenFigure from '@documenso/assets/images/card-open-figure.png';
|
||||||
|
import cardTemplateFigure from '@documenso/assets/images/card-template-figure.png';
|
||||||
import { cn } from '@documenso/ui/lib/utils';
|
import { cn } from '@documenso/ui/lib/utils';
|
||||||
import { Card, CardContent } from '@documenso/ui/primitives/card';
|
import { Card, CardContent } from '@documenso/ui/primitives/card';
|
||||||
|
|
||||||
import backgroundPattern from '~/assets/background-pattern.png';
|
|
||||||
import cardBuildFigure from '~/assets/card-build-figure.png';
|
|
||||||
import cardOpenFigure from '~/assets/card-open-figure.png';
|
|
||||||
import cardTemplateFigure from '~/assets/card-template-figure.png';
|
|
||||||
|
|
||||||
export type OpenBuildTemplateBentoProps = HTMLAttributes<HTMLDivElement>;
|
export type OpenBuildTemplateBentoProps = HTMLAttributes<HTMLDivElement>;
|
||||||
|
|
||||||
export const OpenBuildTemplateBento = ({ className, ...props }: OpenBuildTemplateBentoProps) => {
|
export const OpenBuildTemplateBento = ({ className, ...props }: OpenBuildTemplateBentoProps) => {
|
||||||
|
|||||||
@@ -2,15 +2,14 @@ import { HTMLAttributes } from 'react';
|
|||||||
|
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
|
|
||||||
|
import backgroundPattern from '@documenso/assets/images/background-pattern.png';
|
||||||
|
import cardConnectionsFigure from '@documenso/assets/images/card-connections-figure.png';
|
||||||
|
import cardPaidFigure from '@documenso/assets/images/card-paid-figure.png';
|
||||||
|
import cardSharingFigure from '@documenso/assets/images/card-sharing-figure.png';
|
||||||
|
import cardWidgetFigure from '@documenso/assets/images/card-widget-figure.png';
|
||||||
import { cn } from '@documenso/ui/lib/utils';
|
import { cn } from '@documenso/ui/lib/utils';
|
||||||
import { Card, CardContent } from '@documenso/ui/primitives/card';
|
import { Card, CardContent } from '@documenso/ui/primitives/card';
|
||||||
|
|
||||||
import backgroundPattern from '~/assets/background-pattern.png';
|
|
||||||
import cardConnectionsFigure from '~/assets/card-connections-figure.png';
|
|
||||||
import cardPaidFigure from '~/assets/card-paid-figure.png';
|
|
||||||
import cardSharingFigure from '~/assets/card-sharing-figure.png';
|
|
||||||
import cardWidgetFigure from '~/assets/card-widget-figure.png';
|
|
||||||
|
|
||||||
export type ShareConnectPaidWidgetBentoProps = HTMLAttributes<HTMLDivElement>;
|
export type ShareConnectPaidWidgetBentoProps = HTMLAttributes<HTMLDivElement>;
|
||||||
|
|
||||||
export const ShareConnectPaidWidgetBento = ({
|
export const ShareConnectPaidWidgetBento = ({
|
||||||
|
|||||||
@@ -1,233 +0,0 @@
|
|||||||
'use server';
|
|
||||||
|
|
||||||
import { createElement } from 'react';
|
|
||||||
|
|
||||||
import { DateTime } from 'luxon';
|
|
||||||
import { PDFDocument } from 'pdf-lib';
|
|
||||||
import { match } from 'ts-pattern';
|
|
||||||
import { z } from 'zod';
|
|
||||||
|
|
||||||
import { mailer } from '@documenso/email/mailer';
|
|
||||||
import { render } from '@documenso/email/render';
|
|
||||||
import { DocumentSelfSignedEmailTemplate } from '@documenso/email/templates/document-self-signed';
|
|
||||||
import { FROM_ADDRESS, FROM_NAME, SERVICE_USER_EMAIL } from '@documenso/lib/constants/email';
|
|
||||||
import { insertFieldInPDF } from '@documenso/lib/server-only/pdf/insert-field-in-pdf';
|
|
||||||
import { alphaid } from '@documenso/lib/universal/id';
|
|
||||||
import { getFile } from '@documenso/lib/universal/upload/get-file';
|
|
||||||
import { prisma } from '@documenso/prisma';
|
|
||||||
import {
|
|
||||||
DocumentDataType,
|
|
||||||
DocumentStatus,
|
|
||||||
FieldType,
|
|
||||||
Prisma,
|
|
||||||
ReadStatus,
|
|
||||||
SendStatus,
|
|
||||||
SigningStatus,
|
|
||||||
} from '@documenso/prisma/client';
|
|
||||||
|
|
||||||
const ZCreateSinglePlayerDocumentSchema = z.object({
|
|
||||||
documentData: z.object({
|
|
||||||
data: z.string(),
|
|
||||||
type: z.nativeEnum(DocumentDataType),
|
|
||||||
}),
|
|
||||||
documentName: z.string(),
|
|
||||||
signer: z.object({
|
|
||||||
email: z.string().email().min(1),
|
|
||||||
name: z.string(),
|
|
||||||
signature: z.string(),
|
|
||||||
}),
|
|
||||||
fields: z.array(
|
|
||||||
z.object({
|
|
||||||
page: z.number(),
|
|
||||||
type: z.nativeEnum(FieldType),
|
|
||||||
positionX: z.number(),
|
|
||||||
positionY: z.number(),
|
|
||||||
width: z.number(),
|
|
||||||
height: z.number(),
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
});
|
|
||||||
|
|
||||||
export type TCreateSinglePlayerDocumentSchema = z.infer<typeof ZCreateSinglePlayerDocumentSchema>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create and self signs a document.
|
|
||||||
*
|
|
||||||
* Returns the document token.
|
|
||||||
*/
|
|
||||||
export const createSinglePlayerDocument = async (
|
|
||||||
value: TCreateSinglePlayerDocumentSchema,
|
|
||||||
): Promise<string> => {
|
|
||||||
const { signer, fields, documentData, documentName } =
|
|
||||||
ZCreateSinglePlayerDocumentSchema.parse(value);
|
|
||||||
|
|
||||||
const document = await getFile({
|
|
||||||
data: documentData.data,
|
|
||||||
type: documentData.type,
|
|
||||||
});
|
|
||||||
|
|
||||||
const doc = await PDFDocument.load(document);
|
|
||||||
const createdAt = new Date();
|
|
||||||
|
|
||||||
const isBase64 = signer.signature.startsWith('data:image/png;base64,');
|
|
||||||
const signatureImageAsBase64 = isBase64 ? signer.signature : null;
|
|
||||||
const typedSignature = !isBase64 ? signer.signature : null;
|
|
||||||
|
|
||||||
// Update the document with the fields inserted.
|
|
||||||
for (const field of fields) {
|
|
||||||
const isSignatureField = field.type === FieldType.SIGNATURE;
|
|
||||||
|
|
||||||
await insertFieldInPDF(doc, {
|
|
||||||
...mapField(field, signer),
|
|
||||||
Signature: isSignatureField
|
|
||||||
? {
|
|
||||||
created: createdAt,
|
|
||||||
signatureImageAsBase64,
|
|
||||||
typedSignature,
|
|
||||||
// Dummy data.
|
|
||||||
id: -1,
|
|
||||||
recipientId: -1,
|
|
||||||
fieldId: -1,
|
|
||||||
}
|
|
||||||
: null,
|
|
||||||
// Dummy data.
|
|
||||||
id: -1,
|
|
||||||
documentId: -1,
|
|
||||||
recipientId: -1,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const pdfBytes = await doc.save();
|
|
||||||
|
|
||||||
const documentToken = await prisma.$transaction(
|
|
||||||
async (tx) => {
|
|
||||||
const documentToken = alphaid();
|
|
||||||
|
|
||||||
// Fetch service user who will be the owner of the document.
|
|
||||||
const serviceUser = await tx.user.findFirstOrThrow({
|
|
||||||
where: {
|
|
||||||
email: SERVICE_USER_EMAIL,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const documentDataBytes = Buffer.from(pdfBytes).toString('base64');
|
|
||||||
|
|
||||||
const { id: documentDataId } = await tx.documentData.create({
|
|
||||||
data: {
|
|
||||||
type: DocumentDataType.BYTES_64,
|
|
||||||
data: documentDataBytes,
|
|
||||||
initialData: documentDataBytes,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create document.
|
|
||||||
const document = await tx.document.create({
|
|
||||||
data: {
|
|
||||||
title: documentName,
|
|
||||||
status: DocumentStatus.COMPLETED,
|
|
||||||
documentDataId,
|
|
||||||
userId: serviceUser.id,
|
|
||||||
createdAt,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create recipient.
|
|
||||||
const recipient = await tx.recipient.create({
|
|
||||||
data: {
|
|
||||||
documentId: document.id,
|
|
||||||
name: signer.name,
|
|
||||||
email: signer.email,
|
|
||||||
token: documentToken,
|
|
||||||
signedAt: createdAt,
|
|
||||||
readStatus: ReadStatus.OPENED,
|
|
||||||
signingStatus: SigningStatus.SIGNED,
|
|
||||||
sendStatus: SendStatus.SENT,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create fields and signatures.
|
|
||||||
await Promise.all(
|
|
||||||
fields.map(async (field) => {
|
|
||||||
const insertedField = await tx.field.create({
|
|
||||||
data: {
|
|
||||||
documentId: document.id,
|
|
||||||
recipientId: recipient.id,
|
|
||||||
...mapField(field, signer),
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
if (field.type === FieldType.SIGNATURE || field.type === FieldType.FREE_SIGNATURE) {
|
|
||||||
await tx.signature.create({
|
|
||||||
data: {
|
|
||||||
fieldId: insertedField.id,
|
|
||||||
signatureImageAsBase64,
|
|
||||||
typedSignature,
|
|
||||||
recipientId: recipient.id,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
return documentToken;
|
|
||||||
},
|
|
||||||
{
|
|
||||||
maxWait: 5000,
|
|
||||||
timeout: 30000,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
const template = createElement(DocumentSelfSignedEmailTemplate, {
|
|
||||||
documentName: documentName,
|
|
||||||
assetBaseUrl: process.env.NEXT_PUBLIC_WEBAPP_URL || 'http://localhost:3000',
|
|
||||||
});
|
|
||||||
|
|
||||||
// Send email to signer.
|
|
||||||
await mailer.sendMail({
|
|
||||||
to: {
|
|
||||||
address: signer.email,
|
|
||||||
name: signer.name,
|
|
||||||
},
|
|
||||||
from: {
|
|
||||||
name: FROM_NAME,
|
|
||||||
address: FROM_ADDRESS,
|
|
||||||
},
|
|
||||||
subject: 'Document signed',
|
|
||||||
html: render(template),
|
|
||||||
text: render(template, { plainText: true }),
|
|
||||||
attachments: [{ content: Buffer.from(pdfBytes), filename: documentName }],
|
|
||||||
});
|
|
||||||
|
|
||||||
return documentToken;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Map the fields provided by the user to fields compatible with Prisma.
|
|
||||||
*
|
|
||||||
* Signature fields are handled separately.
|
|
||||||
*
|
|
||||||
* @param field The field passed in by the user.
|
|
||||||
* @param signer The details of the person who is signing this document.
|
|
||||||
* @returns A field compatible with Prisma.
|
|
||||||
*/
|
|
||||||
const mapField = (
|
|
||||||
field: TCreateSinglePlayerDocumentSchema['fields'][number],
|
|
||||||
signer: TCreateSinglePlayerDocumentSchema['signer'],
|
|
||||||
) => {
|
|
||||||
const customText = match(field.type)
|
|
||||||
.with(FieldType.DATE, () => DateTime.now().toFormat('yyyy-MM-dd hh:mm a'))
|
|
||||||
.with(FieldType.EMAIL, () => signer.email)
|
|
||||||
.with(FieldType.NAME, () => signer.name)
|
|
||||||
.otherwise(() => '');
|
|
||||||
|
|
||||||
return {
|
|
||||||
type: field.type,
|
|
||||||
page: field.page,
|
|
||||||
positionX: new Prisma.Decimal(field.positionX),
|
|
||||||
positionY: new Prisma.Decimal(field.positionY),
|
|
||||||
width: new Prisma.Decimal(field.width),
|
|
||||||
height: new Prisma.Decimal(field.height),
|
|
||||||
customText,
|
|
||||||
inserted: true,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -4,6 +4,7 @@ import { useEffect, useState } from 'react';
|
|||||||
|
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
|
||||||
|
import signingCelebration from '@documenso/assets/images/signing-celebration.png';
|
||||||
import { useFeatureFlags } from '@documenso/lib/client-only/providers/feature-flag';
|
import { useFeatureFlags } from '@documenso/lib/client-only/providers/feature-flag';
|
||||||
import { DocumentStatus, Signature } from '@documenso/prisma/client';
|
import { DocumentStatus, Signature } from '@documenso/prisma/client';
|
||||||
import { DocumentWithRecipient } from '@documenso/prisma/types/document-with-recipient';
|
import { DocumentWithRecipient } from '@documenso/prisma/types/document-with-recipient';
|
||||||
@@ -14,7 +15,6 @@ import { SigningCard3D } from '@documenso/ui/components/signing-card';
|
|||||||
import { cn } from '@documenso/ui/lib/utils';
|
import { cn } from '@documenso/ui/lib/utils';
|
||||||
import { Button } from '@documenso/ui/primitives/button';
|
import { Button } from '@documenso/ui/primitives/button';
|
||||||
|
|
||||||
import signingCelebration from '~/assets/signing-celebration.png';
|
|
||||||
import { ConfettiScreen } from '~/components/(marketing)/confetti-screen';
|
import { ConfettiScreen } from '~/components/(marketing)/confetti-screen';
|
||||||
|
|
||||||
interface SinglePlayerModeSuccessProps {
|
interface SinglePlayerModeSuccessProps {
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ export const Widget = ({ className, children, ...props }: WidgetProps) => {
|
|||||||
type="button"
|
type="button"
|
||||||
className="bg-primary h-full w-14 rounded"
|
className="bg-primary h-full w-14 rounded"
|
||||||
disabled={!field.value || !!errors.email?.message}
|
disabled={!field.value || !!errors.email?.message}
|
||||||
onClick={() => onNextStepClick()}
|
onClick={() => step === 'EMAIL' && onNextStepClick()}
|
||||||
>
|
>
|
||||||
Next
|
Next
|
||||||
</Button>
|
</Button>
|
||||||
@@ -303,7 +303,10 @@ export const Widget = ({ className, children, ...props }: WidgetProps) => {
|
|||||||
<div className="mt-12 flex-1" />
|
<div className="mt-12 flex-1" />
|
||||||
|
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<p className="text-muted-foreground text-xs">{stepsRemaining} step(s) until signed</p>
|
<p className="text-muted-foreground text-xs">
|
||||||
|
{isValid ? 'Ready for Signing' : `${stepsRemaining} step(s) until signed`}
|
||||||
|
</p>
|
||||||
|
|
||||||
<p className="text-muted-foreground block text-xs md:hidden">Minimise contract</p>
|
<p className="text-muted-foreground block text-xs md:hidden">Minimise contract</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -313,6 +316,7 @@ export const Widget = ({ className, children, ...props }: WidgetProps) => {
|
|||||||
'w-1/3': stepsRemaining === 3,
|
'w-1/3': stepsRemaining === 3,
|
||||||
'w-2/3': stepsRemaining === 2,
|
'w-2/3': stepsRemaining === 2,
|
||||||
'w-11/12': stepsRemaining === 1,
|
'w-11/12': stepsRemaining === 1,
|
||||||
|
'w-full': isValid,
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { NextApiRequest, NextApiResponse } from 'next';
|
import { NextApiRequest, NextApiResponse } from 'next';
|
||||||
|
|
||||||
import { randomBytes } from 'crypto';
|
import { randomBytes } from 'crypto';
|
||||||
import { readFileSync } from 'fs';
|
|
||||||
import { buffer } from 'micro';
|
import { buffer } from 'micro';
|
||||||
|
|
||||||
import { insertImageInPDF } from '@documenso/lib/server-only/pdf/insert-image-in-pdf';
|
import { insertImageInPDF } from '@documenso/lib/server-only/pdf/insert-image-in-pdf';
|
||||||
@@ -88,7 +87,11 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
|||||||
|
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
|
|
||||||
const bytes64 = readFileSync('./public/documenso-supporter-pledge.pdf').toString('base64');
|
const bytes64 = await fetch(
|
||||||
|
new URL('@documenso/assets/documenso-supporter-pledge.pdf', import.meta.url),
|
||||||
|
)
|
||||||
|
.then(async (res) => res.arrayBuffer())
|
||||||
|
.then((buffer) => Buffer.from(buffer).toString('base64'));
|
||||||
|
|
||||||
const { id: documentDataId } = await prisma.documentData.create({
|
const { id: documentDataId } = await prisma.documentData.create({
|
||||||
data: {
|
data: {
|
||||||
|
|||||||
@@ -2,6 +2,15 @@ import * as trpcNext from '@documenso/trpc/server/adapters/next';
|
|||||||
import { createTrpcContext } from '@documenso/trpc/server/context';
|
import { createTrpcContext } from '@documenso/trpc/server/context';
|
||||||
import { appRouter } from '@documenso/trpc/server/router';
|
import { appRouter } from '@documenso/trpc/server/router';
|
||||||
|
|
||||||
|
export const config = {
|
||||||
|
maxDuration: 60,
|
||||||
|
api: {
|
||||||
|
bodyParser: {
|
||||||
|
sizeLimit: '50mb',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
export default trpcNext.createNextApiHandler({
|
export default trpcNext.createNextApiHandler({
|
||||||
router: appRouter,
|
router: appRouter,
|
||||||
createContext: async ({ req, res }) => createTrpcContext({ req, res }),
|
createContext: async ({ req, res }) => createTrpcContext({ req, res }),
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||||
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const { version } = require('./package.json');
|
const { version } = require('./package.json');
|
||||||
|
|
||||||
@@ -10,22 +11,35 @@ ENV_FILES.forEach((file) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// !: This is a temp hack to get caveat working without placing it back in the public directory.
|
||||||
|
// !: By inlining this at build time we should be able to sign faster.
|
||||||
|
const FONT_CAVEAT_BYTES = fs.readFileSync(
|
||||||
|
path.join(__dirname, '../../packages/assets/fonts/caveat.ttf'),
|
||||||
|
);
|
||||||
|
|
||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const config = {
|
const config = {
|
||||||
|
output: process.env.DOCKER_OUTPUT ? 'standalone' : undefined,
|
||||||
experimental: {
|
experimental: {
|
||||||
serverActionsBodySizeLimit: '50mb',
|
outputFileTracingRoot: path.join(__dirname, '../../'),
|
||||||
|
serverActions: {
|
||||||
|
bodySizeLimit: '50mb',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
reactStrictMode: true,
|
reactStrictMode: true,
|
||||||
transpilePackages: [
|
transpilePackages: [
|
||||||
|
'@documenso/assets',
|
||||||
|
'@documenso/ee',
|
||||||
'@documenso/lib',
|
'@documenso/lib',
|
||||||
'@documenso/prisma',
|
'@documenso/prisma',
|
||||||
|
'@documenso/tailwind-config',
|
||||||
'@documenso/trpc',
|
'@documenso/trpc',
|
||||||
'@documenso/ui',
|
'@documenso/ui',
|
||||||
'@documenso/email',
|
|
||||||
],
|
],
|
||||||
env: {
|
env: {
|
||||||
APP_VERSION: version,
|
APP_VERSION: version,
|
||||||
NEXT_PUBLIC_PROJECT: 'web',
|
NEXT_PUBLIC_PROJECT: 'web',
|
||||||
|
FONT_CAVEAT_URI: `data:font/ttf;base64,${FONT_CAVEAT_BYTES.toString('base64')}`,
|
||||||
},
|
},
|
||||||
modularizeImports: {
|
modularizeImports: {
|
||||||
'lucide-react': {
|
'lucide-react': {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@documenso/web",
|
"name": "@documenso/web",
|
||||||
"version": "0.1.0",
|
"version": "1.2.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -8,10 +8,13 @@
|
|||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "next lint",
|
"lint": "next lint",
|
||||||
|
"e2e:prepare": "next build && next start",
|
||||||
|
"lint:fix": "next lint --fix",
|
||||||
"clean": "rimraf .next && rimraf node_modules",
|
"clean": "rimraf .next && rimraf node_modules",
|
||||||
"copy:pdfjs": "node ../../scripts/copy-pdfjs.cjs"
|
"copy:pdfjs": "node ../../scripts/copy-pdfjs.cjs"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@documenso/assets": "*",
|
||||||
"@documenso/ee": "*",
|
"@documenso/ee": "*",
|
||||||
"@documenso/lib": "*",
|
"@documenso/lib": "*",
|
||||||
"@documenso/prisma": "*",
|
"@documenso/prisma": "*",
|
||||||
@@ -25,8 +28,8 @@
|
|||||||
"lucide-react": "^0.279.0",
|
"lucide-react": "^0.279.0",
|
||||||
"luxon": "^3.4.0",
|
"luxon": "^3.4.0",
|
||||||
"micro": "^10.0.1",
|
"micro": "^10.0.1",
|
||||||
"next": "14.0.0",
|
"next": "14.0.3",
|
||||||
"next-auth": "4.24.3",
|
"next-auth": "4.24.5",
|
||||||
"next-plausible": "^3.10.1",
|
"next-plausible": "^3.10.1",
|
||||||
"next-themes": "^0.2.1",
|
"next-themes": "^0.2.1",
|
||||||
"perfect-freehand": "^1.2.0",
|
"perfect-freehand": "^1.2.0",
|
||||||
@@ -36,11 +39,13 @@
|
|||||||
"react-dom": "18.2.0",
|
"react-dom": "18.2.0",
|
||||||
"react-dropzone": "^14.2.3",
|
"react-dropzone": "^14.2.3",
|
||||||
"react-hook-form": "^7.43.9",
|
"react-hook-form": "^7.43.9",
|
||||||
|
"react-hotkeys-hook": "^4.4.1",
|
||||||
"react-icons": "^4.11.0",
|
"react-icons": "^4.11.0",
|
||||||
"react-rnd": "^10.4.1",
|
"react-rnd": "^10.4.1",
|
||||||
"sharp": "0.32.5",
|
"sharp": "0.32.5",
|
||||||
"ts-pattern": "^5.0.5",
|
"ts-pattern": "^5.0.5",
|
||||||
"typescript": "5.2.2",
|
"typescript": "5.2.2",
|
||||||
|
"uqr": "^0.1.2",
|
||||||
"zod": "^3.22.4"
|
"zod": "^3.22.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -49,5 +54,13 @@
|
|||||||
"@types/node": "20.1.0",
|
"@types/node": "20.1.0",
|
||||||
"@types/react": "18.2.18",
|
"@types/react": "18.2.18",
|
||||||
"@types/react-dom": "18.2.7"
|
"@types/react-dom": "18.2.7"
|
||||||
|
},
|
||||||
|
"overrides": {
|
||||||
|
"next-auth": {
|
||||||
|
"next": "$next"
|
||||||
|
},
|
||||||
|
"next-contentlayer": {
|
||||||
|
"next": "$next"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 29 KiB |
@@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
|
|
||||||
import { redirect } from 'next/navigation';
|
import { redirect } from 'next/navigation';
|
||||||
|
|
||||||
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
|
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
|
||||||
import { isAdmin } from '@documenso/lib/next-auth/guards/is-admin';
|
import { isAdmin } from '@documenso/lib/next-auth/guards/is-admin';
|
||||||
|
|
||||||
import { AdminNav } from './nav';
|
import { AdminNav } from './nav';
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { useRouter } from 'next/navigation';
|
|||||||
|
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
import { useForm } from 'react-hook-form';
|
import { useForm } from 'react-hook-form';
|
||||||
import { z } from 'zod';
|
import type { z } from 'zod';
|
||||||
|
|
||||||
import { trpc } from '@documenso/trpc/react';
|
import { trpc } from '@documenso/trpc/react';
|
||||||
import { ZUpdateProfileMutationByAdminSchema } from '@documenso/trpc/server/admin-router/schema';
|
import { ZUpdateProfileMutationByAdminSchema } from '@documenso/trpc/server/admin-router/schema';
|
||||||
|
|||||||
@@ -1,8 +1,16 @@
|
|||||||
'use server';
|
'use server';
|
||||||
|
|
||||||
|
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
|
||||||
|
import { isAdmin } from '@documenso/lib/next-auth/guards/is-admin';
|
||||||
import { findUsers } from '@documenso/lib/server-only/user/get-all-users';
|
import { findUsers } from '@documenso/lib/server-only/user/get-all-users';
|
||||||
|
|
||||||
export async function search(search: string, page: number, perPage: number) {
|
export async function search(search: string, page: number, perPage: number) {
|
||||||
|
const { user } = await getRequiredServerComponentSession();
|
||||||
|
|
||||||
|
if (!isAdmin(user)) {
|
||||||
|
throw new Error('Unauthorized');
|
||||||
|
}
|
||||||
|
|
||||||
const results = await findUsers({ username: search, email: search, page, perPage });
|
const results = await findUsers({ username: search, email: search, page, perPage });
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
|
|||||||
@@ -4,28 +4,26 @@ import { useState } from 'react';
|
|||||||
|
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
|
|
||||||
import { DocumentData, Field, Recipient, User } from '@documenso/prisma/client';
|
import { DocumentStatus } from '@documenso/prisma/client';
|
||||||
import { DocumentWithData } from '@documenso/prisma/types/document-with-data';
|
import type { DocumentData, Field, Recipient, User } from '@documenso/prisma/client';
|
||||||
|
import type { DocumentWithData } from '@documenso/prisma/types/document-with-data';
|
||||||
|
import { trpc } from '@documenso/trpc/react';
|
||||||
import { cn } from '@documenso/ui/lib/utils';
|
import { cn } from '@documenso/ui/lib/utils';
|
||||||
import { Card, CardContent } from '@documenso/ui/primitives/card';
|
import { Card, CardContent } from '@documenso/ui/primitives/card';
|
||||||
import { AddFieldsFormPartial } from '@documenso/ui/primitives/document-flow/add-fields';
|
import { AddFieldsFormPartial } from '@documenso/ui/primitives/document-flow/add-fields';
|
||||||
import { TAddFieldsFormSchema } from '@documenso/ui/primitives/document-flow/add-fields.types';
|
import type { TAddFieldsFormSchema } from '@documenso/ui/primitives/document-flow/add-fields.types';
|
||||||
import { AddSignersFormPartial } from '@documenso/ui/primitives/document-flow/add-signers';
|
import { AddSignersFormPartial } from '@documenso/ui/primitives/document-flow/add-signers';
|
||||||
import { TAddSignersFormSchema } from '@documenso/ui/primitives/document-flow/add-signers.types';
|
import type { TAddSignersFormSchema } from '@documenso/ui/primitives/document-flow/add-signers.types';
|
||||||
import { AddSubjectFormPartial } from '@documenso/ui/primitives/document-flow/add-subject';
|
import { AddSubjectFormPartial } from '@documenso/ui/primitives/document-flow/add-subject';
|
||||||
import { TAddSubjectFormSchema } from '@documenso/ui/primitives/document-flow/add-subject.types';
|
import type { TAddSubjectFormSchema } from '@documenso/ui/primitives/document-flow/add-subject.types';
|
||||||
import {
|
import { AddTitleFormPartial } from '@documenso/ui/primitives/document-flow/add-title';
|
||||||
DocumentFlowFormContainer,
|
import type { TAddTitleFormSchema } from '@documenso/ui/primitives/document-flow/add-title.types';
|
||||||
DocumentFlowFormContainerHeader,
|
import { DocumentFlowFormContainer } from '@documenso/ui/primitives/document-flow/document-flow-root';
|
||||||
} from '@documenso/ui/primitives/document-flow/document-flow-root';
|
import type { DocumentFlowStep } from '@documenso/ui/primitives/document-flow/types';
|
||||||
import { DocumentFlowStep } from '@documenso/ui/primitives/document-flow/types';
|
|
||||||
import { LazyPDFViewer } from '@documenso/ui/primitives/lazy-pdf-viewer';
|
import { LazyPDFViewer } from '@documenso/ui/primitives/lazy-pdf-viewer';
|
||||||
|
import { Stepper } from '@documenso/ui/primitives/stepper';
|
||||||
import { useToast } from '@documenso/ui/primitives/use-toast';
|
import { useToast } from '@documenso/ui/primitives/use-toast';
|
||||||
|
|
||||||
import { addFields } from '~/components/forms/edit-document/add-fields.action';
|
|
||||||
import { addSigners } from '~/components/forms/edit-document/add-signers.action';
|
|
||||||
import { completeDocument } from '~/components/forms/edit-document/add-subject.action';
|
|
||||||
|
|
||||||
export type EditDocumentFormProps = {
|
export type EditDocumentFormProps = {
|
||||||
className?: string;
|
className?: string;
|
||||||
user: User;
|
user: User;
|
||||||
@@ -35,7 +33,8 @@ export type EditDocumentFormProps = {
|
|||||||
documentData: DocumentData;
|
documentData: DocumentData;
|
||||||
};
|
};
|
||||||
|
|
||||||
type EditDocumentStep = 'signers' | 'fields' | 'subject';
|
type EditDocumentStep = 'title' | 'signers' | 'fields' | 'subject';
|
||||||
|
const EditDocumentSteps: EditDocumentStep[] = ['title', 'signers', 'fields', 'subject'];
|
||||||
|
|
||||||
export const EditDocumentForm = ({
|
export const EditDocumentForm = ({
|
||||||
className,
|
className,
|
||||||
@@ -48,29 +47,60 @@ export const EditDocumentForm = ({
|
|||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const [step, setStep] = useState<EditDocumentStep>('signers');
|
// controlled stepper state
|
||||||
|
const [step, setStep] = useState<EditDocumentStep>(
|
||||||
|
document.status === DocumentStatus.DRAFT ? 'title' : 'signers',
|
||||||
|
);
|
||||||
|
|
||||||
|
const { mutateAsync: addTitle } = trpc.document.setTitleForDocument.useMutation();
|
||||||
|
const { mutateAsync: addFields } = trpc.field.addFields.useMutation();
|
||||||
|
const { mutateAsync: addSigners } = trpc.recipient.addSigners.useMutation();
|
||||||
|
const { mutateAsync: sendDocument } = trpc.document.sendDocument.useMutation();
|
||||||
|
|
||||||
const documentFlow: Record<EditDocumentStep, DocumentFlowStep> = {
|
const documentFlow: Record<EditDocumentStep, DocumentFlowStep> = {
|
||||||
|
title: {
|
||||||
|
title: 'Add Title',
|
||||||
|
description: 'Add the title to the document.',
|
||||||
|
stepIndex: 1,
|
||||||
|
},
|
||||||
signers: {
|
signers: {
|
||||||
title: 'Add Signers',
|
title: 'Add Signers',
|
||||||
description: 'Add the people who will sign the document.',
|
description: 'Add the people who will sign the document.',
|
||||||
stepIndex: 1,
|
stepIndex: 2,
|
||||||
},
|
},
|
||||||
fields: {
|
fields: {
|
||||||
title: 'Add Fields',
|
title: 'Add Fields',
|
||||||
description: 'Add all relevant fields for each recipient.',
|
description: 'Add all relevant fields for each recipient.',
|
||||||
stepIndex: 2,
|
stepIndex: 3,
|
||||||
onBackStep: () => setStep('signers'),
|
|
||||||
},
|
},
|
||||||
subject: {
|
subject: {
|
||||||
title: 'Add Subject',
|
title: 'Add Subject',
|
||||||
description: 'Add the subject and message you wish to send to signers.',
|
description: 'Add the subject and message you wish to send to signers.',
|
||||||
stepIndex: 3,
|
stepIndex: 4,
|
||||||
onBackStep: () => setStep('fields'),
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const currentDocumentFlow = documentFlow[step];
|
const onAddTitleFormSubmit = async (data: TAddTitleFormSchema) => {
|
||||||
|
try {
|
||||||
|
// Custom invocation server action
|
||||||
|
await addTitle({
|
||||||
|
documentId: document.id,
|
||||||
|
title: data.title,
|
||||||
|
});
|
||||||
|
|
||||||
|
router.refresh();
|
||||||
|
|
||||||
|
setStep('signers');
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
|
||||||
|
toast({
|
||||||
|
title: 'Error',
|
||||||
|
description: 'An error occurred while updating title.',
|
||||||
|
variant: 'destructive',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const onAddSignersFormSubmit = async (data: TAddSignersFormSchema) => {
|
const onAddSignersFormSubmit = async (data: TAddSignersFormSchema) => {
|
||||||
try {
|
try {
|
||||||
@@ -81,7 +111,6 @@ export const EditDocumentForm = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
router.refresh();
|
router.refresh();
|
||||||
|
|
||||||
setStep('fields');
|
setStep('fields');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
@@ -103,7 +132,6 @@ export const EditDocumentForm = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
router.refresh();
|
router.refresh();
|
||||||
|
|
||||||
setStep('subject');
|
setStep('subject');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
@@ -120,7 +148,7 @@ export const EditDocumentForm = ({
|
|||||||
const { subject, message } = data.email;
|
const { subject, message } = data.email;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await completeDocument({
|
await sendDocument({
|
||||||
documentId: document.id,
|
documentId: document.id,
|
||||||
email: {
|
email: {
|
||||||
subject,
|
subject,
|
||||||
@@ -146,6 +174,8 @@ export const EditDocumentForm = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const currentDocumentFlow = documentFlow[step];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn('grid w-full grid-cols-12 gap-8', className)}>
|
<div className={cn('grid w-full grid-cols-12 gap-8', className)}>
|
||||||
<Card
|
<Card
|
||||||
@@ -158,44 +188,47 @@ export const EditDocumentForm = ({
|
|||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<div className="col-span-12 lg:col-span-6 xl:col-span-5">
|
<div className="col-span-12 lg:col-span-6 xl:col-span-5">
|
||||||
<DocumentFlowFormContainer onSubmit={(e) => e.preventDefault()}>
|
<DocumentFlowFormContainer
|
||||||
<DocumentFlowFormContainerHeader
|
className="lg:h-[calc(100vh-6rem)]"
|
||||||
title={currentDocumentFlow.title}
|
onSubmit={(e) => e.preventDefault()}
|
||||||
description={currentDocumentFlow.description}
|
>
|
||||||
/>
|
<Stepper
|
||||||
|
currentStep={currentDocumentFlow.stepIndex}
|
||||||
|
setCurrentStep={(step) => setStep(EditDocumentSteps[step - 1])}
|
||||||
|
>
|
||||||
|
<AddTitleFormPartial
|
||||||
|
key={recipients.length}
|
||||||
|
documentFlow={documentFlow.title}
|
||||||
|
recipients={recipients}
|
||||||
|
fields={fields}
|
||||||
|
document={document}
|
||||||
|
onSubmit={onAddTitleFormSubmit}
|
||||||
|
/>
|
||||||
|
|
||||||
{step === 'signers' && (
|
|
||||||
<AddSignersFormPartial
|
<AddSignersFormPartial
|
||||||
key={recipients.length}
|
key={recipients.length}
|
||||||
documentFlow={documentFlow.signers}
|
documentFlow={documentFlow.signers}
|
||||||
|
document={document}
|
||||||
recipients={recipients}
|
recipients={recipients}
|
||||||
fields={fields}
|
fields={fields}
|
||||||
numberOfSteps={Object.keys(documentFlow).length}
|
|
||||||
onSubmit={onAddSignersFormSubmit}
|
onSubmit={onAddSignersFormSubmit}
|
||||||
/>
|
/>
|
||||||
)}
|
|
||||||
|
|
||||||
{step === 'fields' && (
|
|
||||||
<AddFieldsFormPartial
|
<AddFieldsFormPartial
|
||||||
key={fields.length}
|
key={fields.length}
|
||||||
documentFlow={documentFlow.fields}
|
documentFlow={documentFlow.fields}
|
||||||
recipients={recipients}
|
recipients={recipients}
|
||||||
fields={fields}
|
fields={fields}
|
||||||
numberOfSteps={Object.keys(documentFlow).length}
|
|
||||||
onSubmit={onAddFieldsFormSubmit}
|
onSubmit={onAddFieldsFormSubmit}
|
||||||
/>
|
/>
|
||||||
)}
|
|
||||||
|
|
||||||
{step === 'subject' && (
|
|
||||||
<AddSubjectFormPartial
|
<AddSubjectFormPartial
|
||||||
|
key={recipients.length}
|
||||||
documentFlow={documentFlow.subject}
|
documentFlow={documentFlow.subject}
|
||||||
document={document}
|
document={document}
|
||||||
recipients={recipients}
|
recipients={recipients}
|
||||||
fields={fields}
|
fields={fields}
|
||||||
numberOfSteps={Object.keys(documentFlow).length}
|
|
||||||
onSubmit={onAddSubjectFormSubmit}
|
onSubmit={onAddSubjectFormSubmit}
|
||||||
/>
|
/>
|
||||||
)}
|
</Stepper>
|
||||||
</DocumentFlowFormContainer>
|
</DocumentFlowFormContainer>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { redirect } from 'next/navigation';
|
|||||||
|
|
||||||
import { ChevronLeft, Users2 } from 'lucide-react';
|
import { ChevronLeft, Users2 } from 'lucide-react';
|
||||||
|
|
||||||
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
|
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
|
||||||
import { getDocumentById } from '@documenso/lib/server-only/document/get-document-by-id';
|
import { getDocumentById } from '@documenso/lib/server-only/document/get-document-by-id';
|
||||||
import { getFieldsForDocument } from '@documenso/lib/server-only/field/get-fields-for-document';
|
import { getFieldsForDocument } from '@documenso/lib/server-only/field/get-fields-for-document';
|
||||||
import { getRecipientsForDocument } from '@documenso/lib/server-only/recipient/get-recipients-for-document';
|
import { getRecipientsForDocument } from '@documenso/lib/server-only/recipient/get-recipients-for-document';
|
||||||
@@ -43,11 +43,11 @@ export default async function DocumentPage({ params }: DocumentPageProps) {
|
|||||||
const { documentData } = document;
|
const { documentData } = document;
|
||||||
|
|
||||||
const [recipients, fields] = await Promise.all([
|
const [recipients, fields] = await Promise.all([
|
||||||
await getRecipientsForDocument({
|
getRecipientsForDocument({
|
||||||
documentId,
|
documentId,
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
}),
|
}),
|
||||||
await getFieldsForDocument({
|
getFieldsForDocument({
|
||||||
documentId,
|
documentId,
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -0,0 +1,189 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { useState } from 'react';
|
||||||
|
|
||||||
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
|
import { History } from 'lucide-react';
|
||||||
|
import { useSession } from 'next-auth/react';
|
||||||
|
import { useForm } from 'react-hook-form';
|
||||||
|
import * as z from 'zod';
|
||||||
|
|
||||||
|
import { getRecipientType } from '@documenso/lib/client-only/recipient-type';
|
||||||
|
import { recipientAbbreviation } from '@documenso/lib/utils/recipient-formatter';
|
||||||
|
import { type Document, type Recipient, SigningStatus } from '@documenso/prisma/client';
|
||||||
|
import { trpc as trpcReact } from '@documenso/trpc/react';
|
||||||
|
import { cn } from '@documenso/ui/lib/utils';
|
||||||
|
import { Button } from '@documenso/ui/primitives/button';
|
||||||
|
import { Checkbox } from '@documenso/ui/primitives/checkbox';
|
||||||
|
import {
|
||||||
|
Dialog,
|
||||||
|
DialogClose,
|
||||||
|
DialogContent,
|
||||||
|
DialogFooter,
|
||||||
|
DialogHeader,
|
||||||
|
DialogTitle,
|
||||||
|
DialogTrigger,
|
||||||
|
} from '@documenso/ui/primitives/dialog';
|
||||||
|
import { DropdownMenuItem } from '@documenso/ui/primitives/dropdown-menu';
|
||||||
|
import {
|
||||||
|
Form,
|
||||||
|
FormControl,
|
||||||
|
FormField,
|
||||||
|
FormItem,
|
||||||
|
FormLabel,
|
||||||
|
} from '@documenso/ui/primitives/form/form';
|
||||||
|
import { useToast } from '@documenso/ui/primitives/use-toast';
|
||||||
|
|
||||||
|
import { StackAvatar } from '~/components/(dashboard)/avatar/stack-avatar';
|
||||||
|
|
||||||
|
const FORM_ID = 'resend-email';
|
||||||
|
|
||||||
|
export type ResendDocumentActionItemProps = {
|
||||||
|
document: Document;
|
||||||
|
recipients: Recipient[];
|
||||||
|
};
|
||||||
|
|
||||||
|
export const ZResendDocumentFormSchema = z.object({
|
||||||
|
recipients: z.array(z.number()).min(1, {
|
||||||
|
message: 'You must select at least one item.',
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
export type TResendDocumentFormSchema = z.infer<typeof ZResendDocumentFormSchema>;
|
||||||
|
|
||||||
|
export const ResendDocumentActionItem = ({
|
||||||
|
document,
|
||||||
|
recipients,
|
||||||
|
}: ResendDocumentActionItemProps) => {
|
||||||
|
const { data: session } = useSession();
|
||||||
|
const { toast } = useToast();
|
||||||
|
|
||||||
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
|
const isOwner = document.userId === session?.user?.id;
|
||||||
|
|
||||||
|
const isDisabled =
|
||||||
|
!isOwner ||
|
||||||
|
document.status !== 'PENDING' ||
|
||||||
|
!recipients.some((r) => r.signingStatus === SigningStatus.NOT_SIGNED);
|
||||||
|
|
||||||
|
const { mutateAsync: resendDocument } = trpcReact.document.resendDocument.useMutation();
|
||||||
|
|
||||||
|
const form = useForm<TResendDocumentFormSchema>({
|
||||||
|
resolver: zodResolver(ZResendDocumentFormSchema),
|
||||||
|
defaultValues: {
|
||||||
|
recipients: [],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const {
|
||||||
|
handleSubmit,
|
||||||
|
formState: { isSubmitting },
|
||||||
|
} = form;
|
||||||
|
|
||||||
|
const onFormSubmit = async ({ recipients }: TResendDocumentFormSchema) => {
|
||||||
|
try {
|
||||||
|
await resendDocument({ documentId: document.id, recipients });
|
||||||
|
|
||||||
|
toast({
|
||||||
|
title: 'Document re-sent',
|
||||||
|
description: 'Your document has been re-sent successfully.',
|
||||||
|
duration: 5000,
|
||||||
|
});
|
||||||
|
|
||||||
|
setIsOpen(false);
|
||||||
|
} catch (err) {
|
||||||
|
toast({
|
||||||
|
title: 'Something went wrong',
|
||||||
|
description: 'This document could not be re-sent at this time. Please try again.',
|
||||||
|
variant: 'destructive',
|
||||||
|
duration: 7500,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Dialog open={isOpen} onOpenChange={setIsOpen}>
|
||||||
|
<DialogTrigger asChild>
|
||||||
|
<DropdownMenuItem disabled={isDisabled} onSelect={(e) => e.preventDefault()}>
|
||||||
|
<History className="mr-2 h-4 w-4" />
|
||||||
|
Resend
|
||||||
|
</DropdownMenuItem>
|
||||||
|
</DialogTrigger>
|
||||||
|
|
||||||
|
<DialogContent className="sm:max-w-sm" hideClose>
|
||||||
|
<DialogHeader>
|
||||||
|
<DialogTitle>
|
||||||
|
<h1 className="text-center text-xl">Who do you want to remind?</h1>
|
||||||
|
</DialogTitle>
|
||||||
|
</DialogHeader>
|
||||||
|
|
||||||
|
<Form {...form}>
|
||||||
|
<form id={FORM_ID} onSubmit={handleSubmit(onFormSubmit)} className="px-3">
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="recipients"
|
||||||
|
render={({ field: { value, onChange } }) => (
|
||||||
|
<>
|
||||||
|
{recipients.map((recipient) => (
|
||||||
|
<FormItem
|
||||||
|
key={recipient.id}
|
||||||
|
className="flex flex-row items-center justify-between gap-x-3"
|
||||||
|
>
|
||||||
|
<FormLabel
|
||||||
|
className={cn('my-2 flex items-center gap-2 font-normal', {
|
||||||
|
'opacity-50': !value.includes(recipient.id),
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
<StackAvatar
|
||||||
|
key={recipient.id}
|
||||||
|
type={getRecipientType(recipient)}
|
||||||
|
fallbackText={recipientAbbreviation(recipient)}
|
||||||
|
/>
|
||||||
|
{recipient.email}
|
||||||
|
</FormLabel>
|
||||||
|
|
||||||
|
<FormControl>
|
||||||
|
<Checkbox
|
||||||
|
className="h-5 w-5 rounded-full data-[state=checked]:border-black data-[state=checked]:bg-black "
|
||||||
|
checkClassName="text-white"
|
||||||
|
value={recipient.id}
|
||||||
|
checked={value.includes(recipient.id)}
|
||||||
|
onCheckedChange={(checked: boolean) =>
|
||||||
|
checked
|
||||||
|
? onChange([...value, recipient.id])
|
||||||
|
: onChange(value.filter((v) => v !== recipient.id))
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
</FormItem>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</form>
|
||||||
|
</Form>
|
||||||
|
|
||||||
|
<DialogFooter>
|
||||||
|
<div className="flex w-full flex-1 flex-nowrap gap-4">
|
||||||
|
<DialogClose asChild>
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
className="dark:bg-muted dark:hover:bg-muted/80 flex-1 bg-black/5 hover:bg-black/10"
|
||||||
|
variant="secondary"
|
||||||
|
disabled={isSubmitting}
|
||||||
|
>
|
||||||
|
Cancel
|
||||||
|
</Button>
|
||||||
|
</DialogClose>
|
||||||
|
|
||||||
|
<Button className="flex-1" loading={isSubmitting} type="submit" form={FORM_ID}>
|
||||||
|
Send reminder
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</DialogFooter>
|
||||||
|
</DialogContent>
|
||||||
|
</Dialog>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -2,16 +2,15 @@
|
|||||||
|
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
|
||||||
import { Edit, Pencil, Share } from 'lucide-react';
|
import { Download, Edit, Pencil } from 'lucide-react';
|
||||||
import { useSession } from 'next-auth/react';
|
import { useSession } from 'next-auth/react';
|
||||||
import { match } from 'ts-pattern';
|
import { match } from 'ts-pattern';
|
||||||
|
|
||||||
import { useCopyShareLink } from '@documenso/lib/client-only/hooks/use-copy-share-link';
|
import { getFile } from '@documenso/lib/universal/upload/get-file';
|
||||||
import {
|
import type { Document, Recipient, User } from '@documenso/prisma/client';
|
||||||
TOAST_DOCUMENT_SHARE_ERROR,
|
import { DocumentStatus, SigningStatus } from '@documenso/prisma/client';
|
||||||
TOAST_DOCUMENT_SHARE_SUCCESS,
|
import type { DocumentWithData } from '@documenso/prisma/types/document-with-data';
|
||||||
} from '@documenso/lib/constants/toast';
|
import { trpc as trpcClient } from '@documenso/trpc/client';
|
||||||
import { Document, DocumentStatus, Recipient, SigningStatus, User } from '@documenso/prisma/client';
|
|
||||||
import { Button } from '@documenso/ui/primitives/button';
|
import { Button } from '@documenso/ui/primitives/button';
|
||||||
import { useToast } from '@documenso/ui/primitives/use-toast';
|
import { useToast } from '@documenso/ui/primitives/use-toast';
|
||||||
|
|
||||||
@@ -24,14 +23,8 @@ export type DataTableActionButtonProps = {
|
|||||||
|
|
||||||
export const DataTableActionButton = ({ row }: DataTableActionButtonProps) => {
|
export const DataTableActionButton = ({ row }: DataTableActionButtonProps) => {
|
||||||
const { data: session } = useSession();
|
const { data: session } = useSession();
|
||||||
|
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
|
|
||||||
const { createAndCopyShareLink, isCopyingShareLink } = useCopyShareLink({
|
|
||||||
onSuccess: () => toast(TOAST_DOCUMENT_SHARE_SUCCESS),
|
|
||||||
onError: () => toast(TOAST_DOCUMENT_SHARE_ERROR),
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!session) {
|
if (!session) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -45,6 +38,50 @@ export const DataTableActionButton = ({ row }: DataTableActionButtonProps) => {
|
|||||||
const isComplete = row.status === DocumentStatus.COMPLETED;
|
const isComplete = row.status === DocumentStatus.COMPLETED;
|
||||||
const isSigned = recipient?.signingStatus === SigningStatus.SIGNED;
|
const isSigned = recipient?.signingStatus === SigningStatus.SIGNED;
|
||||||
|
|
||||||
|
const onDownloadClick = async () => {
|
||||||
|
try {
|
||||||
|
let document: DocumentWithData | null = null;
|
||||||
|
|
||||||
|
if (!recipient) {
|
||||||
|
document = await trpcClient.document.getDocumentById.query({
|
||||||
|
id: row.id,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
document = await trpcClient.document.getDocumentByToken.query({
|
||||||
|
token: recipient.token,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const documentData = document?.documentData;
|
||||||
|
|
||||||
|
if (!documentData) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const documentBytes = await getFile(documentData);
|
||||||
|
|
||||||
|
const blob = new Blob([documentBytes], {
|
||||||
|
type: 'application/pdf',
|
||||||
|
});
|
||||||
|
|
||||||
|
const link = window.document.createElement('a');
|
||||||
|
const baseTitle = row.title.includes('.pdf') ? row.title.split('.pdf')[0] : row.title;
|
||||||
|
|
||||||
|
link.href = window.URL.createObjectURL(blob);
|
||||||
|
link.download = baseTitle ? `${baseTitle}_signed.pdf` : 'document.pdf';
|
||||||
|
|
||||||
|
link.click();
|
||||||
|
|
||||||
|
window.URL.revokeObjectURL(link.href);
|
||||||
|
} catch (error) {
|
||||||
|
toast({
|
||||||
|
title: 'Something went wrong',
|
||||||
|
description: 'An error occurred while trying to download file.',
|
||||||
|
variant: 'destructive',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return match({
|
return match({
|
||||||
isOwner,
|
isOwner,
|
||||||
isRecipient,
|
isRecipient,
|
||||||
@@ -54,7 +91,7 @@ export const DataTableActionButton = ({ row }: DataTableActionButtonProps) => {
|
|||||||
isSigned,
|
isSigned,
|
||||||
})
|
})
|
||||||
.with({ isOwner: true, isDraft: true }, () => (
|
.with({ isOwner: true, isDraft: true }, () => (
|
||||||
<Button className="w-24" asChild>
|
<Button className="w-32" asChild>
|
||||||
<Link href={`/documents/${row.id}`}>
|
<Link href={`/documents/${row.id}`}>
|
||||||
<Edit className="-ml-1 mr-2 h-4 w-4" />
|
<Edit className="-ml-1 mr-2 h-4 w-4" />
|
||||||
Edit
|
Edit
|
||||||
@@ -62,26 +99,24 @@ export const DataTableActionButton = ({ row }: DataTableActionButtonProps) => {
|
|||||||
</Button>
|
</Button>
|
||||||
))
|
))
|
||||||
.with({ isRecipient: true, isPending: true, isSigned: false }, () => (
|
.with({ isRecipient: true, isPending: true, isSigned: false }, () => (
|
||||||
<Button className="w-24" asChild>
|
<Button className="w-32" asChild>
|
||||||
<Link href={`/sign/${recipient?.token}`}>
|
<Link href={`/sign/${recipient?.token}`}>
|
||||||
<Pencil className="-ml-1 mr-2 h-4 w-4" />
|
<Pencil className="-ml-1 mr-2 h-4 w-4" />
|
||||||
Sign
|
Sign
|
||||||
</Link>
|
</Link>
|
||||||
</Button>
|
</Button>
|
||||||
))
|
))
|
||||||
.otherwise(() => (
|
.with({ isPending: true, isSigned: true }, () => (
|
||||||
<Button
|
<Button className="w-32" disabled={true}>
|
||||||
className="w-24"
|
<Pencil className="-ml-1 mr-2 inline h-4 w-4" />
|
||||||
loading={isCopyingShareLink}
|
Sign
|
||||||
onClick={async () =>
|
|
||||||
createAndCopyShareLink({
|
|
||||||
token: recipient?.token,
|
|
||||||
documentId: row.id,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{!isCopyingShareLink && <Share className="-ml-1 mr-2 h-4 w-4" />}
|
|
||||||
Share
|
|
||||||
</Button>
|
</Button>
|
||||||
));
|
))
|
||||||
|
.with({ isComplete: true }, () => (
|
||||||
|
<Button className="w-32" onClick={onDownloadClick}>
|
||||||
|
<Download className="-ml-1 mr-2 inline h-4 w-4" />
|
||||||
|
Download
|
||||||
|
</Button>
|
||||||
|
))
|
||||||
|
.otherwise(() => <div></div>);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import {
|
|||||||
Copy,
|
Copy,
|
||||||
Download,
|
Download,
|
||||||
Edit,
|
Edit,
|
||||||
History,
|
|
||||||
Loader,
|
Loader,
|
||||||
MoreHorizontal,
|
MoreHorizontal,
|
||||||
Pencil,
|
Pencil,
|
||||||
@@ -18,15 +17,12 @@ import {
|
|||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { useSession } from 'next-auth/react';
|
import { useSession } from 'next-auth/react';
|
||||||
|
|
||||||
import { useCopyShareLink } from '@documenso/lib/client-only/hooks/use-copy-share-link';
|
|
||||||
import {
|
|
||||||
TOAST_DOCUMENT_SHARE_ERROR,
|
|
||||||
TOAST_DOCUMENT_SHARE_SUCCESS,
|
|
||||||
} from '@documenso/lib/constants/toast';
|
|
||||||
import { getFile } from '@documenso/lib/universal/upload/get-file';
|
import { getFile } from '@documenso/lib/universal/upload/get-file';
|
||||||
import { Document, DocumentStatus, Recipient, User } from '@documenso/prisma/client';
|
import type { Document, Recipient, User } from '@documenso/prisma/client';
|
||||||
import { DocumentWithData } from '@documenso/prisma/types/document-with-data';
|
import { DocumentStatus } from '@documenso/prisma/client';
|
||||||
|
import type { DocumentWithData } from '@documenso/prisma/types/document-with-data';
|
||||||
import { trpc as trpcClient } from '@documenso/trpc/client';
|
import { trpc as trpcClient } from '@documenso/trpc/client';
|
||||||
|
import { DocumentShareButton } from '@documenso/ui/components/document/document-share-button';
|
||||||
import {
|
import {
|
||||||
DropdownMenu,
|
DropdownMenu,
|
||||||
DropdownMenuContent,
|
DropdownMenuContent,
|
||||||
@@ -34,9 +30,10 @@ import {
|
|||||||
DropdownMenuLabel,
|
DropdownMenuLabel,
|
||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from '@documenso/ui/primitives/dropdown-menu';
|
} from '@documenso/ui/primitives/dropdown-menu';
|
||||||
import { useToast } from '@documenso/ui/primitives/use-toast';
|
|
||||||
|
|
||||||
import { DeleteDraftDocumentDialog } from './delete-draft-document-dialog';
|
import { ResendDocumentActionItem } from './_action-items/resend-document';
|
||||||
|
import { DeleteDocumentDialog } from './delete-document-dialog';
|
||||||
|
import { DuplicateDocumentDialog } from './duplicate-document-dialog';
|
||||||
|
|
||||||
export type DataTableActionDropdownProps = {
|
export type DataTableActionDropdownProps = {
|
||||||
row: Document & {
|
row: Document & {
|
||||||
@@ -48,14 +45,8 @@ export type DataTableActionDropdownProps = {
|
|||||||
export const DataTableActionDropdown = ({ row }: DataTableActionDropdownProps) => {
|
export const DataTableActionDropdown = ({ row }: DataTableActionDropdownProps) => {
|
||||||
const { data: session } = useSession();
|
const { data: session } = useSession();
|
||||||
|
|
||||||
const { toast } = useToast();
|
|
||||||
|
|
||||||
const { createAndCopyShareLink, isCopyingShareLink } = useCopyShareLink({
|
|
||||||
onSuccess: () => toast(TOAST_DOCUMENT_SHARE_SUCCESS),
|
|
||||||
onError: () => toast(TOAST_DOCUMENT_SHARE_ERROR),
|
|
||||||
});
|
|
||||||
|
|
||||||
const [isDeleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
const [isDeleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
||||||
|
const [isDuplicateDialogOpen, setDuplicateDialogOpen] = useState(false);
|
||||||
|
|
||||||
if (!session) {
|
if (!session) {
|
||||||
return null;
|
return null;
|
||||||
@@ -69,7 +60,7 @@ export const DataTableActionDropdown = ({ row }: DataTableActionDropdownProps) =
|
|||||||
// const isPending = row.status === DocumentStatus.PENDING;
|
// const isPending = row.status === DocumentStatus.PENDING;
|
||||||
const isComplete = row.status === DocumentStatus.COMPLETED;
|
const isComplete = row.status === DocumentStatus.COMPLETED;
|
||||||
// const isSigned = recipient?.signingStatus === SigningStatus.SIGNED;
|
// const isSigned = recipient?.signingStatus === SigningStatus.SIGNED;
|
||||||
const isDocumentDeletable = isOwner && row.status === DocumentStatus.DRAFT;
|
const isDocumentDeletable = isOwner;
|
||||||
|
|
||||||
const onDownloadClick = async () => {
|
const onDownloadClick = async () => {
|
||||||
let document: DocumentWithData | null = null;
|
let document: DocumentWithData | null = null;
|
||||||
@@ -97,15 +88,17 @@ export const DataTableActionDropdown = ({ row }: DataTableActionDropdownProps) =
|
|||||||
});
|
});
|
||||||
|
|
||||||
const link = window.document.createElement('a');
|
const link = window.document.createElement('a');
|
||||||
|
const baseTitle = row.title.includes('.pdf') ? row.title.split('.pdf')[0] : row.title;
|
||||||
|
|
||||||
link.href = window.URL.createObjectURL(blob);
|
link.href = window.URL.createObjectURL(blob);
|
||||||
link.download = row.title || 'document.pdf';
|
link.download = baseTitle ? `${baseTitle}_signed.pdf` : 'document.pdf';
|
||||||
|
|
||||||
link.click();
|
link.click();
|
||||||
|
|
||||||
window.URL.revokeObjectURL(link.href);
|
window.URL.revokeObjectURL(link.href);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const nonSignedRecipients = row.Recipient.filter((item) => item.signingStatus !== 'SIGNED');
|
||||||
return (
|
return (
|
||||||
<DropdownMenu>
|
<DropdownMenu>
|
||||||
<DropdownMenuTrigger>
|
<DropdownMenuTrigger>
|
||||||
@@ -134,7 +127,7 @@ export const DataTableActionDropdown = ({ row }: DataTableActionDropdownProps) =
|
|||||||
Download
|
Download
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
|
|
||||||
<DropdownMenuItem disabled>
|
<DropdownMenuItem onClick={() => setDuplicateDialogOpen(true)}>
|
||||||
<Copy className="mr-2 h-4 w-4" />
|
<Copy className="mr-2 h-4 w-4" />
|
||||||
Duplicate
|
Duplicate
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
@@ -151,36 +144,37 @@ export const DataTableActionDropdown = ({ row }: DataTableActionDropdownProps) =
|
|||||||
|
|
||||||
<DropdownMenuLabel>Share</DropdownMenuLabel>
|
<DropdownMenuLabel>Share</DropdownMenuLabel>
|
||||||
|
|
||||||
<DropdownMenuItem disabled>
|
<ResendDocumentActionItem document={row} recipients={nonSignedRecipients} />
|
||||||
<History className="mr-2 h-4 w-4" />
|
|
||||||
Resend
|
|
||||||
</DropdownMenuItem>
|
|
||||||
|
|
||||||
<DropdownMenuItem
|
<DocumentShareButton
|
||||||
disabled={isDraft}
|
documentId={row.id}
|
||||||
onClick={async () =>
|
token={isOwner ? undefined : recipient?.token}
|
||||||
createAndCopyShareLink({
|
trigger={({ loading, disabled }) => (
|
||||||
token: recipient?.token,
|
<DropdownMenuItem disabled={disabled || isDraft} onSelect={(e) => e.preventDefault()}>
|
||||||
documentId: row.id,
|
<div className="flex items-center">
|
||||||
})
|
{loading ? <Loader className="mr-2 h-4 w-4" /> : <Share className="mr-2 h-4 w-4" />}
|
||||||
}
|
Share Signing Card
|
||||||
>
|
</div>
|
||||||
{isCopyingShareLink ? (
|
</DropdownMenuItem>
|
||||||
<Loader className="mr-2 h-4 w-4" />
|
|
||||||
) : (
|
|
||||||
<Share className="mr-2 h-4 w-4" />
|
|
||||||
)}
|
)}
|
||||||
Share
|
/>
|
||||||
</DropdownMenuItem>
|
|
||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
|
|
||||||
{isDocumentDeletable && (
|
{isDocumentDeletable && (
|
||||||
<DeleteDraftDocumentDialog
|
<DeleteDocumentDialog
|
||||||
id={row.id}
|
id={row.id}
|
||||||
|
status={row.status}
|
||||||
open={isDeleteDialogOpen}
|
open={isDeleteDialogOpen}
|
||||||
onOpenChange={setDeleteDialogOpen}
|
onOpenChange={setDeleteDialogOpen}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{isDuplicateDialogOpen && (
|
||||||
|
<DuplicateDocumentDialog
|
||||||
|
id={row.id}
|
||||||
|
open={isDuplicateDialogOpen}
|
||||||
|
onOpenChange={setDuplicateDialogOpen}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,8 +6,9 @@ import { Loader } from 'lucide-react';
|
|||||||
import { useSession } from 'next-auth/react';
|
import { useSession } from 'next-auth/react';
|
||||||
|
|
||||||
import { useUpdateSearchParams } from '@documenso/lib/client-only/hooks/use-update-search-params';
|
import { useUpdateSearchParams } from '@documenso/lib/client-only/hooks/use-update-search-params';
|
||||||
import { FindResultSet } from '@documenso/lib/types/find-result-set';
|
import type { FindResultSet } from '@documenso/lib/types/find-result-set';
|
||||||
import { Document, Recipient, User } from '@documenso/prisma/client';
|
import type { Document, Recipient, User } from '@documenso/prisma/client';
|
||||||
|
import { ExtendedDocumentStatus } from '@documenso/prisma/types/extended-document-status';
|
||||||
import { DataTable } from '@documenso/ui/primitives/data-table';
|
import { DataTable } from '@documenso/ui/primitives/data-table';
|
||||||
import { DataTablePagination } from '@documenso/ui/primitives/data-table-pagination';
|
import { DataTablePagination } from '@documenso/ui/primitives/data-table-pagination';
|
||||||
|
|
||||||
@@ -74,12 +75,14 @@ export const DocumentsDataTable = ({ results }: DocumentsDataTableProps) => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
header: 'Actions',
|
header: 'Actions',
|
||||||
cell: ({ row }) => (
|
cell: ({ row }) =>
|
||||||
<div className="flex items-center gap-x-4">
|
(!row.original.deletedAt ||
|
||||||
<DataTableActionButton row={row.original} />
|
row.original.status === ExtendedDocumentStatus.COMPLETED) && (
|
||||||
<DataTableActionDropdown row={row.original} />
|
<div className="flex items-center gap-x-4">
|
||||||
</div>
|
<DataTableActionButton row={row.original} />
|
||||||
),
|
<DataTableActionDropdown row={row.original} />
|
||||||
|
</div>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
data={results.data}
|
data={results.data}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
|
import { useState } from 'react';
|
||||||
|
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
|
|
||||||
|
import { DocumentStatus } from '@documenso/prisma/client';
|
||||||
import { trpc as trpcReact } from '@documenso/trpc/react';
|
import { trpc as trpcReact } from '@documenso/trpc/react';
|
||||||
import { Button } from '@documenso/ui/primitives/button';
|
import { Button } from '@documenso/ui/primitives/button';
|
||||||
import {
|
import {
|
||||||
@@ -10,41 +13,46 @@ import {
|
|||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from '@documenso/ui/primitives/dialog';
|
} from '@documenso/ui/primitives/dialog';
|
||||||
|
import { Input } from '@documenso/ui/primitives/input';
|
||||||
import { useToast } from '@documenso/ui/primitives/use-toast';
|
import { useToast } from '@documenso/ui/primitives/use-toast';
|
||||||
|
|
||||||
type DeleteDraftDocumentDialogProps = {
|
type DeleteDraftDocumentDialogProps = {
|
||||||
id: number;
|
id: number;
|
||||||
open: boolean;
|
open: boolean;
|
||||||
onOpenChange: (_open: boolean) => void;
|
onOpenChange: (_open: boolean) => void;
|
||||||
|
status: DocumentStatus;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const DeleteDraftDocumentDialog = ({
|
export const DeleteDocumentDialog = ({
|
||||||
id,
|
id,
|
||||||
open,
|
open,
|
||||||
onOpenChange,
|
onOpenChange,
|
||||||
|
status,
|
||||||
}: DeleteDraftDocumentDialogProps) => {
|
}: DeleteDraftDocumentDialogProps) => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
|
|
||||||
const { mutateAsync: deleteDocument, isLoading } =
|
const [inputValue, setInputValue] = useState('');
|
||||||
trpcReact.document.deleteDraftDocument.useMutation({
|
const [isDeleteEnabled, setIsDeleteEnabled] = useState(status === DocumentStatus.DRAFT);
|
||||||
onSuccess: () => {
|
|
||||||
router.refresh();
|
|
||||||
|
|
||||||
toast({
|
const { mutateAsync: deleteDocument, isLoading } = trpcReact.document.deleteDocument.useMutation({
|
||||||
title: 'Document deleted',
|
onSuccess: () => {
|
||||||
description: 'Your document has been successfully deleted.',
|
router.refresh();
|
||||||
duration: 5000,
|
|
||||||
});
|
|
||||||
|
|
||||||
onOpenChange(false);
|
toast({
|
||||||
},
|
title: 'Document deleted',
|
||||||
});
|
description: 'Your document has been successfully deleted.',
|
||||||
|
duration: 5000,
|
||||||
|
});
|
||||||
|
|
||||||
const onDraftDelete = async () => {
|
onOpenChange(false);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const onDelete = async () => {
|
||||||
try {
|
try {
|
||||||
await deleteDocument({ id });
|
await deleteDocument({ id, status });
|
||||||
} catch {
|
} catch {
|
||||||
toast({
|
toast({
|
||||||
title: 'Something went wrong',
|
title: 'Something went wrong',
|
||||||
@@ -55,6 +63,11 @@ export const DeleteDraftDocumentDialog = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setInputValue(event.target.value);
|
||||||
|
setIsDeleteEnabled(event.target.value === 'delete');
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={open} onOpenChange={(value) => !isLoading && onOpenChange(value)}>
|
<Dialog open={open} onOpenChange={(value) => !isLoading && onOpenChange(value)}>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
@@ -67,6 +80,17 @@ export const DeleteDraftDocumentDialog = ({
|
|||||||
</DialogDescription>
|
</DialogDescription>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
|
|
||||||
|
{status !== DocumentStatus.DRAFT && (
|
||||||
|
<div className="mt-8">
|
||||||
|
<Input
|
||||||
|
type="text"
|
||||||
|
value={inputValue}
|
||||||
|
onChange={onInputChange}
|
||||||
|
placeholder="Type 'delete' to confirm"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
<DialogFooter>
|
<DialogFooter>
|
||||||
<div className="flex w-full flex-1 flex-nowrap gap-4">
|
<div className="flex w-full flex-1 flex-nowrap gap-4">
|
||||||
<Button
|
<Button
|
||||||
@@ -78,7 +102,14 @@ export const DeleteDraftDocumentDialog = ({
|
|||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button type="button" loading={isLoading} onClick={onDraftDelete} className="flex-1">
|
<Button
|
||||||
|
type="button"
|
||||||
|
loading={isLoading}
|
||||||
|
onClick={onDelete}
|
||||||
|
disabled={!isDeleteEnabled}
|
||||||
|
variant="destructive"
|
||||||
|
className="flex-1"
|
||||||
|
>
|
||||||
Delete
|
Delete
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
import { useRouter } from 'next/navigation';
|
||||||
|
|
||||||
|
import { trpc as trpcReact } from '@documenso/trpc/react';
|
||||||
|
import { Button } from '@documenso/ui/primitives/button';
|
||||||
|
import {
|
||||||
|
Dialog,
|
||||||
|
DialogContent,
|
||||||
|
DialogFooter,
|
||||||
|
DialogHeader,
|
||||||
|
DialogTitle,
|
||||||
|
} from '@documenso/ui/primitives/dialog';
|
||||||
|
import { LazyPDFViewer } from '@documenso/ui/primitives/lazy-pdf-viewer';
|
||||||
|
import { useToast } from '@documenso/ui/primitives/use-toast';
|
||||||
|
|
||||||
|
type DuplicateDocumentDialogProps = {
|
||||||
|
id: number;
|
||||||
|
open: boolean;
|
||||||
|
onOpenChange: (_open: boolean) => void;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const DuplicateDocumentDialog = ({
|
||||||
|
id,
|
||||||
|
open,
|
||||||
|
onOpenChange,
|
||||||
|
}: DuplicateDocumentDialogProps) => {
|
||||||
|
const router = useRouter();
|
||||||
|
const { toast } = useToast();
|
||||||
|
|
||||||
|
const { data: document, isLoading } = trpcReact.document.getDocumentById.useQuery({
|
||||||
|
id,
|
||||||
|
});
|
||||||
|
|
||||||
|
const documentData = document?.documentData
|
||||||
|
? {
|
||||||
|
...document.documentData,
|
||||||
|
data: document.documentData.initialData,
|
||||||
|
}
|
||||||
|
: undefined;
|
||||||
|
|
||||||
|
const { mutateAsync: duplicateDocument, isLoading: isDuplicateLoading } =
|
||||||
|
trpcReact.document.duplicateDocument.useMutation({
|
||||||
|
onSuccess: (newId) => {
|
||||||
|
router.push(`/documents/${newId}`);
|
||||||
|
toast({
|
||||||
|
title: 'Document Duplicated',
|
||||||
|
description: 'Your document has been successfully duplicated.',
|
||||||
|
duration: 5000,
|
||||||
|
});
|
||||||
|
|
||||||
|
onOpenChange(false);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const onDuplicate = async () => {
|
||||||
|
try {
|
||||||
|
await duplicateDocument({ id });
|
||||||
|
} catch {
|
||||||
|
toast({
|
||||||
|
title: 'Something went wrong',
|
||||||
|
description: 'This document could not be duplicated at this time. Please try again.',
|
||||||
|
variant: 'destructive',
|
||||||
|
duration: 7500,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Dialog open={open} onOpenChange={(value) => !isLoading && onOpenChange(value)}>
|
||||||
|
<DialogContent>
|
||||||
|
<DialogHeader>
|
||||||
|
<DialogTitle>Duplicate</DialogTitle>
|
||||||
|
</DialogHeader>
|
||||||
|
{!documentData || isLoading ? (
|
||||||
|
<div className="mx-auto -mt-4 flex w-full max-w-screen-xl flex-col px-4 md:px-8">
|
||||||
|
<h1 className="mt-4 grow-0 truncate text-2xl font-semibold md:text-3xl">
|
||||||
|
Loading Document...
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="p-2 [&>div]:h-[50vh] [&>div]:overflow-y-scroll ">
|
||||||
|
<LazyPDFViewer key={document?.id} documentData={documentData} />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<DialogFooter>
|
||||||
|
<div className="flex w-full flex-1 flex-nowrap gap-4">
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
variant="secondary"
|
||||||
|
onClick={() => onOpenChange(false)}
|
||||||
|
className="flex-1"
|
||||||
|
>
|
||||||
|
Cancel
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
disabled={isDuplicateLoading || isLoading}
|
||||||
|
loading={isDuplicateLoading}
|
||||||
|
onClick={onDuplicate}
|
||||||
|
className="flex-1"
|
||||||
|
>
|
||||||
|
Duplicate
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</DialogFooter>
|
||||||
|
</DialogContent>
|
||||||
|
</Dialog>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -14,13 +14,13 @@ export const EmptyDocumentState = ({ status }: EmptyDocumentProps) => {
|
|||||||
.with(ExtendedDocumentStatus.COMPLETED, () => ({
|
.with(ExtendedDocumentStatus.COMPLETED, () => ({
|
||||||
title: 'Nothing to do',
|
title: 'Nothing to do',
|
||||||
message:
|
message:
|
||||||
'There are no completed documents yet. Documents that you have created or received that become completed will appear here later.',
|
'There are no completed documents yet. Documents that you have created or received will appear here once completed.',
|
||||||
icon: CheckCircle2,
|
icon: CheckCircle2,
|
||||||
}))
|
}))
|
||||||
.with(ExtendedDocumentStatus.DRAFT, () => ({
|
.with(ExtendedDocumentStatus.DRAFT, () => ({
|
||||||
title: 'No active drafts',
|
title: 'No active drafts',
|
||||||
message:
|
message:
|
||||||
'There are no active drafts at then current moment. You can upload a document to start drafting.',
|
'There are no active drafts at the current moment. You can upload a document to start drafting.',
|
||||||
icon: CheckCircle2,
|
icon: CheckCircle2,
|
||||||
}))
|
}))
|
||||||
.with(ExtendedDocumentStatus.ALL, () => ({
|
.with(ExtendedDocumentStatus.ALL, () => ({
|
||||||
@@ -32,7 +32,7 @@ export const EmptyDocumentState = ({ status }: EmptyDocumentProps) => {
|
|||||||
.otherwise(() => ({
|
.otherwise(() => ({
|
||||||
title: 'Nothing to do',
|
title: 'Nothing to do',
|
||||||
message:
|
message:
|
||||||
'All documents are currently actioned. Any new documents are sent or recieved they will start to appear here.',
|
'All documents have been processed. Any new documents that are sent or received will show here.',
|
||||||
icon: CheckCircle2,
|
icon: CheckCircle2,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
|
||||||
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
|
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
|
||||||
import { findDocuments } from '@documenso/lib/server-only/document/find-documents';
|
import { findDocuments } from '@documenso/lib/server-only/document/find-documents';
|
||||||
import { getStats } from '@documenso/lib/server-only/document/get-stats';
|
import { getStats } from '@documenso/lib/server-only/document/get-stats';
|
||||||
import { isExtendedDocumentStatus } from '@documenso/prisma/guards/is-extended-document-status';
|
import { isExtendedDocumentStatus } from '@documenso/prisma/guards/is-extended-document-status';
|
||||||
@@ -8,7 +8,8 @@ import { ExtendedDocumentStatus } from '@documenso/prisma/types/extended-documen
|
|||||||
import { Tabs, TabsList, TabsTrigger } from '@documenso/ui/primitives/tabs';
|
import { Tabs, TabsList, TabsTrigger } from '@documenso/ui/primitives/tabs';
|
||||||
|
|
||||||
import { PeriodSelector } from '~/components/(dashboard)/period-selector/period-selector';
|
import { PeriodSelector } from '~/components/(dashboard)/period-selector/period-selector';
|
||||||
import { PeriodSelectorValue } from '~/components/(dashboard)/period-selector/types';
|
import type { PeriodSelectorValue } from '~/components/(dashboard)/period-selector/types';
|
||||||
|
import { isPeriodSelectorValue } from '~/components/(dashboard)/period-selector/types';
|
||||||
import { DocumentStatus } from '~/components/formatter/document-status';
|
import { DocumentStatus } from '~/components/formatter/document-status';
|
||||||
|
|
||||||
import { DocumentsDataTable } from './data-table';
|
import { DocumentsDataTable } from './data-table';
|
||||||
@@ -32,7 +33,7 @@ export default async function DocumentsPage({ searchParams = {} }: DocumentsPage
|
|||||||
});
|
});
|
||||||
|
|
||||||
const status = isExtendedDocumentStatus(searchParams.status) ? searchParams.status : 'ALL';
|
const status = isExtendedDocumentStatus(searchParams.status) ? searchParams.status : 'ALL';
|
||||||
// const period = isPeriodSelectorValue(searchParams.period) ? searchParams.period : '';
|
const period = isPeriodSelectorValue(searchParams.period) ? searchParams.period : '';
|
||||||
const page = Number(searchParams.page) || 1;
|
const page = Number(searchParams.page) || 1;
|
||||||
const perPage = Number(searchParams.perPage) || 20;
|
const perPage = Number(searchParams.perPage) || 20;
|
||||||
|
|
||||||
@@ -45,6 +46,7 @@ export default async function DocumentsPage({ searchParams = {} }: DocumentsPage
|
|||||||
},
|
},
|
||||||
page,
|
page,
|
||||||
perPage,
|
perPage,
|
||||||
|
period,
|
||||||
});
|
});
|
||||||
|
|
||||||
const getTabHref = (value: typeof status) => {
|
const getTabHref = (value: typeof status) => {
|
||||||
@@ -76,7 +78,12 @@ export default async function DocumentsPage({ searchParams = {} }: DocumentsPage
|
|||||||
ExtendedDocumentStatus.DRAFT,
|
ExtendedDocumentStatus.DRAFT,
|
||||||
ExtendedDocumentStatus.ALL,
|
ExtendedDocumentStatus.ALL,
|
||||||
].map((value) => (
|
].map((value) => (
|
||||||
<TabsTrigger key={value} className="min-w-[60px]" value={value} asChild>
|
<TabsTrigger
|
||||||
|
key={value}
|
||||||
|
className="hover:text-foreground min-w-[60px]"
|
||||||
|
value={value}
|
||||||
|
asChild
|
||||||
|
>
|
||||||
<Link href={getTabHref(value)} scroll={false}>
|
<Link href={getTabHref(value)} scroll={false}>
|
||||||
<DocumentStatus status={value} />
|
<DocumentStatus status={value} />
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,10 @@ import Link from 'next/link';
|
|||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
|
|
||||||
import { Loader } from 'lucide-react';
|
import { Loader } from 'lucide-react';
|
||||||
|
import { useSession } from 'next-auth/react';
|
||||||
|
|
||||||
import { useLimits } from '@documenso/ee/server-only/limits/provider/client';
|
import { useLimits } from '@documenso/ee/server-only/limits/provider/client';
|
||||||
|
import { useAnalytics } from '@documenso/lib/client-only/hooks/use-analytics';
|
||||||
import { createDocumentData } from '@documenso/lib/server-only/document-data/create-document-data';
|
import { createDocumentData } from '@documenso/lib/server-only/document-data/create-document-data';
|
||||||
import { putFile } from '@documenso/lib/universal/upload/put-file';
|
import { putFile } from '@documenso/lib/universal/upload/put-file';
|
||||||
import { TRPCClientError } from '@documenso/trpc/client';
|
import { TRPCClientError } from '@documenso/trpc/client';
|
||||||
@@ -22,6 +24,8 @@ export type UploadDocumentProps = {
|
|||||||
|
|
||||||
export const UploadDocument = ({ className }: UploadDocumentProps) => {
|
export const UploadDocument = ({ className }: UploadDocumentProps) => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const analytics = useAnalytics();
|
||||||
|
const { data: session } = useSession();
|
||||||
|
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
|
|
||||||
@@ -53,6 +57,12 @@ export const UploadDocument = ({ className }: UploadDocumentProps) => {
|
|||||||
duration: 5000,
|
duration: 5000,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
analytics.capture('App: Document Uploaded', {
|
||||||
|
userId: session?.user.id,
|
||||||
|
documentId: id,
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
});
|
||||||
|
|
||||||
router.push(`/documents/${id}`);
|
router.push(`/documents/${id}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@@ -79,7 +89,7 @@ export const UploadDocument = ({ className }: UploadDocumentProps) => {
|
|||||||
<div className={cn('relative', className)}>
|
<div className={cn('relative', className)}>
|
||||||
<DocumentDropzone
|
<DocumentDropzone
|
||||||
className="min-h-[40vh]"
|
className="min-h-[40vh]"
|
||||||
disabled={remaining.documents === 0}
|
disabled={remaining.documents === 0 || !session?.user.emailVerified}
|
||||||
onDrop={onFileDrop}
|
onDrop={onFileDrop}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,10 @@ import { getServerSession } from 'next-auth';
|
|||||||
|
|
||||||
import { LimitsProvider } from '@documenso/ee/server-only/limits/provider/server';
|
import { LimitsProvider } from '@documenso/ee/server-only/limits/provider/server';
|
||||||
import { NEXT_AUTH_OPTIONS } from '@documenso/lib/next-auth/auth-options';
|
import { NEXT_AUTH_OPTIONS } from '@documenso/lib/next-auth/auth-options';
|
||||||
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
|
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
|
||||||
|
|
||||||
import { Header } from '~/components/(dashboard)/layout/header';
|
import { Header } from '~/components/(dashboard)/layout/header';
|
||||||
|
import { VerifyEmailBanner } from '~/components/(dashboard)/layout/verify-email-banner';
|
||||||
import { RefreshOnFocus } from '~/components/(dashboard)/refresh-on-focus/refresh-on-focus';
|
import { RefreshOnFocus } from '~/components/(dashboard)/refresh-on-focus/refresh-on-focus';
|
||||||
import { NextAuthProvider } from '~/providers/next-auth';
|
import { NextAuthProvider } from '~/providers/next-auth';
|
||||||
|
|
||||||
@@ -30,6 +31,7 @@ export default async function AuthenticatedDashboardLayout({
|
|||||||
return (
|
return (
|
||||||
<NextAuthProvider session={session}>
|
<NextAuthProvider session={session}>
|
||||||
<LimitsProvider>
|
<LimitsProvider>
|
||||||
|
{!user.emailVerified && <VerifyEmailBanner email={user.email} />}
|
||||||
<Header user={user} />
|
<Header user={user} />
|
||||||
|
|
||||||
<main className="mt-8 pb-8 md:mt-12 md:pb-12">{children}</main>
|
<main className="mt-8 pb-8 md:mt-12 md:pb-12">{children}</main>
|
||||||
|
|||||||
@@ -5,8 +5,9 @@ import {
|
|||||||
getStripeCustomerById,
|
getStripeCustomerById,
|
||||||
} from '@documenso/ee/server-only/stripe/get-customer';
|
} from '@documenso/ee/server-only/stripe/get-customer';
|
||||||
import { getPortalSession } from '@documenso/ee/server-only/stripe/get-portal-session';
|
import { getPortalSession } from '@documenso/ee/server-only/stripe/get-portal-session';
|
||||||
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
|
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
|
||||||
import { Stripe, stripe } from '@documenso/lib/server-only/stripe';
|
import type { Stripe } from '@documenso/lib/server-only/stripe';
|
||||||
|
import { stripe } from '@documenso/lib/server-only/stripe';
|
||||||
import { getSubscriptionByUserId } from '@documenso/lib/server-only/subscription/get-subscription-by-user-id';
|
import { getSubscriptionByUserId } from '@documenso/lib/server-only/subscription/get-subscription-by-user-id';
|
||||||
|
|
||||||
export const createBillingPortal = async () => {
|
export const createBillingPortal = async () => {
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import {
|
|||||||
getStripeCustomerById,
|
getStripeCustomerById,
|
||||||
} from '@documenso/ee/server-only/stripe/get-customer';
|
} from '@documenso/ee/server-only/stripe/get-customer';
|
||||||
import { getPortalSession } from '@documenso/ee/server-only/stripe/get-portal-session';
|
import { getPortalSession } from '@documenso/ee/server-only/stripe/get-portal-session';
|
||||||
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
|
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
|
||||||
import { Stripe } from '@documenso/lib/server-only/stripe';
|
import type { Stripe } from '@documenso/lib/server-only/stripe';
|
||||||
import { getSubscriptionByUserId } from '@documenso/lib/server-only/subscription/get-subscription-by-user-id';
|
import { getSubscriptionByUserId } from '@documenso/lib/server-only/subscription/get-subscription-by-user-id';
|
||||||
|
|
||||||
export type CreateCheckoutOptions = {
|
export type CreateCheckoutOptions = {
|
||||||
@@ -23,7 +23,7 @@ export const createCheckout = async ({ priceId }: CreateCheckoutOptions) => {
|
|||||||
let stripeCustomer: Stripe.Customer | null = null;
|
let stripeCustomer: Stripe.Customer | null = null;
|
||||||
|
|
||||||
// Find the Stripe customer for the current user subscription.
|
// Find the Stripe customer for the current user subscription.
|
||||||
if (existingSubscription) {
|
if (existingSubscription?.periodEnd && existingSubscription.periodEnd >= new Date()) {
|
||||||
stripeCustomer = await getStripeCustomerById(existingSubscription.customerId);
|
stripeCustomer = await getStripeCustomerById(existingSubscription.customerId);
|
||||||
|
|
||||||
if (!stripeCustomer) {
|
if (!stripeCustomer) {
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import { match } from 'ts-pattern';
|
|||||||
|
|
||||||
import { getPricesByInterval } from '@documenso/ee/server-only/stripe/get-prices-by-interval';
|
import { getPricesByInterval } from '@documenso/ee/server-only/stripe/get-prices-by-interval';
|
||||||
import { getProductByPriceId } from '@documenso/ee/server-only/stripe/get-product-by-price-id';
|
import { getProductByPriceId } from '@documenso/ee/server-only/stripe/get-product-by-price-id';
|
||||||
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
|
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
|
||||||
import { getServerComponentFlag } from '@documenso/lib/server-only/feature-flags/get-server-component-feature-flag';
|
import { getServerComponentFlag } from '@documenso/lib/server-only/feature-flags/get-server-component-feature-flag';
|
||||||
import { Stripe } from '@documenso/lib/server-only/stripe';
|
import type { Stripe } from '@documenso/lib/server-only/stripe';
|
||||||
import { getSubscriptionByUserId } from '@documenso/lib/server-only/subscription/get-subscription-by-user-id';
|
import { getSubscriptionByUserId } from '@documenso/lib/server-only/subscription/get-subscription-by-user-id';
|
||||||
|
|
||||||
import { LocaleDate } from '~/components/formatter/locale-date';
|
import { LocaleDate } from '~/components/formatter/locale-date';
|
||||||
@@ -41,7 +41,7 @@ export default async function BillingSettingsPage() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h3 className="text-lg font-medium">Billing</h3>
|
<h3 className="text-2xl font-semibold">Billing</h3>
|
||||||
|
|
||||||
<div className="text-muted-foreground mt-2 text-sm">
|
<div className="text-muted-foreground mt-2 text-sm">
|
||||||
{isMissingOrInactiveOrFreePlan && (
|
{isMissingOrInactiveOrFreePlan && (
|
||||||
|
|||||||
@@ -1,19 +1,5 @@
|
|||||||
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
|
import { redirect } from 'next/navigation';
|
||||||
|
|
||||||
import { PasswordForm } from '~/components/forms/password';
|
export default function PasswordSettingsPage() {
|
||||||
|
redirect('/settings/security');
|
||||||
export default async function PasswordSettingsPage() {
|
|
||||||
const { user } = await getRequiredServerComponentSession();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<h3 className="text-lg font-medium">Password</h3>
|
|
||||||
|
|
||||||
<p className="text-muted-foreground mt-2 text-sm">Here you can update your password.</p>
|
|
||||||
|
|
||||||
<hr className="my-4" />
|
|
||||||
|
|
||||||
<PasswordForm user={user} className="max-w-xl" />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
|
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
|
||||||
|
|
||||||
import { ProfileForm } from '~/components/forms/profile';
|
import { ProfileForm } from '~/components/forms/profile';
|
||||||
|
|
||||||
@@ -7,7 +7,7 @@ export default async function ProfileSettingsPage() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h3 className="text-lg font-medium">Profile</h3>
|
<h3 className="text-2xl font-semibold">Profile</h3>
|
||||||
|
|
||||||
<p className="text-muted-foreground mt-2 text-sm">Here you can edit your personal details.</p>
|
<p className="text-muted-foreground mt-2 text-sm">Here you can edit your personal details.</p>
|
||||||
|
|
||||||
|
|||||||
46
apps/web/src/app/(dashboard)/settings/security/page.tsx
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
|
||||||
|
|
||||||
|
import { AuthenticatorApp } from '~/components/forms/2fa/authenticator-app';
|
||||||
|
import { RecoveryCodes } from '~/components/forms/2fa/recovery-codes';
|
||||||
|
import { PasswordForm } from '~/components/forms/password';
|
||||||
|
|
||||||
|
export default async function SecuritySettingsPage() {
|
||||||
|
const { user } = await getRequiredServerComponentSession();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<h3 className="text-2xl font-semibold">Security</h3>
|
||||||
|
|
||||||
|
<p className="text-muted-foreground mt-2 text-sm">
|
||||||
|
Here you can manage your password and security settings.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<hr className="my-4" />
|
||||||
|
|
||||||
|
<PasswordForm user={user} className="max-w-xl" />
|
||||||
|
|
||||||
|
<hr className="mb-4 mt-8" />
|
||||||
|
|
||||||
|
<h4 className="text-lg font-medium">Two Factor Authentication</h4>
|
||||||
|
|
||||||
|
<p className="text-muted-foreground mt-2 text-sm">
|
||||||
|
Add and manage your two factor security settings to add an extra layer of security to your
|
||||||
|
account!
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div className="mt-4 max-w-xl">
|
||||||
|
<h5 className="font-medium">Two-factor methods</h5>
|
||||||
|
|
||||||
|
<AuthenticatorApp isTwoFactorEnabled={user.twoFactorEnabled} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{user.twoFactorEnabled && (
|
||||||
|
<div className="mt-4 max-w-xl">
|
||||||
|
<h5 className="font-medium">Recovery methods</h5>
|
||||||
|
|
||||||
|
<RecoveryCodes isTwoFactorEnabled={user.twoFactorEnabled} />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -3,17 +3,16 @@ import { NextResponse } from 'next/server';
|
|||||||
|
|
||||||
import { P, match } from 'ts-pattern';
|
import { P, match } from 'ts-pattern';
|
||||||
|
|
||||||
import { getRecipientOrSenderByShareLinkSlug } from '@documenso/lib/server-only/share/get-recipient-or-sender-by-share-link-slug';
|
import type { ShareHandlerAPIResponse } from '~/pages/api/share';
|
||||||
|
|
||||||
import { Logo } from '~/components/branding/logo';
|
export const runtime = 'edge';
|
||||||
import { getAssetBuffer } from '~/helpers/get-asset-buffer';
|
|
||||||
|
|
||||||
const CARD_OFFSET_TOP = 152;
|
const CARD_OFFSET_TOP = 173;
|
||||||
const CARD_OFFSET_LEFT = 350;
|
const CARD_OFFSET_LEFT = 307;
|
||||||
const CARD_WIDTH = 500;
|
const CARD_WIDTH = 590;
|
||||||
const CARD_HEIGHT = 250;
|
const CARD_HEIGHT = 337;
|
||||||
|
|
||||||
const size = {
|
const IMAGE_SIZE = {
|
||||||
width: 1200,
|
width: 1200,
|
||||||
height: 630,
|
height: 630,
|
||||||
};
|
};
|
||||||
@@ -24,15 +23,27 @@ type SharePageOpenGraphImageProps = {
|
|||||||
|
|
||||||
export async function GET(_request: Request, { params: { slug } }: SharePageOpenGraphImageProps) {
|
export async function GET(_request: Request, { params: { slug } }: SharePageOpenGraphImageProps) {
|
||||||
const [interSemiBold, interRegular, caveatRegular, shareFrameImage] = await Promise.all([
|
const [interSemiBold, interRegular, caveatRegular, shareFrameImage] = await Promise.all([
|
||||||
getAssetBuffer('/fonts/inter-semibold.ttf'),
|
fetch(new URL('@documenso/assets/fonts/inter-semibold.ttf', import.meta.url)).then(
|
||||||
getAssetBuffer('/fonts/inter-regular.ttf'),
|
async (res) => res.arrayBuffer(),
|
||||||
getAssetBuffer('/fonts/caveat-regular.ttf'),
|
),
|
||||||
getAssetBuffer('/static/og-share-frame.png'),
|
fetch(new URL('@documenso/assets/fonts/inter-regular.ttf', import.meta.url)).then(async (res) =>
|
||||||
|
res.arrayBuffer(),
|
||||||
|
),
|
||||||
|
fetch(new URL('@documenso/assets/fonts/caveat-regular.ttf', import.meta.url)).then(
|
||||||
|
async (res) => res.arrayBuffer(),
|
||||||
|
),
|
||||||
|
fetch(new URL('@documenso/assets/static/og-share-frame2.png', import.meta.url)).then(
|
||||||
|
async (res) => res.arrayBuffer(),
|
||||||
|
),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const recipientOrSender = await getRecipientOrSenderByShareLinkSlug({ slug }).catch(() => null);
|
const baseUrl = process.env.NEXT_PUBLIC_WEBAPP_URL || 'http://localhost:3000';
|
||||||
|
|
||||||
if (!recipientOrSender) {
|
const recipientOrSender: ShareHandlerAPIResponse = await fetch(
|
||||||
|
new URL(`/api/share?slug=${slug}`, baseUrl),
|
||||||
|
).then(async (res) => res.json());
|
||||||
|
|
||||||
|
if ('error' in recipientOrSender) {
|
||||||
return NextResponse.json({ error: 'Not found' }, { status: 404 });
|
return NextResponse.json({ error: 'Not found' }, { status: 404 });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,15 +67,10 @@ export async function GET(_request: Request, { params: { slug } }: SharePageOpen
|
|||||||
|
|
||||||
return new ImageResponse(
|
return new ImageResponse(
|
||||||
(
|
(
|
||||||
<div tw="relative flex h-full w-full">
|
<div tw="relative flex h-full w-full bg-white">
|
||||||
{/* @ts-expect-error Lack of typing from ImageResponse */}
|
{/* @ts-expect-error Lack of typing from ImageResponse */}
|
||||||
<img src={shareFrameImage} alt="og-share-frame" tw="absolute inset-0 w-full h-full" />
|
<img src={shareFrameImage} alt="og-share-frame" tw="absolute inset-0 w-full h-full" />
|
||||||
|
|
||||||
<div tw="absolute top-20 flex w-full items-center justify-center">
|
|
||||||
{/* @ts-expect-error Lack of typing from ImageResponse */}
|
|
||||||
<Logo tw="h-8 w-60" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{signatureImage ? (
|
{signatureImage ? (
|
||||||
<div
|
<div
|
||||||
tw="absolute py-6 px-12 flex items-center justify-center text-center"
|
tw="absolute py-6 px-12 flex items-center justify-center text-center"
|
||||||
@@ -96,40 +102,28 @@ export async function GET(_request: Request, { params: { slug } }: SharePageOpen
|
|||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* <div
|
|
||||||
tw="absolute flex items-center justify-center text-slate-500"
|
|
||||||
style={{
|
|
||||||
top: `${CARD_OFFSET_TOP + CARD_HEIGHT - 45}px`,
|
|
||||||
left: `${CARD_OFFSET_LEFT}`,
|
|
||||||
width: `${CARD_WIDTH}px`,
|
|
||||||
fontSize: '30px',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{signatureName}
|
|
||||||
</div> */}
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
tw="absolute flex flex-col items-center justify-center pt-12 w-full"
|
tw="absolute flex w-full"
|
||||||
style={{
|
style={{
|
||||||
top: `${CARD_OFFSET_TOP + CARD_HEIGHT}px`,
|
top: `${CARD_OFFSET_TOP - 78}px`,
|
||||||
|
left: `${CARD_OFFSET_LEFT}px`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<h2
|
<h2
|
||||||
tw="text-3xl text-slate-500"
|
tw="text-xl"
|
||||||
style={{
|
style={{
|
||||||
|
color: '#828282',
|
||||||
fontFamily: 'Inter',
|
fontFamily: 'Inter',
|
||||||
fontWeight: 600,
|
fontWeight: 700,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{isRecipient
|
{isRecipient ? 'Document Signed!' : 'Document Sent!'}
|
||||||
? 'I just signed with Documenso and you can too!'
|
|
||||||
: 'I just sent a document with Documenso and you can too!'}
|
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
{
|
{
|
||||||
...size,
|
...IMAGE_SIZE,
|
||||||
fonts: [
|
fonts: [
|
||||||
{
|
{
|
||||||
name: 'Caveat',
|
name: 'Caveat',
|
||||||
@@ -149,6 +143,10 @@ export async function GET(_request: Request, { params: { slug } }: SharePageOpen
|
|||||||
weight: 600,
|
weight: 600,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
headers: {
|
||||||
|
'Access-Control-Allow-Origin': '*',
|
||||||
|
'Access-Control-Allow-Methods': 'GET, OPTIONS',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ type SharePageProps = {
|
|||||||
export function generateMetadata({ params: { slug } }: SharePageProps) {
|
export function generateMetadata({ params: { slug } }: SharePageProps) {
|
||||||
return {
|
return {
|
||||||
title: 'Documenso - Share',
|
title: 'Documenso - Share',
|
||||||
description: 'I just signed a document with Documenso!',
|
description: 'I just signed a document in style with Documenso!',
|
||||||
openGraph: {
|
openGraph: {
|
||||||
title: 'Documenso - Join the open source signing revolution',
|
title: 'Documenso - Join the open source signing revolution',
|
||||||
description: 'I just signed with Documenso!',
|
description: 'I just signed with Documenso!',
|
||||||
|
|||||||
@@ -2,8 +2,10 @@ import Link from 'next/link';
|
|||||||
import { notFound } from 'next/navigation';
|
import { notFound } from 'next/navigation';
|
||||||
|
|
||||||
import { CheckCircle2, Clock8 } from 'lucide-react';
|
import { CheckCircle2, Clock8 } from 'lucide-react';
|
||||||
|
import { getServerSession } from 'next-auth';
|
||||||
import { match } from 'ts-pattern';
|
import { match } from 'ts-pattern';
|
||||||
|
|
||||||
|
import signingCelebration from '@documenso/assets/images/signing-celebration.png';
|
||||||
import { getDocumentAndSenderByToken } from '@documenso/lib/server-only/document/get-document-by-token';
|
import { getDocumentAndSenderByToken } from '@documenso/lib/server-only/document/get-document-by-token';
|
||||||
import { getFieldsForToken } from '@documenso/lib/server-only/field/get-fields-for-token';
|
import { getFieldsForToken } from '@documenso/lib/server-only/field/get-fields-for-token';
|
||||||
import { getRecipientByToken } from '@documenso/lib/server-only/recipient/get-recipient-by-token';
|
import { getRecipientByToken } from '@documenso/lib/server-only/recipient/get-recipient-by-token';
|
||||||
@@ -13,8 +15,6 @@ import { DocumentDownloadButton } from '@documenso/ui/components/document/docume
|
|||||||
import { DocumentShareButton } from '@documenso/ui/components/document/document-share-button';
|
import { DocumentShareButton } from '@documenso/ui/components/document/document-share-button';
|
||||||
import { SigningCard3D } from '@documenso/ui/components/signing-card';
|
import { SigningCard3D } from '@documenso/ui/components/signing-card';
|
||||||
|
|
||||||
import signingCelebration from '~/assets/signing-celebration.png';
|
|
||||||
|
|
||||||
export type CompletedSigningPageProps = {
|
export type CompletedSigningPageProps = {
|
||||||
params: {
|
params: {
|
||||||
token?: string;
|
token?: string;
|
||||||
@@ -54,6 +54,9 @@ export default async function CompletedSigningPage({
|
|||||||
fields.find((field) => field.type === FieldType.NAME)?.customText ||
|
fields.find((field) => field.type === FieldType.NAME)?.customText ||
|
||||||
recipient.email;
|
recipient.email;
|
||||||
|
|
||||||
|
const sessionData = await getServerSession();
|
||||||
|
const isLoggedIn = !!sessionData?.user;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="-mx-4 flex max-w-[100vw] flex-col items-center overflow-x-hidden px-4 pt-24 md:-mx-8 md:px-8 lg:pt-36 xl:pt-44">
|
<div className="-mx-4 flex max-w-[100vw] flex-col items-center overflow-x-hidden px-4 pt-24 md:-mx-8 md:px-8 lg:pt-36 xl:pt-44">
|
||||||
{/* Card with recipient */}
|
{/* Card with recipient */}
|
||||||
@@ -64,18 +67,24 @@ export default async function CompletedSigningPage({
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<div className="relative mt-6 flex w-full flex-col items-center">
|
<div className="relative mt-6 flex w-full flex-col items-center">
|
||||||
{match(document.status)
|
{match({ status: document.status, deletedAt: document.deletedAt })
|
||||||
.with(DocumentStatus.COMPLETED, () => (
|
.with({ status: DocumentStatus.COMPLETED }, () => (
|
||||||
<div className="text-documenso-700 flex items-center text-center">
|
<div className="text-documenso-700 flex items-center text-center">
|
||||||
<CheckCircle2 className="mr-2 h-5 w-5" />
|
<CheckCircle2 className="mr-2 h-5 w-5" />
|
||||||
<span className="text-sm">Everyone has signed</span>
|
<span className="text-sm">Everyone has signed</span>
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
.otherwise(() => (
|
.with({ deletedAt: null }, () => (
|
||||||
<div className="flex items-center text-center text-blue-600">
|
<div className="flex items-center text-center text-blue-600">
|
||||||
<Clock8 className="mr-2 h-5 w-5" />
|
<Clock8 className="mr-2 h-5 w-5" />
|
||||||
<span className="text-sm">Waiting for others to sign</span>
|
<span className="text-sm">Waiting for others to sign</span>
|
||||||
</div>
|
</div>
|
||||||
|
))
|
||||||
|
.otherwise(() => (
|
||||||
|
<div className="flex items-center text-center text-red-600">
|
||||||
|
<Clock8 className="mr-2 h-5 w-5" />
|
||||||
|
<span className="text-sm">Document no longer available to sign</span>
|
||||||
|
</div>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
<h2 className="mt-6 max-w-[35ch] text-center text-2xl font-semibold leading-normal md:text-3xl lg:text-4xl">
|
<h2 className="mt-6 max-w-[35ch] text-center text-2xl font-semibold leading-normal md:text-3xl lg:text-4xl">
|
||||||
@@ -83,16 +92,22 @@ export default async function CompletedSigningPage({
|
|||||||
<span className="mt-1.5 block">"{document.title}"</span>
|
<span className="mt-1.5 block">"{document.title}"</span>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
{match(document.status)
|
{match({ status: document.status, deletedAt: document.deletedAt })
|
||||||
.with(DocumentStatus.COMPLETED, () => (
|
.with({ status: DocumentStatus.COMPLETED }, () => (
|
||||||
<p className="text-muted-foreground/60 mt-2.5 max-w-[60ch] text-center text-sm font-medium md:text-base">
|
<p className="text-muted-foreground/60 mt-2.5 max-w-[60ch] text-center text-sm font-medium md:text-base">
|
||||||
Everyone has signed! You will receive an Email copy of the signed document.
|
Everyone has signed! You will receive an Email copy of the signed document.
|
||||||
</p>
|
</p>
|
||||||
))
|
))
|
||||||
.otherwise(() => (
|
.with({ deletedAt: null }, () => (
|
||||||
<p className="text-muted-foreground/60 mt-2.5 max-w-[60ch] text-center text-sm font-medium md:text-base">
|
<p className="text-muted-foreground/60 mt-2.5 max-w-[60ch] text-center text-sm font-medium md:text-base">
|
||||||
You will receive an Email copy of the signed document once everyone has signed.
|
You will receive an Email copy of the signed document once everyone has signed.
|
||||||
</p>
|
</p>
|
||||||
|
))
|
||||||
|
.otherwise(() => (
|
||||||
|
<p className="text-muted-foreground/60 mt-2.5 max-w-[60ch] text-center text-sm font-medium md:text-base">
|
||||||
|
This document has been cancelled by the owner and is no longer available for others to
|
||||||
|
sign.
|
||||||
|
</p>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
<div className="mt-8 flex w-full max-w-sm items-center justify-center gap-4">
|
<div className="mt-8 flex w-full max-w-sm items-center justify-center gap-4">
|
||||||
@@ -106,15 +121,21 @@ export default async function CompletedSigningPage({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p className="text-muted-foreground/60 mt-36 text-sm">
|
{isLoggedIn ? (
|
||||||
Want to send slick signing links like this one?{' '}
|
<Link href="/documents" className="text-documenso-700 hover:text-documenso-600 mt-36">
|
||||||
<Link
|
Go Back Home
|
||||||
href="https://documenso.com"
|
|
||||||
className="text-documenso-700 hover:text-documenso-600"
|
|
||||||
>
|
|
||||||
Check out Documenso.
|
|
||||||
</Link>
|
</Link>
|
||||||
</p>
|
) : (
|
||||||
|
<p className="text-muted-foreground/60 mt-36 text-sm">
|
||||||
|
Want to send slick signing links like this one?{' '}
|
||||||
|
<Link
|
||||||
|
href="https://documenso.com"
|
||||||
|
className="text-documenso-700 hover:text-documenso-600"
|
||||||
|
>
|
||||||
|
Check out Documenso.
|
||||||
|
</Link>
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -7,9 +7,10 @@ import { useRouter } from 'next/navigation';
|
|||||||
import { useSession } from 'next-auth/react';
|
import { useSession } from 'next-auth/react';
|
||||||
import { useForm } from 'react-hook-form';
|
import { useForm } from 'react-hook-form';
|
||||||
|
|
||||||
import { completeDocumentWithToken } from '@documenso/lib/server-only/document/complete-document-with-token';
|
import { useAnalytics } from '@documenso/lib/client-only/hooks/use-analytics';
|
||||||
import { sortFieldsByPosition, validateFieldsInserted } from '@documenso/lib/utils/fields';
|
import { sortFieldsByPosition, validateFieldsInserted } from '@documenso/lib/utils/fields';
|
||||||
import { Document, Field, Recipient } from '@documenso/prisma/client';
|
import type { Document, Field, Recipient } from '@documenso/prisma/client';
|
||||||
|
import { trpc } from '@documenso/trpc/react';
|
||||||
import { FieldToolTip } from '@documenso/ui/components/field/field-tooltip';
|
import { FieldToolTip } from '@documenso/ui/components/field/field-tooltip';
|
||||||
import { cn } from '@documenso/ui/lib/utils';
|
import { cn } from '@documenso/ui/lib/utils';
|
||||||
import { Button } from '@documenso/ui/primitives/button';
|
import { Button } from '@documenso/ui/primitives/button';
|
||||||
@@ -19,6 +20,7 @@ import { Label } from '@documenso/ui/primitives/label';
|
|||||||
import { SignaturePad } from '@documenso/ui/primitives/signature-pad';
|
import { SignaturePad } from '@documenso/ui/primitives/signature-pad';
|
||||||
|
|
||||||
import { useRequiredSigningContext } from './provider';
|
import { useRequiredSigningContext } from './provider';
|
||||||
|
import { SignDialog } from './sign-dialog';
|
||||||
|
|
||||||
export type SigningFormProps = {
|
export type SigningFormProps = {
|
||||||
document: Document;
|
document: Document;
|
||||||
@@ -28,12 +30,15 @@ export type SigningFormProps = {
|
|||||||
|
|
||||||
export const SigningForm = ({ document, recipient, fields }: SigningFormProps) => {
|
export const SigningForm = ({ document, recipient, fields }: SigningFormProps) => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const analytics = useAnalytics();
|
||||||
const { data: session } = useSession();
|
const { data: session } = useSession();
|
||||||
|
|
||||||
const { fullName, signature, setFullName, setSignature } = useRequiredSigningContext();
|
const { fullName, signature, setFullName, setSignature } = useRequiredSigningContext();
|
||||||
|
|
||||||
const [validateUninsertedFields, setValidateUninsertedFields] = useState(false);
|
const [validateUninsertedFields, setValidateUninsertedFields] = useState(false);
|
||||||
|
|
||||||
|
const { mutateAsync: completeDocumentWithToken } =
|
||||||
|
trpc.recipient.completeDocumentWithToken.useMutation();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
formState: { isSubmitting },
|
formState: { isSubmitting },
|
||||||
@@ -45,6 +50,7 @@ export const SigningForm = ({ document, recipient, fields }: SigningFormProps) =
|
|||||||
|
|
||||||
const onFormSubmit = async () => {
|
const onFormSubmit = async () => {
|
||||||
setValidateUninsertedFields(true);
|
setValidateUninsertedFields(true);
|
||||||
|
|
||||||
const isFieldsValid = validateFieldsInserted(fields);
|
const isFieldsValid = validateFieldsInserted(fields);
|
||||||
|
|
||||||
if (!isFieldsValid) {
|
if (!isFieldsValid) {
|
||||||
@@ -56,6 +62,12 @@ export const SigningForm = ({ document, recipient, fields }: SigningFormProps) =
|
|||||||
documentId: document.id,
|
documentId: document.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
analytics.capture('App: Recipient has completed signing', {
|
||||||
|
signerId: recipient.id,
|
||||||
|
documentId: document.id,
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
});
|
||||||
|
|
||||||
router.push(`/sign/${recipient.token}/complete`);
|
router.push(`/sign/${recipient.token}/complete`);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -132,9 +144,12 @@ export const SigningForm = ({ document, recipient, fields }: SigningFormProps) =
|
|||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button className="w-full" type="submit" size="lg" loading={isSubmitting}>
|
<SignDialog
|
||||||
Complete
|
isSubmitting={isSubmitting}
|
||||||
</Button>
|
onSignatureComplete={handleSubmit(onFormSubmit)}
|
||||||
|
document={document}
|
||||||
|
fields={fields}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { getServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
|
import { getServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
|
||||||
|
|
||||||
import { Header as AuthenticatedHeader } from '~/components/(dashboard)/layout/header';
|
import { Header as AuthenticatedHeader } from '~/components/(dashboard)/layout/header';
|
||||||
import { NextAuthProvider } from '~/providers/next-auth';
|
import { NextAuthProvider } from '~/providers/next-auth';
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import Link from 'next/link';
|
||||||
|
|
||||||
|
import { Clock8 } from 'lucide-react';
|
||||||
|
import { useSession } from 'next-auth/react';
|
||||||
|
|
||||||
|
import signingCelebration from '@documenso/assets/images/signing-celebration.png';
|
||||||
|
import type { Document, Signature } from '@documenso/prisma/client';
|
||||||
|
import { SigningCard3D } from '@documenso/ui/components/signing-card';
|
||||||
|
|
||||||
|
type NoLongerAvailableProps = {
|
||||||
|
document: Document;
|
||||||
|
recipientName: string;
|
||||||
|
recipientSignature: Signature;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const NoLongerAvailable = ({
|
||||||
|
document,
|
||||||
|
recipientName,
|
||||||
|
recipientSignature,
|
||||||
|
}: NoLongerAvailableProps) => {
|
||||||
|
const { data: session } = useSession();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="-mx-4 flex max-w-[100vw] flex-col items-center overflow-x-hidden px-4 pt-16 md:-mx-8 md:px-8 lg:pt-16 xl:pt-24">
|
||||||
|
<SigningCard3D
|
||||||
|
name={recipientName}
|
||||||
|
signature={recipientSignature}
|
||||||
|
signingCelebrationImage={signingCelebration}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div className="relative mt-2 flex w-full flex-col items-center">
|
||||||
|
<div className="mt-8 flex items-center text-center text-red-600">
|
||||||
|
<Clock8 className="mr-2 h-5 w-5" />
|
||||||
|
<span className="text-sm">Document Cancelled</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2 className="mt-6 max-w-[35ch] text-center text-2xl font-semibold leading-normal md:text-3xl lg:text-4xl">
|
||||||
|
<span className="mt-1.5 block">"{document.title}"</span>
|
||||||
|
is no longer available to sign
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<p className="text-muted-foreground/60 mt-2.5 max-w-[60ch] text-center text-sm font-medium md:text-base">
|
||||||
|
This document has been cancelled by the owner.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
{session?.user ? (
|
||||||
|
<Link href="/documents" className="text-documenso-700 hover:text-documenso-600 mt-36">
|
||||||
|
Go Back Home
|
||||||
|
</Link>
|
||||||
|
) : (
|
||||||
|
<p className="text-muted-foreground/60 mt-36 text-sm">
|
||||||
|
Want to send slick signing links like this one?{' '}
|
||||||
|
<Link
|
||||||
|
href="https://documenso.com"
|
||||||
|
className="text-documenso-700 hover:text-documenso-600"
|
||||||
|
>
|
||||||
|
Check out Documenso.
|
||||||
|
</Link>
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -3,11 +3,12 @@ import { notFound, redirect } from 'next/navigation';
|
|||||||
import { match } from 'ts-pattern';
|
import { match } from 'ts-pattern';
|
||||||
|
|
||||||
import { PDF_VIEWER_PAGE_SELECTOR } from '@documenso/lib/constants/pdf-viewer';
|
import { PDF_VIEWER_PAGE_SELECTOR } from '@documenso/lib/constants/pdf-viewer';
|
||||||
import { getServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
|
import { getServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
|
||||||
import { getDocumentAndSenderByToken } from '@documenso/lib/server-only/document/get-document-by-token';
|
import { getDocumentAndSenderByToken } from '@documenso/lib/server-only/document/get-document-by-token';
|
||||||
import { viewedDocument } from '@documenso/lib/server-only/document/viewed-document';
|
import { viewedDocument } from '@documenso/lib/server-only/document/viewed-document';
|
||||||
import { getFieldsForToken } from '@documenso/lib/server-only/field/get-fields-for-token';
|
import { getFieldsForToken } from '@documenso/lib/server-only/field/get-fields-for-token';
|
||||||
import { getRecipientByToken } from '@documenso/lib/server-only/recipient/get-recipient-by-token';
|
import { getRecipientByToken } from '@documenso/lib/server-only/recipient/get-recipient-by-token';
|
||||||
|
import { getRecipientSignatures } from '@documenso/lib/server-only/recipient/get-recipient-signatures';
|
||||||
import { DocumentStatus, FieldType, SigningStatus } from '@documenso/prisma/client';
|
import { DocumentStatus, FieldType, SigningStatus } from '@documenso/prisma/client';
|
||||||
import { Card, CardContent } from '@documenso/ui/primitives/card';
|
import { Card, CardContent } from '@documenso/ui/primitives/card';
|
||||||
import { ElementVisible } from '@documenso/ui/primitives/element-visible';
|
import { ElementVisible } from '@documenso/ui/primitives/element-visible';
|
||||||
@@ -17,6 +18,7 @@ import { DateField } from './date-field';
|
|||||||
import { EmailField } from './email-field';
|
import { EmailField } from './email-field';
|
||||||
import { SigningForm } from './form';
|
import { SigningForm } from './form';
|
||||||
import { NameField } from './name-field';
|
import { NameField } from './name-field';
|
||||||
|
import { NoLongerAvailable } from './no-longer-available';
|
||||||
import { SigningProvider } from './provider';
|
import { SigningProvider } from './provider';
|
||||||
import { SignatureField } from './signature-field';
|
import { SignatureField } from './signature-field';
|
||||||
|
|
||||||
@@ -55,8 +57,24 @@ export default async function SigningPage({ params: { token } }: SigningPageProp
|
|||||||
redirect(`/sign/${token}/complete`);
|
redirect(`/sign/${token}/complete`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const [recipientSignature] = await getRecipientSignatures({ recipientId: recipient.id });
|
||||||
|
|
||||||
|
if (document.deletedAt) {
|
||||||
|
return (
|
||||||
|
<NoLongerAvailable
|
||||||
|
document={document}
|
||||||
|
recipientName={recipient.name}
|
||||||
|
recipientSignature={recipientSignature}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SigningProvider email={recipient.email} fullName={recipient.name} signature={user?.signature}>
|
<SigningProvider
|
||||||
|
email={recipient.email}
|
||||||
|
fullName={user?.email === recipient.email ? user.name : recipient.name}
|
||||||
|
signature={user?.email === recipient.email ? user.signature : undefined}
|
||||||
|
>
|
||||||
<div className="mx-auto w-full max-w-screen-xl">
|
<div className="mx-auto w-full max-w-screen-xl">
|
||||||
<h1 className="mt-4 truncate text-2xl font-semibold md:text-3xl" title={document.title}>
|
<h1 className="mt-4 truncate text-2xl font-semibold md:text-3xl" title={document.title}>
|
||||||
{document.title}
|
{document.title}
|
||||||
|
|||||||
77
apps/web/src/app/(signing)/sign/[token]/sign-dialog.tsx
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
import { useState } from 'react';
|
||||||
|
|
||||||
|
import { Document, Field } from '@documenso/prisma/client';
|
||||||
|
import { Button } from '@documenso/ui/primitives/button';
|
||||||
|
import {
|
||||||
|
Dialog,
|
||||||
|
DialogContent,
|
||||||
|
DialogFooter,
|
||||||
|
DialogTrigger,
|
||||||
|
} from '@documenso/ui/primitives/dialog';
|
||||||
|
|
||||||
|
export type SignDialogProps = {
|
||||||
|
isSubmitting: boolean;
|
||||||
|
document: Document;
|
||||||
|
fields: Field[];
|
||||||
|
onSignatureComplete: () => void | Promise<void>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const SignDialog = ({
|
||||||
|
isSubmitting,
|
||||||
|
document,
|
||||||
|
fields,
|
||||||
|
onSignatureComplete,
|
||||||
|
}: SignDialogProps) => {
|
||||||
|
const [showDialog, setShowDialog] = useState(false);
|
||||||
|
|
||||||
|
const isComplete = fields.every((field) => field.inserted);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Dialog open={showDialog} onOpenChange={setShowDialog}>
|
||||||
|
<DialogTrigger asChild>
|
||||||
|
<Button
|
||||||
|
className="w-full"
|
||||||
|
type="button"
|
||||||
|
size="lg"
|
||||||
|
disabled={!isComplete}
|
||||||
|
loading={isSubmitting}
|
||||||
|
>
|
||||||
|
Complete
|
||||||
|
</Button>
|
||||||
|
</DialogTrigger>
|
||||||
|
<DialogContent>
|
||||||
|
<div className="text-center">
|
||||||
|
<div className="text-xl font-semibold text-neutral-800">Sign Document</div>
|
||||||
|
<div className="text-muted-foreground mx-auto w-4/5 py-2 text-center">
|
||||||
|
You are about to finish signing "{document.title}". Are you sure?
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<DialogFooter>
|
||||||
|
<div className="flex w-full flex-1 flex-nowrap gap-4">
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
className="dark:bg-muted dark:hover:bg-muted/80 flex-1 bg-black/5 hover:bg-black/10"
|
||||||
|
variant="secondary"
|
||||||
|
onClick={() => {
|
||||||
|
setShowDialog(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Cancel
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
className="flex-1"
|
||||||
|
disabled={!isComplete}
|
||||||
|
loading={isSubmitting}
|
||||||
|
onClick={onSignatureComplete}
|
||||||
|
>
|
||||||
|
Sign
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</DialogFooter>
|
||||||
|
</DialogContent>
|
||||||
|
</Dialog>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -6,8 +6,8 @@ import { useRouter } from 'next/navigation';
|
|||||||
|
|
||||||
import { Loader } from 'lucide-react';
|
import { Loader } from 'lucide-react';
|
||||||
|
|
||||||
import { Recipient } from '@documenso/prisma/client';
|
import type { Recipient } from '@documenso/prisma/client';
|
||||||
import { FieldWithSignature } from '@documenso/prisma/types/field-with-signature';
|
import type { FieldWithSignature } from '@documenso/prisma/types/field-with-signature';
|
||||||
import { trpc } from '@documenso/trpc/react';
|
import { trpc } from '@documenso/trpc/react';
|
||||||
import { Button } from '@documenso/ui/primitives/button';
|
import { Button } from '@documenso/ui/primitives/button';
|
||||||
import { Dialog, DialogContent, DialogFooter, DialogTitle } from '@documenso/ui/primitives/dialog';
|
import { Dialog, DialogContent, DialogFooter, DialogTitle } from '@documenso/ui/primitives/dialog';
|
||||||
@@ -76,10 +76,16 @@ export const SignatureField = ({ field, recipient }: SignatureFieldProps) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const value = source === 'local' && localSignature ? localSignature : providedSignature ?? '';
|
||||||
|
|
||||||
|
if (!value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
await signFieldWithToken({
|
await signFieldWithToken({
|
||||||
token: recipient.token,
|
token: recipient.token,
|
||||||
fieldId: field.id,
|
fieldId: field.id,
|
||||||
value: source === 'local' && localSignature ? localSignature : providedSignature ?? '',
|
value,
|
||||||
isBase64: true,
|
isBase64: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { ForgotPasswordForm } from '~/components/forms/forgot-password';
|
|||||||
export default function ForgotPasswordPage() {
|
export default function ForgotPasswordPage() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-4xl font-semibold">Forgotten your password?</h1>
|
<h1 className="text-4xl font-semibold">Forgot your password?</h1>
|
||||||
|
|
||||||
<p className="text-muted-foreground mt-2 text-sm">
|
<p className="text-muted-foreground mt-2 text-sm">
|
||||||
No worries, it happens! Enter your email and we'll email you a special link to reset your
|
No worries, it happens! Enter your email and we'll email you a special link to reset your
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
|
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
|
|
||||||
import backgroundPattern from '~/assets/background-pattern.png';
|
import backgroundPattern from '@documenso/assets/images/background-pattern.png';
|
||||||
|
|
||||||
type UnauthenticatedLayoutProps = {
|
type UnauthenticatedLayoutProps = {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export default function SignInPage() {
|
|||||||
href="/forgot-password"
|
href="/forgot-password"
|
||||||
className="text-muted-foreground text-sm duration-200 hover:opacity-70"
|
className="text-muted-foreground text-sm duration-200 hover:opacity-70"
|
||||||
>
|
>
|
||||||
Forgotten your password?
|
Forgot your password?
|
||||||
</Link>
|
</Link>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,97 @@
|
|||||||
|
import Link from 'next/link';
|
||||||
|
|
||||||
|
import { AlertTriangle, CheckCircle2, XCircle, XOctagon } from 'lucide-react';
|
||||||
|
|
||||||
|
import { verifyEmail } from '@documenso/lib/server-only/user/verify-email';
|
||||||
|
import { Button } from '@documenso/ui/primitives/button';
|
||||||
|
|
||||||
|
export type PageProps = {
|
||||||
|
params: {
|
||||||
|
token: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function VerifyEmailPage({ params: { token } }: PageProps) {
|
||||||
|
if (!token) {
|
||||||
|
return (
|
||||||
|
<div className="w-full">
|
||||||
|
<div className="mb-4 text-red-300">
|
||||||
|
<XOctagon />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2 className="text-4xl font-semibold">No token provided</h2>
|
||||||
|
<p className="text-muted-foreground mt-2 text-base">
|
||||||
|
It seems that there is no token provided. Please check your email and try again.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const verified = await verifyEmail({ token });
|
||||||
|
|
||||||
|
if (verified === null) {
|
||||||
|
return (
|
||||||
|
<div className="flex w-full items-start">
|
||||||
|
<div className="mr-4 mt-1 hidden md:block">
|
||||||
|
<AlertTriangle className="h-10 w-10 text-yellow-500" strokeWidth={2} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h2 className="text-2xl font-bold md:text-4xl">Something went wrong</h2>
|
||||||
|
|
||||||
|
<p className="text-muted-foreground mt-4">
|
||||||
|
We were unable to verify your email. If your email is not verified already, please try
|
||||||
|
again.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<Button className="mt-4" asChild>
|
||||||
|
<Link href="/">Go back home</Link>
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!verified) {
|
||||||
|
return (
|
||||||
|
<div className="flex w-full items-start">
|
||||||
|
<div className="mr-4 mt-1 hidden md:block">
|
||||||
|
<XCircle className="text-destructive h-10 w-10" strokeWidth={2} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h2 className="text-2xl font-bold md:text-4xl">Your token has expired!</h2>
|
||||||
|
|
||||||
|
<p className="text-muted-foreground mt-4">
|
||||||
|
It seems that the provided token has expired. We've just sent you another token, please
|
||||||
|
check your email and try again.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<Button className="mt-4" asChild>
|
||||||
|
<Link href="/">Go back home</Link>
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="flex w-full items-start">
|
||||||
|
<div className="mr-4 mt-1 hidden md:block">
|
||||||
|
<CheckCircle2 className="h-10 w-10 text-green-500" strokeWidth={2} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h2 className="text-2xl font-bold md:text-4xl">Email Confirmed!</h2>
|
||||||
|
|
||||||
|
<p className="text-muted-foreground mt-4">
|
||||||
|
Your email has been successfully confirmed! You can now use all features of Documenso.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<Button className="mt-4" asChild>
|
||||||
|
<Link href="/">Go back home</Link>
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
28
apps/web/src/app/(unauthenticated)/verify-email/page.tsx
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import Link from 'next/link';
|
||||||
|
|
||||||
|
import { XCircle } from 'lucide-react';
|
||||||
|
|
||||||
|
import { Button } from '@documenso/ui/primitives/button';
|
||||||
|
|
||||||
|
export default function EmailVerificationWithoutTokenPage() {
|
||||||
|
return (
|
||||||
|
<div className="flex w-full items-start">
|
||||||
|
<div className="mr-4 mt-1 hidden md:block">
|
||||||
|
<XCircle className="text-destructive h-10 w-10" strokeWidth={2} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h2 className="text-2xl font-bold md:text-4xl">Uh oh! Looks like you're missing a token</h2>
|
||||||
|
|
||||||
|
<p className="text-muted-foreground mt-4">
|
||||||
|
It seems that there is no token provided, if you are trying to verify your email please
|
||||||
|
follow the link in your email.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<Button className="mt-4" asChild>
|
||||||
|
<Link href="/">Go back home</Link>
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -12,7 +12,6 @@ import { Toaster } from '@documenso/ui/primitives/toaster';
|
|||||||
import { TooltipProvider } from '@documenso/ui/primitives/tooltip';
|
import { TooltipProvider } from '@documenso/ui/primitives/tooltip';
|
||||||
|
|
||||||
import { ThemeProvider } from '~/providers/next-theme';
|
import { ThemeProvider } from '~/providers/next-theme';
|
||||||
import { PlausibleProvider } from '~/providers/plausible';
|
|
||||||
import { PostHogPageview } from '~/providers/posthog';
|
import { PostHogPageview } from '~/providers/posthog';
|
||||||
|
|
||||||
import './globals.css';
|
import './globals.css';
|
||||||
@@ -69,13 +68,11 @@ export default async function RootLayout({ children }: { children: React.ReactNo
|
|||||||
<body>
|
<body>
|
||||||
<LocaleProvider locale={locale}>
|
<LocaleProvider locale={locale}>
|
||||||
<FeatureFlagProvider initialFlags={flags}>
|
<FeatureFlagProvider initialFlags={flags}>
|
||||||
<PlausibleProvider>
|
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
|
||||||
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
|
<TooltipProvider>
|
||||||
<TooltipProvider>
|
<TrpcProvider>{children}</TrpcProvider>
|
||||||
<TrpcProvider>{children}</TrpcProvider>
|
</TooltipProvider>
|
||||||
</TooltipProvider>
|
</ThemeProvider>
|
||||||
</ThemeProvider>
|
|
||||||
</PlausibleProvider>
|
|
||||||
|
|
||||||
<Toaster />
|
<Toaster />
|
||||||
</FeatureFlagProvider>
|
</FeatureFlagProvider>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
|
||||||
import { getServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
|
import { getServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
|
||||||
import { Button } from '@documenso/ui/primitives/button';
|
import { Button } from '@documenso/ui/primitives/button';
|
||||||
|
|
||||||
import NotFoundPartial from '~/components/partials/not-found';
|
import NotFoundPartial from '~/components/partials/not-found';
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 3.3 MiB |
|
Before Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 215 KiB |
|
Before Width: | Height: | Size: 36 KiB |