Compare commits
1188 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9c1f3177c | ||
|
|
23c45f137a | ||
|
|
bfb3d12290 | ||
|
|
785609b66e | ||
|
|
8ea4407f04 | ||
|
|
3c9d71df6f | ||
|
|
c8f99da853 | ||
|
|
23e1fc3f73 | ||
|
|
eb6fe42259 | ||
|
|
3b0f3eca2c | ||
|
|
dce581acd7 | ||
|
|
79c2f1ea5e | ||
|
|
471727b769 | ||
|
|
ff7400f2b1 | ||
|
|
4c58e3e10d | ||
|
|
d4742a6233 | ||
|
|
51b46d44b0 | ||
|
|
5b42a9c76e | ||
|
|
d24b3f72ce | ||
|
|
6edf947c26 | ||
|
|
c4a66c2cd9 | ||
|
|
d47e2c5786 | ||
|
|
50b99370d2 | ||
|
|
c4a5f2aea2 | ||
|
|
5f9a5c859e | ||
|
|
c71ba2b079 | ||
|
|
8117425de8 | ||
|
|
39000bdcb2 | ||
|
|
ab9bf1a4c6 | ||
|
|
f5fdec6bf8 | ||
|
|
e76dc76684 | ||
|
|
1aa59a3918 | ||
|
|
5e1ddb552e | ||
|
|
521b49afbf | ||
|
|
b6a9fe4bcf | ||
|
|
3dfd8314f1 | ||
|
|
3e8ad0ab60 | ||
|
|
339f7503a4 | ||
|
|
36aae5c37f | ||
|
|
65c81c7c2a | ||
|
|
39b30da10f | ||
|
|
3c42e6e6af | ||
|
|
71a15b5e6d | ||
|
|
1adca7b09d | ||
|
|
2f18647f87 | ||
|
|
f35cfae566 | ||
|
|
cd9c02094a | ||
|
|
4d04a40b84 | ||
|
|
30b9bd0f9c | ||
|
|
2d1d1b4f32 | ||
|
|
f060d2d8a4 | ||
|
|
b33bca32b9 | ||
|
|
f0f698fa73 | ||
|
|
93ed664920 | ||
|
|
3afefbe592 | ||
|
|
33e0136201 | ||
|
|
1e59d8d730 | ||
|
|
ae4c704a1b | ||
|
|
580e3fe653 | ||
|
|
a897631251 | ||
|
|
fbf82fc205 | ||
|
|
4cc34ad203 | ||
|
|
1617556158 | ||
|
|
23c0f14fec | ||
|
|
aadcd5a8f8 | ||
|
|
ded8c3cd32 | ||
|
|
fef1b98cf1 | ||
|
|
568c6bb7b2 | ||
|
|
f19f688770 | ||
|
|
7e1ce9ce61 | ||
|
|
3f982703ef | ||
|
|
4162010853 | ||
|
|
30db1d1c39 | ||
|
|
cc70f85c5a | ||
|
|
566cc9caec | ||
|
|
8197d060d3 | ||
|
|
ca14e66a58 | ||
|
|
b563f9a039 | ||
|
|
c97ddeb2d9 | ||
|
|
e268e25719 | ||
|
|
4de5605931 | ||
|
|
b2037ecf6f | ||
|
|
75ee5f83f1 | ||
|
|
6ecf834cfc | ||
|
|
40f5901526 | ||
|
|
b1c8ac94a7 | ||
|
|
a8e2cc11af | ||
|
|
c1b2301650 | ||
|
|
a4ee7981c6 | ||
|
|
7c13ab22d5 | ||
|
|
ad5f070286 | ||
|
|
c2c65326a1 | ||
|
|
30dbf782d6 | ||
|
|
a1cbfd5cad | ||
|
|
d343add43e | ||
|
|
9e42d119e4 | ||
|
|
e549298ad5 | ||
|
|
2bc5c59fec | ||
|
|
72a5886191 | ||
|
|
6b6297fb2d | ||
|
|
9b9d0f24b5 | ||
|
|
162ec74445 | ||
|
|
8e022cd48c | ||
|
|
e36c7d269c | ||
|
|
c5d1e5cbf5 | ||
|
|
a8190154d1 | ||
|
|
d307aa5d38 | ||
|
|
3cbf82d33a | ||
|
|
55e0de1719 | ||
|
|
0feb7b7379 | ||
|
|
9d51af3bf8 | ||
|
|
973f6f94c6 | ||
|
|
6c3fb84310 | ||
|
|
4a33223645 | ||
|
|
2c87b67661 | ||
|
|
0899299ebf | ||
|
|
1a590287ea | ||
|
|
fd01715b5b | ||
|
|
300536033f | ||
|
|
79c3ca8611 | ||
|
|
e50fc1f314 | ||
|
|
2e54872d66 | ||
|
|
4f494e5444 | ||
|
|
8916e8af45 | ||
|
|
399ddbe14b | ||
|
|
bb9f5f7a16 | ||
|
|
3999400049 | ||
|
|
1ed189cfb9 | ||
|
|
82c489841c | ||
|
|
7c5d582757 | ||
|
|
da61feb73b | ||
|
|
3facbf99d8 | ||
|
|
d5407060d0 | ||
|
|
3bd0de0a0b | ||
|
|
1ad98ed4a4 | ||
|
|
4f4e70c99e | ||
|
|
60453fec9e | ||
|
|
51c021d3be | ||
|
|
1358a35580 | ||
|
|
3d1ee33521 | ||
|
|
06ddab1249 | ||
|
|
1b6f1b5a77 | ||
|
|
0c9a6e9449 | ||
|
|
37f5b32833 | ||
|
|
e0b1aa2f4d | ||
|
|
853963ff61 | ||
|
|
ebb1a602be | ||
|
|
928230cc5d | ||
|
|
7998c4e36c | ||
|
|
a263df5bf4 | ||
|
|
ed37064e09 | ||
|
|
468df67384 | ||
|
|
fca7a4c31e | ||
|
|
fd539e0a35 | ||
|
|
90d20786c3 | ||
|
|
c9b8a68b43 | ||
|
|
cc35c3d012 | ||
|
|
3a2fe5ae96 | ||
|
|
8218343b6c | ||
|
|
72427f8f39 | ||
|
|
01a3bf930e | ||
|
|
36f0bd81eb | ||
|
|
f1fdad5023 | ||
|
|
90f222ccfb | ||
|
|
7edab5d354 | ||
|
|
c84288c0d9 | ||
|
|
5d0175e007 | ||
|
|
174fa99ecd | ||
|
|
75056e2e13 | ||
|
|
fce56a0e82 | ||
|
|
7914106953 | ||
|
|
e638efa847 | ||
|
|
f558bd2733 | ||
|
|
bd446b60b8 | ||
|
|
e538598e81 | ||
|
|
f995ec1682 | ||
|
|
625ff078fe | ||
|
|
1760d41729 | ||
|
|
e056348850 | ||
|
|
53f7c60267 | ||
|
|
2f4be13018 | ||
|
|
52a0096d3b | ||
|
|
c8d656f1d9 | ||
|
|
08c6628fbd | ||
|
|
4102ca37dc | ||
|
|
5bfddbf71c | ||
|
|
02a89626f0 | ||
|
|
de5bf6ea28 | ||
|
|
cd3f0af79b | ||
|
|
dd31818051 | ||
|
|
2139eb410f | ||
|
|
d23cc20b3d | ||
|
|
d8b52337b2 | ||
|
|
9126268a32 | ||
|
|
ca89368782 | ||
|
|
b41028cf37 | ||
|
|
0f9c6b6ff2 | ||
|
|
e2c7742265 | ||
|
|
1f40afb2fc | ||
|
|
e4ef946020 | ||
|
|
5d7b9af23e | ||
|
|
ba31397ac1 | ||
|
|
f38e0fce98 | ||
|
|
c12d4757a4 | ||
|
|
191a71ab67 | ||
|
|
a4e7cd1fb9 | ||
|
|
5e60b8617e | ||
|
|
2c98087c6f | ||
|
|
a6a23e3b15 | ||
|
|
6e9f2afd61 | ||
|
|
5af3520aca | ||
|
|
4770f24adb | ||
|
|
b57239e2e7 | ||
|
|
ba02ad66c7 | ||
|
|
45681d632a | ||
|
|
b2d05c781d | ||
|
|
c303711813 | ||
|
|
ea47736274 | ||
|
|
45708771b0 | ||
|
|
7865a37998 | ||
|
|
0964b449b9 | ||
|
|
afbc8a4638 | ||
|
|
f41f35b0ae | ||
|
|
1b582f5935 | ||
|
|
6bb58cecd8 | ||
|
|
bd92b0a94b | ||
|
|
d6ca920589 | ||
|
|
0575ab8125 | ||
|
|
196c5bf1d7 | ||
|
|
1304c8a95d | ||
|
|
8db73bbec2 | ||
|
|
335df19226 | ||
|
|
e9ed7ee4bd | ||
|
|
6f713572e3 | ||
|
|
04c24c5dc1 | ||
|
|
617fe14dbe | ||
|
|
37f3633e0c | ||
|
|
87a1717dca | ||
|
|
ba5aceb5c6 | ||
|
|
f49326395d | ||
|
|
f3cf99aa5c | ||
|
|
c4eec6dc12 | ||
|
|
1b49c18767 | ||
|
|
423df3f83a | ||
|
|
d78c76e0b4 | ||
|
|
149781af9e | ||
|
|
51539e6d44 | ||
|
|
ce6e8b7412 | ||
|
|
d22a5ad840 | ||
|
|
e3385e1243 | ||
|
|
d329d9f282 | ||
|
|
644519c539 | ||
|
|
2aab4dfb9d | ||
|
|
2b37bfd93e | ||
|
|
4d6871abc8 | ||
|
|
f059d5b59a | ||
|
|
82d8d28b2c | ||
|
|
2624b0c34b | ||
|
|
8f568411de | ||
|
|
6066f2896a | ||
|
|
c6bc387a88 | ||
|
|
5e0ee919d7 | ||
|
|
9fd545070b | ||
|
|
680863702e | ||
|
|
f20f6d70a0 | ||
|
|
983a939952 | ||
|
|
b579ec7bbd | ||
|
|
9703c34f4d | ||
|
|
d3dd1844dc | ||
|
|
54405732c9 | ||
|
|
6bf141c6d4 | ||
|
|
3be1cf16ef | ||
|
|
0cd585d09b | ||
|
|
c0636dfe22 | ||
|
|
0367ce5d5a | ||
|
|
38bc2e68fe | ||
|
|
b71483f557 | ||
|
|
3557480838 | ||
|
|
13cd1bd060 | ||
|
|
ed24292f55 | ||
|
|
b58a441109 | ||
|
|
eb8b9e2542 | ||
|
|
587a71c1b6 | ||
|
|
06a722ffdb | ||
|
|
e8ba315b20 | ||
|
|
95180f4737 | ||
|
|
558e6839bc | ||
|
|
f52eb88b70 | ||
|
|
cab10e2028 | ||
|
|
6ee2a762e8 | ||
|
|
4d092ab9cb | ||
|
|
da6e6c4441 | ||
|
|
2f9b9931e4 | ||
|
|
43af9146d8 | ||
|
|
99b3499044 | ||
|
|
cef864a80e | ||
|
|
44a4a99b92 | ||
|
|
34c785557d | ||
|
|
b83abf944b | ||
|
|
85658c7017 | ||
|
|
a0bf503f88 | ||
|
|
87aaccac94 | ||
|
|
d43ff8b4a7 | ||
|
|
e093e06926 | ||
|
|
baecb27712 | ||
|
|
faec969752 | ||
|
|
cf89d4cb56 | ||
|
|
57d2c8602f | ||
|
|
3233e903d9 | ||
|
|
5d6a3bc833 | ||
|
|
5eca243af9 | ||
|
|
2683bec738 | ||
|
|
0838b6837b | ||
|
|
885c73c838 | ||
|
|
730d472008 | ||
|
|
7b11dd053b | ||
|
|
c85d72317c | ||
|
|
d76c1f862c | ||
|
|
f1c5cfe1a5 | ||
|
|
68e0e5cbdd | ||
|
|
97ff9eeb1b | ||
|
|
e8eabde889 | ||
|
|
7d05069f36 | ||
|
|
4d871c27f6 | ||
|
|
709cc9c294 | ||
|
|
cd9b360292 | ||
|
|
1f6666785e | ||
|
|
53f8570a53 | ||
|
|
094b0399cb | ||
|
|
fd917e6bae | ||
|
|
b3c254e34f | ||
|
|
22a7ddfd28 | ||
|
|
0eda6b5c47 | ||
|
|
cd0becb7ba | ||
|
|
19b92c4748 | ||
|
|
c572057706 | ||
|
|
c86731aaf7 | ||
|
|
ffa0ea4756 | ||
|
|
0f7046b98e | ||
|
|
f582a254cd | ||
|
|
e067fa12b2 | ||
|
|
a5310ac1b3 | ||
|
|
fa4c9ba796 | ||
|
|
662839fb06 | ||
|
|
d07259d0dc | ||
|
|
4fa942f3a0 | ||
|
|
e2d0fc3e10 | ||
|
|
5e0ece5d72 | ||
|
|
6b5ab50f71 | ||
|
|
d7d906bc86 | ||
|
|
8cb80cecf8 | ||
|
|
5823a864f9 | ||
|
|
36d51de201 | ||
|
|
60c1d1d3d9 | ||
|
|
f0a45281b5 | ||
|
|
86584900b2 | ||
|
|
a7603bcc6b | ||
|
|
eeea06d6aa | ||
|
|
e3c3516283 | ||
|
|
5a45e60a73 | ||
|
|
e2413baf10 | ||
|
|
0c6a08da76 | ||
|
|
8401400129 | ||
|
|
e614a6fc70 | ||
|
|
5f302dd046 | ||
|
|
480bc0ad9d | ||
|
|
7274b1692d | ||
|
|
e263a9c9d4 | ||
|
|
34153dc85b | ||
|
|
5100fd35dc | ||
|
|
d10954b788 | ||
|
|
544a4dbd3a | ||
|
|
c84bcde0a1 | ||
|
|
85a765959b | ||
|
|
3ce6a45121 | ||
|
|
3248740f04 | ||
|
|
30e28603a7 | ||
|
|
0c03c2e3af | ||
|
|
4e48a4ffc5 | ||
|
|
f65e91dc74 | ||
|
|
6df3b381ef | ||
|
|
d849367a12 | ||
|
|
af4c6fb15a | ||
|
|
2856e0213f | ||
|
|
4fbf8aa0bf | ||
|
|
24788b8282 | ||
|
|
8090b2a23b | ||
|
|
64cf32146a | ||
|
|
15e6ee7dac | ||
|
|
8bda6eaa76 | ||
|
|
b8ad84c525 | ||
|
|
72b5817276 | ||
|
|
1fff7374d4 | ||
|
|
fec718e9e5 | ||
|
|
efe0b40aca | ||
|
|
db135129d8 | ||
|
|
b1a15f6e33 | ||
|
|
9037e6c64b | ||
|
|
604922a26e | ||
|
|
0117f18eb1 | ||
|
|
a715a4206e | ||
|
|
6e83edc988 | ||
|
|
9f1ebaf850 | ||
|
|
8571dc3965 | ||
|
|
5b8c721292 | ||
|
|
e2248a066d | ||
|
|
62dea6d52a | ||
|
|
fe380bd943 | ||
|
|
b266ae1356 | ||
|
|
4abcad67b7 | ||
|
|
0243371c71 | ||
|
|
15323a6b6d | ||
|
|
f5b9d32317 | ||
|
|
71ed0ad0ca | ||
|
|
b4fd2b1976 | ||
|
|
b6d2c95ee7 | ||
|
|
238232cf51 | ||
|
|
04cf39749b | ||
|
|
c9616b01ac | ||
|
|
dede06ad76 | ||
|
|
843d65f494 | ||
|
|
58788c327f | ||
|
|
0124ae8812 | ||
|
|
3d08222c29 | ||
|
|
f6c0251a6c | ||
|
|
cf32ee460c | ||
|
|
569ce08174 | ||
|
|
e2d370a415 | ||
|
|
152799ecc7 | ||
|
|
087ac31533 | ||
|
|
b184b26a4e | ||
|
|
f86e90b072 | ||
|
|
be04310810 | ||
|
|
d510961f6c | ||
|
|
d29f6775a8 | ||
|
|
7be836cced | ||
|
|
4528586849 | ||
|
|
47e82cb069 | ||
|
|
d38c6f8118 | ||
|
|
757c8647bf | ||
|
|
ba6c1b9439 | ||
|
|
ac92e1289b | ||
|
|
6a49bffa9a | ||
|
|
a95aada35a | ||
|
|
8fd430819b | ||
|
|
396760d523 | ||
|
|
6ab15fce1c | ||
|
|
81ca30c9d4 | ||
|
|
a5085b6e56 | ||
|
|
4cb8bbd2f4 | ||
|
|
b9c597af92 | ||
|
|
47b6bb683b | ||
|
|
d3df6c606c | ||
|
|
1cd578ef44 | ||
|
|
55dd4768b9 | ||
|
|
66946c8697 | ||
|
|
1e4e6e9619 | ||
|
|
c97fb62228 | ||
|
|
cd5a24e308 | ||
|
|
c17a03ef60 | ||
|
|
abfad8c088 | ||
|
|
82b4042b26 | ||
|
|
1129711f75 | ||
|
|
69582b2e8c | ||
|
|
00821bf0a2 | ||
|
|
4a313ee7c3 | ||
|
|
85f3a8b038 | ||
|
|
5fe4cb9eee | ||
|
|
0e120093cf | ||
|
|
064ab8846d | ||
|
|
1d5338a8dc | ||
|
|
4ac08dac65 | ||
|
|
41df1c447f | ||
|
|
808a283f74 | ||
|
|
be69ff5849 | ||
|
|
9d94c509e7 | ||
|
|
282f575cab | ||
|
|
6b61714d7e | ||
|
|
dc8ffa34e4 | ||
|
|
8c8c49c66d | ||
|
|
bb7c829c5e | ||
|
|
6bf60ff5d6 | ||
|
|
100d1e7220 | ||
|
|
c97732cef3 | ||
|
|
c398c8b2a2 | ||
|
|
cee40169f3 | ||
|
|
7d3b6d12e3 | ||
|
|
98b62df792 | ||
|
|
e2d9cd1eed | ||
|
|
f873a84f08 | ||
|
|
c1b1b81774 | ||
|
|
7333cc25d8 | ||
|
|
32957833f3 | ||
|
|
20fabb81e8 | ||
|
|
7644b031c1 | ||
|
|
dbc403319d | ||
|
|
c1d025e241 | ||
|
|
c3c3f3fc88 | ||
|
|
6f1d61aabc | ||
|
|
3d282d2523 | ||
|
|
ba66a0e801 | ||
|
|
0fcd3d8f28 | ||
|
|
ddda183090 | ||
|
|
f19fc9057d | ||
|
|
17e4d78bdc | ||
|
|
9ef954f430 | ||
|
|
767b68b0bd | ||
|
|
53d78e995b | ||
|
|
0119965287 | ||
|
|
45dc3cab11 | ||
|
|
73d27be947 | ||
|
|
a5bbb338b9 | ||
|
|
fd7cd0324d | ||
|
|
aa795d19d5 | ||
|
|
9019cc9101 | ||
|
|
cd64238a51 | ||
|
|
5ffa0ed6ee | ||
|
|
1889f00f8f | ||
|
|
0e2fbe0e8f | ||
|
|
70a84d90ad | ||
|
|
56072e952d | ||
|
|
f88f482837 | ||
|
|
ca55c4e55f | ||
|
|
a00809db8e | ||
|
|
e930abe741 | ||
|
|
b584d22b3a | ||
|
|
254524ab1b | ||
|
|
472a6cb232 | ||
|
|
ed8d7f2106 | ||
|
|
4239f8e592 | ||
|
|
55deb3f01b | ||
|
|
d09fba47f1 | ||
|
|
2420969375 | ||
|
|
055ff455fe | ||
|
|
f3be1fcc62 | ||
|
|
ec00edcdad | ||
|
|
e36be704a5 | ||
|
|
75e557b894 | ||
|
|
41a26289b3 | ||
|
|
c9cb1ea05c | ||
|
|
b3f326fead | ||
|
|
a1f4168d50 | ||
|
|
8d946f225e | ||
|
|
26a01afa1a | ||
|
|
35686a7dca | ||
|
|
34942daf94 | ||
|
|
0bdd159fb9 | ||
|
|
d6e7211539 | ||
|
|
713673bc42 | ||
|
|
d75da16fef | ||
|
|
cfdacea210 | ||
|
|
924eb1d0b5 | ||
|
|
6fcf4ebc48 | ||
|
|
badd59ac38 | ||
|
|
5b6392009d | ||
|
|
777a2292dc | ||
|
|
352f70a9e4 | ||
|
|
09f267c378 | ||
|
|
c2d2702a59 | ||
|
|
062771e0a7 | ||
|
|
d2571fa798 | ||
|
|
eafc0876a1 | ||
|
|
56ce92e012 | ||
|
|
51958c25ac | ||
|
|
8789dae155 | ||
|
|
d10f3f140f | ||
|
|
7670a23611 | ||
|
|
53811b2324 | ||
|
|
3344656e6a | ||
|
|
e4eece0352 | ||
|
|
2a4b821c34 | ||
|
|
4a4c4223e6 | ||
|
|
314ea43e6d | ||
|
|
fdbdf93250 | ||
|
|
cb33417924 | ||
|
|
cbf12524fe | ||
|
|
8b34cab19a | ||
|
|
05a99b5798 | ||
|
|
f1a83de772 | ||
|
|
eb3d299521 | ||
|
|
60afdd239c | ||
|
|
307840edd1 | ||
|
|
95b8df6d70 | ||
|
|
700f28c3ac | ||
|
|
1487c3ff16 | ||
|
|
b94772bfcd | ||
|
|
44d79d2153 | ||
|
|
09f3008569 | ||
|
|
e5043e73e3 | ||
|
|
16d308f452 | ||
|
|
3e9ad427ec | ||
|
|
16d0289c36 | ||
|
|
894a400b86 | ||
|
|
9134b51985 | ||
|
|
e00321a101 | ||
|
|
75d0b5bb50 | ||
|
|
b774d09b4b | ||
|
|
a91451e946 | ||
|
|
983bf713b3 | ||
|
|
f0ac9d6935 | ||
|
|
d2572ba4e4 | ||
|
|
51307f29c5 | ||
|
|
a608a799aa | ||
|
|
e7822f7a51 | ||
|
|
e3277cf120 | ||
|
|
2ffb2b5200 | ||
|
|
18698a9f18 | ||
|
|
95c96247d9 | ||
|
|
f2f65952b2 | ||
|
|
afe5f16af0 | ||
|
|
6a7da1e603 | ||
|
|
bc9adb9fe5 | ||
|
|
9e1153639e | ||
|
|
59e5a73e49 | ||
|
|
8d1856ae2d | ||
|
|
1eeee4854a | ||
|
|
3bea32883d | ||
|
|
4f2891836e | ||
|
|
63e86c4147 | ||
|
|
dfc77f0a3f | ||
|
|
1aaed161eb | ||
|
|
7d411622c6 | ||
|
|
a106fa62fe | ||
|
|
551c249e39 | ||
|
|
38028dd36b | ||
|
|
5b22d91579 | ||
|
|
09b9ce60ad | ||
|
|
e20a07e06f | ||
|
|
0204aa962c | ||
|
|
d46051435f | ||
|
|
0d56cf4496 | ||
|
|
61dae53fc3 | ||
|
|
f5377120c4 | ||
|
|
780106c7f6 | ||
|
|
811e4bb265 | ||
|
|
111cab1564 | ||
|
|
131dd51c39 | ||
|
|
0d333ce7da | ||
|
|
fa7ad6e9ed | ||
|
|
9b6dd0c771 | ||
|
|
a7a0624235 | ||
|
|
8f08269916 | ||
|
|
dbd305acc5 | ||
|
|
83d32e4449 | ||
|
|
78d7aa7707 | ||
|
|
a3ecd7324a | ||
|
|
87525001f7 | ||
|
|
f52836a7e3 | ||
|
|
fe536f0628 | ||
|
|
1de5ac8cba | ||
|
|
2624ad5f7e | ||
|
|
7fb23ab6be | ||
|
|
208e6fe47a | ||
|
|
9a1c1f64c0 | ||
|
|
65fe6c2f95 | ||
|
|
65ade57c94 | ||
|
|
2565005cc0 | ||
|
|
de4538bf5f | ||
|
|
2b80020393 | ||
|
|
1166e85fad | ||
|
|
e5193476c4 | ||
|
|
5dbf276e82 | ||
|
|
a6f3230915 | ||
|
|
0694a09abd | ||
|
|
dceeeaac6a | ||
|
|
bdc92bcdf0 | ||
|
|
06a6056e1c | ||
|
|
4b951279a8 | ||
|
|
3984f8b36c | ||
|
|
b9b3a0dcc7 | ||
|
|
7caa025278 | ||
|
|
27e5dc4d55 | ||
|
|
63fc9b76be | ||
|
|
5c1e2846a2 | ||
|
|
73c45944f4 | ||
|
|
86171c500f | ||
|
|
1010334f76 | ||
|
|
f44869f7cb | ||
|
|
4b0c5cc9a2 | ||
|
|
36b8f46f7e | ||
|
|
d5ecbc96a3 | ||
|
|
760114b718 | ||
|
|
76068637fb | ||
|
|
bed0b1c04e | ||
|
|
8a1cdc3f7d | ||
|
|
462f7f1f42 | ||
|
|
10a657e9d7 | ||
|
|
ae7a94bf47 | ||
|
|
e12bdb320d | ||
|
|
f667937aef | ||
|
|
20c508cb12 | ||
|
|
c00e5e8904 | ||
|
|
c6b00c9aca | ||
|
|
7154a1e35c | ||
|
|
734662a9b4 | ||
|
|
b11aa62001 | ||
|
|
f4c066e475 | ||
|
|
1d7a789604 | ||
|
|
3f74eff0fe | ||
|
|
2a2d33cd0b | ||
|
|
4e61ae84f7 | ||
|
|
165634d127 | ||
|
|
082c6d010c | ||
|
|
62f65d5ffb | ||
|
|
738698edad | ||
|
|
a83064ed97 | ||
|
|
5ef407ba17 | ||
|
|
21fabfcb29 | ||
|
|
521f250688 | ||
|
|
df33ceca79 | ||
|
|
0ffbd2ee0f | ||
|
|
4d64569c34 | ||
|
|
32c025a2fa | ||
|
|
58fa48a4da | ||
|
|
699aa1b60f | ||
|
|
a00c565a62 | ||
|
|
90bac7f4ab | ||
|
|
ec2cda20cf | ||
|
|
1702261a15 | ||
|
|
bd85d621f5 | ||
|
|
61bc485bf1 | ||
|
|
eaf89794ab | ||
|
|
6a6b23d3d6 | ||
|
|
5bb8a6d6d5 | ||
|
|
cc73db9bf0 | ||
|
|
48d2e230a3 | ||
|
|
0ac24bc4f2 | ||
|
|
29e148763a | ||
|
|
354d1527e1 | ||
|
|
ffa56e6c81 | ||
|
|
edcc6b56c8 | ||
|
|
7e2f3e21ba | ||
|
|
0d238085ba | ||
|
|
082bf2fba4 | ||
|
|
56a3ccaee8 | ||
|
|
3f4c66467d | ||
|
|
85ccd80906 | ||
|
|
de539d00b6 | ||
|
|
f37c9eec04 | ||
|
|
9fd3e8d84f | ||
|
|
07c917e33d | ||
|
|
10c51f11c5 | ||
|
|
5431b8ebcc | ||
|
|
e233551d0b | ||
|
|
5d4d1bf60c | ||
|
|
e6bfe00843 | ||
|
|
5c3b20643a | ||
|
|
e9600802a8 | ||
|
|
0aa2e5138c | ||
|
|
27dad40d5c | ||
|
|
646b46528d | ||
|
|
e097e924f2 | ||
|
|
777aaf9afd | ||
|
|
221ec0bb10 | ||
|
|
67ff273a9e | ||
|
|
397d36291d | ||
|
|
a4066e4802 | ||
|
|
88e24ba452 | ||
|
|
c7b377b84c | ||
|
|
05a06a9aa8 | ||
|
|
90a686ea0b | ||
|
|
215df7ff9e | ||
|
|
0758f01120 | ||
|
|
bb7a910377 | ||
|
|
078293833d | ||
|
|
99f61150d6 | ||
|
|
ac64013a07 | ||
|
|
5735b4bbec | ||
|
|
f0374d5772 | ||
|
|
20a9dcf6fe | ||
|
|
d0ef42a16b | ||
|
|
18077d98bf | ||
|
|
cda4792ff7 | ||
|
|
76df2bc75a | ||
|
|
e52b639e64 | ||
|
|
75604e9b6c | ||
|
|
e058933192 | ||
|
|
a12ae0a1b6 | ||
|
|
5e0fd00b4e | ||
|
|
b4a43475ac | ||
|
|
f0bc59dd0c | ||
|
|
c5aba71aa7 | ||
|
|
cac6a8869b | ||
|
|
787691859d | ||
|
|
bf0d20461a | ||
|
|
7da73626ac | ||
|
|
8086120703 | ||
|
|
7afa815467 | ||
|
|
5400500360 | ||
|
|
ccae4014ec | ||
|
|
02279a769d | ||
|
|
c766a5a40e | ||
|
|
7ac2d0dcff | ||
|
|
6dfa1616ea | ||
|
|
8a0411d6b1 | ||
|
|
fc63a692be | ||
|
|
2b9b504573 | ||
|
|
fd9453889e | ||
|
|
dea21a0aae | ||
|
|
12c520c3b1 | ||
|
|
abc0383ecc | ||
|
|
bb4dce09df | ||
|
|
6b932168ce | ||
|
|
681bba82a9 | ||
|
|
4cfde3eba7 | ||
|
|
71633b1c8d | ||
|
|
2eb863aff0 | ||
|
|
5aede8affb | ||
|
|
09dfb9793a | ||
|
|
09897de77d | ||
|
|
0362290d40 | ||
|
|
57ef9fe623 | ||
|
|
38f08d54e3 | ||
|
|
84191ec8fd | ||
|
|
e88be6b251 | ||
|
|
3bec424d05 | ||
|
|
fc56a42fb0 | ||
|
|
05a5cc16bd | ||
|
|
c99b2f35f4 | ||
|
|
8ae7457a3f | ||
|
|
bb8a04dd7b | ||
|
|
a681f5f725 | ||
|
|
613552de0a | ||
|
|
cd38d37242 | ||
|
|
6b6b503ef0 | ||
|
|
f880072697 | ||
|
|
ffc3f10177 | ||
|
|
f9b7e3239e | ||
|
|
09cc61c96a | ||
|
|
a6325c69f4 | ||
|
|
2f1b1a02b1 | ||
|
|
727c5a4a53 | ||
|
|
918d3bd2bc | ||
|
|
2d7bacad09 | ||
|
|
234ed07ad6 | ||
|
|
964fdf779a | ||
|
|
40afb5e8fa | ||
|
|
72c0145816 | ||
|
|
12eb33b5c9 | ||
|
|
ddb238c7e4 | ||
|
|
32980fcafc | ||
|
|
db6315a621 | ||
|
|
6bf0c2aab6 | ||
|
|
3dc9ddcb52 | ||
|
|
352dfa9a09 | ||
|
|
60a3e680dd | ||
|
|
18f98e24e5 | ||
|
|
c599522e44 | ||
|
|
64fef7d380 | ||
|
|
6381d4cf6b | ||
|
|
91016ec206 | ||
|
|
9aeab9548d | ||
|
|
69d7f21b56 | ||
|
|
9de596605b | ||
|
|
650edcf56a | ||
|
|
2c4dedff2c | ||
|
|
870e39961c | ||
|
|
319148ca68 | ||
|
|
6dac68606b | ||
|
|
9716d008a9 | ||
|
|
b5fd68c3dc | ||
|
|
eea9d14749 | ||
|
|
77de6e4b60 | ||
|
|
58f68e3bda | ||
|
|
1ea3763185 | ||
|
|
920251f296 | ||
|
|
dffb554ebe | ||
|
|
7255f6108f | ||
|
|
078392f2c5 | ||
|
|
c2e9407f50 | ||
|
|
a5a4f1490e | ||
|
|
e20555f9cf | ||
|
|
791a222d28 | ||
|
|
cb97090d88 | ||
|
|
923cdc7b6a | ||
|
|
19369b4c33 | ||
|
|
4ec230e8a0 | ||
|
|
7aafe49662 | ||
|
|
33d8ec8a13 | ||
|
|
fb73e772af | ||
|
|
c2692e9b4a | ||
|
|
a0d6fe5ca7 | ||
|
|
7f65e68e82 | ||
|
|
d9f78fc5bf | ||
|
|
b2a5279bcb | ||
|
|
28baba822b | ||
|
|
3b4875b754 | ||
|
|
8ce88deda2 | ||
|
|
4527658027 | ||
|
|
8057c0ecb8 | ||
|
|
eb74a42386 | ||
|
|
d589a90a42 | ||
|
|
bf3d05cb40 | ||
|
|
7bd4859a31 | ||
|
|
9af097c39c | ||
|
|
7f47cdacbb | ||
|
|
d85cbde7a7 | ||
|
|
79284941db | ||
|
|
35c11aa7aa | ||
|
|
5ac2b1fb3d | ||
|
|
0a5e8ab618 | ||
|
|
5ae267f743 | ||
|
|
bc48e92aea | ||
|
|
98af494dd6 | ||
|
|
31487fb022 | ||
|
|
e00a2eeef7 | ||
|
|
c5ea2dcd2a | ||
|
|
e9c2b46c97 | ||
|
|
043d3fffbf | ||
|
|
febe213e80 | ||
|
|
0764f34c64 | ||
|
|
3dbf9ac27c | ||
|
|
eccb4383a1 | ||
|
|
31180bfc2b | ||
|
|
c6105d9ed3 | ||
|
|
3b82d1ccba | ||
|
|
9fe8a09ac9 | ||
|
|
18a59f84ab | ||
|
|
c28f78cb8a | ||
|
|
18baefed0d | ||
|
|
f56eeddff4 | ||
|
|
f5561b4b4f | ||
|
|
d42171d465 | ||
|
|
f3d56fe435 | ||
|
|
52e9e4daa7 | ||
|
|
dde76572e3 | ||
|
|
df4563274b | ||
|
|
6e93bd006e | ||
|
|
814cc9658c | ||
|
|
efc6d0adf1 | ||
|
|
f37fe42c70 | ||
|
|
3359cd4e9b | ||
|
|
2b80c5fda6 | ||
|
|
4c2bcb2933 | ||
|
|
96c1362a5d | ||
|
|
5f3b1aec0a | ||
|
|
942afd96fe | ||
|
|
39ddde082c | ||
|
|
9b384e8192 | ||
|
|
09543831b9 | ||
|
|
eb0b5870a3 | ||
|
|
49c03135a9 | ||
|
|
22ba992b6d | ||
|
|
553d3ebd48 | ||
|
|
f80bda89b6 | ||
|
|
722f2fc88d | ||
|
|
c89d2e0f01 | ||
|
|
7aab4214b7 | ||
|
|
6294333c88 | ||
|
|
98afd9c53b | ||
|
|
6ccca08319 | ||
|
|
f497fdde22 | ||
|
|
d73fdf6572 | ||
|
|
0e6f790734 | ||
|
|
18774c05ea | ||
|
|
b3dda3c070 | ||
|
|
d9e62e9a6d | ||
|
|
3f5518aa3a | ||
|
|
0c12b8dfda | ||
|
|
a53ac62164 | ||
|
|
8fa63c7131 | ||
|
|
5599b8bd30 | ||
|
|
5694258b74 | ||
|
|
a974c908b5 | ||
|
|
6d7d996d61 | ||
|
|
da4d9c5e71 | ||
|
|
c409ac985c | ||
|
|
62072e2d0f | ||
|
|
18e08ad5a7 | ||
|
|
ae8cc7b9ed | ||
|
|
06fd32786d | ||
|
|
2f5c13aac3 | ||
|
|
5025972450 | ||
|
|
e7d3f77560 | ||
|
|
f171adc88d | ||
|
|
e24428c42c | ||
|
|
e849f0f49e | ||
|
|
b011163d90 | ||
|
|
0492603ac7 | ||
|
|
15a488c03f | ||
|
|
77096cb252 | ||
|
|
6efeafe819 | ||
|
|
dabc5749d4 | ||
|
|
79fc3f72a6 | ||
|
|
7c2de28de9 | ||
|
|
83f77d3a05 | ||
|
|
5b71a3cb60 | ||
|
|
04650a86a5 | ||
|
|
69b4f9f59f | ||
|
|
4df979565e | ||
|
|
193cdbbe5e | ||
|
|
a634a5c00c | ||
|
|
c19ccd5df4 | ||
|
|
57c6afa3a9 | ||
|
|
9354d86af2 | ||
|
|
791de301cc | ||
|
|
87ccdae795 | ||
|
|
a412e68e89 | ||
|
|
98e2f2be08 | ||
|
|
b8b5ca17ed | ||
|
|
96ccebdedd | ||
|
|
59da900a1d | ||
|
|
fbc4429648 | ||
|
|
3feec809e6 | ||
|
|
8dd3298f9a | ||
|
|
0c3986917f | ||
|
|
4c11134141 | ||
|
|
45c824c042 | ||
|
|
181d27e33d | ||
|
|
0e225e1ab1 | ||
|
|
5676f22ede | ||
|
|
e9cc178ed7 | ||
|
|
09a3c859c1 | ||
|
|
628d68ed2d | ||
|
|
fe99952561 | ||
|
|
9c28086ba4 | ||
|
|
f8c225316b | ||
|
|
df1f381354 | ||
|
|
939a2923d3 | ||
|
|
0e15f8376c | ||
|
|
c9d9d5269d | ||
|
|
97f8f2b749 | ||
|
|
ea21480230 | ||
|
|
2918bbeeca | ||
|
|
ac1aea23dc | ||
|
|
d478bd0e34 | ||
|
|
1695e4e685 | ||
|
|
20bf4680db | ||
|
|
4f3dd59d25 | ||
|
|
dde3a35b16 | ||
|
|
a964860e55 | ||
|
|
41dcdabe9c | ||
|
|
8ad96452a0 | ||
|
|
9f426913a2 | ||
|
|
e8376a5662 | ||
|
|
08dcd7f8b2 | ||
|
|
03e1b730b5 | ||
|
|
8252c409d4 | ||
|
|
70ae5b1a19 | ||
|
|
0d42060882 | ||
|
|
e35b212781 | ||
|
|
08731594cb | ||
|
|
c439297223 | ||
|
|
88d80aec55 | ||
|
|
6f6289a069 | ||
|
|
af65787862 | ||
|
|
a39cec2b76 | ||
|
|
f20feae4d9 | ||
|
|
2d1169ac66 | ||
|
|
966dd7a40f | ||
|
|
eee835696c | ||
|
|
e95edbd3e4 | ||
|
|
b462fe5f77 | ||
|
|
a1865ed5fb | ||
|
|
209d812239 | ||
|
|
4e3cc2bc05 | ||
|
|
f5731f2fc8 | ||
|
|
29b608d6f8 | ||
|
|
a10dd738c0 | ||
|
|
0fb96ff3e9 | ||
|
|
55488c5c2e | ||
|
|
5345eb993a | ||
|
|
8f67ee4ac3 | ||
|
|
9f8b1d9521 | ||
|
|
d4c4418a3e | ||
|
|
bb5f747052 | ||
|
|
f2f8ffbbb2 | ||
|
|
fab4c0ed76 | ||
|
|
7b3cefd4ef | ||
|
|
ad483da837 | ||
|
|
01d49ccd36 | ||
|
|
7ceadc15a3 | ||
|
|
3caf81d9f7 | ||
|
|
dd6740e109 | ||
|
|
28e4cf6726 | ||
|
|
95e38a568f | ||
|
|
43f1f41179 | ||
|
|
698a9ead04 | ||
|
|
bd3f628d55 | ||
|
|
14d702ff8d | ||
|
|
dd5acae76f | ||
|
|
9de51bbf02 | ||
|
|
9c44a159b9 | ||
|
|
43e3162c7d | ||
|
|
2b81e887ad | ||
|
|
bfd492b7ed | ||
|
|
bf452c23bc | ||
|
|
da3495cb4b | ||
|
|
899a158843 | ||
|
|
163daf5816 | ||
|
|
7fbab16b22 | ||
|
|
17b8335c3c | ||
|
|
93930d1125 | ||
|
|
9cb630f98d | ||
|
|
f695bd8c1d | ||
|
|
8a8222995f | ||
|
|
ca24263c17 | ||
|
|
0bf0dd7d5e | ||
|
|
ef3a70cc38 | ||
|
|
6fe09c8264 | ||
|
|
4616e7fa16 | ||
|
|
d99788f6f7 | ||
|
|
8a1bd762ba | ||
|
|
c760863f8c | ||
|
|
ed5c3b55f1 | ||
|
|
7d0e2820cc | ||
|
|
f381b9261a | ||
|
|
01f170ba73 | ||
|
|
a53e24904f | ||
|
|
423cdbd63f | ||
|
|
e38c0e687f | ||
|
|
9e82f9d02e | ||
|
|
5f9c48494a | ||
|
|
155db092c4 | ||
|
|
87522ff7d6 | ||
|
|
e6b435e88e | ||
|
|
8c78a0a773 | ||
|
|
597f7d3075 | ||
|
|
9da8aca015 | ||
|
|
13aa1eb13d | ||
|
|
918228c9dc | ||
|
|
92a25867ff | ||
|
|
f698594137 | ||
|
|
c15dff4afb | ||
|
|
985db67d48 | ||
|
|
30c5eeaff9 | ||
|
|
fd81085b54 | ||
|
|
9955621f0a | ||
|
|
599a693f5b | ||
|
|
da6a9a2ba7 | ||
|
|
7002752744 | ||
|
|
53ed79ecbc | ||
|
|
1e342f8bee | ||
|
|
d19576978b | ||
|
|
af59822510 | ||
|
|
f45f93ce38 | ||
|
|
0d1ffdcb4b | ||
|
|
b197d780c1 | ||
|
|
45da1369ca | ||
|
|
478d1cf5ee | ||
|
|
ec0b2c6a5b | ||
|
|
3a5881cc48 | ||
|
|
13c857f753 | ||
|
|
5091a40e96 | ||
|
|
1cf45f7fa9 | ||
|
|
b49b531ce4 | ||
|
|
7553e14a8b | ||
|
|
cb984f4d54 | ||
|
|
9630c2c3b2 | ||
|
|
8bfc892f7c | ||
|
|
756d275edf | ||
|
|
bfe7a139af | ||
|
|
95352f47ea | ||
|
|
98a9eb8d23 | ||
|
|
9a62c2ab5d | ||
|
|
9c928d497c | ||
|
|
6f777dd09c | ||
|
|
5777868eba | ||
|
|
063b3b86c8 | ||
|
|
9ef9cca948 | ||
|
|
74ac23dbc6 | ||
|
|
b2145a0a59 | ||
|
|
fe307ecfeb | ||
|
|
80b99653cf | ||
|
|
75aa92952a | ||
|
|
3375963449 | ||
|
|
f91c47bb37 | ||
|
|
60552d9d86 | ||
|
|
857cf088f6 | ||
|
|
5c506a1db7 | ||
|
|
b81c7917a9 | ||
|
|
5802011eea | ||
|
|
c91f4d9e0d | ||
|
|
b5690cf721 | ||
|
|
aaee4d16d1 | ||
|
|
5148a21769 | ||
|
|
ec461e2440 | ||
|
|
ada2b79054 | ||
|
|
3d652b2c9a | ||
|
|
63bc00e8da | ||
|
|
8162b1fc93 | ||
|
|
a009387461 | ||
|
|
8dbf10dc4a | ||
|
|
954cd9437b | ||
|
|
1c532d3719 | ||
|
|
273351103d | ||
|
|
fd15b06773 | ||
|
|
9efb5e881b |
@@ -4,7 +4,7 @@ charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.js]
|
||||
[*.{js,ts,tsx}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
@@ -15,3 +15,7 @@ indent_size = 2
|
||||
[*.scss]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.mdx]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
68
.eslintrc.js
68
.eslintrc.js
@@ -1,15 +1,63 @@
|
||||
module.exports = {
|
||||
parser: "babel-eslint",
|
||||
extends: "@trbl",
|
||||
rules: {
|
||||
"import/no-unresolved": [
|
||||
2,
|
||||
{
|
||||
ignore: [
|
||||
'payload/config',
|
||||
'payload/unsanitizedConfig',
|
||||
]
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
ecmaVersion: 2020,
|
||||
sourceType: 'module',
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
'@typescript-eslint',
|
||||
],
|
||||
extends: [
|
||||
'@trbl',
|
||||
],
|
||||
settings: {
|
||||
'import/resolver': {
|
||||
node: {
|
||||
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
||||
},
|
||||
},
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.ts', '*.tsx'],
|
||||
parser: '@typescript-eslint/parser',
|
||||
extends: [
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
],
|
||||
rules: {
|
||||
"no-shadow": "off",
|
||||
"@typescript-eslint/no-shadow": ["error"],
|
||||
'import/no-unresolved': [
|
||||
2,
|
||||
{
|
||||
ignore: [
|
||||
'payload-config',
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
],
|
||||
rules: {
|
||||
"import/no-extraneous-dependencies": ["error", { "packageDir": "./" }],
|
||||
'react/jsx-filename-extension': [2, { extensions: ['.js', '.jsx', '.ts', '.tsx'] }],
|
||||
'import/prefer-default-export': 'off',
|
||||
'react/prop-types': 'off',
|
||||
'react/require-default-props': 'off',
|
||||
'react/no-unused-prop-types': 'off',
|
||||
'no-underscore-dangle': 'off',
|
||||
'import/extensions': [
|
||||
'error',
|
||||
'ignorePackages',
|
||||
{
|
||||
js: 'never',
|
||||
jsx: 'never',
|
||||
ts: 'never',
|
||||
tsx: 'never',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
33
.github/ISSUE_TEMPLATE/BUG_REPORT.md
vendored
Normal file
33
.github/ISSUE_TEMPLATE/BUG_REPORT.md
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
name: Bug Report
|
||||
about: Create a bug report for Payload
|
||||
labels: 'bug'
|
||||
---
|
||||
|
||||
# Bug Report
|
||||
|
||||
<!--- Provide a general summary of the issue in the Title above -->
|
||||
|
||||
## Expected Behavior
|
||||
|
||||
<!--- Tell us what should happen -->
|
||||
|
||||
## Current Behavior
|
||||
|
||||
<!--- Tell us what happens instead of the expected behavior -->
|
||||
|
||||
## Possible Solution
|
||||
|
||||
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
|
||||
|
||||
## Steps to Reproduce
|
||||
<!--- Steps to reproduce this bug. Include any code, if relevant -->
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
4.
|
||||
|
||||
## Detailed Description
|
||||
|
||||
<!--- Provide any other additional details -->
|
||||
<!--- Payload version, browser, etc -->
|
||||
18
.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
vendored
Normal file
18
.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
name: Feature Request
|
||||
about: Suggest an idea for improving Payload
|
||||
labels: 'enhancement'
|
||||
---
|
||||
|
||||
# Feature Request
|
||||
|
||||
<!--- Provide a general summary of the proposed feature -->
|
||||
<!--- Is it related to a problem you are having? -->
|
||||
|
||||
## Use-Case
|
||||
|
||||
<!-- Describe your specific use-case and why you think this feature would be beneficial -->
|
||||
|
||||
## Additional Detail
|
||||
|
||||
<!-- Add any other relevant detail -->
|
||||
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Question about Payload
|
||||
url: https://github.com/payloadcms/payload/discussions
|
||||
about: Please ask Payload-related questions in our GitHub Discussions
|
||||
20
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
20
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
## Description
|
||||
|
||||
<!-- Please include a summary of the pull request and any related issues it fixes. Please also include relevant motivation and context. -->
|
||||
|
||||
- [ ] I have read and understand the CONTRIBUTING.md document in this repository
|
||||
|
||||
## Type of change
|
||||
|
||||
<!-- Please delete options that are not relevant. -->
|
||||
|
||||
- [ ] Bug fix (non-breaking change which fixes an issue)
|
||||
- [ ] New feature (non-breaking change which adds functionality)
|
||||
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
||||
- [ ] This change requires a documentation update
|
||||
|
||||
## Checklist:
|
||||
|
||||
- [ ] I have added tests that prove my fix is effective or that my feature works
|
||||
- [ ] Existing test suite passes locally with my changes
|
||||
- [ ] I have made corresponding changes to the documentation
|
||||
11
.github/workflows/tests.yml
vendored
11
.github/workflows/tests.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: Node.js CI
|
||||
name: build
|
||||
|
||||
on: [push]
|
||||
|
||||
@@ -7,7 +7,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [10.x, 12.x]
|
||||
node-version: [10.x, 12.x, 14.x, 15.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@@ -15,6 +15,9 @@ jobs:
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
registry-url: https://registry.npmjs.org
|
||||
scope: '@payloadcms'
|
||||
always-auth: true
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
@@ -25,6 +28,10 @@ jobs:
|
||||
${{ runner.os }}-build-
|
||||
${{ runner.os }}-
|
||||
- run: yarn
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
- run: yarn build
|
||||
- run: yarn test:client
|
||||
- run: yarn test:int # In-memory db + api tests
|
||||
env:
|
||||
CI: true
|
||||
|
||||
13
.gitignore
vendored
13
.gitignore
vendored
@@ -215,15 +215,16 @@ $RECYCLE.BIN/
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
|
||||
# End of https://www.gitignore.io/api/node,macos,windows,webstorm,sublimetext,visualstudiocode
|
||||
|
||||
# Ignores compiled CSS
|
||||
src/**/*.css
|
||||
demo**/*.css
|
||||
dist
|
||||
|
||||
# Ignore all uploads
|
||||
demo/upload
|
||||
demo/media
|
||||
demo/files
|
||||
|
||||
# Ignore build folder
|
||||
build
|
||||
|
||||
# Ignore built components
|
||||
components/index.js
|
||||
components/styles.css
|
||||
|
||||
21
.release-it.json
Normal file
21
.release-it.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"git": {
|
||||
"commitMessage": "chore(release): v${version}",
|
||||
"requireCleanWorkingDir": true
|
||||
},
|
||||
"github": {
|
||||
"release": true
|
||||
},
|
||||
"npm": {
|
||||
"skipChecks": true
|
||||
},
|
||||
"hooks": {
|
||||
"before:init": ["yarn", "yarn clean", "yarn test"]
|
||||
},
|
||||
"plugins": {
|
||||
"@release-it/conventional-changelog": {
|
||||
"preset": "angular",
|
||||
"infile": "CHANGELOG.md"
|
||||
}
|
||||
}
|
||||
}
|
||||
51
.vscode/launch.json
vendored
51
.vscode/launch.json
vendored
@@ -14,27 +14,7 @@
|
||||
"--runInBand"
|
||||
],
|
||||
"env": {
|
||||
"PAYLOAD_CONFIG_PATH": "demo/payload.config.js"
|
||||
},
|
||||
"console": "integratedTerminal",
|
||||
"internalConsoleOptions": "neverOpen",
|
||||
"port": 9229,
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Debug Jest Test - Current File",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"runtimeArgs": [
|
||||
"--inspect-brk",
|
||||
"${workspaceRoot}/node_modules/.bin/jest",
|
||||
"${fileBasename}",
|
||||
"--runInBand"
|
||||
],
|
||||
"env": {
|
||||
"PAYLOAD_CONFIG_PATH": "demo/payload.config.js"
|
||||
"PAYLOAD_CONFIG_PATH": "demo/payload.config.ts"
|
||||
},
|
||||
"console": "integratedTerminal",
|
||||
"internalConsoleOptions": "neverOpen",
|
||||
@@ -48,12 +28,35 @@
|
||||
"request": "launch",
|
||||
"name": "Launch Program",
|
||||
"env": {
|
||||
"PAYLOAD_CONFIG_PATH": "demo/payload.config.js"
|
||||
"PAYLOAD_CONFIG_PATH": "demo/payload.config.ts",
|
||||
"BABEL_ENV": "development"
|
||||
},
|
||||
"program": "${workspaceFolder}/demo/server.js",
|
||||
"program": "${workspaceFolder}/demo/index.js",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
]
|
||||
],
|
||||
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/babel-node",
|
||||
"runtimeArgs": [
|
||||
"--nolazy"
|
||||
],
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Launch Program - Production",
|
||||
"env": {
|
||||
"PAYLOAD_CONFIG_PATH": "demo/payload.config.ts",
|
||||
"NODE_ENV": "production",
|
||||
"BABEL_ENV": "development"
|
||||
},
|
||||
"program": "${workspaceFolder}/demo/index.js",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/babel-node",
|
||||
"runtimeArgs": [
|
||||
"--nolazy"
|
||||
],
|
||||
},
|
||||
{
|
||||
"type": "chrome",
|
||||
|
||||
655
CHANGELOG.md
Normal file
655
CHANGELOG.md
Normal file
@@ -0,0 +1,655 @@
|
||||
## [0.5.3](https://github.com/payloadcms/payload/compare/v0.5.2...v0.5.3) (2021-04-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* unique indices ([23c45f1](https://github.com/payloadcms/payload/commit/23c45f137ac97c99ed38969bed64928f2ce2795e))
|
||||
|
||||
## [0.5.2](https://github.com/payloadcms/payload/compare/v0.5.1...v0.5.2) (2021-03-31)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* modal issues with richtext relationship ([8ea4407](https://github.com/payloadcms/payload/commit/8ea4407f04fd4b63df6afffbe15301f7d5746016))
|
||||
|
||||
## [0.5.1](https://github.com/payloadcms/payload/compare/v0.5.0...v0.5.1) (2021-03-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* base auth / upload fields no longer cause validation issues ([23e1fc3](https://github.com/payloadcms/payload/commit/23e1fc3f73673d4694763908bb819c77bf600702))
|
||||
|
||||
# [0.5.0](https://github.com/payloadcms/payload/compare/v0.4.7...v0.5.0) (2021-03-29)
|
||||
|
||||
### BREAKING CHANGES
|
||||
* changes global find and update payload api from global to slug as the key to find/update with ([c71ba2b](https://github.com/payloadcms/payload/commit/c71ba2b079d109d4028d74f76603905d9382d364))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* allows absolute urls within adminThumbnail ([51b46d4](https://github.com/payloadcms/payload/commit/51b46d44b0c88387d8b23859129f163b581bf1cc))
|
||||
* handles empty indices within array field data ([d47e2c5](https://github.com/payloadcms/payload/commit/d47e2c57868667f2ff9ca87aa9ad862687bd985e))
|
||||
* moving nested arrays now properly persists row count ([5f9a5c8](https://github.com/payloadcms/payload/commit/5f9a5c859eca8854592b2a7a32bef50db4584709))
|
||||
* validation consistency within admin ([50b9937](https://github.com/payloadcms/payload/commit/50b99370d2b849e858fd64e6018ebf0e94103998))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* saves cursor position when relationship element is added to richText ([d24b3f7](https://github.com/payloadcms/payload/commit/d24b3f72ce222e4551c12e202238f171f9cc4b97))
|
||||
|
||||
## [0.4.7](https://github.com/payloadcms/payload/compare/v0.4.6...v0.4.7) (2021-03-15)
|
||||
|
||||
## [0.4.6](https://github.com/payloadcms/payload/compare/v0.4.5...v0.4.6) (2021-03-14)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* allows admin thumbnail to be set programmatically ([b6a9fe4](https://github.com/payloadcms/payload/commit/b6a9fe4bcfc85815a60a3fe8d3cb38b7ae673424))
|
||||
* exports collection field hook types from payload/types ([36aae5c](https://github.com/payloadcms/payload/commit/36aae5c37f8ea8c5dde16a898a28b9301efa6a5b))
|
||||
* only runs adminThumbnail func if image type ([5e1ddb5](https://github.com/payloadcms/payload/commit/5e1ddb552ee9fc8972c9537eee62cddc93a24f42))
|
||||
* provides field access control with document data ([339f750](https://github.com/payloadcms/payload/commit/339f7503a41802421bb38c8cf5da0f0f1573bdd6))
|
||||
* reorders uploads to provide beforeChange hooks with upload data ([3c42e6e](https://github.com/payloadcms/payload/commit/3c42e6e6af849a8acc45e93017b0eafea74ecdba))
|
||||
|
||||
## [0.4.5](https://github.com/payloadcms/payload/compare/v0.4.4...v0.4.5) (2021-03-04)
|
||||
|
||||
### Bug Fixes
|
||||
* config validation allow admin dashboard ([2d1d1b4](https://github.com/payloadcms/payload/commit/2d1d1b4f32bcc6ee1ce709208ae28369611e5bdd))
|
||||
|
||||
## [0.4.4](https://github.com/payloadcms/payload/compare/v0.4.3...v0.4.4) (2021-03-04)
|
||||
|
||||
### Bug Fixes
|
||||
* email verification template missing token ([93ed664](https://github.com/payloadcms/payload/commit/93ed6649201511edfaea14c199022f05623c404c))
|
||||
|
||||
## [0.4.1](https://github.com/payloadcms/payload/compare/v0.4.0...v0.4.3) (2021-03-04)
|
||||
|
||||
### Documentation
|
||||
* fixed broken links throughout docs ([3afefbe](https://github.com/payloadcms/payload/commit/3afefbe5922ee7aff496a96c61ff9a5270d6a7cb))
|
||||
|
||||
## [0.4.0](https://github.com/payloadcms/payload/compare/v0.3.0...v0.4.0) (2021-02-28)
|
||||
|
||||
### Breaking Changes
|
||||
* reverts preview function to only requiring the return of a preview URL ([ca14e66](https://github.com/payloadcms/payload/commit/ca14e66a580fea94ef71416edf6c8caffcf446b0))
|
||||
|
||||
### Features
|
||||
* implements new billing model, including new Personal license which is free forever ([c97ddeb](https://github.com/payloadcms/payload/commit/c97ddeb2d96f949604d46212166c4784330cc72d))
|
||||
* simplifies logic in update operations ([e268e25](https://github.com/payloadcms/payload/commit/e268e25719dd4ebd1a6818dca86d12dc057386ca))
|
||||
* removes the requirement of returning a value from field hooks ([4de5605](https://github.com/payloadcms/payload/commit/4de56059319a6d13b6f0ec20ac4d344f265446bf))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
* properly exposes scss variables for re-use ([c1b2301](https://github.com/payloadcms/payload/commit/c1b230165033ed3cf382a6e42b590815489525f9))
|
||||
* explicitly sets modal z-index and css breakpoints ([c1b2301](https://github.com/payloadcms/payload/commit/c1b230165033ed3cf382a6e42b590815489525f9))
|
||||
* removes `overwrite` from update operation to ensure hidden fields don't get lost on document update ([a8e2cc1](https://github.com/payloadcms/payload/commit/a8e2cc11af177641409ff7726ed8c4f1a154dee4))
|
||||
|
||||
## [0.3.0](https://github.com/payloadcms/payload/compare/v0.2.13...v0.3.0) (2021-02-23)
|
||||
|
||||
### Bug Fixes
|
||||
* properly exposes scss variables for re-use ([c1b2301](https://github.com/payloadcms/payload/commit/c1b230165033ed3cf382a6e42b590815489525f9))
|
||||
* explicitly sets modal z-index and css breakpoints ([c1b2301](https://github.com/payloadcms/payload/commit/c1b230165033ed3cf382a6e42b590815489525f9))
|
||||
* removes `overwrite` from update operation to ensure hidden fields don't get lost on document update ([a8e2cc1](https://github.com/payloadcms/payload/commit/a8e2cc11af177641409ff7726ed8c4f1a154dee4))
|
||||
|
||||
|
||||
## [0.2.13](https://github.com/payloadcms/payload/compare/v0.2.12...v0.2.13) (2021-02-20)
|
||||
|
||||
### Breaking Changes
|
||||
* Preview function now no longer takes form field state as an arg and instead takes a copy of the document itself
|
||||
|
||||
### Features
|
||||
* supports newTab in Button, updates generatePreviewURL api to forward through PreviewButton ([6b6297f](https://github.com/payloadcms/payload/commit/6b6297fb2d22b813f45729429b7efbe9a6ab97da))
|
||||
* detaches localization from mongoose entirely ([162ec74](https://github.com/payloadcms/payload/commit/162ec74445c51a79cd50f75ffb56de8e4bcf9ace))
|
||||
|
||||
### Bug Fixes
|
||||
* infinite loop caused within block component ([9e42d11](https://github.com/payloadcms/payload/commit/9e42d119e471b0efe0d6f69e99d0e31ba5e9237f))
|
||||
* sets sparse true if field localized and unique ([2bc5c59](https://github.com/payloadcms/payload/commit/2bc5c59fec842cd5c5adf201084cdba9b0cab310))
|
||||
* returns entire doc to generatePreviewURL callback of PreviewButton ([9b9d0f2](https://github.com/payloadcms/payload/commit/9b9d0f24b54d46c24734f30ed9640d25e6c19097))
|
||||
* log mongoose connect error message ([e36c7d2](https://github.com/payloadcms/payload/commit/e36c7d269c4b5b49d6c85f416b26196999aadfc0))
|
||||
|
||||
### Documentation
|
||||
* removes incorrect hasMany from upload field type ([e549298](https://github.com/payloadcms/payload/commit/e549298ad5a9a6116659258bb738f5d87abe4ff7))
|
||||
|
||||
|
||||
## [0.2.12](https://github.com/payloadcms/payload/compare/v0.2.11...v0.2.12) (2021-02-1-0)
|
||||
|
||||
### Bug Fixes
|
||||
* middleware for cors set up on static files
|
||||
* windows compatible upload filename paths
|
||||
|
||||
|
||||
## [0.2.11](https://github.com/payloadcms/payload/compare/v0.2.11...v0.2.12) (2021-02-05)
|
||||
|
||||
### Bug Fixes
|
||||
* middleware for cors set up on static files ([55e0de1](https://github.com/payloadcms/payload/commit/55e0de1719ec387e2182bf33922602243f7eda94))
|
||||
* file size in local operations ([0feb7b7](https://github.com/payloadcms/payload/commit/0feb7b7379de6429cf5cb1cdbdad0142f72cc5dc))
|
||||
|
||||
|
||||
## [0.2.11](https://github.com/payloadcms/payload/compare/v0.2.10...v0.2.11) (2021-02-05)
|
||||
|
||||
### Features
|
||||
* allows upload through Local API ([1a59028](https://github.com/payloadcms/payload/commit/1a590287ea181e4548c8e75d8cdb25ada5cbbdbf))
|
||||
|
||||
### Bug Fixes
|
||||
* fix localization within blocks ([e50fc1f](https://github.com/payloadcms/payload/commit/e50fc1f3142ae5e387cef3c778988c473b04417e))
|
||||
* forces fallbackLocale to null in update ops ([3005360](https://github.com/payloadcms/payload/commit/300536033ffe50a2eaedd2a714e844a5282f2ef0))
|
||||
|
||||
|
||||
## [0.2.10](https://github.com/payloadcms/payload/compare/v0.2.9...v0.2.10) (2021-02-04)
|
||||
|
||||
### Features
|
||||
* add support for setting mongoose connection options ([82c4898](https://github.com/payloadcms/payload/commit/82c489841c418b953c7f08d30c8b19751ff050f4))
|
||||
* admin ui create first user add confirm password field (https://github.com/payloadcms/payload/commit/60453fec9ee17e8f83f7e98c5e2b2e39bc6d0365)
|
||||
|
||||
### Bug Fixes
|
||||
* flag scss variables with default ([8916e8a](https://github.com/payloadcms/payload/commit/8916e8af45e179748bf6f2a75216e8d1c35958f2))
|
||||
* relationship component hasMany bug ([d540706](https://github.com/payloadcms/payload/commit/d5407060d079c333081b0298e45dfe866d31b86e))
|
||||
* hide force unlock in admin ui when creating auth collection item ([3bd0de0](https://github.com/payloadcms/payload/commit/3bd0de0a0b6832f5940474c8c40fd85f6fcd1b74))
|
||||
|
||||
|
||||
## [0.2.9](https://github.com/payloadcms/payload/compare/v0.2.6...v0.2.9) (2021-01-27)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* field validation type can return promise ([06ddab1](https://github.com/payloadcms/payload/commit/06ddab124919b28b74667e36e315682a0c9cf459))
|
||||
|
||||
## [0.2.8](https://github.com/payloadcms/payload/compare/v0.2.6...v0.2.8) (2021-01-25)
|
||||
|
||||
### Chore
|
||||
|
||||
* add bugs and keywords to package.json ([37f5b32](https://github.com/payloadcms/payload/commit/37f5b3283363220caa63a5066011b1cb9841812d))
|
||||
|
||||
## [0.2.6](https://github.com/payloadcms/payload/compare/v0.2.5...v0.2.6) (2021-01-25)
|
||||
|
||||
|
||||
|
||||
## [0.2.5](https://github.com/payloadcms/payload/compare/v0.2.4...v0.2.5) (2021-01-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* field gutter padding ([90d2078](https://github.com/payloadcms/payload/commit/90d20786c33b2ef4ea937e75769c023c5776db1b))
|
||||
* richtext sticky toolbar within block ([8218343](https://github.com/payloadcms/payload/commit/8218343b6cf629faed0f752fb27b546684580ec4))
|
||||
|
||||
|
||||
|
||||
## [0.2.4](https://github.com/payloadcms/payload/compare/v0.2.3...v0.2.4) (2021-01-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* block field styles ([36f0bd8](https://github.com/payloadcms/payload/commit/36f0bd81eb340b6d8ac3011a4b10e828e79c20d8))
|
||||
|
||||
|
||||
|
||||
## [0.2.3](https://github.com/payloadcms/payload/compare/v0.2.2...v0.2.3) (2021-01-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* ensures modal heights are 100% of viewport ([7edab5d](https://github.com/payloadcms/payload/commit/7edab5d3543db27c444b180548fc076dd483848a))
|
||||
|
||||
|
||||
|
||||
## [0.2.2](https://github.com/payloadcms/payload/compare/v0.2.1...v0.2.2) (2021-01-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* revert serverURL config change ([f558bd2](https://github.com/payloadcms/payload/commit/f558bd2733a82f1ed9d14604f8b3dea5bb5e8ef5))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* adds better serverURL validation ([75056e2](https://github.com/payloadcms/payload/commit/75056e2e13c4d5f9a2d4341282b6c1f4c42e1609))
|
||||
|
||||
|
||||
### Reverts
|
||||
|
||||
* Revert "docs: configuration overview describe serverURL and removed from code examples where not needed" ([bd446b6](https://github.com/payloadcms/payload/commit/bd446b60b8c56857fb99cda5a9f8a93216efc8b0))
|
||||
|
||||
|
||||
|
||||
## [0.2.1](https://github.com/payloadcms/payload/compare/v0.2.0...v0.2.1) (2021-01-24)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* exposes further types ([e056348](https://github.com/payloadcms/payload/commit/e056348850638f3c621072668a4a9232492c209b))
|
||||
|
||||
|
||||
|
||||
# [0.2.0](https://github.com/payloadcms/payload/compare/v0.1.146...v0.2.0) (2021-01-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* better error handler when sendMail fails ([ea47736](https://github.com/payloadcms/payload/commit/ea47736274b3b176da534b461907da4ddeffa5e9))
|
||||
* button css specificity ([d8b5233](https://github.com/payloadcms/payload/commit/d8b52337b2d34785817b536fe7017853bbc3b5a6))
|
||||
* migrates Condition UI value/operator pattern ([d23cc20](https://github.com/payloadcms/payload/commit/d23cc20b3d0fa061a2b8111f65e04dd5d35a5557))
|
||||
* target es2019, optional chaining not supported for Node < 14 ([52a0096](https://github.com/payloadcms/payload/commit/52a0096d3b8eca47a8afdef42d47117d028b754d))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* adds contributing guidelines ([de5bf6e](https://github.com/payloadcms/payload/commit/de5bf6ea280f771e96de703b3732f851903b1fe5))
|
||||
* allows admins to autoverify via admin ([a6a23e3](https://github.com/payloadcms/payload/commit/a6a23e3b154802e5ec874760b3d3e44e90f56e7c))
|
||||
* auto-removes verificationToken upon manual user verify ([2139eb4](https://github.com/payloadcms/payload/commit/2139eb410f8c95505ef7b90e35a099b0955d4e12))
|
||||
* serverURL no longer required in config ([4770f24](https://github.com/payloadcms/payload/commit/4770f24adb50367ec6f6637cafc3f076023b0416))
|
||||
|
||||
|
||||
|
||||
## [0.1.146](https://github.com/payloadcms/payload/compare/v0.1.145...v0.1.146) (2021-01-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* localized groups ([f38e0fc](https://github.com/payloadcms/payload/commit/f38e0fce981a188b0adb2050cfe8a8e0f047e606))
|
||||
* textarea handle undefined ([ba31397](https://github.com/payloadcms/payload/commit/ba31397ac15402eb3837bcbe454e0aaf82ecbf03))
|
||||
|
||||
|
||||
|
||||
## [0.1.145](https://github.com/payloadcms/payload/compare/v0.1.144...v0.1.145) (2021-01-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add minLength and maxLength to textarea field validations ([2c98087](https://github.com/payloadcms/payload/commit/2c98087c6f40c32dcbccf557aa61ebf8fc1fe17f))
|
||||
* minLength field validation error messages ([5e60b86](https://github.com/payloadcms/payload/commit/5e60b8617e715378831f10b90dedd017ed8d4a8c))
|
||||
|
||||
|
||||
|
||||
## [0.1.144](https://github.com/payloadcms/payload/compare/v0.1.143...v0.1.144) (2021-01-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add default user to collections before checking for valid relationships ([b2d05c7](https://github.com/payloadcms/payload/commit/b2d05c781d7751bbede9e37996cbdc0736d07a66))
|
||||
* handle user collection 'auth: true' ([c303711](https://github.com/payloadcms/payload/commit/c3037118133a242769dfa4a31914e8e61068edcf))
|
||||
|
||||
|
||||
|
||||
## [0.1.143](https://github.com/payloadcms/payload/compare/v0.1.142...v0.1.143) (2021-01-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* payload schema validation allow '*' ([bd92b0a](https://github.com/payloadcms/payload/commit/bd92b0a94ba3562b01000a58a4bc0e0071c1f35b))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* allows undefined collections ([6bb58ce](https://github.com/payloadcms/payload/commit/6bb58cecd8bc0b8faa42bc8995ec5da0421375db))
|
||||
|
||||
|
||||
|
||||
## [0.1.142](https://github.com/payloadcms/payload/compare/v0.1.141...v0.1.142) (2021-01-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* adds disableDuplicate to schema validation of collections config ([e9ed7ee](https://github.com/payloadcms/payload/commit/e9ed7ee4bdc99bdcc0d86272816f3d5c6904ac2b))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add getAdminURL and getAPIURL functions ([8db73bb](https://github.com/payloadcms/payload/commit/8db73bbec22646bc626d17bb783b10ea2d837520))
|
||||
* adds build to CI ([87a1717](https://github.com/payloadcms/payload/commit/87a1717dcae8ec30892cebc46e88cabe8e62bf4c))
|
||||
* disable graphQL flag that will bypass gql on payload init ([d78c76e](https://github.com/payloadcms/payload/commit/d78c76e0b4b7e2c2cc834a2a1288ec75468852ec))
|
||||
|
||||
|
||||
|
||||
## [0.1.141](https://github.com/payloadcms/payload/compare/v0.1.140...v0.1.141) (2021-01-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* properly exports ES6 components ([f493263](https://github.com/payloadcms/payload/commit/f49326395dba523c2193c46a8ca4142ff761f3fd))
|
||||
|
||||
|
||||
|
||||
## [0.1.140](https://github.com/payloadcms/payload/compare/v0.1.139...v0.1.140) (2021-01-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* admin field error messages ([423df3f](https://github.com/payloadcms/payload/commit/423df3f83af0f899b4a9eafa041ab7c79ccfac78))
|
||||
|
||||
|
||||
|
||||
## [0.1.139](https://github.com/payloadcms/payload/compare/v0.1.138...v0.1.139) (2021-01-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* improves typing in delete op ([644519c](https://github.com/payloadcms/payload/commit/644519c539f6fda29d7b61978416b70306d0ea35))
|
||||
* use FileSize and ImageSize types ([4d6871a](https://github.com/payloadcms/payload/commit/4d6871abc854385121c761eea4e4705f45c35832))
|
||||
|
||||
|
||||
|
||||
## [0.1.138](https://github.com/payloadcms/payload/compare/v0.1.137...v0.1.138) (2021-01-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* removes old css ([6066f28](https://github.com/payloadcms/payload/commit/6066f2896a5c1e21137d41404f2a6161ef6de7a2))
|
||||
|
||||
|
||||
|
||||
## [0.1.137](https://github.com/payloadcms/payload/compare/v0.1.136...v0.1.137) (2021-01-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* removes prod devtool ([6808637](https://github.com/payloadcms/payload/commit/680863702e67d69dc4ec8d6a48b0e1402164cc97))
|
||||
|
||||
|
||||
|
||||
## [0.1.136](https://github.com/payloadcms/payload/compare/v0.1.135...v0.1.136) (2021-01-05)
|
||||
|
||||
|
||||
|
||||
## [0.1.135](https://github.com/payloadcms/payload/compare/v0.1.134...v0.1.135) (2021-01-05)
|
||||
|
||||
|
||||
|
||||
## [0.1.134](https://github.com/payloadcms/payload/compare/v0.1.133...v0.1.134) (2021-01-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* updates payload-config path within webpack ([6bf141c](https://github.com/payloadcms/payload/commit/6bf141c6d4707e622f56f5df4f8f3f366d847173))
|
||||
|
||||
|
||||
|
||||
## [0.1.133](https://github.com/payloadcms/payload/compare/v0.1.132...v0.1.133) (2021-01-05)
|
||||
|
||||
|
||||
|
||||
## [0.1.132](https://github.com/payloadcms/payload/compare/v0.1.131...v0.1.132) (2021-01-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* renames webpack config alias ([c0636df](https://github.com/payloadcms/payload/commit/c0636dfe220b72c129c4e2b144e5714755a20043))
|
||||
|
||||
|
||||
|
||||
## [0.1.131](https://github.com/payloadcms/payload/compare/v0.1.130...v0.1.131) (2021-01-05)
|
||||
|
||||
|
||||
|
||||
## [0.1.130](https://github.com/payloadcms/payload/compare/v0.1.129...v0.1.130) (2021-01-05)
|
||||
|
||||
|
||||
|
||||
## [0.1.129](https://github.com/payloadcms/payload/compare/v0.1.128...v0.1.129) (2021-01-05)
|
||||
|
||||
|
||||
|
||||
## [0.1.128](https://github.com/payloadcms/payload/compare/v0.1.127...v0.1.128) (2021-01-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* adds default thumbnail size ([f582a25](https://github.com/payloadcms/payload/commit/f582a254cd6b6f56bb8146923f3ab0130a4b7859))
|
||||
* config validation of block imageURL ([c572057](https://github.com/payloadcms/payload/commit/c572057706f58f7759e167a724837f84e88d0d10))
|
||||
* default config value for email removed as the property was moved out of config ([cf89d4c](https://github.com/payloadcms/payload/commit/cf89d4cb56add645e68cf0be31d943b734dabe39))
|
||||
* demo email start on payload init ([57d2c86](https://github.com/payloadcms/payload/commit/57d2c8602fb81a5d67d34a38c25a0429c2b9c44b))
|
||||
* Edit view main / sidebar widths ([e067fa1](https://github.com/payloadcms/payload/commit/e067fa12b2465d4767bc35b5f1ec0de8096f7439))
|
||||
* graphQL access ([4d871c2](https://github.com/payloadcms/payload/commit/4d871c27f6eefea26ec55302e654fc3b0f4a2933))
|
||||
* graphQL logout ([709cc9c](https://github.com/payloadcms/payload/commit/709cc9c294d959913b382e24dd0d7002d6a7c9cd))
|
||||
* improves edit view layout constraints ([0f7046b](https://github.com/payloadcms/payload/commit/0f7046b98efd82caf98d0d872bd6e68b076452a1))
|
||||
* issues with select hasMany ([a0bf503](https://github.com/payloadcms/payload/commit/a0bf503f888b7fde0c9660e9f8a461da2fab5d67))
|
||||
* lowecases joi like everywhere else in payload ([5823a86](https://github.com/payloadcms/payload/commit/5823a864f926bc6441267a21277059a368410b92))
|
||||
* payload config remove types for email ([faec969](https://github.com/payloadcms/payload/commit/faec969752622c70e9175cc226d888bf32ec732c))
|
||||
* reinstate explicit labels for AllFields collection ([885c73c](https://github.com/payloadcms/payload/commit/885c73c838c597ac03f79558af9946686274969f))
|
||||
* removes delete and unlock from baseField type and schema ([4fa942f](https://github.com/payloadcms/payload/commit/4fa942f3a02089c8320e483b896a59627c28f11e))
|
||||
* removes old reliance on config.email ([e093e06](https://github.com/payloadcms/payload/commit/e093e06926e55916ddb0bdb6f17e0317dfab951c))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* allows for refresh operation to accept a deliberately specified token ([7d05069](https://github.com/payloadcms/payload/commit/7d05069f361d30ff36d990e0926a60b1c374149a))
|
||||
* types this within crreate op ([d43ff8b](https://github.com/payloadcms/payload/commit/d43ff8b4a764dd203fa7eebda28b09dc21a88e31))
|
||||
|
||||
|
||||
|
||||
## [0.1.127](https://github.com/payloadcms/payload/compare/v0.1.126...v0.1.127) (2020-12-31)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* converts class methods to arrow functions ([662839f](https://github.com/payloadcms/payload/commit/662839fb06e95001bb0ef20c4f318cc4c2fccc31))
|
||||
|
||||
|
||||
|
||||
## [0.1.126](https://github.com/payloadcms/payload/compare/v0.1.125...v0.1.126) (2020-12-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* adds delete and unlock to joi baseField schema ([36d51de](https://github.com/payloadcms/payload/commit/36d51de201b27ef91f43f05992d980ad306ba9f3))
|
||||
|
||||
|
||||
|
||||
## [0.1.125](https://github.com/payloadcms/payload/compare/v0.1.124...v0.1.125) (2020-12-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* removes prod source maps ([eeea06d](https://github.com/payloadcms/payload/commit/eeea06d6aaa84efdfb479baf1baad7bdf038d7cd))
|
||||
|
||||
|
||||
|
||||
## [0.1.124](https://github.com/payloadcms/payload/compare/v0.1.123...v0.1.124) (2020-12-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* disable requiring default props in eslint ([64cf321](https://github.com/payloadcms/payload/commit/64cf32146ad75d8ce3e5f3e8e690391ac7884819))
|
||||
* disables inline sourcemaps for admin dist ([8090b2a](https://github.com/payloadcms/payload/commit/8090b2a23bb6298fdd998d9a72c6f596e7473cb0))
|
||||
* type issues that arose from reorganizing certain config props ([0c03c2e](https://github.com/payloadcms/payload/commit/0c03c2e3af34657e3dde1c3f2b675840147f78ec))
|
||||
* updates typing on DatePicker component and joi schema ([5100fd3](https://github.com/payloadcms/payload/commit/5100fd35dc796c5862ef9fd7261abdcba925b020))
|
||||
* webpack config override ([8401400](https://github.com/payloadcms/payload/commit/84014001297519ce7f82f691fb2c4d1c525222f9))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* allows for adding custom CSS in addition to SCSS overrides ([544a4db](https://github.com/payloadcms/payload/commit/544a4dbd3ab17e1c8c9ed864fe17b7359883d845))
|
||||
|
||||
|
||||
|
||||
## [0.1.123](https://github.com/payloadcms/payload/compare/v0.1.123...v0.1.123) (2020-12-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* allows config validation to accept esmodules as components ([b8ad84c](https://github.com/payloadcms/payload/commit/b8ad84c525e597e237caf05e00832ded30668a6b))
|
||||
* prod webpack publicPath ([8bda6ea](https://github.com/payloadcms/payload/commit/8bda6eaa762dff0027036d918155f4618740a84c))
|
||||
|
||||
|
||||
|
||||
## [0.1.122](https://github.com/payloadcms/payload/compare/v0.1.121...v0.1.122) (2020-12-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* improves field schema validation ([db13512](https://github.com/payloadcms/payload/commit/db135129d84bab9df03516ebfa2b667acead3cc9))
|
||||
* safely accesses field permissions ([1fff737](https://github.com/payloadcms/payload/commit/1fff7374d43921d203b9b655ac64dbed3867ad2a))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* sends config through babel/register ([fec718e](https://github.com/payloadcms/payload/commit/fec718e9e523b1e92ca2dc216d99eef2dcbed83a))
|
||||
* splits tsconfig between admin and server ([efe0b40](https://github.com/payloadcms/payload/commit/efe0b40aca4b88084c71f851604d08cae1d62a9a))
|
||||
|
||||
|
||||
|
||||
## [0.1.121](https://github.com/payloadcms/payload/compare/v0.1.120...v0.1.121) (2020-12-27)
|
||||
|
||||
|
||||
|
||||
## [0.1.20](https://github.com/payloadcms/payload/compare/v0.1.19...v0.1.20) (2020-12-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* production webpack css ([6e83edc](https://github.com/payloadcms/payload/commit/6e83edc988e9284ec52164fc6399f45ab5851652))
|
||||
* removes unnecessary meta defaults in admin config ([0117f18](https://github.com/payloadcms/payload/commit/0117f18eb1dd163143e18cd8061a4b96d41c411e))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* improves edit scroll UX in Account and Globals ([604922a](https://github.com/payloadcms/payload/commit/604922a26e7aabde71b470c96ff1b27e0f7b6fc8))
|
||||
* improves scrolling UX in Edit views ([a715a42](https://github.com/payloadcms/payload/commit/a715a4206ed2cedc9b02b58339e44354c571fec5))
|
||||
|
||||
|
||||
|
||||
## [0.1.19](https://github.com/payloadcms/payload/compare/v0.1.18...v0.1.19) (2020-12-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* copyfiles, autocomplete transition ([5b8c721](https://github.com/payloadcms/payload/commit/5b8c721292140e4cd0ed55d13e97c1d4cd359c98))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* flattens build into one command ([8571dc3](https://github.com/payloadcms/payload/commit/8571dc396591487d2a2854b9fe93f5338eb10659))
|
||||
|
||||
|
||||
|
||||
## [0.1.18](https://github.com/payloadcms/payload/compare/v0.1.17...v0.1.18) (2020-12-27)
|
||||
|
||||
|
||||
|
||||
## [0.1.17](https://github.com/payloadcms/payload/compare/v0.1.16...v0.1.17) (2020-12-27)
|
||||
|
||||
|
||||
|
||||
## [0.1.16](https://github.com/payloadcms/payload/compare/v0.1.15...v0.1.16) (2020-12-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* handle access result gracefully ([1cd578e](https://github.com/payloadcms/payload/commit/1cd578ef445499ceb3704ab28d736baaae123cbd))
|
||||
* undo property fix, field exists - bad typing ([66946c8](https://github.com/payloadcms/payload/commit/66946c86973c252585e98aa3f0a453cae9dff598))
|
||||
|
||||
|
||||
|
||||
## [0.1.15](https://github.com/payloadcms/payload/compare/v0.1.14...v0.1.15) (2020-12-02)
|
||||
|
||||
|
||||
|
||||
## [0.1.14](https://github.com/payloadcms/payload/compare/v0.1.13...v0.1.14) (2020-12-02)
|
||||
|
||||
|
||||
|
||||
## [0.1.13](https://github.com/payloadcms/payload/compare/v0.1.12...v0.1.13) (2020-12-02)
|
||||
|
||||
|
||||
|
||||
## [0.1.12](https://github.com/payloadcms/payload/compare/v0.1.11...v0.1.12) (2020-12-02)
|
||||
|
||||
|
||||
|
||||
## [0.1.11](https://github.com/payloadcms/payload/compare/v0.1.10...v0.1.11) (2020-12-01)
|
||||
|
||||
|
||||
|
||||
## [0.1.10](https://github.com/payloadcms/payload/compare/v0.1.9...v0.1.10) (2020-12-01)
|
||||
|
||||
|
||||
|
||||
## [0.1.9](https://github.com/payloadcms/payload/compare/v0.1.8...v0.1.9) (2020-11-25)
|
||||
|
||||
|
||||
|
||||
## [0.1.8](https://github.com/payloadcms/payload/compare/v0.1.7...v0.1.8) (2020-11-25)
|
||||
|
||||
|
||||
|
||||
## [0.1.7](https://github.com/payloadcms/payload/compare/v0.1.6...v0.1.7) (2020-11-25)
|
||||
|
||||
|
||||
|
||||
## [0.1.6](https://github.com/payloadcms/payload/compare/v0.1.5...v0.1.6) (2020-11-25)
|
||||
|
||||
|
||||
|
||||
## [0.1.5](https://github.com/payloadcms/payload/compare/v0.1.4...v0.1.5) (2020-11-25)
|
||||
|
||||
|
||||
|
||||
## [0.1.4](https://github.com/payloadcms/payload/compare/v0.1.3...v0.1.4) (2020-11-25)
|
||||
|
||||
|
||||
|
||||
## [0.1.3](https://github.com/payloadcms/payload/compare/v0.1.2...v0.1.3) (2020-11-24)
|
||||
|
||||
|
||||
|
||||
## [0.1.2](https://github.com/payloadcms/payload/compare/v0.1.1...v0.1.2) (2020-11-24)
|
||||
|
||||
|
||||
|
||||
## [0.1.1](https://github.com/payloadcms/payload/compare/v0.1.0...v0.1.1) (2020-11-24)
|
||||
|
||||
|
||||
|
||||
# [0.1.0](https://github.com/payloadcms/payload/compare/v0.0.141...v0.1.0) (2020-11-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **webpack:** more require.resolves needed ([924eb1d](https://github.com/payloadcms/payload/commit/924eb1d0b566eb7bb3912018e06cf431e5a85524))
|
||||
* **webpack:** use require.resolve for modules ([badd59a](https://github.com/payloadcms/payload/commit/badd59ac38e10e9caf700eece5761e7d65341c21))
|
||||
* add missing webpack dep path-browserify ([8789dae](https://github.com/payloadcms/payload/commit/8789dae155bbb93fdef5104cc616e0a29b1b6409))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add initial types ([983bf71](https://github.com/payloadcms/payload/commit/983bf713b395a68d2374f2446a8a759aeda48579))
|
||||
|
||||
|
||||
|
||||
## [0.0.141](https://github.com/payloadcms/payload/compare/v0.0.140...v0.0.141) (2020-11-20)
|
||||
|
||||
|
||||
|
||||
## [0.0.140](https://github.com/payloadcms/payload/compare/v0.0.139...v0.0.140) (2020-11-20)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* show email creds when explicitly set to 'mock' ([dbd305a](https://github.com/payloadcms/payload/commit/dbd305acc5b083cea08227cbff8afebe8aa4c374))
|
||||
* use react-toastify for notifications ([131dd51](https://github.com/payloadcms/payload/commit/131dd51c39b08c2235582d23deb53188a04e5d80))
|
||||
* validate admin user ([83d32e4](https://github.com/payloadcms/payload/commit/83d32e44498460584bbc82512df91848bcf7cf47))
|
||||
|
||||
|
||||
|
||||
## [0.0.139](https://github.com/payloadcms/payload/compare/v0.0.138...v0.0.139) (2020-11-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* missed a file ([f52836a](https://github.com/payloadcms/payload/commit/f52836a7e342ecccd7409ba382eade43adb18d90))
|
||||
|
||||
|
||||
|
||||
## [0.0.138](https://github.com/payloadcms/payload/compare/v0.0.137...v0.0.138) (2020-11-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* allow e-mail to be unconfigured, remove default fromName and fromAddress ([dceeeaa](https://github.com/payloadcms/payload/commit/dceeeaac6a1a9057cdd9f973c7500b3763514f0a))
|
||||
* auth json schema didn't allow auth as boolean ([0694a09](https://github.com/payloadcms/payload/commit/0694a09abdde59eb8e785301230ed4e8e244c84a))
|
||||
* properly concat verification and locking fields ([2624ad5](https://github.com/payloadcms/payload/commit/2624ad5f7e50332eb9212877d0eefcdcb2fa399b))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add blind index for encrypting API Keys ([9a1c1f6](https://github.com/payloadcms/payload/commit/9a1c1f64c0ea0066b679195f50e6cb1ac4bf3552))
|
||||
* add license key to access routej ([2565005](https://github.com/payloadcms/payload/commit/2565005cc099797a6e3b8995e0984c28b7837e82))
|
||||
|
||||
|
||||
|
||||
## [0.0.137](https://github.com/payloadcms/payload/commit/5c1e2846a2694a80cc8707703406c2ac1bb6af8a) (2020-11-12)
|
||||
76
README.md
76
README.md
@@ -1,21 +1,77 @@
|
||||
# Payload
|
||||
<h1 align="center">Payload</h1>
|
||||
<p align="center">A self-hosted, JavaScript headless CMS & application framework built with Express, MongoDB and React.</p>
|
||||
<p align="center">
|
||||
<a href="https://github.com/payloadcms/payload/actions">
|
||||
<img src="https://github.com/payloadcms/payload/workflows/build/badge.svg">
|
||||
</a>
|
||||
<a href="https://www.npmjs.com/package/payload">
|
||||
<img alt="npm" src="https://img.shields.io/npm/v/payload">
|
||||
</a>
|
||||
|
||||
Headless CMS and application framework
|
||||
<a href="https://twitter.com/intent/tweet?text=Payload%20-%20A%20self-hosted%2C%20headless%20JavaScript%20CMS%20%26%20application%20framework&url=https%3A%2F%2Fgithub.com%2Fpayloadcms%2Fpayload">
|
||||
<img alt="Tweet Payload" src="https://img.shields.io/twitter/url/http/shields.io.svg?style=social">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
*TODO: More on why to use it and some features*
|
||||
<a href="https://payloadcms.com">
|
||||
<img src="https://payloadcms.com/images/og-image.jpg" alt="Payload headless CMS Admin panel built with React" />
|
||||
</a>
|
||||
|
||||
### Quick Start
|
||||
|
||||
```
|
||||
npx create-payload-app
|
||||
```
|
||||
|
||||
Alternatively, it only takes about five minutes to [create an app from scratch](https://payloadcms.com/docs/getting-started/installation#from-scratch).
|
||||
|
||||
### Documentation
|
||||
|
||||
Check out the [Payload website](https://payloadcms.com/docs/getting-started/what-is-payload) to find in-depth documentation for everything that Payload offers.
|
||||
|
||||
### Features
|
||||
|
||||
- [GraphQL](https://payloadcms.com/docs/graphql/overview), [REST](https://payloadcms.com/docs/rest-api/overview), and [Local](https://payloadcms.com/docs/local-api/overview) APIs
|
||||
- [Easily customizable ReactJS Admin](https://payloadcms.com/docs/admin/overview)
|
||||
- [Fully self-hosted](https://payloadcms.com/docs/production/deployment)
|
||||
- [Extensible Authentication](https://payloadcms.com/docs/authentication/overview)
|
||||
- [Local file storage & upload](https://payloadcms.com/docs/upload/overview)
|
||||
- [Field-based Localization](https://payloadcms.com/docs/configuration/localization)
|
||||
- [Block-based Layout Builder](https://payloadcms.com/docs/fields/blocks)
|
||||
- [Extensible SlateJS rich text editor](https://payloadcms.com/docs/fields/rich-text)
|
||||
- [Array field type](https://payloadcms.com/docs/fields/array)
|
||||
- [Field conditional logic](https://payloadcms.com/docs/fields/overview#conditional-logic)
|
||||
- Extremely granular [Access Control](https://payloadcms.com/docs/access-control/overview)
|
||||
- [Document and field-level hooks](https://payloadcms.com/docs/hooks/overview) for every action Payload provides
|
||||
- Built with Typescript & very Typescript-friendly
|
||||
- Intensely fast API
|
||||
- Highly secure thanks to HTTP-only cookies, CSRF protection, and more
|
||||
|
||||
### Code-first
|
||||
|
||||
If you know JavaScript, you know Payload. Payload is a _code-first_ CMS, which allows us to do a lot of things right:
|
||||
|
||||
- Payload gives you everything you need, but then steps back and lets you build what you want in JavaScript or TypeScript - with no unnecessary complexity brought by GUIs. You'll understand how your CMS works, because you will have written it exactly how you want it.
|
||||
- Bring your own Express server and do whatever you need on top of Payload. Payload doesn't impose anything on you or your app.
|
||||
- Completely control the Admin panel by using your own React components. Swap out fields or even entire views with ease.
|
||||
- Use your data however and wherever you need thanks to auto-generated, yet fully extensible REST, GraphQL and Local Node APIs.
|
||||
|
||||
### Free forever for personal use and small projects
|
||||
|
||||
Payload is 100% free for personal projects or small use cases where only one admin user is required. You can also get started without an account whatsoever while running on `localhost`.
|
||||
|
||||
## Installation
|
||||
|
||||
`yarn add @payloadcms/payload` or `npm install @payloadcms/payload`
|
||||
Before beginning to work with Payload, make sure you have all of the [required software](https://payloadcms.com/docs/getting-started/installation).
|
||||
|
||||
## Usage
|
||||
From there, the easiest way to get started with Payload is to use the `create-payload-app` package:
|
||||
|
||||
*TODO: Show basic usage and link to docs*
|
||||
```
|
||||
npx create-payload-app
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
*TODO: Create Contributing.md*
|
||||
Alternatively, it only takes about five minutes to [write out your own app from scratch](https://payloadcms.com/docs/getting-started/installation#from-scratch).
|
||||
|
||||
## License
|
||||
|
||||
*TODO: Create License.md*
|
||||
Find the Payload license [here](https://github.com/payloadcms/payload/blob/master/license.md).
|
||||
|
||||
3
babel.config.js
Normal file
3
babel.config.js
Normal file
@@ -0,0 +1,3 @@
|
||||
const config = require('./src/babel.config');
|
||||
|
||||
module.exports = config;
|
||||
19
components/forms.js
Normal file
19
components/forms.js
Normal file
@@ -0,0 +1,19 @@
|
||||
export {
|
||||
useForm,
|
||||
useWatchForm,
|
||||
useFormSubmitted,
|
||||
useFormProcessing,
|
||||
useFormModified,
|
||||
} from '../dist/admin/components/forms/Form/context';
|
||||
|
||||
export { default as useFieldType } from '../dist/admin/components/forms/useFieldType';
|
||||
|
||||
export { default as Form } from '../dist/admin/components/forms/Form';
|
||||
|
||||
export { default as Text } from '../dist/admin/components/forms/field-types/Text';
|
||||
export { default as Group } from '../dist/admin/components/forms/field-types/Group';
|
||||
export { default as Select } from '../dist/admin/components/forms/field-types/Select';
|
||||
export { default as Checkbox } from '../dist/admin/components/forms/field-types/Checkbox';
|
||||
export { default as Submit } from '../dist/admin/components/forms/Submit';
|
||||
|
||||
export { default as reduceFieldsToValues } from '../dist/admin/components/forms/Form/reduceFieldsToValues';
|
||||
3
components/rich-text.js
Normal file
3
components/rich-text.js
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default as LeafButton } from '../dist/admin/components/forms/field-types/RichText/leaves/Button';
|
||||
export { default as ElementButton } from '../dist/admin/components/forms/field-types/RichText/elements/Button';
|
||||
export { default as toggleElement } from '../dist/admin/components/forms/field-types/RichText/elements/toggle';
|
||||
2
components/views.js
Normal file
2
components/views.js
Normal file
@@ -0,0 +1,2 @@
|
||||
export { default as Edit } from '../dist/admin/components/views/collections/Edit/Default';
|
||||
export { default as List } from '../dist/admin/components/views/collections/List/Default';
|
||||
2
config.d.ts
vendored
Normal file
2
config.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export { buildConfig } from './dist/config/build';
|
||||
export * from './dist/config/types';
|
||||
1
config.js
Normal file
1
config.js
Normal file
@@ -0,0 +1 @@
|
||||
exports.buildConfig = require('./dist/config/build').buildConfig;
|
||||
33
contributing.md
Normal file
33
contributing.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# Contributing to Payload CMS
|
||||
|
||||
Below you'll find a set of guidelines for how to contribute to Payload CMS.
|
||||
|
||||
## Payload is proprietary software
|
||||
|
||||
Even though you can read Payload's source code, it's technically not "open source". Payload requires an active license to be used in all production purposes. That said, we do not expect PRs from the public, but we still welcome pull requests of any kind.
|
||||
|
||||
## Opening issues
|
||||
|
||||
Before you submit an issue, please check all existing [open and closed issues](https://github.com/payloadcms/payload/issues) to see if your issue has previously been resolved or is already known. If there is already an issue logged, feel free to upvote it by adding a :thumbsup: [reaction](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments). If you would like to submit a new issue, please fill out our Issue Template to the best of your ability so we can accurately understand your report.
|
||||
|
||||
## Security issues & vulnerabilities
|
||||
|
||||
If you come across an issue related to security, or a potential attack vector within Payload or one of its dependencies, please DO NOT create a publicly viewable issue. Instead, please contact us directly at [`dev@payloadcms.com`](mailto:dev@payloadcms.com). We will do everything we can to respond to the issue as soon as possible.
|
||||
|
||||
If you find a vulnerability within the core Payload repository, and we determine that it is remediable and of significant nature, we will be happy to pay you a reward for your findings and diligence. [`Contact us`](mailto:dev@payloadcms.com) to find out more.
|
||||
|
||||
## Documentation edits
|
||||
|
||||
Payload documentation can be found directly within its codebase and you can feel free to make changes / improvements to any of it through opening a PR. We utilize these files directly in our website and will periodically deploy documentation updates as necessary.
|
||||
|
||||
## Building additional features
|
||||
|
||||
If you're an incredibly awesome person and want to help us make Payload even better through new features or additions, we would be thrilled to work with you. If your proposed feature is accepted by our team and is significant enough, pending our discretion, we'd be happy to hook you up with a pro-bono license.
|
||||
|
||||
To help us work on new features, you can reach out to our Development team at [`dev@payloadcms.com`](mailto:dev@payloadcms.com). Be as complete and descriptive as possible regarding your vision and we'll go from there!
|
||||
|
||||
## Pull Requests
|
||||
|
||||
For all Pull Requests, you should be extremely descriptive about both your problem and proposed solution. If there are any affected open or closed issues, please leave the issue number in your PR message.
|
||||
|
||||
By opening a Pull Request against Payload's codebase, you automatically give the entirety of the contribution within your PR to Payload CMS, LLC and retain no personal ownership whatsoever afterward. For more information, please read the full [Payload license](https://github.com/payloadcms/payload/blob/master/license.md).
|
||||
@@ -6,11 +6,7 @@
|
||||
*/
|
||||
const checkRole = (allRoles, user) => {
|
||||
if (user) {
|
||||
if (allRoles.some((role) => {
|
||||
return user.roles && user.roles.some((individualRole) => {
|
||||
return individualRole === role;
|
||||
});
|
||||
})) {
|
||||
if (allRoles.some((role) => user.roles && user.roles.some((individualRole) => individualRole === role))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -18,4 +14,4 @@ const checkRole = (allRoles, user) => {
|
||||
return false;
|
||||
};
|
||||
|
||||
module.exports = checkRole;
|
||||
export default checkRole;
|
||||
@@ -1,4 +1,4 @@
|
||||
module.exports = [
|
||||
export default [
|
||||
'admin',
|
||||
'editor',
|
||||
'moderator',
|
||||
@@ -1,4 +1,6 @@
|
||||
module.exports = {
|
||||
import { Block } from '../../src/fields/config/types';
|
||||
|
||||
const CTA: Block = {
|
||||
slug: 'cta',
|
||||
labels: {
|
||||
singular: 'Call to Action',
|
||||
@@ -16,8 +18,9 @@ module.exports = {
|
||||
name: 'url',
|
||||
label: 'URL',
|
||||
type: 'text',
|
||||
height: 100,
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default CTA;
|
||||
@@ -1,4 +1,6 @@
|
||||
module.exports = {
|
||||
import { Block } from '../../src/fields/config/types';
|
||||
|
||||
const Email: Block = {
|
||||
slug: 'email',
|
||||
labels: {
|
||||
singular: 'Email',
|
||||
@@ -9,8 +11,9 @@ module.exports = {
|
||||
name: 'testEmail',
|
||||
label: 'Test Email Field',
|
||||
type: 'email',
|
||||
maxLength: 100,
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default Email;
|
||||
@@ -1,4 +1,6 @@
|
||||
module.exports = {
|
||||
import { Block } from '../../src/fields/config/types';
|
||||
|
||||
const NumberBlock: Block = {
|
||||
slug: 'number',
|
||||
labels: {
|
||||
singular: 'Number',
|
||||
@@ -9,8 +11,10 @@ module.exports = {
|
||||
name: 'testNumber',
|
||||
label: 'Test Number Field',
|
||||
type: 'number',
|
||||
maxLength: 100,
|
||||
max: 100,
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default NumberBlock;
|
||||
@@ -1,5 +1,7 @@
|
||||
module.exports = {
|
||||
blockImage: '/static/assets/images/generic-block-image.svg',
|
||||
import { Block } from '../../src/fields/config/types';
|
||||
|
||||
const Quote: Block = {
|
||||
imageURL: '/static/assets/images/generic-block-image.svg',
|
||||
slug: 'quote',
|
||||
labels: {
|
||||
singular: 'Quote',
|
||||
@@ -17,7 +19,6 @@ module.exports = {
|
||||
name: 'quote',
|
||||
label: 'Quote',
|
||||
type: 'textarea',
|
||||
height: 100,
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
@@ -29,3 +30,5 @@ module.exports = {
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default Quote;
|
||||
@@ -1,9 +0,0 @@
|
||||
import PageList from '../collections/Page/components/List';
|
||||
|
||||
const components = {
|
||||
pages: {
|
||||
List: PageList,
|
||||
},
|
||||
};
|
||||
|
||||
export default components;
|
||||
@@ -1,5 +0,0 @@
|
||||
import React from 'react';
|
||||
|
||||
const Sidebar = () => <div className="sidebar">fake sidebar</div>
|
||||
|
||||
export default Sidebar;
|
||||
@@ -0,0 +1,33 @@
|
||||
@import '../../../../../../../scss/vars.scss';
|
||||
|
||||
.button-rich-text-button {
|
||||
.btn {
|
||||
margin-right: base(1);
|
||||
}
|
||||
|
||||
&__modal {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
|
||||
&.payload__modal-item--enterDone {
|
||||
@include blur-bg;
|
||||
}
|
||||
}
|
||||
|
||||
&__header {
|
||||
width: 100%;
|
||||
margin-bottom: $baseline;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
h3 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
svg {
|
||||
width: base(1.5);
|
||||
height: base(1.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
124
demo/client/components/richText/elements/Button/Button/index.tsx
Normal file
124
demo/client/components/richText/elements/Button/Button/index.tsx
Normal file
@@ -0,0 +1,124 @@
|
||||
import React, { Fragment, useCallback } from 'react';
|
||||
import { Modal, useModal } from '@faceless-ui/modal';
|
||||
import { Transforms } from 'slate';
|
||||
import { useSlate, ReactEditor } from 'slate-react';
|
||||
import MinimalTemplate from '../../../../../../../src/admin/components/templates/Minimal';
|
||||
import { ElementButton } from '../../../../../../../components/rich-text';
|
||||
import X from '../../../../../../../src/admin/components/icons/X';
|
||||
import Button from '../../../../../../../src/admin/components/elements/Button';
|
||||
import { Form, Text, Checkbox, Select, Submit, reduceFieldsToValues } from '../../../../../../../components/forms';
|
||||
|
||||
import './index.scss';
|
||||
|
||||
const baseClass = 'button-rich-text-button';
|
||||
|
||||
const initialFormData = {
|
||||
style: 'primary',
|
||||
};
|
||||
|
||||
const insertButton = (editor, { href, label, style, newTab = false }: any) => {
|
||||
const text = { text: ' ' };
|
||||
const button = {
|
||||
type: 'button',
|
||||
href,
|
||||
style,
|
||||
newTab,
|
||||
label,
|
||||
children: [
|
||||
text,
|
||||
],
|
||||
};
|
||||
|
||||
const nodes = [button, { children: [{ text: '' }] }];
|
||||
|
||||
if (editor.blurSelection) {
|
||||
Transforms.select(editor, editor.blurSelection);
|
||||
}
|
||||
|
||||
Transforms.insertNodes(editor, nodes);
|
||||
|
||||
const currentPath = editor.selection.anchor.path[0];
|
||||
const newSelection = { anchor: { path: [currentPath + 1, 0], offset: 0 }, focus: { path: [currentPath + 1, 0], offset: 0 } };
|
||||
|
||||
Transforms.select(editor, newSelection);
|
||||
ReactEditor.focus(editor);
|
||||
};
|
||||
|
||||
const ToolbarButton: React.FC<{path: string}> = ({ path }) => {
|
||||
const { open, closeAll } = useModal();
|
||||
const editor = useSlate();
|
||||
|
||||
const handleAddButton = useCallback((fields) => {
|
||||
const data = reduceFieldsToValues(fields);
|
||||
insertButton(editor, data);
|
||||
closeAll();
|
||||
}, [editor, closeAll]);
|
||||
|
||||
const modalSlug = `${path}-add-button`;
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<ElementButton
|
||||
className={baseClass}
|
||||
format="button"
|
||||
onClick={() => open(modalSlug)}
|
||||
>
|
||||
Button
|
||||
</ElementButton>
|
||||
<Modal
|
||||
slug={modalSlug}
|
||||
className={`${baseClass}__modal`}
|
||||
>
|
||||
<MinimalTemplate>
|
||||
<header className={`${baseClass}__header`}>
|
||||
<h3>Add button</h3>
|
||||
<Button
|
||||
buttonStyle="none"
|
||||
onClick={closeAll}
|
||||
>
|
||||
<X />
|
||||
</Button>
|
||||
</header>
|
||||
<Form
|
||||
onSubmit={handleAddButton}
|
||||
initialData={initialFormData}
|
||||
>
|
||||
<Text
|
||||
label="Label"
|
||||
name="label"
|
||||
required
|
||||
/>
|
||||
<Text
|
||||
label="URL"
|
||||
name="href"
|
||||
required
|
||||
/>
|
||||
<Select
|
||||
label="Style"
|
||||
name="style"
|
||||
options={[
|
||||
{
|
||||
label: 'Primary',
|
||||
value: 'primary',
|
||||
},
|
||||
{
|
||||
label: 'Secondary',
|
||||
value: 'secondary',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<Checkbox
|
||||
label="Open in new tab"
|
||||
name="newTab"
|
||||
/>
|
||||
<Submit>
|
||||
Add button
|
||||
</Submit>
|
||||
</Form>
|
||||
</MinimalTemplate>
|
||||
</Modal>
|
||||
</Fragment>
|
||||
);
|
||||
};
|
||||
|
||||
export default ToolbarButton;
|
||||
@@ -0,0 +1,19 @@
|
||||
@import '../../../../../../../scss/vars.scss';
|
||||
|
||||
.rich-text-button {
|
||||
margin: $baseline 0;
|
||||
}
|
||||
|
||||
.rich-text-button__button {
|
||||
padding: base(.5) base(1.5);
|
||||
border-radius: $style-radius-s;
|
||||
|
||||
&--primary {
|
||||
background-color: $color-dark-gray;
|
||||
color: white;
|
||||
}
|
||||
|
||||
&--secondary {
|
||||
background-color: $color-light-gray;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import './index.scss';
|
||||
|
||||
const baseClass = 'rich-text-button';
|
||||
|
||||
const ButtonElement: React.FC = ({ attributes, children, element }) => {
|
||||
const { style = 'primary', label } = element;
|
||||
|
||||
return (
|
||||
<div
|
||||
className={baseClass}
|
||||
contentEditable={false}
|
||||
>
|
||||
<span
|
||||
{...attributes}
|
||||
className={[
|
||||
`${baseClass}__button`,
|
||||
`${baseClass}__button--${style}`,
|
||||
].join(' ')}
|
||||
>
|
||||
{label}
|
||||
{children}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
ButtonElement.defaultProps = {
|
||||
attributes: {},
|
||||
children: null,
|
||||
};
|
||||
|
||||
ButtonElement.propTypes = {
|
||||
attributes: PropTypes.shape({}),
|
||||
children: PropTypes.node,
|
||||
element: PropTypes.shape({
|
||||
style: PropTypes.oneOf(['primary', 'secondary']),
|
||||
label: PropTypes.string,
|
||||
}).isRequired,
|
||||
};
|
||||
|
||||
export default ButtonElement;
|
||||
12
demo/client/components/richText/elements/Button/index.ts
Normal file
12
demo/client/components/richText/elements/Button/index.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import Button from './Button';
|
||||
import Element from './Element';
|
||||
import plugin from './plugin';
|
||||
|
||||
export default {
|
||||
name: 'button',
|
||||
Button,
|
||||
Element,
|
||||
plugins: [
|
||||
plugin,
|
||||
],
|
||||
};
|
||||
12
demo/client/components/richText/elements/Button/plugin.ts
Normal file
12
demo/client/components/richText/elements/Button/plugin.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Editor } from 'slate';
|
||||
|
||||
const withButton = (incomingEditor: Editor): Editor => {
|
||||
const editor = incomingEditor;
|
||||
const { isVoid } = editor;
|
||||
|
||||
editor.isVoid = (element) => (element.type === 'button' ? true : isVoid(element));
|
||||
|
||||
return editor;
|
||||
};
|
||||
|
||||
export default withButton;
|
||||
@@ -0,0 +1,10 @@
|
||||
import React from 'react';
|
||||
import { LeafButton } from '../../../../../../../components/rich-text';
|
||||
|
||||
const Button = () => (
|
||||
<LeafButton format="purple-background">
|
||||
Purple Background
|
||||
</LeafButton>
|
||||
);
|
||||
|
||||
export default Button;
|
||||
@@ -0,0 +1,23 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const PurpleBackground: React.FC<any> = ({ attributes, children }) => (
|
||||
<span
|
||||
{...attributes}
|
||||
style={{ backgroundColor: 'purple' }}
|
||||
>
|
||||
{children}
|
||||
</span>
|
||||
);
|
||||
|
||||
PurpleBackground.defaultProps = {
|
||||
attributes: {},
|
||||
children: null,
|
||||
};
|
||||
|
||||
PurpleBackground.propTypes = {
|
||||
attributes: PropTypes.shape({}),
|
||||
children: PropTypes.node,
|
||||
};
|
||||
|
||||
export default PurpleBackground;
|
||||
@@ -0,0 +1,8 @@
|
||||
import Button from './Button';
|
||||
import Leaf from './Leaf';
|
||||
|
||||
export default {
|
||||
name: 'purple-background',
|
||||
Button,
|
||||
Leaf,
|
||||
};
|
||||
@@ -1,12 +1,13 @@
|
||||
const roles = require('../access/roles');
|
||||
const checkRole = require('../access/checkRole');
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
import roles from '../access/roles';
|
||||
import checkRole from '../access/checkRole';
|
||||
|
||||
const access = ({ req: { user } }) => {
|
||||
const result = checkRole(['admin'], user);
|
||||
return result;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
const Admin: PayloadCollectionConfig = {
|
||||
slug: 'admins',
|
||||
labels: {
|
||||
singular: 'Admin',
|
||||
@@ -20,9 +21,17 @@ module.exports = {
|
||||
admin: () => true,
|
||||
},
|
||||
auth: {
|
||||
tokenExpiration: 7200,
|
||||
tokenExpiration: 7200, // 2 hours
|
||||
verify: false,
|
||||
maxLoginAttempts: 5,
|
||||
lockTime: 600 * 1000, // lock time in ms
|
||||
useAPIKey: true,
|
||||
secureCookie: process.env.NODE_ENV === 'production',
|
||||
depth: 0,
|
||||
cookies: {
|
||||
secure: false,
|
||||
sameSite: 'lax',
|
||||
domain: undefined,
|
||||
},
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
@@ -37,6 +46,7 @@ module.exports = {
|
||||
},
|
||||
{
|
||||
name: 'apiKey',
|
||||
type: 'text',
|
||||
access: {
|
||||
read: ({ req: { user } }) => {
|
||||
if (checkRole(['admin'], user)) {
|
||||
@@ -59,3 +69,5 @@ module.exports = {
|
||||
useAsTitle: 'email',
|
||||
},
|
||||
};
|
||||
|
||||
export default Admin;
|
||||
@@ -1,10 +1,11 @@
|
||||
const checkRole = require('../access/checkRole');
|
||||
const Email = require('../blocks/Email');
|
||||
const Quote = require('../blocks/Quote');
|
||||
const NumberBlock = require('../blocks/Number');
|
||||
const CallToAction = require('../blocks/CallToAction');
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
import checkRole from '../access/checkRole';
|
||||
import Email from '../blocks/Email';
|
||||
import Quote from '../blocks/Quote';
|
||||
import NumberBlock from '../blocks/Number';
|
||||
import CallToAction from '../blocks/CallToAction';
|
||||
|
||||
const AllFields = {
|
||||
const AllFields: PayloadCollectionConfig = {
|
||||
slug: 'all-fields',
|
||||
labels: {
|
||||
singular: 'All Fields',
|
||||
@@ -12,13 +13,13 @@ const AllFields = {
|
||||
},
|
||||
admin: {
|
||||
useAsTitle: 'text',
|
||||
},
|
||||
preview: (doc, token) => {
|
||||
if (doc && doc.text) {
|
||||
return `http://localhost:3000/previewable-posts/${doc.text.value}?preview=true&token=${token}`;
|
||||
}
|
||||
preview: (doc, token) => {
|
||||
if (doc && doc.text) {
|
||||
return `http://localhost:3000/previewable-posts/${doc.text}?preview=true&token=${token}`;
|
||||
}
|
||||
|
||||
return null;
|
||||
return null;
|
||||
},
|
||||
},
|
||||
access: {
|
||||
read: () => true,
|
||||
@@ -84,6 +85,37 @@ const AllFields = {
|
||||
required: true,
|
||||
hasMany: true,
|
||||
},
|
||||
{
|
||||
name: 'dateFieldExample',
|
||||
label: 'Day and Time',
|
||||
type: 'date',
|
||||
admin: {
|
||||
date: {
|
||||
timeIntervals: 30,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'dayOnlyDateFieldExample',
|
||||
label: 'Day Only',
|
||||
type: 'date',
|
||||
admin: {
|
||||
date: {
|
||||
pickerAppearance: 'dayOnly',
|
||||
monthsToShow: 2,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'timeOnlyDateFieldExample',
|
||||
label: 'Time Only',
|
||||
type: 'date',
|
||||
admin: {
|
||||
date: {
|
||||
pickerAppearance: 'timeOnly',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'radioGroupExample',
|
||||
label: 'Radio Group Example',
|
||||
@@ -100,6 +132,9 @@ const AllFields = {
|
||||
}],
|
||||
defaultValue: 'option-2',
|
||||
required: true,
|
||||
admin: {
|
||||
readOnly: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'row',
|
||||
@@ -151,11 +186,18 @@ const AllFields = {
|
||||
label: 'Array Text 1',
|
||||
type: 'text',
|
||||
required: true,
|
||||
}, {
|
||||
admin: {
|
||||
width: '50%',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'arrayText2',
|
||||
label: 'Array Text 2',
|
||||
type: 'text',
|
||||
required: true,
|
||||
admin: {
|
||||
width: '50%',
|
||||
},
|
||||
access: {
|
||||
read: ({ req: { user } }) => Boolean(user),
|
||||
update: ({ req: { user } }) => checkRole(['admin'], user),
|
||||
@@ -171,6 +213,11 @@ const AllFields = {
|
||||
readOnly: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'checkbox',
|
||||
label: 'Checkbox',
|
||||
type: 'checkbox',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -178,7 +225,6 @@ const AllFields = {
|
||||
label: 'Blocks Content',
|
||||
name: 'blocks',
|
||||
minRows: 2,
|
||||
singularLabel: 'Block',
|
||||
blocks: [Email, NumberBlock, Quote, CallToAction],
|
||||
localized: true,
|
||||
required: true,
|
||||
@@ -226,8 +272,34 @@ const AllFields = {
|
||||
position: 'sidebar',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'richText',
|
||||
type: 'richText',
|
||||
label: 'Rich Text',
|
||||
required: true,
|
||||
admin: {
|
||||
elements: [
|
||||
'h1',
|
||||
'h2',
|
||||
'h3',
|
||||
'h4',
|
||||
'h5',
|
||||
'h6',
|
||||
'blockquote',
|
||||
'ul',
|
||||
'ol',
|
||||
'link',
|
||||
],
|
||||
leaves: [
|
||||
'bold',
|
||||
'italic',
|
||||
'underline',
|
||||
'strikethrough',
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
timestamps: true,
|
||||
};
|
||||
|
||||
module.exports = AllFields;
|
||||
export default AllFields;
|
||||
12
demo/collections/AutoLabel.ts
Normal file
12
demo/collections/AutoLabel.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
|
||||
const AutoLabel: PayloadCollectionConfig = {
|
||||
slug: 'auto-label',
|
||||
fields: [{
|
||||
name: 'text',
|
||||
type: 'text',
|
||||
label: 'Text',
|
||||
}],
|
||||
};
|
||||
|
||||
export default AutoLabel;
|
||||
@@ -1,26 +0,0 @@
|
||||
const Email = require('../blocks/Email');
|
||||
const Quote = require('../blocks/Quote');
|
||||
const NumberBlock = require('../blocks/Number');
|
||||
const CallToAction = require('../blocks/CallToAction');
|
||||
|
||||
module.exports = {
|
||||
slug: 'blocks',
|
||||
labels: {
|
||||
singular: 'Blocks',
|
||||
plural: 'Blocks',
|
||||
},
|
||||
access: {
|
||||
read: () => true,
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'layout',
|
||||
label: 'Layout Blocks',
|
||||
singularLabel: 'Block',
|
||||
type: 'blocks',
|
||||
blocks: [Email, NumberBlock, Quote, CallToAction],
|
||||
localized: true,
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
43
demo/collections/Blocks.ts
Normal file
43
demo/collections/Blocks.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
import Email from '../blocks/Email';
|
||||
import Quote from '../blocks/Quote';
|
||||
import NumberBlock from '../blocks/Number';
|
||||
import CallToAction from '../blocks/CallToAction';
|
||||
|
||||
const Blocks: PayloadCollectionConfig = {
|
||||
slug: 'blocks',
|
||||
labels: {
|
||||
singular: 'Blocks',
|
||||
plural: 'Blocks',
|
||||
},
|
||||
access: {
|
||||
read: () => true,
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'layout',
|
||||
label: 'Layout Blocks',
|
||||
labels: {
|
||||
singular: 'Block',
|
||||
plural: 'Blocks',
|
||||
},
|
||||
type: 'blocks',
|
||||
blocks: [Email, NumberBlock, Quote, CallToAction],
|
||||
localized: true,
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: 'nonLocalizedLayout',
|
||||
label: 'Non Localized Layout',
|
||||
labels: {
|
||||
singular: 'Layout',
|
||||
plural: 'Layouts',
|
||||
},
|
||||
type: 'blocks',
|
||||
blocks: [Email, NumberBlock, Quote, CallToAction],
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default Blocks;
|
||||
@@ -1,4 +1,6 @@
|
||||
const Code = {
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
|
||||
const Code: PayloadCollectionConfig = {
|
||||
slug: 'code',
|
||||
labels: {
|
||||
singular: 'Code',
|
||||
@@ -10,8 +12,11 @@ const Code = {
|
||||
type: 'code',
|
||||
label: 'Code',
|
||||
required: true,
|
||||
admin: {
|
||||
language: 'js',
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
module.exports = Code;
|
||||
export default Code;
|
||||
@@ -1,4 +1,6 @@
|
||||
const Conditions = {
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
|
||||
const Conditions: PayloadCollectionConfig = {
|
||||
slug: 'conditions',
|
||||
labels: {
|
||||
singular: 'Conditions',
|
||||
@@ -50,4 +52,4 @@ const Conditions = {
|
||||
],
|
||||
};
|
||||
|
||||
module.exports = Conditions;
|
||||
export default Conditions;
|
||||
@@ -1,5 +0,0 @@
|
||||
import React from 'react';
|
||||
|
||||
const Cell = () => <div className="description">fake description cell</div>;
|
||||
|
||||
export default Cell;
|
||||
@@ -0,0 +1,5 @@
|
||||
import React from 'react';
|
||||
|
||||
const Cell: React.FC = () => <div className="description">fake description cell</div>;
|
||||
|
||||
export default Cell;
|
||||
@@ -1,5 +0,0 @@
|
||||
import React from 'react';
|
||||
|
||||
const Description = () => <div className="description">fake description field</div>
|
||||
|
||||
export default Description;
|
||||
@@ -0,0 +1,5 @@
|
||||
import React from 'react';
|
||||
|
||||
const Description: React.FC = () => <div className="description">fake description field</div>;
|
||||
|
||||
export default Description;
|
||||
@@ -1,26 +0,0 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import './index.scss';
|
||||
|
||||
const Filter = ({ onChange, value }) => {
|
||||
return (
|
||||
<input
|
||||
className="custom-description-filter"
|
||||
type="text"
|
||||
onChange={e => onChange(e.target.value)}
|
||||
value={value}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
Filter.defaultProps = {
|
||||
value: '',
|
||||
};
|
||||
|
||||
Filter.propTypes = {
|
||||
onChange: PropTypes.func.isRequired,
|
||||
value: PropTypes.string,
|
||||
};
|
||||
|
||||
export default Filter;
|
||||
@@ -0,0 +1,15 @@
|
||||
import React from 'react';
|
||||
import { Props } from './types';
|
||||
|
||||
import './index.scss';
|
||||
|
||||
const Filter: React.FC<Props> = ({ onChange, value }) => (
|
||||
<input
|
||||
className="custom-description-filter"
|
||||
type="text"
|
||||
onChange={(e) => onChange(e.target.value)}
|
||||
value={value}
|
||||
/>
|
||||
);
|
||||
|
||||
export default Filter;
|
||||
@@ -0,0 +1,4 @@
|
||||
export type Props = {
|
||||
value?: string
|
||||
onChange?: (value: string) => void
|
||||
}
|
||||
@@ -1,14 +1,12 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Group } from '../../../../../../../field-types';
|
||||
import { Group } from '../../../../../../../components/forms';
|
||||
|
||||
const CustomGroup = (props) => {
|
||||
return (
|
||||
<div className="custom-group">
|
||||
<Group {...props} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
const CustomGroup: React.FC = (props) => (
|
||||
<div className="custom-group">
|
||||
<Group {...props} />
|
||||
</div>
|
||||
);
|
||||
|
||||
CustomGroup.defaultProps = {
|
||||
value: '',
|
||||
@@ -1,25 +0,0 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import DefaultList from '../../../../../../src/client/components/views/collections/List/Default';
|
||||
|
||||
import './index.scss';
|
||||
|
||||
const CustomListView = (props) => {
|
||||
return (
|
||||
<div className="custom-list">
|
||||
<p>This is a custom Pages list view</p>
|
||||
<p>Sup</p>
|
||||
<DefaultList {...props} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
CustomListView.propTypes = {
|
||||
collection: PropTypes.shape({
|
||||
labels: PropTypes.shape({
|
||||
plural: PropTypes.string,
|
||||
}),
|
||||
}).isRequired,
|
||||
};
|
||||
|
||||
export default CustomListView;
|
||||
@@ -0,0 +1,14 @@
|
||||
import React from 'react';
|
||||
import DefaultList from '../../../../../../src/admin/components/views/collections/List/Default';
|
||||
|
||||
import './index.scss';
|
||||
|
||||
const CustomListView: React.FC = (props) => (
|
||||
<div className="custom-list">
|
||||
<p>This is a custom Pages list view</p>
|
||||
<p>Sup</p>
|
||||
<DefaultList {...props} />
|
||||
</div>
|
||||
);
|
||||
|
||||
export default CustomListView;
|
||||
@@ -1,6 +1,14 @@
|
||||
const path = require('path');
|
||||
import { PayloadCollectionConfig } from '../../../src/collections/config/types';
|
||||
import DescriptionField from './components/fields/Description/Field';
|
||||
import DescriptionCell from './components/fields/Description/Cell';
|
||||
import DescriptionFilter from './components/fields/Description/Filter';
|
||||
import NestedArrayField from './components/fields/NestedArrayCustomField/Field';
|
||||
import GroupField from './components/fields/Group/Field';
|
||||
import NestedGroupField from './components/fields/NestedGroupCustomField/Field';
|
||||
import NestedText1Field from './components/fields/NestedText1/Field';
|
||||
import ListView from './components/views/List';
|
||||
|
||||
module.exports = {
|
||||
const CustomComponents: PayloadCollectionConfig = {
|
||||
slug: 'custom-components',
|
||||
labels: {
|
||||
singular: 'Custom Component',
|
||||
@@ -20,14 +28,13 @@ module.exports = {
|
||||
name: 'description',
|
||||
label: 'Description',
|
||||
type: 'textarea',
|
||||
height: 100,
|
||||
required: true,
|
||||
localized: true,
|
||||
admin: {
|
||||
components: {
|
||||
field: path.resolve(__dirname, 'components/fields/Description/Field/index.js'),
|
||||
cell: path.resolve(__dirname, 'components/fields/Description/Cell/index.js'),
|
||||
filter: path.resolve(__dirname, 'components/fields/Description/Filter/index.js'),
|
||||
Field: DescriptionField,
|
||||
Cell: DescriptionCell,
|
||||
Filter: DescriptionFilter,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -42,7 +49,7 @@ module.exports = {
|
||||
label: 'Nested Array Custom Field',
|
||||
admin: {
|
||||
components: {
|
||||
field: path.resolve(__dirname, 'components/fields/NestedArrayCustomField/Field/index.js'),
|
||||
Field: NestedArrayField,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -54,7 +61,7 @@ module.exports = {
|
||||
type: 'group',
|
||||
admin: {
|
||||
components: {
|
||||
field: path.resolve(__dirname, 'components/fields/Group/Field/index.js'),
|
||||
Field: GroupField,
|
||||
},
|
||||
},
|
||||
fields: [
|
||||
@@ -64,7 +71,7 @@ module.exports = {
|
||||
label: 'Nested Group Custom Field',
|
||||
admin: {
|
||||
components: {
|
||||
field: path.resolve(__dirname, 'components/fields/NestedGroupCustomField/Field/index.js'),
|
||||
Field: NestedGroupField,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -79,7 +86,7 @@ module.exports = {
|
||||
type: 'text',
|
||||
admin: {
|
||||
components: {
|
||||
field: path.resolve(__dirname, 'components/fields/NestedText1/Field/index.js'),
|
||||
Field: NestedText1Field,
|
||||
},
|
||||
},
|
||||
}, {
|
||||
@@ -95,8 +102,10 @@ module.exports = {
|
||||
useAsTitle: 'title',
|
||||
components: {
|
||||
views: {
|
||||
List: path.resolve(__dirname, 'components/views/List/index.js'),
|
||||
List: ListView,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default CustomComponents;
|
||||
287
demo/collections/DefaultValues.ts
Normal file
287
demo/collections/DefaultValues.ts
Normal file
@@ -0,0 +1,287 @@
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
import checkRole from '../access/checkRole';
|
||||
import Email from '../blocks/Email';
|
||||
import Quote from '../blocks/Quote';
|
||||
import NumberBlock from '../blocks/Number';
|
||||
import CallToAction from '../blocks/CallToAction';
|
||||
|
||||
const DefaultValues: PayloadCollectionConfig = {
|
||||
slug: 'default-values',
|
||||
labels: {
|
||||
singular: 'Default Value Test',
|
||||
plural: 'Default Value Tests',
|
||||
},
|
||||
admin: {
|
||||
useAsTitle: 'text',
|
||||
},
|
||||
access: {
|
||||
read: () => true,
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'text',
|
||||
type: 'text',
|
||||
label: 'Text',
|
||||
defaultValue: 'Default Value',
|
||||
unique: true,
|
||||
access: {
|
||||
create: ({ req: { user } }) => checkRole(['admin'], user),
|
||||
update: ({ req: { user } }) => checkRole(['admin'], user),
|
||||
read: ({ req: { user } }) => Boolean(user),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'image',
|
||||
type: 'upload',
|
||||
label: 'Image',
|
||||
relationTo: 'media',
|
||||
},
|
||||
{
|
||||
name: 'select',
|
||||
label: 'Select',
|
||||
type: 'select',
|
||||
options: [{
|
||||
value: 'option-1',
|
||||
label: 'Option 1 Label',
|
||||
}, {
|
||||
value: 'option-2',
|
||||
label: 'Option 2 Label',
|
||||
}, {
|
||||
value: 'option-3',
|
||||
label: 'Option 3 Label',
|
||||
}, {
|
||||
value: 'option-4',
|
||||
label: 'Option 4 Label',
|
||||
}],
|
||||
defaultValue: 'option-1',
|
||||
},
|
||||
{
|
||||
name: 'selectMany',
|
||||
label: 'Select w/ hasMany',
|
||||
type: 'select',
|
||||
options: [{
|
||||
value: 'option-1',
|
||||
label: 'Option 1 Label',
|
||||
}, {
|
||||
value: 'option-2',
|
||||
label: 'Option 2 Label',
|
||||
}, {
|
||||
value: 'option-3',
|
||||
label: 'Option 3 Label',
|
||||
}, {
|
||||
value: 'option-4',
|
||||
label: 'Option 4 Label',
|
||||
}],
|
||||
defaultValue: ['option-1', 'option-4'],
|
||||
hasMany: true,
|
||||
},
|
||||
{
|
||||
name: 'radioGroupExample',
|
||||
label: 'Radio Group Example',
|
||||
type: 'radio',
|
||||
options: [{
|
||||
value: 'option-1',
|
||||
label: 'Options 1 Label',
|
||||
}, {
|
||||
value: 'option-2',
|
||||
label: 'Option 2 Label',
|
||||
}, {
|
||||
value: 'option-3',
|
||||
label: 'Option 3 Label',
|
||||
}],
|
||||
defaultValue: 'option-2',
|
||||
},
|
||||
{
|
||||
type: 'row',
|
||||
fields: [
|
||||
{
|
||||
name: 'email',
|
||||
label: 'Email',
|
||||
type: 'email',
|
||||
defaultValue: 'some@email.com',
|
||||
}, {
|
||||
name: 'number',
|
||||
label: 'Number',
|
||||
type: 'number',
|
||||
defaultValue: 5,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'group',
|
||||
label: 'Group',
|
||||
name: 'group',
|
||||
defaultValue: {
|
||||
nestedText1: 'neat',
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
type: 'row',
|
||||
fields: [
|
||||
{
|
||||
name: 'nestedText1',
|
||||
label: 'Nested Text 1',
|
||||
type: 'text',
|
||||
defaultValue: 'nested default text 1',
|
||||
}, {
|
||||
name: 'nestedText2',
|
||||
label: 'Nested Text 2',
|
||||
type: 'text',
|
||||
defaultValue: 'nested default text 2',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'array',
|
||||
label: 'Array',
|
||||
name: 'array',
|
||||
admin: {
|
||||
readOnly: true,
|
||||
},
|
||||
defaultValue: [
|
||||
{
|
||||
arrayText1: 'Get out',
|
||||
},
|
||||
],
|
||||
fields: [
|
||||
{
|
||||
type: 'row',
|
||||
fields: [
|
||||
{
|
||||
name: 'arrayText1',
|
||||
label: 'Array Text 1',
|
||||
type: 'text',
|
||||
admin: {
|
||||
width: '50%',
|
||||
},
|
||||
defaultValue: 'default array text',
|
||||
},
|
||||
{
|
||||
name: 'arrayText2',
|
||||
label: 'Array Text 2',
|
||||
type: 'text',
|
||||
admin: {
|
||||
width: '50%',
|
||||
},
|
||||
access: {
|
||||
read: ({ req: { user } }) => Boolean(user),
|
||||
update: ({ req: { user } }) => checkRole(['admin'], user),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
name: 'arrayText3',
|
||||
label: 'Array Text 3',
|
||||
admin: {
|
||||
readOnly: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'checkbox',
|
||||
label: 'Checkbox',
|
||||
type: 'checkbox',
|
||||
defaultValue: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'blocks',
|
||||
label: 'Blocks Content',
|
||||
name: 'blocks',
|
||||
labels: {
|
||||
singular: 'Block',
|
||||
plural: 'Blocks',
|
||||
},
|
||||
blocks: [Email, NumberBlock, Quote, CallToAction],
|
||||
localized: true,
|
||||
admin: {
|
||||
readOnly: true,
|
||||
},
|
||||
defaultValue: [
|
||||
{
|
||||
blockType: 'email',
|
||||
testEmail: 'dev@payloadcms.com',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'relationship',
|
||||
label: 'Relationship to One Collection',
|
||||
name: 'relationship',
|
||||
relationTo: 'conditions',
|
||||
},
|
||||
{
|
||||
type: 'relationship',
|
||||
label: 'Relationship hasMany',
|
||||
name: 'relationshipHasMany',
|
||||
relationTo: 'localized-posts',
|
||||
hasMany: true,
|
||||
},
|
||||
{
|
||||
type: 'relationship',
|
||||
label: 'Relationship to Multiple Collections',
|
||||
name: 'relationshipMultipleCollections',
|
||||
relationTo: ['localized-posts', 'conditions'],
|
||||
},
|
||||
{
|
||||
type: 'textarea',
|
||||
label: 'Textarea',
|
||||
name: 'textarea',
|
||||
defaultValue: 'my textarea text',
|
||||
},
|
||||
{
|
||||
name: 'slug',
|
||||
type: 'text',
|
||||
label: 'Slug',
|
||||
admin: {
|
||||
position: 'sidebar',
|
||||
},
|
||||
localized: true,
|
||||
unique: true,
|
||||
defaultValue: 'my-slug',
|
||||
},
|
||||
{
|
||||
name: 'checkbox',
|
||||
type: 'checkbox',
|
||||
label: 'Checkbox',
|
||||
admin: {
|
||||
position: 'sidebar',
|
||||
},
|
||||
defaultValue: true,
|
||||
},
|
||||
{
|
||||
name: 'richText',
|
||||
type: 'richText',
|
||||
label: 'Rich Text',
|
||||
admin: {
|
||||
elements: [
|
||||
'h1',
|
||||
'h2',
|
||||
'h3',
|
||||
'h4',
|
||||
'h5',
|
||||
'h6',
|
||||
'blockquote',
|
||||
'ul',
|
||||
'ol',
|
||||
'link',
|
||||
],
|
||||
leaves: [
|
||||
'bold',
|
||||
'italic',
|
||||
'underline',
|
||||
'strikethrough',
|
||||
],
|
||||
},
|
||||
defaultValue: [{
|
||||
children: [{ text: 'Cookin now' }],
|
||||
}],
|
||||
},
|
||||
],
|
||||
timestamps: true,
|
||||
};
|
||||
export default DefaultValues;
|
||||
@@ -1,5 +1,5 @@
|
||||
const path = require('path');
|
||||
const checkRole = require('../access/checkRole');
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
import checkRole from '../access/checkRole';
|
||||
|
||||
const access = ({ req: { user } }) => {
|
||||
const isAdmin = checkRole(['admin'], user);
|
||||
@@ -15,9 +15,11 @@ const access = ({ req: { user } }) => {
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
const Files: PayloadCollectionConfig = {
|
||||
slug: 'files',
|
||||
labels: {
|
||||
singular: 'File',
|
||||
@@ -25,7 +27,7 @@ module.exports = {
|
||||
},
|
||||
upload: {
|
||||
staticURL: '/files',
|
||||
staticDir: path.resolve(__dirname, '../files'),
|
||||
staticDir: './files',
|
||||
},
|
||||
access: {
|
||||
create: () => true,
|
||||
@@ -64,3 +66,5 @@ module.exports = {
|
||||
useAsTitle: 'filename',
|
||||
},
|
||||
};
|
||||
|
||||
export default Files;
|
||||
@@ -1,4 +1,6 @@
|
||||
const HiddenFields = {
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
|
||||
const HiddenFields: PayloadCollectionConfig = {
|
||||
slug: 'hidden-fields',
|
||||
labels: {
|
||||
singular: 'Hidden Fields',
|
||||
@@ -15,7 +17,9 @@ const HiddenFields = {
|
||||
name: 'hiddenAdmin',
|
||||
type: 'text',
|
||||
label: 'Hidden on Admin',
|
||||
hidden: 'admin',
|
||||
admin: {
|
||||
hidden: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
@@ -28,4 +32,4 @@ const HiddenFields = {
|
||||
],
|
||||
};
|
||||
|
||||
module.exports = HiddenFields;
|
||||
export default HiddenFields;
|
||||
@@ -1,5 +1,8 @@
|
||||
/* eslint-disable no-param-reassign */
|
||||
module.exports = {
|
||||
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
|
||||
const Hooks: PayloadCollectionConfig = {
|
||||
slug: 'hooks',
|
||||
labels: {
|
||||
singular: 'Hook',
|
||||
@@ -25,7 +28,7 @@ module.exports = {
|
||||
beforeChange: [
|
||||
(operation) => {
|
||||
if (operation.req.headers.hook === 'beforeChange') {
|
||||
operation.req.body.description += '-beforeChangeSuffix';
|
||||
operation.data.description += '-beforeChangeSuffix';
|
||||
}
|
||||
return operation.data;
|
||||
},
|
||||
@@ -82,10 +85,11 @@ module.exports = {
|
||||
name: 'description',
|
||||
label: 'Description',
|
||||
type: 'textarea',
|
||||
height: 100,
|
||||
required: true,
|
||||
localized: true,
|
||||
},
|
||||
],
|
||||
timestamps: true,
|
||||
};
|
||||
|
||||
export default Hooks;
|
||||
@@ -1,4 +1,6 @@
|
||||
const LocalOperations = {
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
|
||||
const LocalOperations: PayloadCollectionConfig = {
|
||||
slug: 'local-operations',
|
||||
labels: {
|
||||
singular: 'Local Operation',
|
||||
@@ -12,7 +14,12 @@ const LocalOperations = {
|
||||
collection: 'localized-posts',
|
||||
});
|
||||
|
||||
const blocksGlobal = await req.payload.findGlobal({
|
||||
global: 'blocks-global',
|
||||
});
|
||||
|
||||
formattedData.localizedPosts = localizedPosts;
|
||||
formattedData.blocksGlobal = blocksGlobal;
|
||||
|
||||
return formattedData;
|
||||
},
|
||||
@@ -28,4 +35,4 @@ const LocalOperations = {
|
||||
],
|
||||
};
|
||||
|
||||
module.exports = LocalOperations;
|
||||
export default LocalOperations;
|
||||
@@ -1,52 +0,0 @@
|
||||
module.exports = {
|
||||
slug: 'localized-posts',
|
||||
labels: {
|
||||
singular: 'Localized Post',
|
||||
plural: 'Localized Posts',
|
||||
},
|
||||
admin: {
|
||||
useAsTitle: 'title',
|
||||
defaultColumns: [
|
||||
'title',
|
||||
'priority',
|
||||
'createdAt',
|
||||
],
|
||||
},
|
||||
access: {
|
||||
read: () => true,
|
||||
},
|
||||
preview: (doc, token) => {
|
||||
if (doc && doc.title) {
|
||||
return `http://localhost:3000/posts/${doc.title.value}?preview=true&token=${token}`;
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'title',
|
||||
label: 'Title',
|
||||
type: 'text',
|
||||
maxLength: 100,
|
||||
required: true,
|
||||
unique: true,
|
||||
localized: true,
|
||||
},
|
||||
{
|
||||
name: 'description',
|
||||
label: 'Description',
|
||||
type: 'textarea',
|
||||
height: 100,
|
||||
required: true,
|
||||
localized: true,
|
||||
},
|
||||
{
|
||||
name: 'priority',
|
||||
label: 'Priority',
|
||||
type: 'number',
|
||||
required: true,
|
||||
localized: true,
|
||||
},
|
||||
],
|
||||
timestamps: true,
|
||||
};
|
||||
124
demo/collections/Localized.ts
Normal file
124
demo/collections/Localized.ts
Normal file
@@ -0,0 +1,124 @@
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
import { Block } from '../../src/fields/config/types';
|
||||
|
||||
const RichTextBlock: Block = {
|
||||
slug: 'richTextBlock',
|
||||
labels: {
|
||||
singular: 'Rich Text Block',
|
||||
plural: 'Rich Text Blocks',
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'content',
|
||||
localized: true,
|
||||
type: 'richText',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const LocalizedPosts: PayloadCollectionConfig = {
|
||||
slug: 'localized-posts',
|
||||
labels: {
|
||||
singular: 'Localized Post',
|
||||
plural: 'Localized Posts',
|
||||
},
|
||||
admin: {
|
||||
useAsTitle: 'title',
|
||||
defaultColumns: [
|
||||
'title',
|
||||
'priority',
|
||||
'createdAt',
|
||||
],
|
||||
enableRichTextRelationship: true,
|
||||
},
|
||||
access: {
|
||||
read: () => true,
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'title',
|
||||
label: 'Title',
|
||||
type: 'text',
|
||||
maxLength: 100,
|
||||
required: true,
|
||||
unique: true,
|
||||
localized: true,
|
||||
},
|
||||
{
|
||||
name: 'summary',
|
||||
label: 'Summary',
|
||||
type: 'text',
|
||||
index: true,
|
||||
},
|
||||
{
|
||||
name: 'description',
|
||||
label: 'Description',
|
||||
type: 'textarea',
|
||||
required: true,
|
||||
localized: true,
|
||||
},
|
||||
{
|
||||
type: 'richText',
|
||||
name: 'richText',
|
||||
label: 'Rich Text',
|
||||
},
|
||||
{
|
||||
name: 'priority',
|
||||
label: 'Priority',
|
||||
type: 'number',
|
||||
required: true,
|
||||
localized: true,
|
||||
},
|
||||
{
|
||||
name: 'localizedGroup',
|
||||
label: 'Localized Group',
|
||||
type: 'group',
|
||||
localized: true,
|
||||
fields: [
|
||||
{
|
||||
type: 'text',
|
||||
name: 'text',
|
||||
label: 'Text',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'nonLocalizedGroup',
|
||||
label: 'Non-Localized Group',
|
||||
type: 'group',
|
||||
fields: [
|
||||
{
|
||||
type: 'text',
|
||||
name: 'text',
|
||||
label: 'Text',
|
||||
localized: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'array',
|
||||
label: 'Non-Localized Array',
|
||||
name: 'nonLocalizedArray',
|
||||
maxRows: 3,
|
||||
fields: [
|
||||
{
|
||||
type: 'text',
|
||||
name: 'localizedEmbeddedText',
|
||||
label: 'Localized Embedded Text',
|
||||
localized: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: 'Blocks',
|
||||
name: 'richTextBlocks',
|
||||
type: 'blocks',
|
||||
blocks: [
|
||||
RichTextBlock,
|
||||
],
|
||||
},
|
||||
],
|
||||
timestamps: true,
|
||||
};
|
||||
|
||||
export default LocalizedPosts;
|
||||
@@ -1,4 +1,18 @@
|
||||
const LocalizedArrays = {
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
import { FieldAccess } from '../../src/fields/config/types';
|
||||
import checkRole from '../access/checkRole';
|
||||
|
||||
const PublicReadabilityAccess: FieldAccess = ({ req: { user }, siblingData }) => {
|
||||
if (checkRole(['admin'], user)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (siblingData.allowPublicReadability) return true;
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
const LocalizedArrays: PayloadCollectionConfig = {
|
||||
slug: 'localized-arrays',
|
||||
labels: {
|
||||
singular: 'Localized Array',
|
||||
@@ -20,16 +34,31 @@ const LocalizedArrays = {
|
||||
{
|
||||
type: 'row',
|
||||
fields: [
|
||||
{
|
||||
name: 'allowPublicReadability',
|
||||
label: 'Allow Public Readability',
|
||||
type: 'checkbox',
|
||||
},
|
||||
{
|
||||
name: 'arrayText1',
|
||||
label: 'Array Text 1',
|
||||
type: 'text',
|
||||
required: true,
|
||||
}, {
|
||||
admin: {
|
||||
width: '50%',
|
||||
},
|
||||
access: {
|
||||
read: PublicReadabilityAccess,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'arrayText2',
|
||||
label: 'Array Text 2',
|
||||
type: 'text',
|
||||
required: true,
|
||||
admin: {
|
||||
width: '50%',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -47,4 +76,4 @@ const LocalizedArrays = {
|
||||
timestamps: true,
|
||||
};
|
||||
|
||||
module.exports = LocalizedArrays;
|
||||
export default LocalizedArrays;
|
||||
@@ -1,7 +1,6 @@
|
||||
const path = require('path');
|
||||
const checkRole = require('../access/checkRole');
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
|
||||
module.exports = {
|
||||
const Media: PayloadCollectionConfig = {
|
||||
slug: 'media',
|
||||
labels: {
|
||||
singular: 'Media',
|
||||
@@ -10,10 +9,13 @@ module.exports = {
|
||||
access: {
|
||||
read: () => true,
|
||||
},
|
||||
admin: {
|
||||
enableRichTextRelationship: true,
|
||||
},
|
||||
upload: {
|
||||
staticURL: '/media',
|
||||
staticDir: path.resolve(__dirname, '../media'),
|
||||
adminThumbnail: 'mobile',
|
||||
staticDir: './media',
|
||||
adminThumbnail: ({ doc }) => `/media/${doc.filename}`,
|
||||
imageSizes: [
|
||||
{
|
||||
name: 'tablet',
|
||||
@@ -41,26 +43,9 @@ module.exports = {
|
||||
type: 'text',
|
||||
required: true,
|
||||
localized: true,
|
||||
hooks: {
|
||||
afterRead: [
|
||||
({ value }) => `${value} alt`,
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'sizes',
|
||||
fields: [
|
||||
{
|
||||
name: 'icon',
|
||||
access: {
|
||||
read: ({ req: { user } }) => {
|
||||
const result = checkRole(['admin'], user);
|
||||
return result;
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
timestamps: true,
|
||||
};
|
||||
|
||||
export default Media;
|
||||
@@ -1,4 +1,6 @@
|
||||
const NestedArray = {
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
|
||||
const NestedArray: PayloadCollectionConfig = {
|
||||
slug: 'nested-arrays',
|
||||
labels: {
|
||||
singular: 'Nested Array',
|
||||
@@ -23,7 +25,7 @@ const NestedArray = {
|
||||
{
|
||||
name: 'parentIdentifier',
|
||||
label: 'Parent Identifier',
|
||||
defaultValue: '',
|
||||
defaultValue: ' ',
|
||||
type: 'text',
|
||||
required: true,
|
||||
},
|
||||
@@ -55,7 +57,6 @@ const NestedArray = {
|
||||
name: 'grandchildIdentifier',
|
||||
label: 'Grandchild Identifier',
|
||||
type: 'text',
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -67,4 +68,4 @@ const NestedArray = {
|
||||
timestamps: true,
|
||||
};
|
||||
|
||||
module.exports = NestedArray;
|
||||
export default NestedArray;
|
||||
@@ -1,4 +1,6 @@
|
||||
module.exports = {
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
|
||||
const Preview: PayloadCollectionConfig = {
|
||||
slug: 'previewable-post',
|
||||
labels: {
|
||||
singular: 'Previewable Post',
|
||||
@@ -6,13 +8,13 @@ module.exports = {
|
||||
},
|
||||
admin: {
|
||||
useAsTitle: 'title',
|
||||
},
|
||||
preview: (doc, token) => {
|
||||
if (doc.title) {
|
||||
return `http://localhost:3000/previewable-posts/${doc.title.value}?preview=true&token=${token}`;
|
||||
}
|
||||
preview: (doc, token) => {
|
||||
if (doc.title) {
|
||||
return `http://localhost:3000/previewable-posts/${doc.title}?preview=true&token=${token}`;
|
||||
}
|
||||
|
||||
return null;
|
||||
return null;
|
||||
},
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
@@ -27,3 +29,5 @@ module.exports = {
|
||||
],
|
||||
timestamps: true,
|
||||
};
|
||||
|
||||
export default Preview;
|
||||
@@ -1,8 +1,9 @@
|
||||
const checkRole = require('../access/checkRole');
|
||||
import checkRole from '../access/checkRole';
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
|
||||
const access = ({ req: { user } }) => checkRole(['admin'], user);
|
||||
|
||||
module.exports = {
|
||||
const PublicUsers: PayloadCollectionConfig = {
|
||||
slug: 'public-users',
|
||||
labels: {
|
||||
singular: 'Public User',
|
||||
@@ -32,7 +33,14 @@ module.exports = {
|
||||
},
|
||||
auth: {
|
||||
tokenExpiration: 300,
|
||||
secureCookie: process.env.NODE_ENV === 'production',
|
||||
verify: true,
|
||||
maxLoginAttempts: 5,
|
||||
lockTime: 600 * 1000, // lock time in ms
|
||||
cookies: {
|
||||
secure: process.env.NODE_ENV === 'production',
|
||||
sameSite: 'lax',
|
||||
domain: undefined,
|
||||
},
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
@@ -49,3 +57,5 @@ module.exports = {
|
||||
],
|
||||
timestamps: true,
|
||||
};
|
||||
|
||||
export default PublicUsers;
|
||||
@@ -1,20 +0,0 @@
|
||||
module.exports = {
|
||||
slug: 'relationship-a',
|
||||
access: {
|
||||
read: () => true,
|
||||
},
|
||||
labels: {
|
||||
singular: 'Relationship A',
|
||||
plural: 'Relationship A',
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'post',
|
||||
label: 'Post',
|
||||
type: 'relationship',
|
||||
relationTo: 'relationship-b',
|
||||
localized: false,
|
||||
},
|
||||
],
|
||||
timestamps: true,
|
||||
};
|
||||
48
demo/collections/RelationshipA.ts
Normal file
48
demo/collections/RelationshipA.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
|
||||
const RelationshipA: PayloadCollectionConfig = {
|
||||
slug: 'relationship-a',
|
||||
access: {
|
||||
read: () => true,
|
||||
},
|
||||
labels: {
|
||||
singular: 'Relationship A',
|
||||
plural: 'Relationship A',
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'post',
|
||||
label: 'Post',
|
||||
type: 'relationship',
|
||||
relationTo: 'relationship-b',
|
||||
localized: true,
|
||||
},
|
||||
{
|
||||
name: 'LocalizedPost',
|
||||
label: 'Localized Post',
|
||||
type: 'relationship',
|
||||
relationTo: 'localized-posts',
|
||||
hasMany: true,
|
||||
localized: true,
|
||||
},
|
||||
{
|
||||
name: 'postLocalizedMultiple',
|
||||
label: 'Localized Post Multiple',
|
||||
type: 'relationship',
|
||||
relationTo: ['localized-posts', 'all-fields'],
|
||||
hasMany: true,
|
||||
localized: true,
|
||||
},
|
||||
{
|
||||
name: 'postManyRelationships',
|
||||
label: 'Post Many Relationships',
|
||||
type: 'relationship',
|
||||
relationTo: ['relationship-b'],
|
||||
localized: true,
|
||||
hasMany: false,
|
||||
},
|
||||
],
|
||||
timestamps: true,
|
||||
};
|
||||
|
||||
export default RelationshipA;
|
||||
@@ -1,21 +0,0 @@
|
||||
module.exports = {
|
||||
slug: 'relationship-b',
|
||||
access: {
|
||||
read: () => true,
|
||||
},
|
||||
labels: {
|
||||
singular: 'Relationship B',
|
||||
plural: 'Relationship B',
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'post',
|
||||
label: 'Post',
|
||||
type: 'relationship',
|
||||
relationTo: 'relationship-a',
|
||||
localized: false,
|
||||
hasMany: true,
|
||||
},
|
||||
],
|
||||
timestamps: true,
|
||||
};
|
||||
33
demo/collections/RelationshipB.ts
Normal file
33
demo/collections/RelationshipB.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
|
||||
const RelationshipB: PayloadCollectionConfig = {
|
||||
slug: 'relationship-b',
|
||||
access: {
|
||||
read: () => true,
|
||||
},
|
||||
labels: {
|
||||
singular: 'Relationship B',
|
||||
plural: 'Relationship B',
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'post',
|
||||
label: 'Post',
|
||||
type: 'relationship',
|
||||
relationTo: 'relationship-a',
|
||||
localized: false,
|
||||
hasMany: true,
|
||||
},
|
||||
{
|
||||
name: 'postManyRelationships',
|
||||
label: 'Post Many Relationships',
|
||||
type: 'relationship',
|
||||
relationTo: ['relationship-a'],
|
||||
localized: true,
|
||||
hasMany: false,
|
||||
},
|
||||
],
|
||||
timestamps: true,
|
||||
};
|
||||
|
||||
export default RelationshipB;
|
||||
@@ -1,19 +0,0 @@
|
||||
const RichText = {
|
||||
slug: 'rich-text',
|
||||
labels: {
|
||||
singular: 'Rich Text',
|
||||
plural: 'Rich Texts',
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'richText',
|
||||
type: 'richText',
|
||||
label: 'Rich Text',
|
||||
required: true,
|
||||
disabledElements: [],
|
||||
disabledMarks: [],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
module.exports = RichText;
|
||||
38
demo/collections/RichText.ts
Normal file
38
demo/collections/RichText.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import Button from '../client/components/richText/elements/Button';
|
||||
import PurpleBackground from '../client/components/richText/leaves/PurpleBackground';
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
|
||||
const RichText: PayloadCollectionConfig = {
|
||||
slug: 'rich-text',
|
||||
labels: {
|
||||
singular: 'Rich Text',
|
||||
plural: 'Rich Texts',
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'defaultRichText',
|
||||
type: 'richText',
|
||||
label: 'Default Rich Text',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: 'customRichText',
|
||||
type: 'richText',
|
||||
label: 'Customized Rich Text',
|
||||
required: true,
|
||||
admin: {
|
||||
elements: [
|
||||
'h2',
|
||||
'h3',
|
||||
Button,
|
||||
],
|
||||
leaves: [
|
||||
'bold',
|
||||
PurpleBackground,
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default RichText;
|
||||
45
demo/collections/Select.ts
Normal file
45
demo/collections/Select.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
|
||||
const Select: PayloadCollectionConfig = {
|
||||
slug: 'select',
|
||||
labels: {
|
||||
singular: 'Select',
|
||||
plural: 'Selects',
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'Select',
|
||||
type: 'select',
|
||||
options: [{
|
||||
value: 'one',
|
||||
label: 'One',
|
||||
}, {
|
||||
value: 'two',
|
||||
label: 'Two',
|
||||
}, {
|
||||
value: 'three',
|
||||
label: 'Three',
|
||||
}],
|
||||
label: 'Select From',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: 'Radio',
|
||||
type: 'radio',
|
||||
options: [{
|
||||
value: 'one',
|
||||
label: 'One',
|
||||
}, {
|
||||
value: 'two',
|
||||
label: 'Two',
|
||||
}, {
|
||||
value: 'three',
|
||||
label: 'Three',
|
||||
}],
|
||||
label: 'Choose From',
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default Select;
|
||||
@@ -1,6 +1,7 @@
|
||||
const checkRole = require('../access/checkRole');
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
import checkRole from '../access/checkRole';
|
||||
|
||||
module.exports = {
|
||||
const StrictAccess: PayloadCollectionConfig = {
|
||||
slug: 'strict-access',
|
||||
labels: {
|
||||
singular: 'Strict Access',
|
||||
@@ -71,3 +72,5 @@ module.exports = {
|
||||
],
|
||||
timestamps: true,
|
||||
};
|
||||
|
||||
export default StrictAccess;
|
||||
25
demo/collections/Uniques.ts
Normal file
25
demo/collections/Uniques.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
|
||||
const Uniques: PayloadCollectionConfig = {
|
||||
slug: 'uniques',
|
||||
labels: {
|
||||
singular: 'Unique',
|
||||
plural: 'Uniques',
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'title',
|
||||
type: 'text',
|
||||
label: 'Title',
|
||||
required: true,
|
||||
unique: true,
|
||||
},
|
||||
{
|
||||
name: 'description',
|
||||
type: 'textarea',
|
||||
label: 'Description',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default Uniques;
|
||||
@@ -1,4 +1,6 @@
|
||||
module.exports = {
|
||||
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
||||
|
||||
const Validations: PayloadCollectionConfig = {
|
||||
slug: 'validations',
|
||||
labels: {
|
||||
singular: 'Validation',
|
||||
@@ -106,5 +108,6 @@ module.exports = {
|
||||
],
|
||||
},
|
||||
],
|
||||
timestamps: true,
|
||||
};
|
||||
|
||||
export default Validations;
|
||||
15
demo/custom-index.html
Normal file
15
demo/custom-index.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="application-name" content="My Payload Application" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<div id="portal"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
5
demo/customComponents/views/Account/index.tsx
Normal file
5
demo/customComponents/views/Account/index.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import React from 'react';
|
||||
|
||||
const CustomAccountView: React.FC = () => <div>fake account view</div>;
|
||||
|
||||
export default CustomAccountView;
|
||||
5
demo/customComponents/views/Dashboard/index.tsx
Normal file
5
demo/customComponents/views/Dashboard/index.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import React from 'react';
|
||||
|
||||
const CustomDashboardView: React.FC = () => <div>fake dashboard view</div>;
|
||||
|
||||
export default CustomDashboardView;
|
||||
@@ -1,8 +1,9 @@
|
||||
const checkRole = require('../access/checkRole');
|
||||
const Quote = require('../blocks/Quote');
|
||||
const CallToAction = require('../blocks/CallToAction');
|
||||
import checkRole from '../access/checkRole';
|
||||
import Quote from '../blocks/Quote';
|
||||
import CallToAction from '../blocks/CallToAction';
|
||||
import { PayloadGlobalConfig } from '../../src/globals/config/types';
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
slug: 'blocks-global',
|
||||
label: 'Blocks Global',
|
||||
access: {
|
||||
@@ -18,4 +19,4 @@ module.exports = {
|
||||
localized: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
} as PayloadGlobalConfig;
|
||||
@@ -1,6 +1,7 @@
|
||||
const checkRole = require('../access/checkRole');
|
||||
import { PayloadGlobalConfig } from '../../src/globals/config/types';
|
||||
import checkRole from '../access/checkRole';
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
slug: 'global-with-access',
|
||||
label: 'Global with Strict Access',
|
||||
access: {
|
||||
@@ -31,4 +32,4 @@ module.exports = {
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
} as PayloadGlobalConfig;
|
||||
@@ -1,6 +1,7 @@
|
||||
const checkRole = require('../access/checkRole');
|
||||
import { PayloadGlobalConfig } from '../../src/globals/config/types';
|
||||
import checkRole from '../access/checkRole';
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
slug: 'navigation-array',
|
||||
label: 'Navigation Array',
|
||||
access: {
|
||||
@@ -24,4 +25,4 @@ module.exports = {
|
||||
}],
|
||||
},
|
||||
],
|
||||
};
|
||||
} as PayloadGlobalConfig;
|
||||
14
demo/index.js
Normal file
14
demo/index.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const babelConfig = require('../babel.config');
|
||||
|
||||
require('@babel/register')({
|
||||
...babelConfig,
|
||||
extensions: ['.ts', '.tsx', '.js', '.jsx'],
|
||||
env: {
|
||||
development: {
|
||||
sourceMaps: 'inline',
|
||||
retainLines: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
require('./server.ts');
|
||||
@@ -1,99 +0,0 @@
|
||||
const path = require('path');
|
||||
const Admin = require('./collections/Admin');
|
||||
const AllFields = require('./collections/AllFields');
|
||||
const Code = require('./collections/Code');
|
||||
const Conditions = require('./collections/Conditions');
|
||||
const CustomComponents = require('./collections/CustomComponents');
|
||||
const File = require('./collections/File');
|
||||
const Blocks = require('./collections/Blocks');
|
||||
const HiddenFields = require('./collections/HiddenFields');
|
||||
const Hooks = require('./collections/Hooks');
|
||||
const Localized = require('./collections/Localized');
|
||||
const LocalizedArray = require('./collections/LocalizedArray');
|
||||
const LocalOperations = require('./collections/LocalOperations');
|
||||
const Media = require('./collections/Media');
|
||||
const NestedArrays = require('./collections/NestedArrays');
|
||||
const Preview = require('./collections/Preview');
|
||||
const PublicUsers = require('./collections/PublicUsers');
|
||||
const RelationshipA = require('./collections/RelationshipA');
|
||||
const RelationshipB = require('./collections/RelationshipB');
|
||||
const RichText = require('./collections/RichText');
|
||||
const StrictPolicies = require('./collections/StrictPolicies');
|
||||
const Validations = require('./collections/Validations');
|
||||
|
||||
const BlocksGlobal = require('./globals/BlocksGlobal');
|
||||
const NavigationArray = require('./globals/NavigationArray');
|
||||
const GlobalWithStrictAccess = require('./globals/GlobalWithStrictAccess');
|
||||
|
||||
module.exports = {
|
||||
admin: {
|
||||
user: 'admins',
|
||||
disable: false,
|
||||
components: {
|
||||
layout: {
|
||||
// Sidebar: path.resolve(__dirname, 'client/components/layout/Sidebar/index.js'),
|
||||
},
|
||||
},
|
||||
},
|
||||
collections: [
|
||||
Admin,
|
||||
AllFields,
|
||||
Code,
|
||||
Conditions,
|
||||
CustomComponents,
|
||||
File,
|
||||
Blocks,
|
||||
HiddenFields,
|
||||
Hooks,
|
||||
Localized,
|
||||
LocalizedArray,
|
||||
LocalOperations,
|
||||
Media,
|
||||
NestedArrays,
|
||||
Preview,
|
||||
PublicUsers,
|
||||
RelationshipA,
|
||||
RelationshipB,
|
||||
RichText,
|
||||
StrictPolicies,
|
||||
Validations,
|
||||
],
|
||||
globals: [
|
||||
NavigationArray,
|
||||
GlobalWithStrictAccess,
|
||||
BlocksGlobal,
|
||||
],
|
||||
cookiePrefix: 'payload',
|
||||
serverURL: 'http://localhost:3000',
|
||||
cors: ['http://localhost', 'http://localhost:8080', 'http://localhost:8081'],
|
||||
routes: {
|
||||
api: '/api',
|
||||
admin: '/admin',
|
||||
graphQL: '/graphql',
|
||||
graphQLPlayground: '/graphql-playground',
|
||||
},
|
||||
defaultDepth: 2,
|
||||
compression: {},
|
||||
paths: {
|
||||
scss: path.resolve(__dirname, 'client/scss/overrides.scss'),
|
||||
},
|
||||
graphQL: {
|
||||
mutations: {},
|
||||
queries: {},
|
||||
},
|
||||
localization: {
|
||||
locales: [
|
||||
'en',
|
||||
'es',
|
||||
],
|
||||
defaultLocale: 'en',
|
||||
fallback: true,
|
||||
},
|
||||
productionGraphQLPlayground: false,
|
||||
hooks: {
|
||||
afterError: () => {
|
||||
console.error('global error config handler');
|
||||
},
|
||||
},
|
||||
webpack: (config) => config,
|
||||
};
|
||||
139
demo/payload.config.ts
Normal file
139
demo/payload.config.ts
Normal file
@@ -0,0 +1,139 @@
|
||||
import path from 'path';
|
||||
import { buildConfig } from '../src/config/build';
|
||||
|
||||
import Admin from './collections/Admin';
|
||||
import AllFields from './collections/AllFields';
|
||||
import AutoLabel from './collections/AutoLabel';
|
||||
import Code from './collections/Code';
|
||||
import Conditions from './collections/Conditions';
|
||||
import CustomComponents from './collections/CustomComponents';
|
||||
import File from './collections/File';
|
||||
import Blocks from './collections/Blocks';
|
||||
import DefaultValues from './collections/DefaultValues';
|
||||
import HiddenFields from './collections/HiddenFields';
|
||||
import Hooks from './collections/Hooks';
|
||||
import Localized from './collections/Localized';
|
||||
import LocalizedArray from './collections/LocalizedArray';
|
||||
import LocalOperations from './collections/LocalOperations';
|
||||
import Media from './collections/Media';
|
||||
import NestedArrays from './collections/NestedArrays';
|
||||
import Preview from './collections/Preview';
|
||||
import PublicUsers from './collections/PublicUsers';
|
||||
import RelationshipA from './collections/RelationshipA';
|
||||
import RelationshipB from './collections/RelationshipB';
|
||||
import RichText from './collections/RichText';
|
||||
import Select from './collections/Select';
|
||||
import StrictPolicies from './collections/StrictPolicies';
|
||||
import Validations from './collections/Validations';
|
||||
import Uniques from './collections/Uniques';
|
||||
|
||||
import BlocksGlobal from './globals/BlocksGlobal';
|
||||
import NavigationArray from './globals/NavigationArray';
|
||||
import GlobalWithStrictAccess from './globals/GlobalWithStrictAccess';
|
||||
|
||||
export default buildConfig({
|
||||
cookiePrefix: 'payload',
|
||||
serverURL: 'http://localhost:3000',
|
||||
admin: {
|
||||
user: 'admins',
|
||||
indexHTML: path.resolve(__dirname, './client/index.html'),
|
||||
// meta: {
|
||||
// titleSuffix: '- Payload Demo',
|
||||
// // ogImage: '/static/find-image-here.jpg',
|
||||
// // favicon: '/img/whatever.png',
|
||||
// },
|
||||
disable: false,
|
||||
scss: path.resolve(__dirname, './client/scss/overrides.scss'),
|
||||
components: {
|
||||
// Nav: () => (
|
||||
// <div>Hello</div>
|
||||
// ),
|
||||
views: {
|
||||
// Dashboard: CustomDashboardView,
|
||||
// Account: CustomAccountView,
|
||||
},
|
||||
},
|
||||
webpack: (config) => config,
|
||||
},
|
||||
collections: [
|
||||
Admin,
|
||||
AllFields,
|
||||
AutoLabel,
|
||||
Code,
|
||||
Conditions,
|
||||
CustomComponents,
|
||||
File,
|
||||
DefaultValues,
|
||||
Blocks,
|
||||
HiddenFields,
|
||||
Hooks,
|
||||
Localized,
|
||||
LocalizedArray,
|
||||
LocalOperations,
|
||||
Media,
|
||||
NestedArrays,
|
||||
Preview,
|
||||
PublicUsers,
|
||||
RelationshipA,
|
||||
RelationshipB,
|
||||
RichText,
|
||||
Select,
|
||||
StrictPolicies,
|
||||
Validations,
|
||||
Uniques,
|
||||
],
|
||||
globals: [
|
||||
NavigationArray,
|
||||
GlobalWithStrictAccess,
|
||||
BlocksGlobal,
|
||||
],
|
||||
cors: [
|
||||
'http://localhost',
|
||||
'http://localhost:3000',
|
||||
'http://localhost:8080',
|
||||
'http://localhost:8081',
|
||||
],
|
||||
csrf: [
|
||||
'http://localhost:3000',
|
||||
'https://other-app-here.com',
|
||||
],
|
||||
routes: {
|
||||
api: '/api',
|
||||
admin: '/admin',
|
||||
graphQL: '/graphql',
|
||||
graphQLPlayground: '/graphql-playground',
|
||||
},
|
||||
defaultDepth: 2,
|
||||
graphQL: {
|
||||
maxComplexity: 1000,
|
||||
mutations: {},
|
||||
queries: {},
|
||||
disablePlaygroundInProduction: true,
|
||||
disable: false,
|
||||
},
|
||||
// rateLimit: {
|
||||
// window: 15 * 60 * 100,
|
||||
// max: 100,
|
||||
// trustProxy: true,
|
||||
// skip: (req) => req.ip === '127.0.0.1',
|
||||
// },
|
||||
maxDepth: 10,
|
||||
localization: {
|
||||
locales: [
|
||||
'en',
|
||||
'es',
|
||||
],
|
||||
defaultLocale: 'en',
|
||||
fallback: true,
|
||||
},
|
||||
hooks: {
|
||||
afterError: (err) => {
|
||||
console.error('global error config handler', err);
|
||||
},
|
||||
},
|
||||
upload: {
|
||||
limits: {
|
||||
fileSize: 10000000, // 10MB
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -1,55 +0,0 @@
|
||||
/* eslint-disable no-console */
|
||||
const express = require('express');
|
||||
const path = require('path');
|
||||
const payload = require('../src');
|
||||
const logger = require('../src/utilities/logger')();
|
||||
|
||||
const expressApp = express();
|
||||
|
||||
expressApp.use('/static', express.static(path.resolve(__dirname, 'client/static')));
|
||||
|
||||
payload.init({
|
||||
email: {
|
||||
provider: 'mock',
|
||||
},
|
||||
secret: 'SECRET_KEY',
|
||||
mongoURL: 'mongodb://localhost/payload',
|
||||
express: expressApp,
|
||||
onInit: () => {
|
||||
logger.info('Payload is initialized');
|
||||
// console.log('Payload is initialized');
|
||||
},
|
||||
});
|
||||
|
||||
const externalRouter = express.Router();
|
||||
|
||||
externalRouter.use(payload.authenticate);
|
||||
|
||||
externalRouter.get('/', (req, res) => {
|
||||
if (req.user) {
|
||||
return res.send(`Authenticated successfully as ${req.user.email}.`);
|
||||
}
|
||||
|
||||
return res.send('Not authenticated');
|
||||
});
|
||||
|
||||
expressApp.use('/external-route', externalRouter);
|
||||
|
||||
exports.start = (cb) => {
|
||||
const server = expressApp.listen(3000, async () => {
|
||||
logger.info(`listening on ${3000}...`);
|
||||
if (cb) cb();
|
||||
|
||||
const creds = await payload.getMockEmailCredentials();
|
||||
logger.info(`Mock email account username: ${creds.user}`);
|
||||
logger.info(`Mock email account password: ${creds.pass}`);
|
||||
logger.info(`Log in to mock email provider at ${creds.web}`);
|
||||
});
|
||||
|
||||
return server;
|
||||
};
|
||||
|
||||
// when server.js is launched directly
|
||||
if (module.id === require.main.id) {
|
||||
exports.start();
|
||||
}
|
||||
40
demo/server.ts
Normal file
40
demo/server.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
/* eslint-disable no-console */
|
||||
import express from 'express';
|
||||
import path from 'path';
|
||||
import payload from '../src';
|
||||
|
||||
const expressApp = express();
|
||||
|
||||
expressApp.use('/static', express.static(path.resolve(__dirname, 'client/static')));
|
||||
|
||||
payload.init({
|
||||
secret: 'SECRET_KEY',
|
||||
mongoURL: 'mongodb://localhost/payload',
|
||||
express: expressApp,
|
||||
email: {
|
||||
fromName: 'Payload',
|
||||
fromAddress: 'hello@payloadcms.com',
|
||||
},
|
||||
onInit: (app) => {
|
||||
app.logger.info('Payload Demo Initialized');
|
||||
},
|
||||
});
|
||||
|
||||
const externalRouter = express.Router();
|
||||
|
||||
externalRouter.use(payload.authenticate);
|
||||
|
||||
externalRouter.get('/', (req, res) => {
|
||||
if (req.user) {
|
||||
return res.send(`Authenticated successfully as ${req.user.email}.`);
|
||||
}
|
||||
|
||||
return res.send('Not authenticated');
|
||||
});
|
||||
|
||||
expressApp.use('/external-route', externalRouter);
|
||||
|
||||
expressApp.listen(3000, async () => {
|
||||
payload.logger.info(`Admin URL on ${payload.getAdminURL()}`);
|
||||
payload.logger.info(`API URL on ${payload.getAPIURL()}`);
|
||||
});
|
||||
106
docs/access-control/collections.mdx
Normal file
106
docs/access-control/collections.mdx
Normal file
@@ -0,0 +1,106 @@
|
||||
---
|
||||
title: Collection Access Control
|
||||
label: Collections
|
||||
order: 20
|
||||
desc: With Collection-level Access Control you can define which users can create, read, update or delete Collections.
|
||||
keywords: collections, access control, permissions, documentation, Content Management System, cms, headless, javascript, node, react, express
|
||||
---
|
||||
|
||||
You can define Collection-level Access Control within each Collection's `access` property. All Access Control functions accept one `args` argument.
|
||||
|
||||
## Available Controls
|
||||
|
||||
| Function | Allows/Denies Access |
|
||||
| ------------------------ | -------------------- |
|
||||
| **[`create`](#create)** | Used in the `create` operation |
|
||||
| **[`read`](#read)** | Used in the `find` and `findByID` operations |
|
||||
| **[`update`](#update)** | Used in the `update` operation |
|
||||
| **[`delete`](#delete)** | Used in the `delete` operation |
|
||||
|
||||
#### Auth-enabled Controls
|
||||
|
||||
If a Collection supports [`Authentication`](/docs/authentication/overview), the following Access Controls become available:
|
||||
|
||||
| Function | Allows/Denies Access |
|
||||
| ----------------------- | -------------------- |
|
||||
| **[`admin`](#admin)** | Used to restrict access to the Payload Admin panel |
|
||||
| **[`unlock`](#unlock)** | Used to restrict which users can access the `unlock` operation |
|
||||
|
||||
**Example Collection config:**
|
||||
```js
|
||||
export default {
|
||||
slug: "posts",
|
||||
// highlight-start
|
||||
access: {
|
||||
create: ({ req: { user } }) => { ... },
|
||||
read: ({ req: { user } }) => { ... },
|
||||
update: ({ req: { user } }) => { ... },
|
||||
delete: ({ req: { user } }) => { ... },
|
||||
admin: ({ req: { user } }) => { ... },
|
||||
},
|
||||
// highlight-end
|
||||
};
|
||||
```
|
||||
|
||||
### Create
|
||||
|
||||
Returns a boolean which allows/denies access to the `create` request.
|
||||
|
||||
**Available argument properties :**
|
||||
|
||||
| Option | Description |
|
||||
| --------- | ----------- |
|
||||
| **`req`** | The Express `request` object containing the currently authenticated `user` |
|
||||
|
||||
### Read
|
||||
|
||||
Read access functions can return a boolean result or optionally return a [query constraint](/docs/queries/overview) which limits the documents that are returned to only those that match the constraint you provide. This can be helpful to restrict users' access to only certain documents however you specify.
|
||||
|
||||
**Available argument properties :**
|
||||
|
||||
| Option | Description |
|
||||
| --------- | ----------- |
|
||||
| **`req`** | The Express `request` object containing the currently authenticated `user` |
|
||||
| **`id`** | `id` of document requested, if within `findByID`. Otherwise, `id` is undefined. |
|
||||
|
||||
### Update
|
||||
|
||||
Update access functions can return a boolean result or optionally return a [query constraint](/docs/queries/overview) to limit the document(s) that can be updated by the currently authenticated user. For example, returning a `query` from the `update` Access Control is helpful in cases where you would like to restrict a user to only being able to update the documents containing a `createdBy` relationship field equal to the user's ID.
|
||||
|
||||
**Available argument properties :**
|
||||
|
||||
| Option | Description |
|
||||
| --------- | ----------- |
|
||||
| **`req`** | The Express `request` object containing the currently authenticated `user` |
|
||||
| **`id`** | `id` of document requested to update |
|
||||
|
||||
### Delete
|
||||
|
||||
Similarly to the Update function, returns a boolean or a [query constraint](/docs/queries/overview) to limit which documents can be deleted by which users.
|
||||
|
||||
**Available argument properties :**
|
||||
|
||||
| Option | Description |
|
||||
| --------- | ----------- |
|
||||
| **`req`** | The Express `request` object with additional `user` property, which is the currently logged in user |
|
||||
| **`id`** | `id` of document requested to delete |
|
||||
|
||||
### Admin
|
||||
|
||||
If the Collection is [used to access the Payload Admin panel](/docs/admin/overview#the-admin-user-collection), the `Admin` Access Control function determines whether or not the currently logged in user can access the admin UI.
|
||||
|
||||
**Available argument properties :**
|
||||
|
||||
| Option | Description |
|
||||
| --------- | ----------- |
|
||||
| **`req`** | The Express `request` object containing the currently authenticated `user` |
|
||||
|
||||
### Unlock
|
||||
|
||||
Determines which users can [unlock](/docs/authentication/operations#unlock) other users who may be blocked from authenticating successfully due to [failing too many login attempts](/docs/authentication/config#options).
|
||||
|
||||
**Available argument properties :**
|
||||
|
||||
| Option | Description |
|
||||
| --------- | ----------- |
|
||||
| **`req`** | The Express `request` object containing the currently authenticated `user` |
|
||||
76
docs/access-control/fields.mdx
Normal file
76
docs/access-control/fields.mdx
Normal file
@@ -0,0 +1,76 @@
|
||||
---
|
||||
title: Field-level Access Control
|
||||
label: Fields
|
||||
order: 30
|
||||
desc: Field-level Access Control is specified within a field's config, and allows you to define which users can create, read or update Fields.
|
||||
keywords: fields, access control, permissions, documentation, Content Management System, cms, headless, javascript, node, react, express
|
||||
---
|
||||
|
||||
Field Access Control is specified with functions inside a field's config. All field-level Controls return a boolean value to allow or deny access for the specified operation. No field-level Access Controls support returning query constraints. All Access Control functions accept one `args` argument.
|
||||
|
||||
## Available Controls
|
||||
|
||||
| Function | Purpose |
|
||||
| ------------------------ | ------- |
|
||||
| **[`create`](#create)** | Allows or denies the ability to set a field's value when creating a new document |
|
||||
| **[`read`](#read)** | Allows or denies the ability to read a field's value |
|
||||
| **[`update`](#update)** | Allows or denies the ability to update a field's value |
|
||||
|
||||
**Example Collection config:**
|
||||
```js
|
||||
export default {
|
||||
slug: 'posts',
|
||||
fields: [
|
||||
{
|
||||
name: 'title',
|
||||
label: 'Title',
|
||||
type: 'text',
|
||||
// highlight-start
|
||||
access: {
|
||||
create: ({ req: { user } }) => { ... },
|
||||
read: ({ req: { user } }) => { ... },
|
||||
update: ({ req: { user } }) => { ... },
|
||||
},
|
||||
// highlight-end
|
||||
};
|
||||
],
|
||||
}
|
||||
```
|
||||
|
||||
### Create
|
||||
|
||||
Returns a boolean which allows or denies the ability to set a field's value when creating a new document. If `false` is returned, any passed values will be discarded.
|
||||
|
||||
**Available argument properties:**
|
||||
|
||||
| Option | Description |
|
||||
| ----------------- | ----------- |
|
||||
| **`req`** | The Express `request` object containing the currently authenticated `user` |
|
||||
| **`data`** | The full data passed to create the document. |
|
||||
| **`siblingData`** | Immediately adjacent field data passed to create the document. |
|
||||
|
||||
### Read
|
||||
|
||||
Returns a boolean which allows or denies the ability to read a field's value. If `false`, the entire property is omitted from the resulting document.
|
||||
|
||||
**Available argument properties:**
|
||||
|
||||
| Option | Description |
|
||||
| ----------------- | ----------- |
|
||||
| **`req`** | The Express `request` object containing the currently authenticated `user` |
|
||||
| **`id`** | `id` of the document being read |
|
||||
| **`data`** | The full data of the document being read. |
|
||||
| **`siblingData`** | Immediately adjacent field data of the document being read. |
|
||||
|
||||
### Update
|
||||
|
||||
Returns a boolean which allows or denies the ability to update a field's value. If `false` is returned, any passed values will be discarded.
|
||||
|
||||
**Available argument properties:**
|
||||
|
||||
| Option | Description |
|
||||
| ----------------- | ----------- |
|
||||
| **`req`** | The Express `request` object containing the currently authenticated `user` |
|
||||
| **`id`** | `id` of the document being updated |
|
||||
| **`data`** | The full data passed to update the document. |
|
||||
| **`siblingData`** | Immediately adjacent field data passed to update the document with. |
|
||||
51
docs/access-control/globals.mdx
Normal file
51
docs/access-control/globals.mdx
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
title: Globals Access Control
|
||||
label: Globals
|
||||
order: 40
|
||||
desc: Global-level Access Control is specified within each Global's `access` property and allows you to define which users can read or update Globals.
|
||||
keywords: globals, access control, permissions, documentation, Content Management System, cms, headless, javascript, node, react, express
|
||||
---
|
||||
|
||||
You can define Global-level Access Control within each Global's `access` property. All Access Control functions accept one `args` argument.
|
||||
|
||||
**Available argument properties:
|
||||
|
||||
## Available Controls
|
||||
|
||||
| Function | Allows/Denies Access |
|
||||
| ------------------------ | -------------------- |
|
||||
| **[`read`](#read)** | Used in the `findOne` Global operation |
|
||||
| **[`update`](#update)** | Used in the `update` Global operation |
|
||||
|
||||
**Example Global config:**
|
||||
```js
|
||||
export default {
|
||||
slug: "header",
|
||||
// highlight-start
|
||||
access: {
|
||||
read: ({ req: { user } }) => { ... },
|
||||
update: ({ req: { user } }) => { ... },
|
||||
},
|
||||
// highlight-end
|
||||
};
|
||||
```
|
||||
|
||||
### Read
|
||||
|
||||
Returns a boolean result to allow or deny a user's ability to read the Global.
|
||||
|
||||
**Available argument properties:**
|
||||
|
||||
| Option | Description |
|
||||
| --------- | ----------- |
|
||||
| **`req`** | The Express `request` object containing the currently authenticated `user` |
|
||||
|
||||
### Update
|
||||
|
||||
Returns a boolean result to allow or deny a user's ability to update the Global.
|
||||
|
||||
**Available argument properties:**
|
||||
|
||||
| Option | Description |
|
||||
| --------- | ----------- |
|
||||
| **`req`** | The Express `request` object containing the currently authenticated `user` |
|
||||
45
docs/access-control/overview.mdx
Normal file
45
docs/access-control/overview.mdx
Normal file
@@ -0,0 +1,45 @@
|
||||
---
|
||||
title: Access Control
|
||||
label: Overview
|
||||
order: 10
|
||||
desc: Payload makes it simple to define and manage access control. By declaring roles, you can set permissions and restrict what your users can interact with.
|
||||
keywords: overview, access control, permissions, documentation, Content Management System, cms, headless, javascript, node, react, express
|
||||
---
|
||||
|
||||
Access control within Payload is extremely powerful while remaining easy and intuitive to manage. Declaring who should have access to what documents is no more complex than writing a simple JavaScript function that either returns a `boolean` or a [`query`](/docs/queries/overview) constraint to restrict which documents users can interact with.
|
||||
|
||||
**Example use cases:**
|
||||
|
||||
- Allowing anyone `read` access to all `Post`s
|
||||
- Only allowing public access to `Post`s where a `status` field is equal to `published`
|
||||
- Giving only `User`s with a `role` field equal to `admin` the ability to delete `Page`(s)
|
||||
- Allowing anyone to create `ContactSubmission`s, but only logged in users to `read`, `update` or `delete` them
|
||||
- Restricting a `User` to only be able to see their own `Order`(s), but no others
|
||||
- Allowing `User`s that belong to a certain `Organization` to access only that `Organization`'s `Resource`s
|
||||
|
||||
### Default Settings
|
||||
|
||||
**By default, all Collections and Globals require that a user is logged in to be able to interact in any way.** The default Access Control function evaluates the `user` from the Express `req` and returns `true` if a user is logged in, and `false` if not.
|
||||
|
||||
**Default Access function:**
|
||||
|
||||
```js
|
||||
const defaultPayloadAccess = ({ req: { user } }) => {
|
||||
// Return `true` if a user is found
|
||||
// and `false` if it is undefined or null
|
||||
return Boolean(user);
|
||||
}
|
||||
```
|
||||
|
||||
<Banner type="success">
|
||||
<strong>Note:</strong><br/>
|
||||
In the Local API, all Access Control functions are skipped by default, allowing your server to do whatever it needs. But, you can opt back in by setting the option <strong>overrideAccess</strong> to <strong>true</strong>.
|
||||
</Banner>
|
||||
|
||||
### Access Control Types
|
||||
|
||||
You can manage access within Payload on three different levels:
|
||||
|
||||
- [Collections](/docs/access-control/collections)
|
||||
- [Fields](/docs/access-control/fields)
|
||||
- [Globals](/docs/access-control/globals)
|
||||
108
docs/admin/components.mdx
Normal file
108
docs/admin/components.mdx
Normal file
@@ -0,0 +1,108 @@
|
||||
---
|
||||
title: Swap in your own React components
|
||||
label: Custom Components
|
||||
order: 20
|
||||
desc: Fully customize your Admin Panel by swapping in your own React components. Add fields, remove views, update routes and change functions to sculpt your perfect Dashboard.
|
||||
keywords: admin, components, custom, documentation, Content Management System, cms, headless, javascript, node, react, express
|
||||
---
|
||||
|
||||
While designing the Payload Admin panel, we determined it should be as minimal and straightforward as possible to allow easy customization and control. There are many times where you may want to completely control how a whole view or a field works. You might even want to add in your own routes entirely. In order for Payload to support that level of customization without introducing versioning / future-proofing issues, Payload provides for a pattern to supply your own React components via your Payload config.
|
||||
|
||||
To swap in your own React component, first, consult the list of available component overrides below. Determine the scope that corresponds to what you are trying to accomplish, and then author your React component accordingly.
|
||||
|
||||
<Banner type="success">
|
||||
<strong>Tip:</strong><br/>
|
||||
Custom components will automatically be provided with all props that the default component would accept.
|
||||
</Banner>
|
||||
|
||||
### Base Component Overrides
|
||||
|
||||
You can override a set of admin panel-wide components by providing a component to your base Payload config's `admin.components` property. The following options are available:
|
||||
|
||||
| Path | Description |
|
||||
| --------------------- | -------------|
|
||||
| **`Nav`** | Contains the sidebar and mobile Nav in its entirety. |
|
||||
| **`views.Account`** | The Account view is used to show the currently logged in user's Account page. |
|
||||
| **`views.Dashboard`** | The main landing page of the Admin panel. |
|
||||
| **`graphics.Icon`** | Used as a graphic within the `Nav` component. Often represents a condensed version of a full logo. |
|
||||
| **`graphics.Logo`** | The full logo to be used in contexts like the `Login` view. |
|
||||
|
||||
#### Full example:
|
||||
|
||||
`payload.config.js`
|
||||
```js
|
||||
import { buildConfig } from 'payload/config';
|
||||
import { MyCustomNav, MyCustomLogo, MyCustomIcon, MyCustomAccount, MyCustomDashboard } from './customComponents.js';
|
||||
|
||||
export default buildConfig({
|
||||
serverURL: 'http://localhost:3000',
|
||||
admin: {
|
||||
components: {
|
||||
Nav: MyCustomNav,
|
||||
graphics: {
|
||||
Icon: MyCustomIcon,
|
||||
Logo: MyCustomLogo,
|
||||
},
|
||||
views: {
|
||||
Account: MyCustomAccount,
|
||||
Dashboard: MyCustomDashboard,
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
*For more examples regarding how to customize components, look at the [demo app](https://github.com/payloadcms/payload/tree/master/demo).*
|
||||
|
||||
### Collections
|
||||
|
||||
You can override components on a Collection-by-Collection basis via each Collection's `admin` property.
|
||||
|
||||
| Path | Description |
|
||||
| ---------------- | -------------|
|
||||
| **`views.Edit`** | Used while a document within this Collection is being edited. |
|
||||
| **`views.List`** | The `List` view is used to render a paginated, filterable table of Documents in this Collection. |
|
||||
|
||||
### Globals
|
||||
|
||||
As with Collections, You can override components on a global-by-global basis via their `admin` property.
|
||||
|
||||
| Path | Description |
|
||||
| ---------------- | -------------|
|
||||
| **`views.Edit`** | Used while this Global is being edited. |
|
||||
|
||||
### Fields
|
||||
|
||||
All Payload fields support the ability to swap in your own React components. So, for example, instead of rendering a default Text input, you might need to render a color picker that provides the editor with a custom color picker interface to restrict the data entered to colors only.
|
||||
|
||||
<Banner type="success">
|
||||
<strong>Tip:</strong><br/>
|
||||
Don't see a built-in field type that you need? Build it! Using a combination of custom validation and custom components, you can override the entirety of how a component functions within the admin panel and effectively create your own field type.
|
||||
</Banner>
|
||||
|
||||
**Fields support the following custom components:**
|
||||
|
||||
| Component | Description |
|
||||
| --------------- | -------------|
|
||||
| **`Filter`** | Override the text input that is presented in the `List` view when a user is filtering documents by the customized field. |
|
||||
| **`Cell`** | Used in the `List` view's table to represent a table-based preview of the data stored in the field. |
|
||||
| **`Field`** | Swap out the field itself within all `Edit` views. |
|
||||
|
||||
#### Sending and receiving values from the form
|
||||
|
||||
When swapping out the `Field` component, you'll be responsible for sending and receiving the field's `value` from the form itself. To do so, import the `useFieldType` hook as follows:
|
||||
|
||||
```js
|
||||
import { useFieldType } from 'payload/components/forms';
|
||||
|
||||
const CustomTextField = ({ path }) => {
|
||||
const { value, setValue } = useFieldType({ path });
|
||||
|
||||
return (
|
||||
<input
|
||||
onChange={(e) => setValue(e.target.value)}
|
||||
value={value}
|
||||
/>
|
||||
)
|
||||
}
|
||||
```
|
||||
63
docs/admin/customizing-css.mdx
Normal file
63
docs/admin/customizing-css.mdx
Normal file
@@ -0,0 +1,63 @@
|
||||
---
|
||||
title: Customizing CSS & SCSS
|
||||
label: Customizing CSS
|
||||
order: 30
|
||||
desc: Customize your Payload admin panel further by adding your own CSS or SCSS style sheet to the configuration, powerful theme and design options are waiting for you.
|
||||
keywords: admin, css, scss, documentation, Content Management System, cms, headless, javascript, node, react, express
|
||||
---
|
||||
|
||||
### Adding your own CSS / SCSS
|
||||
|
||||
You can add your own CSS by providing your base Payload config with a path to your own CSS or SCSS. Customize the styling of any part of the Payload dashboard as necessary.
|
||||
|
||||
To do so, provide your base Payload config with a path to your own stylesheet. It can be either a CSS or SCSS file.
|
||||
|
||||
**Example in payload.config.js:**
|
||||
```js
|
||||
import { buildConfig } from 'payload/config';
|
||||
import path from 'path';
|
||||
|
||||
const config = buildConfig({
|
||||
serverURL: 'http://localhost:3000',
|
||||
admin: {
|
||||
css: path.resolve(__dirname, 'relative/path/to/stylesheet.scss'),
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
### Overriding SCSS variables
|
||||
|
||||
You can specify your own SCSS variable stylesheet that will allow for the override of Payload's base theme. This unlocks a ton of powerful theming and design options such as:
|
||||
|
||||
- Changing dashboard font families
|
||||
- Modifying color palette
|
||||
- Creating a dark theme
|
||||
- Etc.
|
||||
|
||||
To do so, provide your base Payload config with a path to your own SCSS variable sheet.
|
||||
|
||||
**Example in payload.config.js:**
|
||||
```js
|
||||
import { buildConfig } from 'payload/config';
|
||||
import path from 'path';
|
||||
|
||||
const config = buildConfig({
|
||||
serverURL: 'http://localhost:3000',
|
||||
admin: {
|
||||
scss: path.resolve(__dirname, 'relative/path/to/vars.scss'),
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
**Example stylesheet override:**
|
||||
```scss
|
||||
$font-body: 'Papyrus';
|
||||
$style-radius-m: 10px;
|
||||
```
|
||||
|
||||
To reference all Sass variables that you can override, look at the default [SCSS variable stylesheet](https://github.com/payloadcms/payload/blob/master/src/admin/scss/vars.scss) within the Payload source code.
|
||||
|
||||
<Banner type="error">
|
||||
<strong>Warning:</strong><br />
|
||||
Only SCSS variables, mixins, functions, and extends are allowed in <strong>your SCSS overrides</strong>. Do not attempt to add any CSS declarations to this file, as this variable stylesheet is imported by many components throughout the Payload Admin panel and will result in your CSS definition(s) being duplicated many times. If you need to add real CSS definitions, see "Adding your own CSS / SCSS" the top of this page.
|
||||
</Banner>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user