Compare commits

...

755 Commits

Author SHA1 Message Date
James
dabc0bbe80 chore(release): v1.5.6 2023-01-11 16:13:53 -05:00
James
3f30b2f489 fix: ensures that find with draft=true returns ids with drafts 2023-01-11 16:08:32 -05:00
James
a470706c2e chore(release): v1.5.5 2023-01-11 10:41:22 -05:00
James Mikrut
5e7d731ddd Merge pull request #1850 from payloadcms/fix/1848
fix: rte link from text
2023-01-11 10:33:21 -05:00
Jacob Fletcher
2e833a6efd chore: e2e test for rte link from text 2023-01-11 10:25:43 -05:00
Jacob Fletcher
1cde647a2a fix: rte link element initial state #1848 2023-01-11 09:44:41 -05:00
James
047efe02ff chore: revert #1794 for now until permanent init architecture is established 2023-01-11 09:32:44 -05:00
Jarrod Flesch
96002dbda5 Merge pull request #1719 from payloadcms/feat/1695-nullable-localized-array-and-blocks
Feat: allow null for non-default locales on arrays and blocks
2023-01-10 11:23:46 -05:00
James Mikrut
93d0a9b3d4 Merge pull request #1837 from payloadcms/chore/manual-draft-aggregate
feat/documentdb / azure cosmos compatibiilty
2023-01-10 11:23:19 -05:00
Jarrod Flesch
571495c3e0 chore: sets parameter defaults for locale and defaultLocale to null 2023-01-10 10:44:48 -05:00
Jarrod Flesch
9b71aa17b3 chore: uses defaultLocale for local operations locale and fallbackLocale 2023-01-10 10:40:35 -05:00
Jacob Fletcher
03dcf743e8 Merge pull request #1835 from payloadcms/fix/1801
fix: upload field filterOptions
2023-01-10 09:46:26 -05:00
Jacob Fletcher
dadaf32e4d Merge pull request #1839 from payloadcms/fix/date-useastitle
fix: formats date when useAsTitle
2023-01-10 09:45:04 -05:00
Jacob Fletcher
086117d703 fix: formats date when useAsTitle 2023-01-09 22:05:56 -05:00
James
ea9943e135 chore: ensures versions aggregate runs in the right order 2023-01-09 19:47:31 -05:00
James
bda03d7a84 Merge branch 'chore/manual-draft-aggregate' of github.com:payloadcms/payload into chore/manual-draft-aggregate 2023-01-09 19:46:57 -05:00
James
665d3da651 chore: ensures sort is used within mergeDrafts 2023-01-09 19:46:35 -05:00
James
faab09b76f chore: ensures sort is used within mergeDrafts 2023-01-09 19:41:30 -05:00
James
33401f4064 chore: comment accuracy 2023-01-09 19:11:40 -05:00
James
9e9dfbcb10 chore: cleanup mergeDrafts 2023-01-09 19:06:02 -05:00
James
73af283e1c feat: ensures compatibility with azure cosmos and aws documentdb 2023-01-09 18:59:20 -05:00
PatrikKozak
6c25ad9cc2 Merge branch 'master' of https://github.com/payloadcms/payload into feat/1695-nullable-localized-array-and-blocks 2023-01-09 17:49:31 -05:00
PatrikKozak
c247f3130c feat: adds translations for fallbackToDefaultLocale 2023-01-09 17:46:35 -05:00
Jacob Fletcher
4194632318 chore: fixes failing upload e2e test 2023-01-09 17:15:05 -05:00
Jarrod Flesch
8f84f9e140 chore: adds simplified config for testing 2023-01-09 17:02:25 -05:00
Jarrod Flesch
21420f16df chore: adjusts skipValidation for array 2023-01-09 16:39:13 -05:00
Jarrod Flesch
ee682270a4 Merge remote-tracking branch 'origin' into feat/1695-nullable-localized-array-and-blocks 2023-01-09 16:19:11 -05:00
Jarrod Flesch
6923128774 chore: abstracts NullifyField component out, non-default locales can be set to null to use fallback 2023-01-09 16:08:55 -05:00
Jarrod Flesch
5cabd8e4c0 chore: abstracts CheckboxInput into a uncontrolled input 2023-01-09 16:07:41 -05:00
Jarrod Flesch
84bc5ab299 chore: fixes incorrect tooltip arrow color 2023-01-09 16:06:51 -05:00
Jacob Fletcher
9483ccb120 fix: upload field filterOptions 2023-01-09 14:40:30 -05:00
Jacob Fletcher
d8c700975f chore: creates uploads e2e testing suite 2023-01-09 13:17:55 -05:00
James Mikrut
aee7d36f1d Merge pull request #1832 from payloadcms/fix/#1808
fix: #1808, arrays and blocks now save localized nested field data upon reordering rows
2023-01-09 12:59:52 -05:00
James
febbea5550 chore: restores debugger to use fields test suite 2023-01-09 12:59:36 -05:00
James
ee54c1481c fix: #1808, arrays and blocks now save localized nested field data upon reordering rows 2023-01-09 12:58:13 -05:00
James
78af86f9d1 chore: simplifies init code 2023-01-09 11:27:00 -05:00
Christian Schurr
82961767e3 feat!: enforces payload.init is async
* Run connectMongoose before starting payload init

* - reverted changes
- added deprecated to init
- docs: changed all payload.init to payload.initAsync
- changed all internal init calls

* forgotten inits in docs

* reverted back - removed init and renamed initAsync to init
2023-01-09 11:24:22 -05:00
James Mikrut
7583289d24 Merge pull request #1830 from payloadcms/fix/#1737-upload-filedata-available
fix: ensures upload file data is available for conditions
2023-01-09 11:14:55 -05:00
James
d40e136947 fix: ensures upload file data is available for conditions 2023-01-09 10:43:42 -05:00
Jessica Chowdhury
ed7cfff45c fix: bug when clearing relationship field without hasMany: true (#1829)
* fix: bug when clearing relationship field without hasMany: true

* fix: checks for null value within function
2023-01-09 10:23:40 -05:00
James Mikrut
a10376372a Merge pull request #1796 from payloadcms/fix/groups-within-row
fix: updates margin for group field within a row
2023-01-09 10:03:50 -05:00
James Mikrut
f6e749734a Merge pull request #1824 from payloadcms/fix/rte-uploads-drawer
fix: prevents uploads drawer from crashing when no uploads are enabled
2023-01-09 09:06:25 -05:00
Jacob Fletcher
62c9efbc54 Merge pull request #1819 from Elliot67/patch-2
fix: wrong translation and punctuation spacing
2023-01-09 09:02:09 -05:00
Jacob Fletcher
84e1417b71 fix: prevents uploads drawer from crashing when no uploads are enabled 2023-01-08 23:04:42 -05:00
Elliot Lintz
bf1242aafa fix: wrong translation and punctuation spacing 2023-01-07 03:38:40 +01:00
Jarrod Flesch
001a68f45c chore: adjusts block and array schemas to store undefined instead of empty arrays by default 2023-01-06 16:56:26 -05:00
Jacob Fletcher
a823e75d2b Merge pull request #1815 from iamprompt/patch-1
fix: fix miss typo in Thai translation
2023-01-06 12:24:39 -05:00
James
c21c6b8013 chore(release): v1.5.4 2023-01-06 11:36:26 -05:00
James Mikrut
e42d103af3 Merge pull request #1816 from payloadcms/feat/prebuilt-config
feat: allows init to accept a pre-built config
2023-01-06 11:30:57 -05:00
James
84e00bf7b3 feat: allows init to accept a pre-built config 2023-01-06 11:23:55 -05:00
Supakarn Laorattanakul
25e5ab7cee fix: fix miss typo in Thai translation 2023-01-06 20:23:27 +07:00
James
5a7972fbf8 chore(release): v1.5.3 2023-01-05 13:53:39 -05:00
James
74e10b1788 Merge branch 'master' of github.com:payloadcms/payload 2023-01-05 13:32:47 -05:00
James
6c3bc6fb34 chore: moves graphql types for globals onto payload class 2023-01-05 13:32:38 -05:00
Jarrod Flesch
b8ca2c56d9 Merge pull request #1807 from payloadcms/fix/code-editor-theme-flicker
fix: theme flicker on code editor
2023-01-05 09:42:24 -05:00
Jessica Boezwinkle
c9e7c1b3bc chore: commits the correct file (jess negligence) 2023-01-05 13:58:44 +00:00
Jessica Boezwinkle
dacf1a85fd chore: removes code editor theme from options 2023-01-05 13:57:10 +00:00
Jessica Boezwinkle
6567454ae4 fix: theme flicker on code editor 2023-01-05 10:03:19 +00:00
James
06fd7e7776 chore(release): v1.5.2 2023-01-04 15:16:32 -05:00
James Mikrut
cac4b92a02 Merge pull request #1805 from payloadcms/fix/swc-ignore
fix: ignores admin and components from swc
2023-01-04 15:01:43 -05:00
Jacob Fletcher
7d27431312 fix: ignores admin and components from swc 2023-01-04 14:57:07 -05:00
Jarrod Flesch
206d0c2c2a chore: adds sourcemaps for swc register 2023-01-04 13:54:39 -05:00
James
38b8423150 chore(release): v1.5.1 2023-01-04 13:23:46 -05:00
James Mikrut
ea8b1ba10c Merge pull request #1804 from payloadcms/fix/components-dir
fix: reverts components directory back to ts
2023-01-04 13:07:51 -05:00
Jacob Fletcher
1bbf099fe0 fix: reverts components directory back to ts 2023-01-04 13:04:07 -05:00
James
5fae18e940 chore: passing tests 2023-01-04 12:46:18 -05:00
James
f4d20a9aed chore: removes logging 2023-01-04 11:43:45 -05:00
James
27dd945544 chore: adds logging to debug why tests not passing in ci 2023-01-04 11:36:38 -05:00
James
7c74507bca chore(release): v1.5.0 2023-01-04 10:43:08 -05:00
James
c18ea7c856 chore: migrates component tests to new version of jest 2023-01-04 10:28:31 -05:00
James
681d75e43e chore: adapts tests to new jest version 2023-01-04 10:22:57 -05:00
James Mikrut
c11bcd1416 feat: swc register (#1779)
* feat: implements esbuild and removes babel

* chore: implements esbuild-register

* chore: tests passing

* chore: implements @swc/jest for tests

* feat: implements swc

* chore: removes build and relies on swc/register only

* chore: converts some exports

* chore: flattens ts configs

* chore: allows tsx in swc

* chore: converts more exports into js

* chore: restores payload module.exports

* chore: removes unused dependency
2023-01-04 10:11:26 -05:00
James
82501319ce chore: dependency updates 2023-01-04 10:06:00 -05:00
Jarrod Flesch
b379001f00 Merge pull request #1802 from payloadcms/chore/code-field-props
chore: moves editorProps into admin property for code and json field types
2023-01-04 09:01:07 -05:00
Jarrod Flesch
fe1dfa3e23 chore: updates test config payload-types 2023-01-04 08:51:54 -05:00
Jarrod Flesch
d97c9fd2ee chore: moves editorProps into admin property for code and json field types 2023-01-04 08:41:59 -05:00
Jarrod Flesch
fde79a1b3c Merge pull request #1731 from payloadcms/feat/json-field
feat: builds json field and updates code field editor
2023-01-03 17:00:34 -05:00
Jarrod Flesch
59781b9eef chore: adjusts JSON field type, removes jsonError from config type 2023-01-03 16:47:51 -05:00
Jarrod Flesch
27ab978565 chore: updates json field docs 2023-01-03 15:01:43 -05:00
Jarrod Flesch
f7d664fdcf docs: updates code and json field types to reflect internal switch to monaco-react editor 2023-01-03 15:01:04 -05:00
Jarrod Flesch
4d74d7a994 chore: abstracts CodeEditor component, ensures js and ts language are respected in Code Field with new editor 2023-01-03 13:57:06 -05:00
James
6a3ee4debe chore(release): v1.4.2 2023-01-03 10:16:45 -05:00
Jarrod Flesch
a0181a0eee Merge branch 'master' into feat/json-field 2023-01-03 10:03:16 -05:00
Jessica Boezwinkle
1c3a257244 fix: updatesmargin for group field within a row 2023-01-03 10:26:10 +00:00
James Mikrut
7727496548 Merge pull request #1793 from payloadcms/fix/#1786
fix: #1786, relationship with hasMany no longer sets empty array as default value
2023-01-02 15:50:58 -05:00
James
ecfb363169 fix: #1786, relationship with hasMany no longer sets empty array as default value 2023-01-02 15:49:19 -05:00
James Mikrut
4579a2adc1 Merge pull request #1787 from payloadcms/chore/deleting-error-i18n
chore: fix incorrect translation for error deleting document
2023-01-02 14:42:37 -05:00
James Mikrut
57ba307c3b Merge pull request #1792 from payloadcms/feat/reactive-preview
feat: preview now exposes most recent draft data
2023-01-02 14:39:38 -05:00
James
54dadbeae5 feat: preview now exposes most recent draft data 2023-01-02 14:38:35 -05:00
James Mikrut
2a8bc31e4a Merge pull request #1789 from payloadcms/fix/#1775
fix: #1775 - siblingData for unnamed fields within array rows improperly formatted
2023-01-02 13:39:02 -05:00
James
d6fcd19bd1 fix: #1775 - siblingData for unnamed fields within array rows improperly formatted 2023-01-02 13:31:34 -05:00
Dan Ribbens
e0d4b3fef2 chore: fix incorrect translation for error deleting document 2023-01-02 12:43:05 -05:00
James Mikrut
3552d6a340 Merge pull request #1770 from payloadcms/fix/#1762-select-unmatched-value
fix: #1762 select field crash on missing value option
2023-01-02 10:28:57 -05:00
James Mikrut
e330d8874b Merge pull request #1766 from jacobsfletch/fix/1765
fix: error clearing date field
2023-01-02 09:51:51 -05:00
James Mikrut
d919abbda4 Merge pull request #1782 from jacobsfletch/fix/1777
docs: reserved field names
2023-01-02 09:45:24 -05:00
Jacob Fletcher
8e6b2c4f9d docs: reserved field names 2023-01-02 00:47:54 -05:00
Jacob Fletcher
420ed6738e chore: e2e test for date input clearing 2022-12-26 14:31:08 -05:00
Zlatex
49fa5cb23a feat: add Ukrainian translation (#1767) 2022-12-26 12:48:13 -05:00
Dan Ribbens
ec9196e33c fix: select field crash on missing value option 2022-12-26 12:13:11 -05:00
Jacob Fletcher
883daf7b46 fix: error clearing date field 2022-12-24 09:02:35 -05:00
James
7b92211eca chore(release): v1.4.1 2022-12-23 19:52:05 -05:00
James
192c9fe981 Merge branch 'master' of github.com:payloadcms/payload 2022-12-23 19:46:09 -05:00
James
9f4ce8d756 fix: #1761, avoids rich text modifying form due to selection change 2022-12-23 19:46:01 -05:00
Dan Ribbens
abaa22950c test: json field e2e and int 2022-12-23 17:45:22 -05:00
James Mikrut
e23481a011 Update README.md 2022-12-23 16:29:51 -05:00
James
8a8741a792 chore(release): v1.4.0 2022-12-23 16:13:12 -05:00
James Mikrut
206b757629 Merge pull request #1757 from payloadcms/fix/#1738-svg-image-sizes
fix: #1738 save image dimensions to svg uploads
2022-12-23 16:05:22 -05:00
PatrikKozak
238badabb4 fix: translated tab classnames 2022-12-23 15:20:44 -05:00
James
e86a6efe45 Merge branch 'master' of github.com:payloadcms/payload 2022-12-23 14:39:35 -05:00
James
37bc8826f7 chore: allows relationship and upload elements to reside within lists 2022-12-23 14:39:25 -05:00
Jacob Fletcher
3d4dfbcf7a chore: translates tooltip in rte relationship 2022-12-23 14:09:10 -05:00
Dan Ribbens
2de435f43a fix: #1738 save image dimensions to svg uploads 2022-12-23 13:42:31 -05:00
James
ff4a6a1ea1 Merge branch 'master' of github.com:payloadcms/payload 2022-12-23 13:12:33 -05:00
James
55df622007 chore: ensures that de-indenting top-level lists works in all cases 2022-12-23 13:11:38 -05:00
Jacob Fletcher
baf5b10d23 roadmap: rte and upload drawers (#1668) 2022-12-23 12:41:06 -05:00
James
794b6e8783 chore: safely checks if rte last selected element is empty 2022-12-23 12:30:54 -05:00
James Mikrut
df41201134 Merge pull request #1759 from payloadcms/fix/#1748
fix: #1748, bails out of autosave if doc is published while autosaving
2022-12-23 12:21:29 -05:00
James
95e9300d10 fix: #1748, bails out of autosave if doc is published while autosaving 2022-12-23 12:20:04 -05:00
James Mikrut
ad2a54bb78 Merge pull request #1758 from payloadcms/fix/#1747
fix: #1747, rich text in arrays improperly updating initialValue when…
2022-12-23 11:53:21 -05:00
James
d417e50d52 fix: #1747, rich text in arrays improperly updating initialValue when moving rows 2022-12-23 11:47:16 -05:00
James Mikrut
16c41d36cf Merge pull request #1722 from payloadcms/fix/#551
fix: #551 - rich text nested list structure
2022-12-23 11:14:28 -05:00
James Mikrut
4e019e44b0 Merge pull request #1756 from payloadcms/fix/1753-date-field-updates
Fix: updatedAt and createdAt fields change
2022-12-23 11:04:30 -05:00
Jarrod Flesch
d7e7ee9a52 chore: threads global updatedAt through to edit view 2022-12-23 11:01:02 -05:00
James Mikrut
e7a16364c0 Merge pull request #1754 from payloadcms/fix/#1752
fix: #1752, removes label from row field type
2022-12-23 10:51:48 -05:00
James Mikrut
a46c220489 Merge pull request #1745 from payloadcms/fix/1737
fix: allows cleared file to be reselected
2022-12-23 10:50:30 -05:00
James Mikrut
830af2389e Merge pull request #1744 from payloadcms/fix/1739
fix: missing file after reselect in upload component
2022-12-23 10:49:38 -05:00
James Mikrut
332b5d1dad Merge pull request #1743 from payloadcms/fix/1736
fix: safely clears sort #1736
2022-12-23 10:48:50 -05:00
James Mikrut
3cde636d47 Merge pull request #1741 from payloadcms/fix/richtext-toolbar-drawer
fix: updates richtext toolbar position if inside a drawer
2022-12-23 10:47:42 -05:00
James Mikrut
c0293719d9 Merge pull request #1733 from payloadcms/fix/drawer-stepnav
fix: relationship labels and page stepnav
2022-12-23 10:46:54 -05:00
Jarrod Flesch
bd4ed5b99b fix: removes update and created at fields when duplicating, ensures updatedAt data is reactive 2022-12-23 10:39:15 -05:00
James Mikrut
0527e6f3ea Merge pull request #1700 from payloadcms/fix/#1666-api-key-header-label
fix: #1666 use the slug for authentication header API Key
2022-12-23 10:37:19 -05:00
James
ff3ab18d16 fix: #1752, removes label from row field type 2022-12-23 10:24:43 -05:00
James
691730974e chore: ensures that isListActive disregards editor parent 2022-12-23 10:15:26 -05:00
James
46a29f54fc chore: removes debugging for slate 2022-12-23 10:05:28 -05:00
James
95127c94a6 chore: fixes rich text tests 2022-12-23 09:54:41 -05:00
James
88a0c56f40 chore: finishes left indent of lists 2022-12-23 08:53:35 -05:00
Jacob Fletcher
6bd5907ad7 chore: reverts 9567328 2022-12-23 08:34:41 -05:00
James
801068c8fe chore: revises left indent 2022-12-22 18:26:09 -05:00
James
4516c3670e chore: overhauls lists, prepares for left indent 2022-12-22 15:55:07 -05:00
Jessica Boezwinkle
73b8ba3d4a fix: json field type 2022-12-22 14:12:39 +00:00
Jacob Fletcher
9567328d28 fix: refreshes document drawer on save 2022-12-21 22:42:00 -05:00
Jacob Fletcher
35abe811c1 fix: allows cleared file to be reselected 2022-12-21 17:55:48 -05:00
Jacob Fletcher
6bc1758dc0 fix: missing file after reselect in upload component 2022-12-21 17:28:09 -05:00
Jacob Fletcher
341c163b36 fix: safely clears sort #1736 2022-12-21 16:50:52 -05:00
PatrikKozak
468b0d2a55 fix: updates richtext toolbar position if inside a drawer 2022-12-21 11:49:31 -05:00
Elliot DeNolf
f873fa8d99 docs: add example Dockerfile and docker-compose.yml (#1735)
* docs: add example Dockerfile and docker-compose.yml

* docs: link to docker deployment from installation
2022-12-21 11:39:32 -05:00
Jacob Fletcher
59de4f7e82 fix: updates relationship label on drawer save and prevents stepnav update 2022-12-20 16:48:47 -05:00
Elliot DeNolf
f02bbe6308 chore: README logo (#1732)
* chore: README header logo

* updates conditionally rendered logo for light/dark mode

* adds img folder with light and dark logos to utilize gh conditional

* moves payload logos to avoid polluting root directory

Co-authored-by: Sean Zubrickas <zubricks@gmail.com>
2022-12-20 13:24:07 -05:00
Jessica Boezwinkle
e5835ae4f6 chore: cleans up files 2022-12-20 16:57:54 +00:00
Jessica Boezwinkle
309569c581 chore: pass options through to JSON and code fields, fix versions preview 2022-12-20 16:47:31 +00:00
James Mikrut
a88dddab22 Merge pull request #1728 from payloadcms/feat/account-doc-access
feat: adds doc permissions to account view
2022-12-20 10:08:01 -05:00
Jarrod Flesch
b5048a3323 chore: threads onSave through to account render component, refreshes docPermissions after successful save 2022-12-20 09:43:56 -05:00
Elliot DeNolf
3ec6b3d846 chore: revert README h1 2022-12-20 09:35:07 -05:00
Sean Zubrickas
d0dacdbde0 chore: readme updates (#1717)
* refines readme banner image, badges and headings

* chore: spruce up README a bit more

* adds dark/light mode support for logo

Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
2022-12-20 09:28:12 -05:00
Jarrod Flesch
8d643fb29d feat: adds doc permissions to account view 2022-12-20 09:13:19 -05:00
Jessica Boezwinkle
e5ffb1e92d Merge branch 'master' of https://github.com/payloadcms/payload into feat/json-field 2022-12-20 13:33:02 +00:00
James
087eeb01a2 chore: rich text type declarations 2022-12-19 23:02:39 -05:00
James
542ea8eb81 fix: #551 - rich text nested list structure 2022-12-19 22:51:24 -05:00
Dan Ribbens
60bb2652f0 fix: get relationships in locale of i18n language setting (#1648) 2022-12-19 20:42:09 -05:00
Jarrod Flesch
7b769caf78 chore: stubs out data layer and simple frontend example allow explicit null value setting 2022-12-19 17:02:45 -05:00
Elliot DeNolf
0796d5394d chore: fix single quotes in translations file 2022-12-19 16:15:11 -05:00
Lukas Frana
0be4285305 feat: add Czech translation (#1705) 2022-12-19 16:12:57 -05:00
James Mikrut
e366624440 Merge pull request #1672 from payloadcms/fix/query-drafts
fix: #1611, unable to query draft versions with draft=true
2022-12-19 16:01:57 -05:00
James
c755143cc0 chore: uses mongo aggregate for merging draft results 2022-12-19 16:01:30 -05:00
James Mikrut
020a2797d5 Merge pull request #1716 from payloadcms/fix/#1656-image-sizes-patch
fix: #1656 remove size data
2022-12-19 15:44:16 -05:00
Dan Ribbens
389ee261d4 fix: #1656 remove size data 2022-12-19 15:31:03 -05:00
PatrikKozak
13fd974a2d Merge pull request #1715 from payloadcms/feat/graphql-16
feat(graphql): upgrade to graphql 16
2022-12-19 14:20:17 -05:00
James Mikrut
d492870924 Merge pull request #1709 from payloadcms/fix/#1698
fix: #1698 - globals and autosave not working
2022-12-19 14:07:14 -05:00
Calvin Lai
57f5f5ec43 feat(graphql): upgrade to graphql 16 2022-12-19 14:01:51 -05:00
Jarrod Flesch
0d06b8c178 Merge pull request #1711 from payloadcms/fix/1701-radio-validation
Fix/radio-field-validation
2022-12-19 12:17:13 -05:00
Jessica Chowdhury
9af4c1dde7 fix: prevents special characters breaking relationship field search (#1710)
* fix: prevents special characters breaking relationship field search

* test: add special char querying w/ like operator

Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
2022-12-19 12:16:30 -05:00
Dan Ribbens
5b70ebd119 fix: use the slug for authentication header API Key
BREAKING CHANGE: replaced the useAPIKey authentication header format to use the collection slug instead of the collection label. Previous: `${collection.labels.singular} API-Key ${apiKey}`, updated: `${collection.slug} API-Key ${apiKey}`
2022-12-19 11:02:40 -05:00
Jarrod Flesch
0dfed3b30a fix: simplifies radio validation 2022-12-19 11:01:57 -05:00
James
915f1e2b3a fix: #1698 - globals and autosave not working 2022-12-19 10:52:11 -05:00
Elliot DeNolf
2e765a1e05 chore: log full error on transport configuration error (#1702) 2022-12-18 21:57:33 -05:00
James
26717c9ce4 chore(release): v1.3.4 2022-12-16 17:55:42 -05:00
James
fc35d845e7 Merge branch 'master' of github.com:payloadcms/payload 2022-12-16 17:39:51 -05:00
James Mikrut
6580fc7f91 Merge pull request #1690 from payloadcms/fix/doc-access
fix: doc access should not run where query on collections without id
2022-12-16 17:39:39 -05:00
James
1b8ab36123 chore: removes unnecessary async 2022-12-16 17:39:02 -05:00
Jarrod Flesch
b8c0482cda fix: run docAccess also when checking global 2022-12-16 17:38:29 -05:00
James Mikrut
100da03647 Merge pull request #1688 from payloadcms/fix/#1658-async-validate
fix: #1658 async validate out of order
2022-12-16 17:38:25 -05:00
Jarrod Flesch
016beb6eec fix: doc access should not run where query on collections without id 2022-12-16 17:36:41 -05:00
James Mikrut
f85d366500 Merge pull request #1689 from payloadcms/fix/#1687
fix: autosave with nested localized fields
2022-12-16 17:24:32 -05:00
James
a5670c3163 chore: simplifies logic for autosave patch 2022-12-16 17:24:13 -05:00
James
4202fc2933 fix: autosave with nested localized fields 2022-12-16 17:14:00 -05:00
Dan Ribbens
e913fbe4ea fix: async validate out of order 2022-12-16 16:45:38 -05:00
James
0fbfe149df chore(release): v1.3.3 2022-12-16 10:07:47 -05:00
Jessica Boezwinkle
07b2ccad61 feat: wires up i18n with monaco editor 2022-12-16 15:04:25 +00:00
James
f715146aa3 fix: ensures select field avoids circular dependencies 2022-12-16 10:01:08 -05:00
Jessica Boezwinkle
efe4f6d861 feat: fixes json editor errors and misc styling 2022-12-16 13:34:21 +00:00
James
8eaf05efef chore: json field now edits string but saves json in db 2022-12-15 21:10:56 -05:00
James
6c7282ec37 Merge branch 'feat/json-field' of github.com:payloadcms/payload into feat/json-field 2022-12-15 20:32:30 -05:00
James
d9d05f3644 chore: uses aggregate query if draft=true 2022-12-15 20:31:06 -05:00
Dan Ribbens
d88daa433e chore: Revert "chore: allow empty string route.api" (#1681) 2022-12-15 15:08:50 -05:00
Jessica Boezwinkle
4d6eba8d21 feat: updates code field editor 2022-12-15 18:47:53 +00:00
Jessica Boezwinkle
28d9f9009c feat: adds initial json field 2022-12-15 18:32:11 +00:00
Dan Ribbens
91e33ad1ee fix: allow translation in group admin.description (#1680) 2022-12-15 13:13:33 -05:00
James
4359564e2f chore(release): v1.3.2 2022-12-15 12:58:23 -05:00
James
420eef4d91 fix: safely handles rich text deselection 2022-12-15 12:39:57 -05:00
Dan Ribbens
d2f281d318 chore: update changelog 2022-12-15 12:26:06 -05:00
Dan Ribbens
2f723e0d78 chore(release): v1.3.1 2022-12-15 12:15:09 -05:00
Jacob Fletcher
a1813ca4b3 fix: stringifies date in DateTime field for useAsTitle (#1674) 2022-12-15 10:05:49 -05:00
Dan Ribbens
049d560898 fix: add i18n type to collection and globals admin.description (#1675) 2022-12-15 09:45:06 -05:00
Dan Ribbens
91493f9e8f chore: richtext relationship i18n label (#1662) 2022-12-15 09:23:21 -05:00
PatrikKozak
64086e8122 fix: collapsible children margin bottom (#1673) 2022-12-15 09:22:26 -05:00
Dan Ribbens
75d2cbe9e3 chore: update global admin group type (#1647) 2022-12-15 09:09:53 -05:00
Jacob Fletcher
a0b41eb83b fix: ensures unique document drawer slugs 2022-12-14 16:26:50 -05:00
James
44b31a9e58 fix: #1611, unable to query draft versions with draft=true 2022-12-14 16:25:04 -05:00
Jarrod Flesch
de4c7ae625 Merge pull request #1671 from iamprompt/fix-array-collapsible-label-i18n
fix: array collapsible lable i18n object
2022-12-14 16:20:41 -05:00
Jacob Fletcher
414ae9e11f Merge pull request #1669 from iamprompt/fix-label-i18n-add-relationship-tooltip
fix: add new relationship tooltip label translation
2022-12-14 16:17:20 -05:00
James Mikrut
f13742c1f7 Merge pull request #1670 from payloadcms/fix/select-field-clear-value
Fix/select field clear value
2022-12-14 16:16:21 -05:00
Jarrod Flesch
eda6f70acb Roadmap/#1379 admin ui doc level access (#1624)
* feat: adds document level access endpoints so admin ui can now accurately reflect document level access control
* chore(docs): new doc access callout, updates useDocumentInfo props from change
2022-12-14 16:14:29 -05:00
Supakarn Laorattanakul
8b18da78fe fix i18n object in array collapsible lable 2022-12-15 03:08:09 +07:00
Supakarn Laorattanakul
36c1008a22 fix label i18n - add new relationship tooltip 2022-12-15 02:49:00 +07:00
PatrikKozak
c52389ecb6 Merge branch 'master' of https://github.com/payloadcms/payload into fix/select-field-clear-value 2022-12-14 14:41:52 -05:00
PatrikKozak
80da898de8 fix: adds draftsEnabled to baseSchema for tabs / arrays / groups & allows for null enum 2022-12-14 14:41:41 -05:00
PatrikKozak
b4f39d5fd3 fix: removes case for select field that sets data to undefined if set to null 2022-12-14 14:39:39 -05:00
PatrikKozak
f0db5e0170 fix: adds draftsEnabled to versionSchema in collections / globals 2022-12-14 14:38:18 -05:00
Supakarn Laorattanakul
d9c45f62b1 fix: label translation in about to delete dialog (#1667) 2022-12-14 13:16:15 -05:00
Jacob Fletcher
3ae5d954b5 Merge pull request #1558 from jacobsfletch/feat/inline-relationships
roadmap: inline relationships
2022-12-14 09:51:54 -05:00
PatrikKozak
934b443b5b fix: list view date field display format (#1661) 2022-12-14 07:09:54 -05:00
James Mikrut
965bd456cd Merge pull request #1653 from damtzi/fix/#1652-dashboard-to-custom-route
fix: Set 'Dashboard's link to config route (#1652)
2022-12-13 11:00:43 -05:00
Damian Tziamtzis
9d4dac892e fix: Remove template literal from link 2022-12-12 23:16:56 +01:00
Damian Tziamtzis
940c1e84f5 fix: Set 'Dashboard's link to config route (#1652) 2022-12-12 23:10:57 +01:00
Alessio Gravili
1d7ed8aff9 chore: add default credentials to contributing.md (#1642) 2022-12-12 09:40:34 -05:00
Supakarn Laorattanakul
c15da3178e chore: improve thai translation (#1641) 2022-12-12 09:13:13 -05:00
Elliot DeNolf
c0f8f94cd6 chore: update payload component usage comment 2022-12-11 12:43:21 -05:00
Jacob Fletcher
92d2c4d805 fix: fields e2e tests 2022-12-09 17:50:54 -05:00
Jacob Fletcher
50ea48901e Merge branch 'master' into feat/inline-relationships 2022-12-09 15:37:40 -05:00
Jacob Fletcher
c72f074b77 fix: fields-relationship e2e tests 2022-12-09 15:34:35 -05:00
PatrikKozak
72f7927cc6 chore: adds close & edit keys to translations (#1640) 2022-12-09 14:57:40 -05:00
Jacob Fletcher
cb0437fbca Merge branch 'master' into feat/inline-relationships 2022-12-09 13:18:49 -05:00
Jacob Fletcher
bc6cc8dd14 chore: bumps pino-pretty to latest 2022-12-09 13:16:54 -05:00
Jacob Fletcher
1695b8f263 chore: document drawer a11y 2022-12-09 13:01:57 -05:00
Elliot DeNolf
6ea462c0f7 docs: fix graphql localhost link 2022-12-09 12:24:09 -05:00
Dan Ribbens
45e4504a7b chore(release): v1.3.0 2022-12-09 09:53:33 -05:00
Elliot DeNolf
ba2f2d6e9b feat!: no longer sanitize collection slugs to kebab case (#1607)
BREAKING CHANGE: collection slugs are no longer automatically sanitized to be kebab case. This will only be an issue if your current slugs were in camel case. The upgrade path will be to change those slugs to the kebab case version that the slug was automatically being sanitized to on the backend.

If you only use kebab case or single word slugs: no action needed.

If you have existing slugs with camel case and populated data: you'll need to convert these to the kebab case version to match the previously sanitized value.

ie. myOldSlug is your slug, you should convert it to my-old-slug.

Any future slugs after updating will be used as-is.
2022-12-09 09:40:05 -05:00
Nut Pinyo
7777d11b9e feat: add Thai translation (#1630) 2022-12-09 09:38:57 -05:00
Dan Ribbens
eff3f18e7c fix: #1632 graphQL non-nullable relationship and upload fields (#1633) 2022-12-09 09:38:05 -05:00
Dan Ribbens
756edb858a fix: Select with hasMany and localized (#1636) 2022-12-09 09:36:39 -05:00
Dan Ribbens
b6c597ab5c fix: translation key in revert published modal (#1628) 2022-12-09 09:35:40 -05:00
Dan Ribbens
a44dba5ccc chore: cleanup test fields relationship config (#1635) 2022-12-08 22:46:31 -05:00
Dan Ribbens
11b1c0efc6 fix: filterOptions function argument relationTo is an array (#1627)
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2022-12-08 21:24:00 -05:00
Jacob Fletcher
3da0cb9c79 chore: improves useDocumentDrawer memoization 2022-12-08 18:13:46 -05:00
Jacob Fletcher
a36ac209b2 fix: drawer blur, scroll, and document sidebar 2022-12-08 18:12:48 -05:00
Jacob Fletcher
e101f925cc feat: further Tooltip improvements 2022-12-08 17:01:00 -05:00
James
bff7c9f7aa chore: ensures rich text initialValue exists 2022-12-08 16:11:13 -05:00
Jacob Fletcher
17fac6e6a0 chore: general ReactSelect and Relationship styles 2022-12-08 14:22:02 -05:00
Jacob Fletcher
00b3b768eb feat: supports tooltip show and delay 2022-12-08 14:11:55 -05:00
James
9558a22ce6 fix: resets slate state when initialValue changes, fixes #1600, #1546 2022-12-08 11:39:17 -05:00
Jarrod Flesch
512bc1ebe6 fix: sanitizes global find query params 2022-12-08 08:39:17 -05:00
Jacob Fletcher
39a956cee3 fix: relationship drawer permissions 2022-12-07 16:40:42 -05:00
Jacob Fletcher
6da13f3794 chore: moves drawer logic from ReactSelect to Relationship 2022-12-07 16:22:33 -05:00
Dan Ribbens
471d21410a fix: change edit key to prevent richtext editor from crashing (#1616) 2022-12-07 14:47:47 -05:00
Jacob Fletcher
f290cda333 fix: escapes react-select events when drawer is open 2022-12-07 12:40:19 -05:00
Christoffer Bjelke
759f001681 feat: add Norwegian bokmål (nb) translation (#1614) 2022-12-07 10:39:02 -05:00
Carsten Dietzel
dc806a9650 chore: update de.json (#1608) 2022-12-07 07:54:25 -05:00
Jacob Fletcher
5f0227fa80 chore: custom react-select clear indicator 2022-12-06 23:45:27 -05:00
Jacob Fletcher
e2fce30964 fix: add new relationship modal when related to many 2022-12-06 18:00:58 -05:00
James Mikrut
1c193b0ed2 Merge pull request #1609 from payloadcms/chore/translation-key-problem-uploading
chore: fix incorrect translation key in FileUploadError
2022-12-06 16:02:06 -05:00
Dan Ribbens
5588b342d7 chore: fix incorrect translation key in FileUploadError 2022-12-06 15:51:00 -05:00
Jacob Fletcher
f4b099a3d1 chore: removes useDrawer hook and drawer context 2022-12-06 14:56:14 -05:00
Jacob Fletcher
49528dd3c3 fix: relationship create and edit onSave handling 2022-12-06 14:56:03 -05:00
James Mikrut
3aee027b0f Merge pull request #1606 from jacobsfletch/fix/1605-filter-options
fix: unflattens fields in filterOptions callback
2022-12-06 13:53:07 -05:00
Jacob Fletcher
92177e012c Merge branch 'master' into feat/inline-relationships 2022-12-06 13:00:15 -05:00
Jacob Fletcher
acff46b4a5 fix: unflattens fields in filterOptions callback 2022-12-06 12:26:58 -05:00
Jacob Fletcher
445c6fc775 chore: reconfigures useDocumentDrawer hook 2022-12-06 12:13:30 -05:00
Jarrod Flesch
de57aa8417 Merge pull request #1532 from payloadcms/feat/#1423-copy-paste-upload
Feat/#1423 copy paste upload
2022-12-06 10:20:13 -05:00
Jarrod Flesch
ff1b4b098c style: reverts upload field to original, keeps underlying copy-paste functionality 2022-12-06 10:05:22 -05:00
James
a72123dd47 fix: #1547, global afterChange hook not falling back to original global if nothing returned 2022-12-06 09:56:52 -05:00
James
5d0fe9a6da chore(release): v1.2.5 2022-12-06 09:38:25 -05:00
James
04eaf725a0 Merge branch 'master' of github.com:payloadcms/payload 2022-12-06 09:32:18 -05:00
James
46a96ccb2e chore: ensures date field modifies form modified 2022-12-06 09:32:10 -05:00
James Mikrut
0b857f7234 Merge pull request #1584 from kalon-robson/fix/missing-unpublish
fix: #1583 mismatch language condition when rendering unpublish
2022-12-06 09:18:06 -05:00
torunai
c8a683100f feat: add Turkish translations (#1596) 2022-12-06 09:14:22 -05:00
Jacob Fletcher
4e0dd3d12d Merge pull request #1592 from jacobsfletch/fix/relationship-option
fix: relationship option
2022-12-05 17:15:49 -05:00
Jacob Fletcher
d9eb1ea801 fix: remounts document drawer when single-value relationship changes 2022-12-05 14:07:42 -05:00
Jacob Fletcher
881c067c40 fix: exits findOptionsByValue when matchedOption is found 2022-12-05 14:04:46 -05:00
PatrikKozak
9d4f4c6305 chore: removes isLocked since not being defined and always returning false (#1553) 2022-12-05 12:37:50 -05:00
Jarrod Flesch
3e2d1b5e9d Merge pull request #1580 from payloadcms/fix/inline-relationship-select
fix: uses pathOrName to pass to internal Relationship field components
2022-12-05 11:09:03 -05:00
James
b6ec4bd2d4 chore: binds prefs model even if not local 2022-12-05 10:25:36 -05:00
Jarrod Flesch
b70dc83d0e Merge pull request #1589 from payloadcms/fix/NaN-limit-and-depth-query
fix: safely coerces limit and depth to number or undefined
2022-12-05 09:29:59 -05:00
Roman Ryzhikov
a2eda6999a chore: update russian translation (#1582) 2022-12-05 09:29:00 -05:00
Jarrod Flesch
dd04d7842e fix: safely coerces limit and depth to number or undefined 2022-12-05 08:41:47 -05:00
Jacob Fletcher
3c862add3c fix: prevents react-select from opening on drawer toggle 2022-12-05 00:29:30 -05:00
Kalon Robson
3ddd0ea3ef fix: mismatch language condition when rendering unpublish 2022-12-04 00:42:38 +00:00
bobbyZ
8ad0042f5f chore: added german translation for richtext fields (#1579) 2022-12-03 17:06:26 -05:00
Jarrod Flesch
8874e871d4 fix: uses pathOrName to pass to internal Relationship field components 2022-12-03 13:44:46 -05:00
Dan Ribbens
356ab8d7eb chore(release): v1.2.4 2022-12-03 12:40:50 -05:00
Dan Ribbens
2dcada199c fix: missing translation richText link modal (#1573) 2022-12-03 12:29:33 -05:00
Dan Ribbens
ca59efe396 chore: typescript typo fix (#1575) 2022-12-03 12:28:08 -05:00
Jacob Fletcher
5592fb148d feat: custom button html element 2022-12-03 00:31:00 -05:00
Jacob Fletcher
1f53990bb1 Merge branch 'master' into feat/inline-relationships 2022-12-02 23:14:10 -05:00
Jacob Fletcher
811ade60b4 feat: wires DocumentDrawer into singular relationships 2022-12-02 17:44:12 -05:00
Jacob Fletcher
6fab722a2e fix: prevents duplicative DocumentDrawer 2022-12-02 15:46:46 -05:00
Jacob Fletcher
83eef0bc77 chore: migrates from react-sortable-hoc to @dnd-kit 2022-12-02 14:26:26 -05:00
Dan Ribbens
308dc3d600 chore(release): v1.2.3 2022-12-02 12:52:18 -05:00
Dan Ribbens
396ea0bd53 fix: reset password regression (#1574) 2022-12-02 12:36:19 -05:00
Dan Ribbens
44df7f523b chore(release): v1.2.2 2022-12-01 20:24:05 -05:00
James Mikrut
8b36ff8d60 Merge pull request #1551 from payloadcms/fix/#1505-collection-model-types
chore: extend CollectionModel type to include mongoose model
2022-12-01 19:30:25 -05:00
James Mikrut
e01b165693 Merge pull request #1559 from payloadcms/fix/#1512-localized-drafts
fix: update drafts includes latest version changes
2022-12-01 19:08:23 -05:00
James Mikrut
15671f2494 Merge pull request #1564 from payloadcms/docs/update-label-descriptions
docs: remove GraphQL from label descriptions
2022-12-01 19:07:44 -05:00
Jacob Fletcher
dd217750d7 feat: retrofits DocumentDrawer into relationship multi-select 2022-12-01 18:01:51 -05:00
Jacob Fletcher
7a42e38cca feat: supports custom react-select components 2022-12-01 17:42:24 -05:00
Jacob Fletcher
475f147f2c feat: retrofits DocumentDrawer into relationship AddNew 2022-12-01 16:39:51 -05:00
Jacob Fletcher
670e5243a9 fix: prevents recursive DocumentDrawer 2022-12-01 16:39:51 -05:00
Jacob Fletcher
2118927f42 feat: builds DocumentDrawer component 2022-12-01 16:39:51 -05:00
Jacob Fletcher
f8cf4c7b6a chore: reconfigures drawer context 2022-12-01 16:39:51 -05:00
Jacob Fletcher
c6013c3904 feat: builds Drawer component 2022-12-01 16:39:51 -05:00
Jarrod Flesch
80d8367a2f Merge pull request #1560 from payloadcms/roadmap/#1401-decouple-pagination-args
Roadmap/#1401 decouple pagination args
2022-12-01 16:34:22 -05:00
Dan Ribbens
283343c4a4 docs: update upload filterOptions 2022-12-01 15:50:41 -05:00
Dan Ribbens
924d903456 docs: remove GraphQL from label descriptions 2022-12-01 15:48:40 -05:00
Justin Nicewander
49efd028fa docs: add filter options section to upload field docs. (#1550) 2022-12-01 15:47:37 -05:00
Jarrod Flesch
e6bda625b4 chore: fixes test expectation 2022-12-01 12:17:47 -05:00
Jarrod Flesch
226c7d5da5 chore: adds REST test for http limitless query param 2022-12-01 11:43:15 -05:00
Jarrod Flesch
891f00d05c fix: allows for limit bypass on version find operations 2022-12-01 10:44:11 -05:00
Jarrod Flesch
c8d1b9f88a fix: sanitize number query params before passing to find operation 2022-12-01 10:06:22 -05:00
Jarrod Flesch
a71801006c fix: adjusts how limit is set, both in options and paginates limit 2022-12-01 09:10:56 -05:00
Jarrod Flesch
dc4e0971a6 chore: simplifies logic to decouple pagination and limit 2022-12-01 08:17:00 -05:00
Jarrod Flesch
f7ce0c615d feat: decouples limit from pagination, allows for no limit query 2022-11-30 22:18:37 -05:00
Jarrod Flesch
dce2081663 fix: aligns mongoose PaginatedDocs type with actual lib type 2022-11-30 22:17:38 -05:00
Dan Ribbens
48989d0f6e fix: update drafts includes latest version changes 2022-11-30 17:03:00 -05:00
Chris Waschl
47fd0d9ec4 fix(i18n): requiresAtLeast variable in de.json (#1556) 2022-11-30 16:32:37 -05:00
Dan Ribbens
bbe547ec47 chore: extend CollectionModel type to include mongoose model 2022-11-30 10:47:04 -05:00
Dan Ribbens
c211a804bd chore: change test assertion to be more consistent (#1543) 2022-11-29 18:24:40 -05:00
Dan Ribbens
57fbff3655 chore: fix translation rich text links (#1499) 2022-11-29 16:36:05 -05:00
Jarrod Flesch
5a158c1b58 Merge pull request #1541 from payloadcms/fix/#1495-sharp-types
Fix/#1495 Sharp types
2022-11-29 16:19:46 -05:00
Jarrod Flesch
088cc16f9b Merge pull request #1523 from payloadcms/fix/#1461-unpublish-validation
Fix/#1461 Form validation when un-publishing
2022-11-29 16:02:50 -05:00
Jarrod Flesch
b3d526b59a fix: moves sharp types from devDeps to deps 2022-11-29 16:00:53 -05:00
Jarrod Flesch
afe2ed2ebc chore: removes frontend ui logic, unnecessary when overwriting document on unpublish 2022-11-29 15:44:56 -05:00
Jarrod Flesch
e6f1c6fc7b fix: corrects skipValidation 2022-11-29 15:44:56 -05:00
Jarrod Flesch
77ab54243a fix: ignore validation when unpublishing, do not allow restore with invalid form state 2022-11-29 15:44:56 -05:00
Dan Ribbens
5a69ed562e chore: fix translation key requiresAtLeast (#1538) 2022-11-29 15:43:41 -05:00
Angelo Bartolome
7aada3c746 fix: indexSortableFields timestamp fields #1506 (#1537) 2022-11-29 15:36:27 -05:00
Jarrod Flesch
425b66a0c2 Merge pull request #1501 from payloadcms/fix/#1446-graphql-contains-schema 2022-11-29 14:15:41 -05:00
Jacob Fletcher
f4ac714286 Merge pull request #1520 from jacobsfletch/docs/rate-limit
docs: rateLimit defaults
2022-11-29 12:50:28 -05:00
Jacob Fletcher
c9bfdbb63c docs: rateLimit defaults 2022-11-29 12:48:53 -05:00
Jarrod Flesch
c56381b721 Merge pull request #1475 from payloadcms/fix/#1442-reactive-relationship-select
Fix/#1442 reactive relationship select
2022-11-29 11:24:37 -05:00
Jarrod Flesch
70675251e5 Merge pull request #1529 from iheidari-aci/patch-1
Add type to fix TS error for re-exporting a type
2022-11-29 11:17:46 -05:00
Jarrod Flesch
3482dd5f78 Merge pull request #1521 from payloadcms/fix/light-theme-syntax
fix: updates syntax colors for light theme
2022-11-29 11:14:11 -05:00
Jessica Boezwinkle
3eebd6613f fix: updates code field css 2022-11-29 16:05:28 +00:00
Jessica Boezwinkle
d03f0aef84 fix: uses baseClass in code field 2022-11-29 16:03:34 +00:00
Jarrod Flesch
b0964b066b chore: exports types as types from /components 2022-11-29 10:37:46 -05:00
Thomas Ghysels
5bd86571ca feat: improve typescript comments (#1467) 2022-11-29 10:10:30 -05:00
Elliot DeNolf
a90a1a9e19 feat: log email transport error messages (#1469) 2022-11-29 09:33:00 -05:00
Jarrod Flesch
d10a993465 Merge pull request #1534 from payloadcms/fix/#1517-blockName-cutoff
fix: blockName grows in all browsers
2022-11-29 09:28:25 -05:00
Jarrod Flesch
03c2ab52a8 fix: blockName grows in all browsers 2022-11-29 08:57:53 -05:00
Jarrod Flesch
143362d45c chore: styles copy paste, adds text translations 2022-11-29 08:41:17 -05:00
Arick
eb69b82adf feat: upload support pasting file 2022-11-29 08:26:11 -05:00
Jessica Boezwinkle
1a6c9a3e18 feat: removes theme provider and updates background for code fields 2022-11-29 10:48:57 +00:00
Iman
6cb9ab6b44 Add type to fix TS error for re-exporting a type
To fix TS error:
Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
2022-11-28 18:28:49 -08:00
Dan Ribbens
04c689c5b0 fix: handle multiple locales in relationship population (#1452) 2022-11-28 14:24:01 -05:00
Jessica Boezwinkle
dbfe7ca6e6 fix: updates syntax colors for light theme 2022-11-28 16:22:13 +00:00
Christian Reichart
e9d2163601 fix: german translation optimizations (#1485)
Co-authored-by: Christian Reichart <christian.reichart@camperboys.com>
2022-11-28 10:02:58 -05:00
Jarrod Flesch
ec51929b1a fix: ensures enums cannot query on partial matches 2022-11-23 16:38:25 -05:00
Jarrod Flesch
a0d03667c5 docs: updates messsy components banner 2022-11-23 16:21:44 -05:00
Jacob Fletcher
246ab414c8 chore: writes e2e test for dynamic filterOptions 2022-11-23 15:11:16 -05:00
Jarrod Flesch
cde1f128e9 chore: adds contains to operators.contains 2022-11-23 14:59:51 -05:00
Jarrod Flesch
4c37af6f10 fix: adds contain operators for text/email/radio fields 2022-11-23 14:46:54 -05:00
Jarrod Flesch
5e829a94bf Merge pull request #1482 from payloadcms/fix/#1479-edit-view-sidebar-styles
Fix/#1479 edit view sidebar styles
2022-11-23 14:26:10 -05:00
Jarrod Flesch
56144c07f0 chore: merge tests 2022-11-23 14:05:56 -05:00
Jacob Fletcher
99c1f41e30 fix: dynamic relationship filterOptions 2022-11-23 13:47:44 -05:00
Jacob Fletcher
be9b5adfa3 types: passes generic through FilterOptions 2022-11-23 13:00:19 -05:00
Jacob Fletcher
a9da81f18c fix: reverts async reducer and resolves infinite effect 2022-11-23 12:11:01 -05:00
Jacob Fletcher
54ef40a335 fix: moves relationship field useEffect into async reducer action 2022-11-23 10:39:38 -05:00
James
fbb4944e83 chore: fixes broken tests and ts 2022-11-22 20:05:40 -05:00
James
56682c7fd4 chore: improves logic for ensuring programmatically set relationship values have options loaded 2022-11-22 19:35:23 -05:00
Vlad Kovalevsky
114758b193 chore: allow empty string route.api 2022-11-22 15:46:22 -05:00
Jarrod Flesch
1602bdc17a chore: moves ensureValuesAreLoaded into effect 2022-11-22 15:17:04 -05:00
Dan Ribbens
9ea41fbb58 chore: fix translation key (#1491) 2022-11-22 13:12:58 -05:00
Jarrod Flesch
59631c7879 chore: adds preview button to versions test configs 2022-11-22 09:13:41 -05:00
Jarrod Flesch
9770affad0 chore: improves edit screen sidebar styles 2022-11-22 09:13:00 -05:00
Dan Ribbens
9f6f2d24f3 Merge branch 'master' of github.com:payloadcms/payload 2022-11-21 21:31:16 -05:00
Dan Ribbens
efb4bd17d4 chore(release): v1.2.1 2022-11-21 21:30:59 -05:00
Dan Ribbens
3a9dc9ef68 fix: translate select field option labels (#1476) 2022-11-21 20:45:23 -05:00
Dan Ribbens
8123585592 fix: translate version comparison view field labels (#1470) 2022-11-21 20:19:16 -05:00
Jarrod Flesch
1d1d2493aa fix: rendering of localized select value 2022-11-21 17:07:22 -05:00
Dan Ribbens
7b6a9ede6e feat: add i18n to option labels in version comparison (#1477) 2022-11-21 16:38:01 -05:00
Dan Ribbens
400cb9b6bc fix: invalid query string user account request (#1478) 2022-11-21 16:32:15 -05:00
Carlo Brualdi
078c28bd5f fix: versionCount was broken & other i18n improvements (#1450) 2022-11-21 16:24:13 -05:00
Jarrod Flesch
23f1ac1e72 chore: updates inline comment 2022-11-21 16:12:50 -05:00
Jarrod Flesch
16d00e87c2 fix: infinite rerenders, accounts for hasMany false 2022-11-21 16:09:31 -05:00
Jarrod Flesch
6a28a41069 chore: adds precision to relationship test 2022-11-21 15:17:48 -05:00
Jacob Fletcher
59a4355614 Merge pull request #1451 from jacobsfletch/fix/draft-patch
fix: ensures draft operations save as drafts
2022-11-21 15:15:52 -05:00
Jarrod Flesch
e4435bb8bd fix: allows for form controlled relationship fields to be populated 2022-11-21 12:55:06 -05:00
Dan Ribbens
3a622fcd63 chore: fix translation namespace typo (#1460) 2022-11-21 11:21:44 -05:00
James Mikrut
29ed75c329 Merge pull request #1456 from jacobsfletch/fix/reactive-stepnav
fix: dynamically sets stepnav from default edit view
2022-11-21 09:13:23 -05:00
Jarrod Flesch
9303e32273 Merge pull request #1420 from thgh/fix/textarea-click-target
fix: Increase textarea click area
2022-11-21 08:13:24 -05:00
Elliot DeNolf
3dbf4e2cd7 chore: simplify bug report template 2022-11-20 12:57:05 -05:00
Ed
5673b709ec docs: make it clear that lockTime is defined in ms (#1459) 2022-11-20 12:50:03 -05:00
Valentín Costa
b00987b044 docs: add missing S in example of i18n (#1463) 2022-11-20 12:47:52 -05:00
Elliot DeNolf
075b7e9f02 fix(i18n): version count (#1465) 2022-11-20 12:46:57 -05:00
Jacob Fletcher
40c87784b0 fix: dynamically sets stepnav from default edit view 2022-11-18 17:30:33 -05:00
Jarrod Flesch
bf30713860 chore: removes unnecessary styles 2022-11-18 16:14:31 -05:00
Jarrod Flesch
2e57b76df0 fix: adjusts styles to allow error bg to fill textarea 2022-11-18 16:11:32 -05:00
Jarrod Flesch
ab4aa9eec6 Merge pull request #1453 from payloadcms/fix/#1424-isClearable-select
fix: sanitizes null select value on the server
2022-11-18 15:19:02 -05:00
Jarrod Flesch
699ca14434 fix: sanitizes select values on the server, allowing isClearable selects to be cleared without error 2022-11-18 14:58:51 -05:00
Jacob Fletcher
25822a91b1 fix: allows patching global drafts #1415 2022-11-18 14:55:24 -05:00
Jacob Fletcher
f700f51f2b fix: flattens locales before versioning published docs #1415 2022-11-18 14:31:25 -05:00
Jacob Fletcher
af6a7aa9e8 fix: versions tests 2022-11-18 14:27:58 -05:00
Jacob Fletcher
b3c232dbbe chore: write tests for draft patches #1415 2022-11-18 13:08:24 -05:00
Jacob Fletcher
fc16ffefdb fix: ensures drafts operations saves as draft #1415 2022-11-18 13:08:16 -05:00
Jarrod Flesch
1d6cf04647 Merge pull request #1447 from payloadcms/fix/1441-options-type
Fix/1441 options type
2022-11-18 12:29:28 -05:00
Jarrod Flesch
a2c0481f59 chore: updates changelog with examples 2022-11-18 11:37:29 -05:00
Jarrod Flesch
bb6ee6a974 chore: reverts irrelevant ts-config change 2022-11-18 08:26:05 -05:00
Dan Ribbens
fa577d0490 chore(release): v1.2.0 2022-11-18 07:43:45 -05:00
Dan Ribbens
bab34d82f5 feat: add i18n to admin panel (#1326)
Co-authored-by: shikhantmaungs <shinkhantmaungs@gmail.com>
Co-authored-by: Thomas Ghysels <info@thomasg.be>
Co-authored-by: Kokutse Djoguenou <kokutse@Kokutses-MacBook-Pro.local>
Co-authored-by: Christian Gil <47041342+ChrisGV04@users.noreply.github.com>
Co-authored-by: Łukasz Rabiec <lukaszrabiec@gmail.com>
Co-authored-by: Jenny <jennifer.eberlei@gmail.com>
Co-authored-by: Hung Vu <hunghvu2017@gmail.com>
Co-authored-by: Shin Khant Maung <101539335+shinkhantmaungs@users.noreply.github.com>
Co-authored-by: Carlo Brualdi <carlo.brualdi@gmail.com>
Co-authored-by: Ariel Tonglet <ariel.tonglet@gmail.com>
Co-authored-by: Roman Ryzhikov <general+github@ya.ru>
Co-authored-by: maekoya <maekoya@stromatolite.jp>
Co-authored-by: Emilia Trollros <3m1l1a@emiliatrollros.se>
Co-authored-by: Kokutse J Djoguenou <90865585+Julesdj@users.noreply.github.com>
Co-authored-by: Mitch Dries <mitch.dries@gmail.com>

BREAKING CHANGE: If you assigned labels to collections, globals or block names, you need to update your config! Your GraphQL schema and generated Typescript interfaces may have changed. Payload no longer uses labels for code based naming. To prevent breaking changes to your GraphQL API and typescript types in your project, you can assign the below properties to match what Payload previously generated for you from labels.

On Collections
Use `graphQL.singularName`, `graphQL.pluralName` for GraphQL schema names.
Use `typescript.interface` for typescript generation name.

On Globals
Use `graphQL.name` for GraphQL Schema name.
Use `typescript.interface` for typescript generation name.

On Blocks (within Block fields)
Use `graphQL.singularName` for graphQL schema names.
2022-11-18 07:36:30 -05:00
Jarrod Flesch
7c6d6fd1ca feat: exports field types properly 2022-11-17 17:06:34 -05:00
Jarrod Flesch
ed01a17621 fix: removes incorrectly import/export option type - #1441 2022-11-17 16:45:38 -05:00
Jarrod Flesch
c49ee15b6a Merge pull request #1223 from bigmistqke/feat/customizable-header-labels
WIP: customizable RowHeaders
2022-11-16 15:06:16 -05:00
Jarrod Flesch
402b1e4615 chore: adds visualization to test examples, reduces collapsibles in test file 2022-11-16 14:54:36 -05:00
Jarrod Flesch
8d827933f3 docs: updates docs to reflect new API 2022-11-16 13:35:00 -05:00
Jarrod Flesch
65f0e1caac fix: build errors 2022-11-16 13:08:07 -05:00
Jarrod Flesch
d9df98ff22 feat: simplifies collapsible label API, adds e2e tests 2022-11-16 12:57:54 -05:00
Jarrod Flesch
999c8fc08b Merge remote-tracking branch 'origin/master' into pr/bigmistqke/1223 2022-11-16 09:05:07 -05:00
Jarrod Flesch
fe221aea67 Merge remote-tracking branch 'origin/master' into pr/bigmistqke/1223 2022-11-16 09:00:53 -05:00
Jarrod Flesch
57a8c352e4 feat: adds playwright tests for array fields 2022-11-16 09:00:50 -05:00
Thomas Ghysels
c303913e61 fix: Increase textarea click area 2022-11-16 01:41:08 +01:00
Jarrod Flesch
e458087a55 fix: sets pointer-events to none so the entire label bar is clickable 2022-11-15 16:05:54 -05:00
Jarrod Flesch
ccb42319ab fix: corrects type for CollapsibleLabel example type, adjusts custom component filenames 2022-11-15 12:40:31 -05:00
Jarrod Flesch
2bf0fffa0d feat: adds docs example 2022-11-15 12:37:47 -05:00
Jarrod Flesch
b74ea218ca feat: specifies component names for arrays/collapsibles, simplifies threaded data 2022-11-15 11:34:36 -05:00
James
49cbb2d0ac chore(release): v1.1.26 2022-11-15 09:26:01 -05:00
Jarrod Flesch
2878b4b1be fix: corrects exported custom component type 2022-11-15 09:23:20 -05:00
James
0f0dc0948e Merge branch 'master' of github.com:payloadcms/payload 2022-11-15 09:21:00 -05:00
James
50bcf001ea fix: #1414 2022-11-15 09:20:54 -05:00
James Mikrut
7be202486b Update CHANGELOG.md 2022-11-15 08:40:12 -05:00
James
f938dd718f chore(release): v1.1.25 2022-11-15 08:39:43 -05:00
James Mikrut
94b2ef1613 Merge pull request #1411 from jacobsfletch/master
Saves tabs to user preferences
2022-11-15 08:06:03 -05:00
Jacob Fletcher
71a6c58b27 chore: cleans up handleTabChange async callback 2022-11-15 07:40:39 -05:00
Jarrod Flesch
13ec1e0398 feat: converts rowHeader to collapsibleLabel, extends data passed to functions/components 2022-11-15 01:53:09 -05:00
Jacob Fletcher
35426eef36 feat: updates tab preference keys 2022-11-14 18:30:18 -05:00
Jacob Fletcher
32833ec571 Merge branch 'payloadcms:master' into master 2022-11-14 17:49:36 -05:00
Jacob Fletcher
5eb8e4a28f feat: saves tab index to user preferences 2022-11-14 17:49:18 -05:00
Thomas Ghysels
0f27b103b4 feat: let textarea grow based on value (#1398)
* feat: autogrowing textarea

* feat: sets textarea min-height and reduces height on mobile

Co-authored-by: Jessica Boezwinkle <jessica@trbl.design>
2022-11-14 16:26:22 -05:00
James
d103f6c94f fix: ensures admin components is defaulted 2022-11-14 15:46:34 -05:00
Alberto Maghini
a345ef0d31 feat: admin UI logout extensibility (#1274)
* added Logout documentation

* updated type and schema

* updated logout component, route and inactivityRoute references

* added custom Logout component into test admin instance

* fixed windows path management

* added dotenv usage

* added check on testSuiteDir and provided more meaningful error message

* fixed object destructure

* updated from logout.route to logoutRoute

* extracted getSanitizedLogoutRoutes method

* added unit tests

* updated references

* updated doc

* reviewed casing and added defaults

* updated usage

* restored workers previous value

* fixed config validation

* updated docs and schema

* updated reference to logoutRoute and inactivityRoute

* updated test ref

Co-authored-by: Alberto Maghini (MSC Technology Italia) <alberto.maghini@msc.com>
Co-authored-by: Alberto Maghini <alberto@newesis.com>
2022-11-14 14:55:31 -05:00
Thomas Ghysels
4d8cc97475 fix: add slug to DocumentInfo context (#1389) 2022-11-14 14:54:05 -05:00
James
7556b54017 chore: fixes TS error in UploadGallery 2022-11-14 14:49:31 -05:00
Feng Sun
5e8a8b2df9 fix: adds unique key to upload cards to prevent old images being shown while navigating to new page 2022-11-14 14:48:08 -05:00
James Mikrut
244fb63c6d Update what-is-payload.mdx 2022-11-14 14:19:48 -05:00
bigmistqke
e4f2be3dec RowHeaderFunction becomes RowHeaderComponent 2022-11-14 17:44:39 +01:00
bigmistqke
f43f433f51 add index to tests 2022-11-14 17:42:50 +01:00
James Mikrut
84f01e8836 Update ui.mdx 2022-11-14 10:11:28 -05:00
bigmistqke
30def3511e add RowHeaders to array's and collapsible's tests 2022-11-14 15:54:21 +01:00
bigmistqke
27499981c8 admin.header to admin.components.RowHeader 2022-11-14 15:53:37 +01:00
bigmistqke
d5e725c608 fix: components optional chaining 2022-11-14 15:52:43 +01:00
bigmistqke
ef5cc2ab0f rename RowLabel-parameter to RowHeader 2022-11-14 15:51:47 +01:00
bigmistqke
5cd87a754b update collapsible's schema and type 2022-11-14 15:12:58 +01:00
bigmistqke
b1370b814a fix bug: deleted baseAdminFields caused errors
also rename admin.header to admin.components.RowHeader
2022-11-14 15:04:45 +01:00
bigmistqke
b1105085c5 rename RowLabel to RowHeader
edit RowLabel.fallback's type to allow strings
2022-11-14 15:02:55 +01:00
Elliot DeNolf
cdaa8cc29f fix: global afterRead and afterChange execution (#1405) 2022-11-14 08:18:58 -05:00
bigmistqke
811913cb85 rename files and collapse types
RowLabel becomes RowHeader for continuity purposes
RowHeaderFunction is removed from types as it is equal to Component
2022-11-14 14:13:51 +01:00
James Mikrut
7356d8977f Update overview.mdx 2022-11-13 20:39:26 -05:00
James
a3959ca5d8 chore(release): v1.1.24 2022-11-13 19:21:13 -05:00
Thomas Ghysels
216b9f88d9 fix: cursor jumping while typing in inputs
* Revert "feat: optimizes field performance by storing internal values in useField hook"

This reverts commit 66210b856b.

* fix: Lightweight fix for cursor jump issue

Resolves #1393
2022-11-13 19:14:16 -05:00
James
183cd9a0be chore: updates docs to reflect new website public images folder 2022-11-13 17:41:39 -05:00
James
5f5c7ba7bf chore(release): v1.1.23 2022-11-12 18:58:34 -05:00
James
66210b856b feat: optimizes field performance by storing internal values in useField hook 2022-11-12 18:46:31 -05:00
James
2f684040fc fix: #1361, ensures collection auth depth works while retrieving static assets 2022-11-12 15:44:24 -05:00
James
2364476689 chore(release): v1.1.22 2022-11-12 14:49:20 -05:00
James
7136db4c71 fix: #1360, relationship field onMenuScrollToBottom not working in some browsers 2022-11-12 14:44:00 -05:00
James
562fccce05 docs: resolves #1273, inaccurate docs regarding local API overrideAccess 2022-11-12 14:22:23 -05:00
James
35f91b038b fix: 1309, duplicative logout in admin UI 2022-11-12 14:19:08 -05:00
James
eb0023e961 fix: #1358, allows listSearchableFields to work when indicated fields are nested 2022-11-12 13:44:30 -05:00
James
1d76e973bb fix: #1367, allows custom global components within schema validation 2022-11-12 13:08:10 -05:00
James
3f28a69959 fix: #1353, ensures errors returned from server make their way to UI 2022-11-12 12:55:30 -05:00
James
77792327f1 Merge branch 'master' of github.com:payloadcms/payload 2022-11-11 12:04:01 -07:00
James
86855d68f6 fix: #1357, nested arrays and blocks sometimes not allowing save 2022-11-11 12:03:39 -07:00
Nick Borko
cfef68f364 fix: fixed GraphQL Access query resolver to return the correct data (#1339) 2022-11-11 04:25:46 -08:00
Nut Pinyo
32b8f46bf2 docs: field hook example configuration (#1329) 2022-11-11 04:19:18 -08:00
James
cc5fa943ad Merge branch 'master' of github.com:payloadcms/payload 2022-11-11 04:12:48 -08:00
James
9da9d38aed docs: adds useEditDepth to docs 2022-11-11 04:12:43 -08:00
Feng Sun
d90ca777db chore: export useEditDepth (#1350) 2022-11-11 04:09:06 -08:00
James
e4b4931dba chore(release): v1.1.21 2022-11-05 12:10:30 -04:00
James
93acea9d7f chore: ensures when array / block rows are added, new row count is properly calculated 2022-11-05 12:05:34 -04:00
James
f883e04ee1 chore(release): v1.1.20 2022-11-05 11:45:07 -04:00
James
bb51a54ebe Merge branch 'master' of github.com:payloadcms/payload 2022-11-05 11:38:02 -04:00
James
483adf08c4 feat: optimizes blocks and arrays by removing some additional rerenders 2022-11-05 11:37:55 -04:00
Elliot DeNolf
4a78f7d3c3 chore: change discord readme badge to blurple 2022-11-04 10:31:42 -04:00
James
78c2306b73 Merge branch 'master' of github.com:payloadcms/payload 2022-11-01 17:51:03 -04:00
James
ddfb011904 docs: quick fix to strong tag 2022-11-01 17:50:55 -04:00
James Mikrut
d1c20e4fef Update CHANGELOG.md 2022-10-31 18:23:34 -04:00
James
a5139072c8 chore(release): v1.1.19 2022-10-31 18:23:10 -04:00
James
e004682799 Merge branch 'master' of github.com:payloadcms/payload 2022-10-31 17:51:00 -04:00
James
c651835061 fix: #1318, improves popup positioning and logic 2022-10-31 17:50:52 -04:00
Elliot DeNolf
2255ebb64a feat: revert enforce kebab-case slugs (#1322) (#1325) 2022-10-31 16:10:11 -04:00
James
e2ec2f7b97 fix: #1311, select existing upload modal always updates state 2022-10-31 15:40:18 -04:00
James
00196a8631 chore: ensures form is modified when rows are moved, fixes #1314 2022-10-31 13:25:19 -04:00
James
2a09f15a15 fix: #1307, #1321 - bug with disableFormData and blocks field 2022-10-31 13:21:16 -04:00
Elliot DeNolf
0420b6dc27 feat: enforce kebab-case slugs (#1322) 2022-10-31 11:11:00 -04:00
Dan Ribbens
10c30260dd docs: fix listSearchableFields anchor (#1297) 2022-10-31 09:44:49 -04:00
Elliot DeNolf
25000261bd fix: custom pino logger options (#1299) 2022-10-26 15:08:52 -04:00
Elliot DeNolf
bb82cdcef4 docs: better inline docs for InitOptions 2022-10-26 10:25:06 -04:00
Elliot DeNolf
027dff8363 chore(release): v1.1.18 2022-10-25 12:30:47 -04:00
James
31ca1ab379 chore: ensures defaultMaxTextLength is optional 2022-10-25 12:23:45 -04:00
Elliot DeNolf
33c1f287f3 chore(release): v1.1.17 2022-10-25 11:09:30 -04:00
Elliot DeNolf
cd4861afda chore: move release-it back to dev deps 2022-10-25 11:03:13 -04:00
James
9f56ac182f Merge branch 'master' of github.com:payloadcms/payload 2022-10-25 11:00:48 -04:00
James
3301f59822 fix: enforces depth: 0 in graphql resolvers 2022-10-25 11:00:38 -04:00
James
f9ca3a9f96 chore: fixes bad field name 2022-10-25 11:00:22 -04:00
Elliot DeNolf
3ba7594a65 chore: update release-it plugin 2022-10-25 10:31:37 -04:00
TomDo1234
6a1b25ab30 feat: adds default max length for text-based fields
* feat: Added to types.ts the default Max Field Length

* feat: Added the defaultMaxFieldLength to the schema.ts

* feat: applying defaultMaxFieldLength to 3 validators

* feat: renamed defaultMaxFieldLength to defaultMaxTextLength , adding defaultMax and min nums

* feat: validating numbers with new defaultminnum and defaultmaxnum

* feat: FIXED BUG, do not return an error message on the defaultmaxnum and minnum override checks

* Added test fields

* Eslint compliance

* feat : eslint compliacnce

* Added tests, though a reasonable payload config needs to be imported to them

* Removed my failed jest tests, relying on the yarn dev test instead

* Increased default num max and min range to JS safe integer

* Jmi suggestions

* feat: removing the superfluous number max and min default

* Added test for max text field

Co-authored-by: Tom Do <tom@iifuture.com>
Co-authored-by: TomDoFuture <108644869+TomDoFuture@users.noreply.github.com>
2022-10-24 18:57:45 -04:00
James
17dbbc7775 fix: group + group styles within collapsible 2022-10-24 18:56:56 -04:00
James
7e25abf87a chore: type fixes 2022-10-24 12:26:25 -04:00
James
0591dfd05b chore: typo 2022-10-24 12:18:03 -04:00
Will Laeri
17610adf36 chore: upgrade vulnerable dependencies (#1228)
* upgrade vulnerable deps

* removed specified node/yarn versions
2022-10-24 12:14:48 -04:00
Will Laeri
91814777b0 feat: specify node 14+ and yarn classic LTS (#1240) 2022-10-24 12:14:22 -04:00
Daniel Söderling
09d793926d feat: added beforeLogin hook (#1289) 2022-10-24 12:05:12 -04:00
James
a9f2f0ec03 fix: #1290, renders more than one rich text leaf where applicable 2022-10-24 12:03:06 -04:00
James
66bf8c3cbd fix: #1286, uses defaultDepth in graphql rich text depth 2022-10-24 11:31:09 -04:00
James
3967c1233f fix: #1291, add inline relationship drafts 2022-10-24 11:23:01 -04:00
James
c929725dd5 fix: ensures field updates when disableFormData changes 2022-10-24 08:56:08 -04:00
James
9c6098b191 chore(release): v1.1.16 2022-10-21 15:48:40 -04:00
James
6daab398da Merge branch 'master' of github.com:payloadcms/payload 2022-10-21 15:39:36 -04:00
James
36ef3789fb fix: obscure bug where upload collection has upload field relating to itself 2022-10-21 15:39:29 -04:00
Hung Vu
14cbf2f079 docs: correction to demo code of radio field (#1266) 2022-10-18 14:10:27 -04:00
Dan Ribbens
87bbf4416b Merge pull request #1272 from payloadcms/fix/#1271-index-sortable-fields-regression 2022-10-18 14:05:36 -04:00
Dan Ribbens
785b992c3e fix: indexSortableFields not respected 2022-10-17 20:17:55 -04:00
James
b4695e10b6 chore(release): v1.1.15 2022-10-14 11:38:48 -04:00
James
0b0d971491 fix: ensures svg mime type is always image/svg+xml 2022-10-14 11:33:41 -04:00
James
02af6b90b2 chore(release): v1.1.14 2022-10-14 10:22:14 -04:00
James
2181bc84a1 1.1.13 2022-10-14 10:02:40 -04:00
James
036cd5f831 1.1.12 2022-10-14 10:02:33 -04:00
James
da9825cd99 chore: reverts hiding scrollbars in tabs 2022-10-14 09:53:43 -04:00
James
4a43f95952 fix: hides scrollbar in tabs with overflowing tabs, closes #1259 2022-10-14 09:51:44 -04:00
James
9af9b73132 fix: cleans up draft global action buttons 2022-10-14 09:37:27 -04:00
James
7f7d3dbeef Merge branch 'master' of github.com:payloadcms/payload 2022-10-13 08:28:37 -04:00
James
8ef9206001 chore: properly exports BeforeDuplicate type 2022-10-13 08:17:05 -04:00
James
21ba237135 fix: #1183 - better handling of mime types with svgs + similar files 2022-10-13 08:12:15 -04:00
James Mikrut
3bda163e7b Merge pull request #1241 from jacobsfletch/master
feat: bumps @faceless-ui/modal to v2.0.1
2022-10-12 12:00:22 -04:00
James
e4e4ad1b08 chore: ensures beforeDuplicate works on each locale 2022-10-12 11:59:56 -04:00
James
f7352a7d08 chore(release): v1.1.11 2022-10-12 11:52:48 -04:00
James
6f6f2f8e7b feat: builds beforeDuplicate admin hook, closes #1243 2022-10-12 11:44:41 -04:00
James
5ca5abab42 fix: ensures arrays and blocks mount as disableFormData: true, fixes #1242 2022-10-12 10:52:59 -04:00
Jacob Fletcher
9a7553099c feat: migrates @faceless-ui/modal to v2.0.1 2022-10-12 01:28:17 -04:00
James
55d0c917e6 chore(release): v1.1.10 2022-10-11 13:40:19 -04:00
James
f52daeccf0 docs: adds access control vid to docs 2022-10-11 13:34:35 -04:00
James
6c871c57fc chore(release): v1.1.9 2022-10-11 12:12:40 -04:00
James
5322ada9e6 feat: improves access control typing 2022-10-11 11:46:58 -04:00
James
ee83a50ea9 chore: improves read-only styling of all react-selects 2022-10-11 11:46:44 -04:00
James
f6b19e074c chore: more predictably exports Access type 2022-10-11 09:44:52 -04:00
James
6cc1d9e41b chore(release): v1.1.8 2022-10-11 09:24:07 -04:00
James
74863f9462 chore: workaround for faceless-ui modal types 2022-10-11 09:19:20 -04:00
James
fdcf029da2 chore: adjusts LeaveWithoutSaving z-index 2022-10-11 09:00:19 -04:00
James
3e3d151e4c docs: #1235, broken typescript link 2022-10-11 08:32:27 -04:00
James Mikrut
5da204b152 Merge pull request #1224 from payloadcms/feat/use-context-selector
Feat/use context selector
2022-10-10 18:38:36 -04:00
James
3d6c3f7339 chore: cleanup 2022-10-10 18:38:15 -04:00
James
8d49517004 chore: merge master 2022-10-10 15:12:38 -04:00
James Mikrut
d1c0f2b97b Merge pull request #1230 from payloadcms/feat/add-inline-relationship
feat: adds ability to create related docs while editing another
2022-10-10 15:07:41 -04:00
James
1bc42ae098 chore: tests 2022-10-10 14:56:10 -04:00
James
c6edb7f53a chore: improves design 2022-10-10 13:57:08 -04:00
James
1e048fe037 feat: adds ability to create related docs while editing another 2022-10-09 20:24:38 -04:00
James
8fabdce584 chore: restores old useWatchForm to avoid breaking change 2022-10-07 17:54:35 -04:00
James
5c1a3fabee feat: implements use-context-selector for form field access 2022-10-07 17:41:41 -04:00
bigmistqke
d45de99956 feat: customizable header-labels
for Collapsibles and Arrays
2022-10-07 23:17:24 +02:00
James
fe6d30210b Merge branch 'master' of github.com:payloadcms/payload into feat/use-context-selector 2022-10-07 10:09:20 -04:00
James
93f71e621c chore(release): v1.1.7 2022-10-06 18:14:37 -04:00
James Mikrut
39d1a09d5a Merge pull request #1215 from damtzi/chore/credentials-include
chore: Add 'credentials: include' to all fetch calls
2022-10-06 17:55:55 -04:00
Damian Tziamtzis
74ae6fd1d5 chore: Add 'credentials: include' to all fetch calls 2022-10-06 23:14:55 +02:00
James
bbbcf8c869 chore(release): v1.1.6 2022-10-06 17:10:10 -04:00
James
b379666dec chore: improves upload field button aesthetics a bit 2022-10-06 17:04:29 -04:00
James Mikrut
6f40b5c9ab Merge pull request #1175 from bigmistqke/fix/responsive-fileupload-width
Fix: responsive fileupload width
2022-10-06 16:42:25 -04:00
James Mikrut
b329be7dc1 Merge pull request #1214 from payloadcms/fix/#1184
fix: #1184
2022-10-06 16:12:05 -04:00
James
c2ec54a7cb fix: #1184 2022-10-06 16:11:24 -04:00
James
3641dfd38a fix: #1189 2022-10-06 15:42:20 -04:00
James
5bf1354741 chore: fixes tests 2022-10-06 15:23:49 -04:00
James Mikrut
b894b809bf Merge pull request #1212 from payloadcms/fix/#940
Fix/#940
2022-10-06 14:24:51 -04:00
James
a4504ca15b Merge branch 'master' of github.com:payloadcms/payload into fix/#940 2022-10-06 14:23:37 -04:00
James
7926083732 fix: #940 2022-10-06 14:23:08 -04:00
James Mikrut
534cd5ae53 Merge pull request #1211 from jacobsfletch/master
feat: async admin access control
2022-10-06 13:31:01 -04:00
James Mikrut
fb329a99ba Merge pull request #1210 from payloadcms/fix/#1204
fix: #1204
2022-10-06 13:24:42 -04:00
James Mikrut
9e726d9b90 Merge pull request #1174 from payloadcms/fix/#1156-file-uploads-changing-extensions
fix: upload xls renaming ext
2022-10-06 13:23:23 -04:00
James Mikrut
8d065d619d Merge pull request #1124 from payloadcms/feat/sortable-by-default
feat: sort select and relationship fields by default
2022-10-06 13:20:32 -04:00
James Mikrut
cbff1776e7 Merge pull request #1168 from payloadcms/fix/read-only
Fix: read only field styles
2022-10-06 13:20:16 -04:00
nwhitmont
e517695000 docs: +note that collection slug must be in kebab-case, refactor example routes to match (#1176)
Co-authored-by: Nils Whitmont <nwhitmont@genvidtech.com>
2022-10-06 13:18:44 -04:00
James Mikrut
4370cfca0c Merge pull request #1195 from bigmistqke/fix/textarea-resize-vertical
fix: resize textarea only vertically
2022-10-06 13:17:51 -04:00
James Mikrut
4135b618ef Merge pull request #1198 from dsod/fix/resize-images-naming-and-mimetype
use the converted image mimeType for filename and admin interface
2022-10-06 13:17:22 -04:00
Jacob Fletcher
1cfce87549 feat: async admin access control 2022-10-06 13:16:15 -04:00
James Mikrut
c48283ac1d Merge pull request #1201 from christian-reichart/fix/sibling-data-in-after-read
fix: sibling data in after read hook
2022-10-06 13:15:52 -04:00
James Mikrut
328be3e4bc Merge pull request #1206 from payloadcms/style/color-scheme
fix: system dark scrollbars
2022-10-06 13:14:54 -04:00
James
b4becd1493 fix: #1204 2022-10-06 13:11:25 -04:00
James
95fac0bd62 chore: wip 2022-10-05 15:51:22 -04:00
Jarrod Flesch
a30d9dc1d7 fix(style): system dark scrollbars 2022-10-05 15:33:41 -04:00
Christian Reichart
7bfcefbfea fix sibling data in after read hook 2022-10-04 14:39:09 +02:00
dsod
131b2796e7 now uses the converted image mimeType for file extension and in the admin interface 2022-10-03 19:24:14 +02:00
Elliot DeNolf
debcb003bb docs: clarify api key auth usage 2022-10-03 08:41:23 -04:00
bigmistqke
6e1dfff1b8 fix: resize textarea only vertically 2022-10-02 17:37:27 +02:00
Jarrod Flesch
a9ebb71a09 Merge branch 'master' into fix/read-only 2022-09-30 10:47:34 -04:00
James
3e34e5216f chore(release): v1.1.5 2022-09-29 17:56:44 -04:00
James
2400c58219 chore: addresses more flaky tests 2022-09-29 17:52:51 -04:00
James
90d504526c chore: adds more delay to flaky test 2022-09-29 17:17:14 -04:00
Jarrod Flesch
c97d4f9545 Merge branch 'master' into fix/read-only 2022-09-29 12:54:02 -04:00
Jarrod Flesch
09a8144f3c fix: richText e2e test, specific selectors 2022-09-29 12:53:16 -04:00
Jarrod Flesch
00ef1700ae fix: ajusts how disabled states are being set on anchors and buttons 2022-09-29 11:49:25 -04:00
James
3e03b2b5df Merge branch 'master' of github.com:payloadcms/payload 2022-09-29 11:11:14 -04:00
James
974f79e57e chore: sends 204 on GraphQL OPTIONS requests 2022-09-29 11:11:02 -04:00
James
34f42083b5 chore: rolls back changes to useThrottledEffect 2022-09-29 10:26:06 -04:00
Elliot DeNolf
c0cae1e834 chore: reorder bug report template 2022-09-29 09:27:33 -04:00
James
3ce8ee4661 fix: bug in useThrottledEffect 2022-09-28 17:40:31 -04:00
bigmistqke
f9feff58d6 add flex-wrap: wrap to upload__wrap 2022-09-26 21:03:28 +02:00
bigmistqke
73848b6037 fix: remove min-width from fileupload 2022-09-26 20:51:45 +02:00
Dan Ribbens
7fd8124df6 fix: upload xls renaming ext 2022-09-26 08:19:58 -04:00
James Mikrut
1c77455403 Merge pull request #1169 from payloadcms/docs/test-cache
Improves contributing doc
2022-09-24 12:06:42 -07:00
James
051a0fad84 chore(release): v1.1.4 2022-09-23 20:15:52 -07:00
Jarrod Flesch
8e53ef47a0 chore: adds note about clearing the node module cache when switching test directories 2022-09-23 15:23:28 -04:00
Jarrod Flesch
918130486e fix: styles readOnly RichTextEditor, removes interactivity within when readOnly 2022-09-23 14:34:02 -04:00
Jarrod Flesch
b454811698 fix: threads readOnly to ReactSelect 2022-09-23 13:17:11 -04:00
James Mikrut
f87c68f310 Merge pull request #1147 from abaco/fix/refine-relationship-typegen
fix: refine type generation for relationships
2022-09-23 09:51:36 -07:00
James
25006d44e8 Merge branch 'master' of github.com:payloadcms/payload 2022-09-23 09:49:06 -07:00
James Mikrut
d8e51dd200 Merge pull request #1157 from payloadcms/docs/cell-component-props
docs: cell component props and example
2022-09-23 09:46:49 -07:00
James Mikrut
f54210a528 Merge pull request #1161 from jacobsfletch/master
feat: supports root endpoints
2022-09-23 09:46:30 -07:00
James Mikrut
96dab15cd1 Merge pull request #1163 from payloadcms/fix/nested-fields-permissions
fix: field level access for nested fields
2022-09-23 09:44:02 -07:00
James Mikrut
4126843619 Merge pull request #1165 from jacobsfletch/docs/webpack-cache
docs: adds tip for clearing webpack cache when aliasing server modules
2022-09-23 09:42:35 -07:00
James
e0238ad393 chore: updates sass 2022-09-23 09:42:10 -07:00
Jacob Fletcher
aa0302c05e docs: adds tip for clearing webpack cache when aliasing server modules 2022-09-23 12:24:51 -04:00
Jacob Fletcher
1040ad2cfe Merge branch 'payloadcms:master' into master 2022-09-23 12:23:57 -04:00
Dan Ribbens
c64f15d4d9 test: field level access for nested fields 2022-09-23 03:26:26 -04:00
Dan Ribbens
22ea98ca33 fix: field level access for nested fields 2022-09-22 21:37:02 -04:00
Jacob Fletcher
75bab716d1 chore: adds root endpoint test 2022-09-22 13:23:42 -04:00
Dan Ribbens
52a8e9624c docs: plugins typo 2022-09-22 12:19:18 -04:00
Jacob Fletcher
52cd3b4a7e feat: supports root endpoints 2022-09-22 10:49:49 -04:00
addison-codes
cc63167307 docs: fix highlighting 2022-09-22 00:51:25 -04:00
Dan Ribbens
314671b3b7 docs: cell component props and example 2022-09-21 14:20:01 -04:00
Dario Aprea
ef83bdb709 fix: refine type generation for relationships 2022-09-20 16:27:09 +02:00
Dan Ribbens
686085496a chore(release): v1.1.3 2022-09-16 17:05:57 -04:00
Dan Ribbens
76ae20aa16 fix: disable-local-strategy-and-graphql 2022-09-16 16:56:29 -04:00
Dan Ribbens
a1a55386f0 fix: duplicate with relationships 2022-09-16 14:57:29 -04:00
Elliot DeNolf
b3bb421c6c fix: adjust prevPage and nextPage graphql typing (#1140) 2022-09-16 09:40:21 -07:00
Dan Ribbens
eabb981243 fix: duplicate with relationships 2022-09-16 12:26:18 -04:00
Dan Ribbens
4be14a12d0 chore(release): v1.1.2 2022-09-14 15:42:13 -04:00
Dan Ribbens
ce174878f3 fix: disableLocalStorage with image resizing 2022-09-14 15:34:59 -04:00
Dan Ribbens
14966796ae fix: resize images without local storage 2022-09-14 13:07:18 -04:00
Dan Ribbens
7b756f3421 fix: resize images without local storage 2022-09-14 11:34:40 -04:00
Marco Sangalli
9fea2b4e08 chore: fixing uploadFile when using s3 bucket 2022-09-14 14:43:47 +02:00
James
f9b1b1fe7f docs: adds Link example in rich text 2022-09-13 21:25:08 -07:00
Elliot DeNolf
205404a88a chore: remove unused cypress package 2022-09-13 20:09:24 -07:00
Elliot DeNolf
813c46c86d feat: sort select and relationship fields by default 2022-09-13 20:06:12 -07:00
Luciano Greiner
8bfe253157 Avoid adding password and email to schemas when disableLocalStrategy is on 2022-09-13 17:55:22 -03:00
Dan Ribbens
ed8e581629 chore: changelog update 2022-09-13 13:44:22 -04:00
Dan Ribbens
7cf66b081a chore(release): v1.1.1 2022-09-13 13:20:24 -04:00
Dan Ribbens
64503f8267 fix: conditions on collapsible fields 2022-09-13 13:16:52 -04:00
Dan Ribbens
d82c12eab6 Merge pull request #1120 from payloadcms/fix/#1117 2022-09-13 11:58:28 -04:00
Dan Ribbens
9c4f2b68b0 fix: conditions on conditionals 2022-09-13 11:53:52 -04:00
James
bcfda707ff Merge branch 'master' of github.com:payloadcms/payload 2022-09-13 07:40:57 -07:00
James
66b77f7dca chore: re-adds key to tabs RenderFields 2022-09-13 07:40:48 -07:00
Dan Ribbens
dcc8dad53b fix: dashboard links to globals 2022-09-13 09:47:28 -04:00
Elliot DeNolf
bb1477e08b chore(release): v1.1.0 2022-09-12 20:54:50 -07:00
James
4e165cf52e chore: ensures new listSearchableFields works with complex queries 2022-09-12 19:40:01 -07:00
James Mikrut
a1083727ef feat: #1001 - builds a way to allow list view to search multiple fields
* make textfields searchable

* shorten namings in placeholder function

* chore: finishes listSearchableFields

Co-authored-by: Christian Reichart <christian.reichart@camperboys.com>
2022-09-12 16:38:02 -07:00
Elliot DeNolf
d5ccd45b53 Ability to get the "previous" state in the AfterChange Hook (#1115)
Co-authored-by: Alessio Gravili <alessio@bonfireleads.com>
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2022-09-12 15:48:50 -07:00
Dan Ribbens
94d355ba5e Merge pull request #1102 from payloadcms/feat/group-collections 2022-09-12 16:52:24 -04:00
Dan Ribbens
892a774998 Merge branch 'master' into feat/group-collections 2022-09-12 16:39:07 -04:00
James
78f39af5cf chore: finishes collapsible nav groups 2022-09-12 12:45:06 -07:00
James
813fa1571c Merge branch 'feat/group-collections' of github.com:payloadcms/payload into feat/group-collections 2022-09-12 10:55:15 -07:00
Dan Ribbens
c40e232ac6 feat: hide nav labels with no un-grouped collections 2022-09-12 13:51:24 -04:00
Dan Ribbens
834f4ebd38 feat/add support for setting collapsable fields (array, block, collapsable… (#1057)
Co-authored-by: liorix <liorix@gmail.com>
Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
2022-09-12 10:39:49 -07:00
Elliot DeNolf
ca434b8a92 feat: implement gravatar (#1107) 2022-09-12 10:29:22 -07:00
Dan Ribbens
7acf944a28 Feat/expose sharp options (#1029)
Co-authored-by: khakimvinh <kha.kim.vinh@gmail.com>
Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
2022-09-12 10:29:07 -07:00
Elliot DeNolf
391c9d8682 fix: word boundaries, no regex lookbehind support for Safari (#1114) 2022-09-12 10:28:29 -07:00
James Mikrut
8e47961da1 Merge pull request #814 from slavanossar/feat/optional-tab-namespacing
feat: optional tab namespacing
2022-09-11 21:42:54 -07:00
James
016f3e47ab chore: ensures generate types works with named tabs 2022-09-11 21:19:20 -07:00
James
21eb19edd1 chore: further refinements 2022-09-11 20:57:30 -07:00
James
ad4f7a5fff chore: fixes and cleanup 2022-09-11 20:07:02 -07:00
James
cd209379b2 chore: merge master 2022-09-11 18:07:05 -07:00
Elliot DeNolf
14a16dc05f chore: remove unneeded package (#1110) 2022-09-11 16:39:16 -07:00
James
9a461b8536 fix: #1106 2022-09-10 17:58:39 -07:00
Dan Ribbens
59af8725b4 feat: globals groups 2022-09-10 19:59:11 -04:00
Dan Ribbens
dffeaf6a69 feat: collection groups 2022-09-10 19:59:11 -04:00
James
c7851f8189 chore(release): v1.0.36 2022-09-10 13:55:23 -07:00
James
ada1871993 fix: bug with account view 2022-09-10 13:50:34 -07:00
James
78ccd2ad9b chore: cleanup exports 2022-09-10 13:33:14 -07:00
James
4cb69039ed chore(release): v1.0.35 2022-09-09 20:12:41 -07:00
James
c8b37f40cb fix: incorrect auth strategy type 2022-09-09 20:03:49 -07:00
Elliot DeNolf
4963f10a18 Merge pull request #1083 from payloadcms/feat/improve-rich-text-link
Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
Co-authored-by: Jacob Fletcher <jacobsfletch@gmail.com>
2022-09-09 15:34:17 -07:00
Elliot DeNolf
6f77fe7c27 Merge branch 'master' into feat/improve-rich-text-link 2022-09-09 15:23:46 -07:00
Elliot DeNolf
c584c2ed47 test: rich text link e2e 2022-09-09 15:18:02 -07:00
Elliot DeNolf
5a19f6915a fix: rich text link with no selection 2022-09-09 15:17:51 -07:00
Jacob Fletcher
48f0c06edc chore: bumps @faceless-ui/modal to v2.0.0-alpha.4 2022-09-09 00:13:27 -04:00
Jacob Fletcher
50cc3c5a21 chore: bumps @faceless-ui/modal to v2.0.0-alpha.3 2022-09-08 23:08:54 -04:00
James
6674a0df6b Merge branch 'feat/improve-rich-text-link' of github.com:payloadcms/payload into feat/improve-rich-text-link 2022-09-08 18:05:39 -07:00
James
cbbace21ca chore: updates faceless modal 2022-09-08 18:05:21 -07:00
Elliot DeNolf
87346a97ab test: rich text internal link 2022-09-08 15:40:49 -07:00
Elliot DeNolf
4357c5491d docs: add rich text link fields 2022-09-08 15:40:49 -07:00
Elliot DeNolf
03847703b0 chore: update rich text data seeding 2022-09-08 15:40:49 -07:00
James
3c46851426 chore: migrates to new faceless modal version 2022-09-08 15:22:09 -07:00
James Mikrut
8115855e5a Merge pull request #1089 from payloadcms/fix/height-width-by-default
fix: add height/width if imageSizes not specified
2022-09-07 20:03:39 -07:00
James Mikrut
ddb2a0a4f5 Merge pull request #1095 from jacobsfletch/master
chore: bumps @faceless-ui/modal to v1.3.2 #1070
2022-09-07 20:03:27 -07:00
James
a45577f182 chore: misc ux improvements to rich text link 2022-09-07 17:25:15 -07:00
James
eb963066f7 chore: fixes bug with links always populating 2022-09-07 16:52:32 -07:00
James
a99d9c98c3 feat: allows rich text links to link to other docs 2022-09-07 16:42:43 -07:00
James
cdfc0dec70 chore: ensures logic is accurate while updating links 2022-09-07 13:48:36 -07:00
Elliot DeNolf
eb1ff7efce chore: update label for bug reports 2022-09-07 12:40:00 -07:00
Jacob Fletcher
55843f6c55 chore: bumps @faceless-ui/modal to v1.3.2 #1070 2022-09-07 15:23:47 -04:00
James
7856f66b31 merge master 2022-09-07 11:53:02 -07:00
James Mikrut
47ac86b4b7 Merge pull request #1094 from payloadcms/fix/#1059
fix: #1059
2022-09-07 11:51:42 -07:00
James
13dc39dc6d fix: #1059 2022-09-07 11:50:55 -07:00
James
65653bd1d3 chore(release): v1.0.34 2022-09-07 09:39:24 -07:00
James
299ee82ccf chore: pins faceless ui 2022-09-07 09:35:24 -07:00
James
b38b6427b8 fix: pins faceless ui modal 2022-09-07 09:29:04 -07:00
James
784696f9a6 chore: comments todos 2022-09-07 09:27:39 -07:00
Elliot DeNolf
8bd2a0e6c9 fix: add height/width if imageSizes not specified 2022-09-07 08:58:02 -07:00
Dan Ribbens
0f671b1b35 chore(release): v1.0.33 2022-09-07 10:57:08 -04:00
Dan Ribbens
d56882cc20 fix: require min 1 option in field schema validation (#1082) 2022-09-07 10:53:21 -04:00
James
6d13ae6846 chore: removes old comment 2022-09-06 22:58:14 -07:00
James
91000d7fda feat: improves rich text link ux 2022-09-06 22:53:27 -07:00
Elliot DeNolf
888734dcdf fix: accented label char sanitization for GraphQL (#1080) 2022-09-06 16:03:43 -07:00
James Mikrut
e81da57f61 Merge pull request #1079 from payloadcms/fix/#1062
fix: #1062
2022-09-06 13:58:20 -07:00
James
05d1b141b2 fix: #1062 2022-09-06 13:56:53 -07:00
Elliot DeNolf
b7e5828adc feat: cyrillic like query support (#1078) 2022-09-06 16:47:57 -04:00
Dan Ribbens
2ee4c7ad72 fix: update removing an upload with null (#1076) 2022-09-06 16:19:59 -04:00
max frühschütz
77ab11bce8 docs: move description prop doc to right place (#1077) 2022-09-06 16:19:47 -04:00
Arick
cd8edbaa1f fix: reorder plugin wrapping (#1051) 2022-09-06 16:19:21 -04:00
Matt Arnold
5e21048457 docs: update custom endpoints link (#1075) 2022-09-06 15:41:27 -04:00
pixelistik
c0c093d16c docs: Fix missing word (#1063) 2022-09-05 21:03:48 -04:00
James
117153fad7 chore: bump version 2022-09-02 14:56:09 -07:00
James
5ae666b0e0 fix: ensures adding new media to upload works when existing doc does not exist 2022-09-02 14:39:41 -07:00
Dustin Miller
afa03789b8 docs: Correct “autheticate” misspelling in docs (#1048) 2022-09-02 15:27:06 -04:00
Dan Ribbens
44b0073834 fix: update removing a relationship with null (#1056) 2022-09-02 15:21:09 -04:00
Dan Ribbens
254636167d test: custom css (#1053) 2022-09-02 14:03:49 -04:00
Dan Ribbens
29e82ec845 fix: children of conditional fields required in graphql schema (#1055) 2022-09-02 14:02:58 -04:00
Wesley
c3a0bd8625 fix: implement the same word boundary search as the like query (#1038)
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2022-09-01 13:03:21 -04:00
Ikko Ashimine
32a4e8e9b9 docs: update overview.mdx (#1046) 2022-09-01 12:58:09 -04:00
Elliot DeNolf
482cbe71c7 feat: update operator type with contains (#1045) 2022-09-01 12:17:53 -04:00
Elliot DeNolf
7dbcd9ca89 docs: fix relationship where query 2022-09-01 12:14:07 -04:00
Dan Ribbens
a1f2dcab8f docs: fix defaultValue example (#1044) 2022-09-01 10:26:41 -04:00
James
21417c6598 chore: better logic for changing password in ui 2022-08-30 17:58:17 -07:00
James
f1a272f407 1.0.31 2022-08-30 15:21:59 -07:00
James Mikrut
064f797023 Merge pull request #1033 from Elliot67/patch-1
docs: fix graphql `disable` property explanation
2022-08-30 15:21:10 -07:00
James Mikrut
26c2020b12 Merge pull request #1034 from payloadcms/feat/duplicate-all-locales
Feat/duplicate all locales
2022-08-30 15:13:07 -07:00
James
af1a483e64 chore: ensures new Edit view is mounted when going directly between one id and another 2022-08-30 15:12:23 -07:00
James
f517cb5e93 chore: cleanup 2022-08-30 15:07:38 -07:00
James
c8a8914ea7 Merge branch 'feat/duplicate-all-locales' of github.com:payloadcms/payload into feat/duplicate-all-locales 2022-08-30 14:52:51 -07:00
James Mikrut
4f834c6bf8 Merge pull request #1035 from payloadcms/fix/#981
fix: #981
2022-08-30 14:44:40 -07:00
James
d588843121 fix: #981 2022-08-30 14:43:44 -07:00
Dan Ribbens
51c7770b10 feat: duplicate copies all locales 2022-08-30 17:23:30 -04:00
Elliot Lintz
18ff5d29b0 docs: fix graphql disable property explanation 2022-08-30 22:41:00 +02:00
Dan Ribbens
e31098eaa5 test: duplicate copies all locales 2022-08-30 16:25:26 -04:00
James Mikrut
0873050b32 Merge pull request #1032 from payloadcms/fix/#948
fix: #948
2022-08-30 11:55:39 -07:00
James
8df9ee7b2d fix: #948 2022-08-30 11:54:41 -07:00
Dan Ribbens
2ae33b603a feat: WIP tab compatible with traverseFields 2022-08-11 12:05:35 -04:00
Dan Ribbens
6a6a69190f feat: tabs support localization at the tab level 2022-08-11 12:05:33 -04:00
Dan Ribbens
a7b882c03d chore: run ci test workflow on pull requests 2022-08-11 12:05:05 -04:00
Dan Ribbens
a83921a2fe feat: support localized tab fields 2022-08-11 12:05:02 -04:00
Slava Nossar
4b7b04d5fa return full Tab object for column display 2022-08-11 12:04:20 -04:00
Slava Nossar
b403f5228b update Tabs field docs 2022-08-11 12:04:20 -04:00
Slava Nossar
dd289ca24a update data and path when tab had name 2022-08-11 12:04:20 -04:00
Slava Nossar
daf5fc83d8 update test data 2022-08-11 12:04:20 -04:00
Slava Nossar
08271086c3 return tab.name for columns 2022-08-11 12:04:20 -04:00
Slava Nossar
30da37becd add namespaced field path 2022-08-11 12:04:20 -04:00
Slava Nossar
df1491de74 add extra test fields and data 2022-08-11 12:04:20 -04:00
Slava Nossar
420fd67905 update mongodb schema builder 2022-08-11 12:04:20 -04:00
Slava Nossar
17a55e4a3a add tab field with name and data to test suite 2022-08-11 12:04:20 -04:00
Slava Nossar
1b3a328388 update graphql schema builder 2022-08-11 12:04:20 -04:00
Slava Nossar
060ee40bab add name to schema and types 2022-08-11 12:04:20 -04:00
715 changed files with 30745 additions and 12047 deletions

View File

@@ -40,6 +40,7 @@ module.exports = {
'jest/no-test-callback': 'off',
'jest/prefer-strict-equal': 'off',
'jest/expect-expect': 'off',
'jest-dom/prefer-to-have-attribute': 'off',
}
},
{

View File

@@ -1,33 +1,22 @@
---
name: Bug Report
about: Create a bug report for Payload
labels: 'bug'
labels: 'possible-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
## Other Details
<!--- Provide any other additional details -->
<!--- Payload version, browser, etc -->
<!--- Possible solution if you're familiar with the code -->

1
.node-version Normal file
View File

@@ -0,0 +1 @@
v16.14.2

9
.vscode/launch.json vendored
View File

@@ -28,16 +28,7 @@
"type": "node",
"request": "launch",
"name": "Launch Program",
"env": {
"BABEL_ENV": "development"
},
"program": "${workspaceFolder}/test/dev.js",
"skipFiles": [
"<node_internals>/**"
],
"runtimeArgs": [
"--nolazy"
],
"args": [
"fields"
]

View File

@@ -1,3 +1,723 @@
## [1.5.6](https://github.com/payloadcms/payload/compare/v1.5.5...v1.5.6) (2023-01-11)
### Bug Fixes
* ensures that find with draft=true returns ids with drafts ([3f30b2f](https://github.com/payloadcms/payload/commit/3f30b2f4894258d67e9a9a79e2213f9d5f69f856))
## [1.5.5](https://github.com/payloadcms/payload/compare/v1.5.4...v1.5.5) (2023-01-11)
### Bug Fixes
* [#1808](https://github.com/payloadcms/payload/issues/1808), arrays and blocks now save localized nested field data upon reordering rows ([ee54c14](https://github.com/payloadcms/payload/commit/ee54c1481cdb8d6669864f20584fa6ef072c9097))
* bug when clearing relationship field without hasMany: true ([#1829](https://github.com/payloadcms/payload/issues/1829)) ([ed7cfff](https://github.com/payloadcms/payload/commit/ed7cfff45c262206495580509a77adb72a646ddb))
* ensures upload file data is available for conditions ([d40e136](https://github.com/payloadcms/payload/commit/d40e1369472f212b5f85bfc72fac01dc708aa507))
* fix miss typo in Thai translation ([25e5ab7](https://github.com/payloadcms/payload/commit/25e5ab7ceebfb36960b6969db543a2b4ae7127d2))
* formats date when useAsTitle ([086117d](https://github.com/payloadcms/payload/commit/086117d7039b2b68ab2789b57cac97e2735819cf))
* prevents uploads drawer from crashing when no uploads are enabled ([84e1417](https://github.com/payloadcms/payload/commit/84e1417b711e0823753f0b9174c145e40b68e0be))
* rte link element initial state [#1848](https://github.com/payloadcms/payload/issues/1848) ([1cde647](https://github.com/payloadcms/payload/commit/1cde647a2a86df21312229b8beec0a6b75df22c3))
* updatesmargin for group field within a row ([1c3a257](https://github.com/payloadcms/payload/commit/1c3a257244e322c04164f6630772a40baf256da7))
* upload field filterOptions ([9483ccb](https://github.com/payloadcms/payload/commit/9483ccb1208a91c1376ac4bd5186037f909aa45d))
* wrong translation and punctuation spacing ([bf1242a](https://github.com/payloadcms/payload/commit/bf1242aafa3fa7e72e81af10284f4ddade28c4a0))
### Features
* adds translations for fallbackToDefaultLocale ([c247f31](https://github.com/payloadcms/payload/commit/c247f3130cf03d1dc12d456886b04db028161800))
* ensures compatibility with azure cosmos and aws documentdb ([73af283](https://github.com/payloadcms/payload/commit/73af283e1c24befc2797e2bc9766a22d26e3c288))
## [1.5.4](https://github.com/payloadcms/payload/compare/v1.5.3...v1.5.4) (2023-01-06)
### Features
* allows init to accept a pre-built config ([84e00bf](https://github.com/payloadcms/payload/commit/84e00bf7b3dfc1c23367765eec60bec45b81617b))
## [1.5.3](https://github.com/payloadcms/payload/compare/v1.5.2...v1.5.3) (2023-01-05)
### Bug Fixes
* theme flicker on code editor ([6567454](https://github.com/payloadcms/payload/commit/6567454ae4e4808303da9b80d26633bc77e1445d))
## [1.5.2](https://github.com/payloadcms/payload/compare/v1.5.1...v1.5.2) (2023-01-04)
### Bug Fixes
* ignores admin and components from swc ([7d27431](https://github.com/payloadcms/payload/commit/7d274313129c44618ebd8d1fd7a176694ee40476))
## [1.5.1](https://github.com/payloadcms/payload/compare/v1.5.0...v1.5.1) (2023-01-04)
### Bug Fixes
* reverts components directory back to ts ([1bbf099](https://github.com/payloadcms/payload/commit/1bbf099fe052e767512e111f8f2b778c1b9c59d9))
# [1.5.0](https://github.com/payloadcms/payload/compare/v1.4.2...v1.5.0) (2023-01-04)
### Bug Fixes
* json field type ([73b8ba3](https://github.com/payloadcms/payload/commit/73b8ba3d4a86385cd0a80efcdc19e4972d16b0b7))
### Features
* adds initial json field ([28d9f90](https://github.com/payloadcms/payload/commit/28d9f9009cc479b0e5da5c5b4fb85eb29b055309))
* fixes json editor errors and misc styling ([efe4f6d](https://github.com/payloadcms/payload/commit/efe4f6d861a99337cfd35592557d3e8f16ff924a))
* swc register ([#1779](https://github.com/payloadcms/payload/issues/1779)) ([c11bcd1](https://github.com/payloadcms/payload/commit/c11bcd1416b19e48569218d9011d013ad77306ce))
* updates code field editor ([4d6eba8](https://github.com/payloadcms/payload/commit/4d6eba8d21d19eac63df02d56d27b0a17006d042))
* wires up i18n with monaco editor ([07b2cca](https://github.com/payloadcms/payload/commit/07b2ccad61a619478f6613fa65f4f630222639d4))
## [1.4.2](https://github.com/payloadcms/payload/compare/v1.4.1...v1.4.2) (2023-01-03)
### Bug Fixes
* [#1775](https://github.com/payloadcms/payload/issues/1775) - siblingData for unnamed fields within array rows improperly formatted ([d6fcd19](https://github.com/payloadcms/payload/commit/d6fcd19bd1eaf2942c2eaa31f0de4770ca10ff06))
* [#1786](https://github.com/payloadcms/payload/issues/1786), relationship with hasMany no longer sets empty array as default value ([ecfb363](https://github.com/payloadcms/payload/commit/ecfb36316961ef0eb9dd1ba1dc95ba98f95223f8))
* error clearing date field ([883daf7](https://github.com/payloadcms/payload/commit/883daf7b469c03fae67c16292af6aded662c0bd0))
* select field crash on missing value option ([ec9196e](https://github.com/payloadcms/payload/commit/ec9196e33ca01e6a15097943b4be6dee6ea5202f))
### Features
* add Ukrainian translation ([#1767](https://github.com/payloadcms/payload/issues/1767)) ([49fa5cb](https://github.com/payloadcms/payload/commit/49fa5cb23a0bb57348d8cd7ec0b7805d651fda2d))
* preview now exposes most recent draft data ([54dadbe](https://github.com/payloadcms/payload/commit/54dadbeae5b195405a7cfb480fd38b2eeb684938))
## [1.4.1](https://github.com/payloadcms/payload/compare/v1.4.0...v1.4.1) (2022-12-24)
### Bug Fixes
* [#1761](https://github.com/payloadcms/payload/issues/1761), avoids rich text modifying form due to selection change ([9f4ce8d](https://github.com/payloadcms/payload/commit/9f4ce8d756742a6e1b2644ea49d0778774aae457))
# [1.4.0](https://github.com/payloadcms/payload/compare/v1.3.4...v1.4.0) (2022-12-23)
### Bug Fixes
* [#1611](https://github.com/payloadcms/payload/issues/1611), unable to query draft versions with draft=true ([44b31a9](https://github.com/payloadcms/payload/commit/44b31a9e585aad515557b749bf05253139a17bd9))
* [#1656](https://github.com/payloadcms/payload/issues/1656) remove size data ([389ee26](https://github.com/payloadcms/payload/commit/389ee261d4ebae0b773bca375ed8a74685506aa0))
* [#1698](https://github.com/payloadcms/payload/issues/1698) - globals and autosave not working ([915f1e2](https://github.com/payloadcms/payload/commit/915f1e2b3a0c9618d5699a0ee6f5e74c6f4038ee))
* [#1738](https://github.com/payloadcms/payload/issues/1738) save image dimensions to svg uploads ([2de435f](https://github.com/payloadcms/payload/commit/2de435f43a2e75391a655e91a0cda251da776bcb))
* [#1747](https://github.com/payloadcms/payload/issues/1747), rich text in arrays improperly updating initialValue when moving rows ([d417e50](https://github.com/payloadcms/payload/commit/d417e50d52fc0824fb5aaedd3e1208c3e1468bdd))
* [#1748](https://github.com/payloadcms/payload/issues/1748), bails out of autosave if doc is published while autosaving ([95e9300](https://github.com/payloadcms/payload/commit/95e9300d109c9bfd377d5b5efbb68ddca306bbec))
* [#1752](https://github.com/payloadcms/payload/issues/1752), removes label from row field type ([ff3ab18](https://github.com/payloadcms/payload/commit/ff3ab18d1690e50473be2d77897fb9de48361413))
* [#551](https://github.com/payloadcms/payload/issues/551) - rich text nested list structure ([542ea8e](https://github.com/payloadcms/payload/commit/542ea8eb81a6e608c7368882da9692d656f1d36b))
* allows cleared file to be reselected ([35abe81](https://github.com/payloadcms/payload/commit/35abe811c1534ba4f7e926edd3a2978ee67b181e))
* get relationships in locale of i18n language setting ([#1648](https://github.com/payloadcms/payload/issues/1648)) ([60bb265](https://github.com/payloadcms/payload/commit/60bb2652f0aa63747513e771173362985123519c))
* missing file after reselect in upload component ([6bc1758](https://github.com/payloadcms/payload/commit/6bc1758dc0cad3f52ce332e71134ee527e17fff0))
* prevents special characters breaking relationship field search ([#1710](https://github.com/payloadcms/payload/issues/1710)) ([9af4c1d](https://github.com/payloadcms/payload/commit/9af4c1dde7f4a68dc629738dff4fc314626cabb8))
* refreshes document drawer on save ([9567328](https://github.com/payloadcms/payload/commit/9567328d28709c5721b33e5bd61c9535568ffffd))
* removes update and created at fields when duplicating, ensures updatedAt data is reactive ([bd4ed5b](https://github.com/payloadcms/payload/commit/bd4ed5b99b5026544c910592c3bff6040e2058bc))
* safely clears sort [#1736](https://github.com/payloadcms/payload/issues/1736) ([341c163](https://github.com/payloadcms/payload/commit/341c163b36c330df76a6eb5146fccc80059eb9d7))
* simplifies radio validation ([0dfed3b](https://github.com/payloadcms/payload/commit/0dfed3b30a15829f9454332a4cbd7d9ce1fddea3))
* translated tab classnames ([238bada](https://github.com/payloadcms/payload/commit/238badabb4f38e691608219c54a541993d9f3010))
* updates relationship label on drawer save and prevents stepnav update ([59de4f7](https://github.com/payloadcms/payload/commit/59de4f7e82dc4f08240b13d48054589b561688fa))
* updates richtext toolbar position if inside a drawer ([468b0d2](https://github.com/payloadcms/payload/commit/468b0d2a55616993f10eac7d1709620d114ad7d6))
* use the slug for authentication header API Key ([5b70ebd](https://github.com/payloadcms/payload/commit/5b70ebd119b557cff66e97e3554af730657b4071))
### Features
* add Czech translation ([#1705](https://github.com/payloadcms/payload/issues/1705)) ([0be4285](https://github.com/payloadcms/payload/commit/0be428530512c3babdfe39be259dd165bb66b5f4))
* adds doc permissions to account view ([8d643fb](https://github.com/payloadcms/payload/commit/8d643fb29d3604b78f6cb46582720dde2a46affb))
* **graphql:** upgrade to graphql 16 ([57f5f5e](https://github.com/payloadcms/payload/commit/57f5f5ec439b5aee1d46bff0bf31aac6148f16b2))
### BREAKING CHANGES
* replaced the useAPIKey authentication header format to use the collection slug instead of the collection label. Previous: `${collection.labels.singular} API-Key ${apiKey}`, updated: `${collection.slug} API-Key ${apiKey}`
## [1.3.4](https://github.com/payloadcms/payload/compare/v1.3.3...v1.3.4) (2022-12-16)
### Bug Fixes
* async validate out of order ([e913fbe](https://github.com/payloadcms/payload/commit/e913fbe4ea4f9abf7eeb29db3b03e1afe4649d50))
* autosave with nested localized fields ([4202fc2](https://github.com/payloadcms/payload/commit/4202fc29337763f8fd90ec4beaf0d34e39a916bc))
* doc access should not run where query on collections without id ([016beb6](https://github.com/payloadcms/payload/commit/016beb6eec96857fe913888a1d9c4994dbd94e7e))
* run docAccess also when checking global ([b8c0482](https://github.com/payloadcms/payload/commit/b8c0482cdae6d372f81823ee4541717131d9dac4))
## [1.3.3](https://github.com/payloadcms/payload/compare/v1.3.2...v1.3.3) (2022-12-16)
### Bug Fixes
* allow translation in group admin.description ([#1680](https://github.com/payloadcms/payload/issues/1680)) ([91e33ad](https://github.com/payloadcms/payload/commit/91e33ad1ee04750425112602fcfddcf329f934e8))
* ensures select field avoids circular dependencies ([f715146](https://github.com/payloadcms/payload/commit/f715146aa35a6f3a8f5d7d4e066c71fb26027472))
## [1.3.2](https://github.com/payloadcms/payload/compare/v1.3.1...v1.3.2) (2022-12-15)
### Bug Fixes
* safely handles rich text deselection ([420eef4](https://github.com/payloadcms/payload/commit/420eef4d91d6c5810b4e9dbda1e87e9f0e6d8dba))
## [1.3.1](https://github.com/payloadcms/payload/compare/v1.3.0...v1.3.1) (2022-12-15)
### Bug Fixes
* add i18n type to collection and globals admin.description ([#1675](https://github.com/payloadcms/payload/issues/1675)) ([049d560](https://github.com/payloadcms/payload/commit/049d560898fdf3fd9be40a4689eb1ef4170ef207))
* adds draftsEnabled to baseSchema for tabs / arrays / groups & allows for null enum ([80da898](https://github.com/payloadcms/payload/commit/80da898de8cfe068a0ad685803d8523fd9a10dcd))
* adds draftsEnabled to versionSchema in collections / globals ([f0db5e0](https://github.com/payloadcms/payload/commit/f0db5e0170807944cfbed8495c813b7c28b05bb3))
* collapsible margin bottom adjustment ([#1673](https://github.com/payloadcms/payload/issues/1673)) ([64086e8](https://github.com/payloadcms/payload/commit/64086e8122e04965ca0ae8d254b99114208944bf))
* escapes react-select events when drawer is open ([f290cda](https://github.com/payloadcms/payload/commit/f290cda333aecab104d7cd195bcc7fab2059134d))
* label translation in about to delete dialog ([#1667](https://github.com/payloadcms/payload/issues/1667)) ([d9c45f6](https://github.com/payloadcms/payload/commit/d9c45f62b19162a34bc317e997d9912213a3012b))
* list view date field display format ([#1661](https://github.com/payloadcms/payload/issues/1661)) ([934b443](https://github.com/payloadcms/payload/commit/934b443b5b3b0f610767786f940175b9db0b2da7))
* removes case for select field that sets data to undefined if set to null ([b4f39d5](https://github.com/payloadcms/payload/commit/b4f39d5fd380190ee82a5bb967756d25e9c98e95))
* Set 'Dashboard's link to config route ([#1652](https://github.com/payloadcms/payload/issues/1652)) ([940c1e8](https://github.com/payloadcms/payload/commit/940c1e84f5f091bf4b4ae0bd6628f077d9d0d6e9))
* stringifies date in DateTime field for useAsTitle ([#1674](https://github.com/payloadcms/payload/issues/1674)) ([a1813ca](https://github.com/payloadcms/payload/commit/a1813ca4b32dfcd8ca3604f7f03b1ba316d740e2))
### Features
* inline relationships ([8d744c8](https://github.com/payloadcms/payload/commit/c6013c39043cc7bf9e8ff39551662c25e8d744c8))
* custom button html element ([5592fb1](https://github.com/payloadcms/payload/commit/5592fb148dfa3058df577cfb7f5ed72ea25e1217))
* further Tooltip improvements ([e101f92](https://github.com/payloadcms/payload/commit/e101f925cc71af4c3a1b5ce4ad552d9834d35bfd))
# [1.3.0](https://github.com/payloadcms/payload/compare/v1.2.5...v1.3.0) (2022-12-09)
### Bug Fixes
* [#1547](https://github.com/payloadcms/payload/issues/1547), global afterChange hook not falling back to original global if nothing returned ([a72123d](https://github.com/payloadcms/payload/commit/a72123dd471e1032d832e409560bda9cf3058095))
* [#1632](https://github.com/payloadcms/payload/issues/1632) graphQL non-nullable relationship and upload fields ([#1633](https://github.com/payloadcms/payload/issues/1633)) ([eff3f18](https://github.com/payloadcms/payload/commit/eff3f18e7c184e5f82325e960b4cbe84b6377d82))
* change edit key to prevent richtext editor from crashing ([#1616](https://github.com/payloadcms/payload/issues/1616)) ([471d214](https://github.com/payloadcms/payload/commit/471d21410ac9ac852a8581a019dd6759f56cd8b2))
* filterOptions function argument relationTo is an array ([#1627](https://github.com/payloadcms/payload/issues/1627)) ([11b1c0e](https://github.com/payloadcms/payload/commit/11b1c0efc66acd32de2efcaf65bad504d2e2eb45))
* resets slate state when initialValue changes, fixes [#1600](https://github.com/payloadcms/payload/issues/1600), [#1546](https://github.com/payloadcms/payload/issues/1546) ([9558a22](https://github.com/payloadcms/payload/commit/9558a22ce6cdf9bc13215931b43bde0a7dd4bf50))
* sanitizes global find query params ([512bc1e](https://github.com/payloadcms/payload/commit/512bc1ebe636841f1dee6ce49c1d97db1810c4bd))
* Select with hasMany and localized ([#1636](https://github.com/payloadcms/payload/issues/1636)) ([756edb8](https://github.com/payloadcms/payload/commit/756edb858a1ca66c32e674770ddcdceae77bf349))
* translation key in revert published modal ([#1628](https://github.com/payloadcms/payload/issues/1628)) ([b6c597a](https://github.com/payloadcms/payload/commit/b6c597ab5c4fcd879496db5373155df48c657e28))
* unflattens fields in filterOptions callback ([acff46b](https://github.com/payloadcms/payload/commit/acff46b4a5b57f01fa0b14c1e9fd8330b4d787db))
* feat!: no longer sanitize collection slugs to kebab case (#1607) ([ba2f2d6](https://github.com/payloadcms/payload/commit/ba2f2d6e9b66568b11632bacdd92cfdc8ddae300)), closes [#1607](https://github.com/payloadcms/payload/issues/1607)
### Features
* add Norwegian bokmål (nb) translation ([#1614](https://github.com/payloadcms/payload/issues/1614)) ([759f001](https://github.com/payloadcms/payload/commit/759f00168137ff1a0fd862796a5971a9ba0264cd))
* add Thai translation ([#1630](https://github.com/payloadcms/payload/issues/1630)) ([7777d11](https://github.com/payloadcms/payload/commit/7777d11b9ed458a6c64efc8c9572edb898f6ceed))
* upload support pasting file ([eb69b82](https://github.com/payloadcms/payload/commit/eb69b82adfb4e94c1ef36b219310c55afc7a1d4e))
### BREAKING CHANGES
* collection slugs are no longer automatically sanitized to be kebab case. This will only be an issue if your current slugs were in camel case. The upgrade path will be to change those slugs to the kebab case version that the slug was automatically being sanitized to on the backend.
If you only use kebab case or single word slugs: no action needed.
If you have existing slugs with camel case and populated data: you'll need to convert these to the kebab case version to match the previously sanitized value.
ie. myOldSlug is your slug, you should convert it to my-old-slug.
Any future slugs after updating will be used as-is.
## [1.2.5](https://github.com/payloadcms/payload/compare/v1.2.4...v1.2.5) (2022-12-06)
### Bug Fixes
* exits findOptionsByValue when matchedOption is found ([881c067](https://github.com/payloadcms/payload/commit/881c067c40d7477fa2a56d9c700feab49410e1c1))
* mismatch language condition when rendering unpublish ([3ddd0ea](https://github.com/payloadcms/payload/commit/3ddd0ea3efbd4d673a943dbf63363c548ae5562c))
* safely coerces limit and depth to number or undefined ([dd04d78](https://github.com/payloadcms/payload/commit/dd04d7842efe9228e98271a878fd68a814042f41))
* uses pathOrName to pass to internal Relationship field components ([8874e87](https://github.com/payloadcms/payload/commit/8874e871d4a48d5d3fccb8233464437d8ea61ad4))
### Features
* add Turkish translations ([#1596](https://github.com/payloadcms/payload/issues/1596)) ([c8a6831](https://github.com/payloadcms/payload/commit/c8a683100f1ec663a2fdfd5c1ab82300d2618995))
## [1.2.4](https://github.com/payloadcms/payload/compare/v1.2.3...v1.2.4) (2022-12-03)
### Bug Fixes
* missing translation richText link modal ([#1573](https://github.com/payloadcms/payload/issues/1573)) ([2dcada1](https://github.com/payloadcms/payload/commit/2dcada199c21bee97eca88aa6bc8ba1bc2b45e7c))
## [1.2.3](https://github.com/payloadcms/payload/compare/v1.2.2...v1.2.3) (2022-12-02)
### Bug Fixes
* reset password regression ([#1574](https://github.com/payloadcms/payload/issues/1574)) ([396ea0b](https://github.com/payloadcms/payload/commit/396ea0bd53dc9e1ae1e348d6fe1eb3c36232b35b))
## [1.2.2](https://github.com/payloadcms/payload/compare/v1.2.1...v1.2.2) (2022-12-02)
### Bug Fixes
* adds contain operators for text/email/radio fields ([4c37af6](https://github.com/payloadcms/payload/commit/4c37af6f10dcfd77b5aec963bc5f84a178942143))
* adjusts how limit is set, both in options and paginates limit ([a718010](https://github.com/payloadcms/payload/commit/a71801006cbc4b989d5057a5f04e8e8e0a6dbeed))
* aligns mongoose PaginatedDocs type with actual lib type ([dce2081](https://github.com/payloadcms/payload/commit/dce208166337a8e47cc41301c9c5be0854199eaa))
* allows for form controlled relationship fields to be populated ([e4435bb](https://github.com/payloadcms/payload/commit/e4435bb8bd13fd7122124fb6e171f4bd1cce819c))
* allows for limit bypass on version find operations ([891f00d](https://github.com/payloadcms/payload/commit/891f00d05cd57d9387dd25be81daa3de99e315ed))
* blockName grows in all browsers ([03c2ab5](https://github.com/payloadcms/payload/commit/03c2ab52a89817e94ec9a7b4339e807d995e04f6))
* corrects skipValidation ([e6f1c6f](https://github.com/payloadcms/payload/commit/e6f1c6fc7bb56fe5a858b405c3bf799a46ac57f4))
* dynamic relationship filterOptions ([99c1f41](https://github.com/payloadcms/payload/commit/99c1f41e306a11547965fd938fa5607787243003))
* ensures enums cannot query on partial matches ([ec51929](https://github.com/payloadcms/payload/commit/ec51929b1af0b2c1138aa315d106b52f7e771779))
* german translation optimizations ([#1485](https://github.com/payloadcms/payload/issues/1485)) ([e9d2163](https://github.com/payloadcms/payload/commit/e9d21636011ac084fa26ffbea199fc766fe19b25))
* handle multiple locales in relationship population ([#1452](https://github.com/payloadcms/payload/issues/1452)) ([04c689c](https://github.com/payloadcms/payload/commit/04c689c5b04bc91020eb682b97721eba213836d2))
* **i18n:** requiresAtLeast variable in de.json ([#1556](https://github.com/payloadcms/payload/issues/1556)) ([47fd0d9](https://github.com/payloadcms/payload/commit/47fd0d9ec4aa62335d505a0bfba0305355a318ca))
* ignore validation when unpublishing, do not allow restore with invalid form state ([77ab542](https://github.com/payloadcms/payload/commit/77ab54243ab1857f4f430be4f8c4dc51e15f94ca))
* indexSortableFields timestamp fields [#1506](https://github.com/payloadcms/payload/issues/1506) ([#1537](https://github.com/payloadcms/payload/issues/1537)) ([7aada3c](https://github.com/payloadcms/payload/commit/7aada3c746603b91bbb4fadf953f36e23fba5121))
* infinite rerenders, accounts for hasMany false ([16d00e8](https://github.com/payloadcms/payload/commit/16d00e87c2f8b63e695e46ccbf279ad90621dc17))
* moves relationship field useEffect into async reducer action ([54ef40a](https://github.com/payloadcms/payload/commit/54ef40a335905f7295f847c68762f7fe06bccc30))
* moves sharp types from devDeps to deps ([b3d526b](https://github.com/payloadcms/payload/commit/b3d526b59a275a1f58a76322a588ba8a6370f26b))
* reverts async reducer and resolves infinite effect ([a9da81f](https://github.com/payloadcms/payload/commit/a9da81f18cf9e6eba67187a3a2735b267949e0ae))
* sanitize number query params before passing to find operation ([c8d1b9f](https://github.com/payloadcms/payload/commit/c8d1b9f88af62ad1ab927ca3d035fa4c031989f1))
* translate select field option labels ([#1476](https://github.com/payloadcms/payload/issues/1476)) ([3a9dc9e](https://github.com/payloadcms/payload/commit/3a9dc9ef68374692c3314651bee6e1b00ae55f17))
* update drafts includes latest version changes ([48989d0](https://github.com/payloadcms/payload/commit/48989d0f6ed086dc60dc94165a4e0ca8120f9b1a))
* updates code field css ([3eebd66](https://github.com/payloadcms/payload/commit/3eebd6613f66f3cac38e00cfd94e80b2999cf791))
* updates syntax colors for light theme ([dbfe7ca](https://github.com/payloadcms/payload/commit/dbfe7ca6e61e3a93baabc378f52835af9e53fd38))
* uses baseClass in code field ([d03f0ae](https://github.com/payloadcms/payload/commit/d03f0aef8423597aceb36ddbbb1cc63033d0066d))
### Features
* decouples limit from pagination, allows for no limit query ([f7ce0c6](https://github.com/payloadcms/payload/commit/f7ce0c615d76035ee48ef32047613ab1415deb44))
* improve typescript comments ([#1467](https://github.com/payloadcms/payload/issues/1467)) ([5bd8657](https://github.com/payloadcms/payload/commit/5bd86571cada5791003bbfa84183f5b300649533))
* log email transport error messages ([#1469](https://github.com/payloadcms/payload/issues/1469)) ([a90a1a9](https://github.com/payloadcms/payload/commit/a90a1a9e19bb54eb6d88129b5e2cb6483e22db61))
* removes theme provider and updates background for code fields ([1a6c9a3](https://github.com/payloadcms/payload/commit/1a6c9a3e181930a6f45027fecc5313e8d7228c71))
## [1.2.1](https://github.com/payloadcms/payload/compare/v1.2.0...v1.2.1) (2022-11-22)
### Bug Fixes
* adjusts styles to allow error bg to fill textarea ([2e57b76](https://github.com/payloadcms/payload/commit/2e57b76df01acf7ed1ce5fcb824ef5f96d11621d))
* allows patching global drafts [#1415](https://github.com/payloadcms/payload/issues/1415) ([25822a9](https://github.com/payloadcms/payload/commit/25822a91b1e4f2bf4804f15947d211138d696219))
* dynamically sets stepnav from default edit view ([40c8778](https://github.com/payloadcms/payload/commit/40c87784b0c6281c599b6d2a46a27b70b0568c30))
* ensures drafts operations saves as draft [#1415](https://github.com/payloadcms/payload/issues/1415) ([fc16ffe](https://github.com/payloadcms/payload/commit/fc16ffefdb354ea023462d784cdac7ab6fcc26d3))
* flattens locales before versioning published docs [#1415](https://github.com/payloadcms/payload/issues/1415) ([f700f51](https://github.com/payloadcms/payload/commit/f700f51f2bcdd657d1fab6b6d83ac00a11ed870d))
* **i18n:** version count ([#1465](https://github.com/payloadcms/payload/issues/1465)) ([075b7e9](https://github.com/payloadcms/payload/commit/075b7e9f02498ea253cf270654dcce0f11ec1f93))
* Increase textarea click area ([c303913](https://github.com/payloadcms/payload/commit/c303913e61881a3b0d90615dda905b20347d6f1e))
* invalid query string user account request ([#1478](https://github.com/payloadcms/payload/issues/1478)) ([400cb9b](https://github.com/payloadcms/payload/commit/400cb9b6bcfd09c39cb6aa438daad876d12e8e13))
* removes incorrectly import/export option type - [#1441](https://github.com/payloadcms/payload/issues/1441) ([ed01a17](https://github.com/payloadcms/payload/commit/ed01a176210a02a32874f4d0d1c5206d9a772e7e))
* rendering of localized select value ([1d1d249](https://github.com/payloadcms/payload/commit/1d1d2493aa08db4c300c01e72ccb6c11e03f9e09))
* sanitizes select values on the server, allowing isClearable selects to be cleared without error ([699ca14](https://github.com/payloadcms/payload/commit/699ca14434eeff3025cffd3f6e00efada80e021f))
* translate version comparison view field labels ([#1470](https://github.com/payloadcms/payload/issues/1470)) ([8123585](https://github.com/payloadcms/payload/commit/8123585592b9a53ef746f17476b36a2661cca025))
* versionCount was broken & other i18n improvements ([#1450](https://github.com/payloadcms/payload/issues/1450)) ([078c28b](https://github.com/payloadcms/payload/commit/078c28bd5fd08fd17a0b0b360e904f51fe8a2e98))
* versions tests ([af6a7aa](https://github.com/payloadcms/payload/commit/af6a7aa9e850c0817ea40d755f51255ccf0938c2))
### Features
* add i18n to option labels in version comparison ([#1477](https://github.com/payloadcms/payload/issues/1477)) ([7b6a9ed](https://github.com/payloadcms/payload/commit/7b6a9ede6e3a72e7e64358cb88946b16153d8dc6))
* exports field types properly ([7c6d6fd](https://github.com/payloadcms/payload/commit/7c6d6fd1caeb25e1a871fa1b9cecc53be8a2a7a1))
# [1.2.0](https://github.com/payloadcms/payload/compare/v1.1.26...v1.2.0) (2022-11-18)
### 🐛 Bug Fixes
* build errors ([65f0e1c](https://github.com/payloadcms/payload/commit/65f0e1caace193f034139e331883d01d8eb92d2c))
* components optional chaining ([d5e725c](https://github.com/payloadcms/payload/commit/d5e725c608588e96b974291fa86d5e89dea9060d))
* corrects exported custom component type ([2878b4b](https://github.com/payloadcms/payload/commit/2878b4b1bec5c0c9997c1ba2a080640d4d3f8e5f))
* corrects type for CollapsibleLabel example type, adjusts custom component filenames ([ccb4231](https://github.com/payloadcms/payload/commit/ccb42319abf0679d998e15b6b47fff3ce95d4ca1))
* sets pointer-events to none so the entire label bar is clickable ([e458087](https://github.com/payloadcms/payload/commit/e458087a55cbbad29ca3568ca4c089aaee49693a))
### ✨ Features
* add i18n to admin panel ([#1326](https://github.com/payloadcms/payload/issues/1326)) ([bab34d8](https://github.com/payloadcms/payload/commit/bab34d82f5fddad32ceafd116ad97e87cab4c862))
* adds docs example ([2bf0fff](https://github.com/payloadcms/payload/commit/2bf0fffa0dd83f395aa3318b3baba1e22dd58b51))
* adds playwright tests for array fields ([57a8c35](https://github.com/payloadcms/payload/commit/57a8c352e44750d1785b65074c15812dc8226585))
* converts rowHeader to collapsibleLabel, extends data passed to functions/components ([13ec1e0](https://github.com/payloadcms/payload/commit/13ec1e0398d2a9ce1aeddc5692008173acfde45e))
* customizable header-labels ([d45de99](https://github.com/payloadcms/payload/commit/d45de99956273c59e6d1a3a11c7cce36f3d123f6))
* simplifies collapsible label API, adds e2e tests ([d9df98f](https://github.com/payloadcms/payload/commit/d9df98ff22041908fc2ce0972c844116edd409be))
* specifies component names for arrays/collapsibles, simplifies threaded data ([b74ea21](https://github.com/payloadcms/payload/commit/b74ea218ca47ce9db9d20586dbbce73e4ce0f917))
### 🚨 BREAKING CHANGES
* You ***might*** need to update your config. This change affects `collections`, `globals` and `block fields` with custom labeling.
* **Collections:** are affected if you have a custom `labels.singular` defined that differs from your collection slug.
```typescript
// ExampleCollection.ts
// Before
const ExampleCollection: CollectionConfig = {
slug: 'case-studies',
labels: {
// Before Payload used `labels.singular` to generate types/graphQL schema
singular: 'Project',
plural: 'Projects',
},
}
// After
const ExampleCollection: CollectionConfig = {
// Now Payload uses `slug` to generate types/graphQL schema
slug: 'case-studies',
labels: {
singular: 'Project',
plural: 'Projects',
},
// To override the usage of slug in graphQL schema generation
graphQL: {
singularName: 'Project',
pluralName: 'Projects',
},
// To override the usage of slug in type file generation
typescript: {
interface: 'Project',
}
}
```
* **Globals:** are affected if you have a `label` defined that differs from your global slug.
```typescript
// ExampleGlobal.ts
// Before
const ExampleGlobal: GlobalConfig = {
slug: 'footer',
// Before Payload used `label` to generate types/graphQL schema
label: 'Page Footer',
}
// After
const ExampleGlobal: GlobalConfig = {
// Now Payload uses `slug` to generate types/graphQL schema
slug: 'footer',
label: 'Page Footer',
// To override the usage of slug in graphQL schema generation
graphQL: {
name: 'PageFooter',
},
// To override the usage of slug in type file generation
typescript: {
interface: 'PageFooter',
},
}
```
* **Block Fields:** are affected if you have a `label` defined that differs from your block slug.
```typescript
// ExampleBlock.ts
// Before
const ExampleBlock: Block = {
slug: 'content',
// Before Payload used `label` to generate graphQL schema
label: 'Content Block',
}
// After
const ExampleBlock: Block = {
// Now Payload uses `slug` to generate graphQL schema
slug: 'content',
label: 'Content Block',
// To override the usage of slug in graphQL schema generation
graphQL: {
singularName: 'ContentBlock',
},
}
```
**Breaking changes recap**:
- On Collections
- Use `graphQL.singularName`, `graphQL.pluralName` for GraphQL schema names.
- Use `typescript.interface` for typescript generation name.
- On Globals
- Use `graphQL.name` for GraphQL Schema name.
- Use `typescript.interface` for typescript generation name.
- On Blocks (within Block fields)
- Use `graphQL.singularName` for graphQL schema names.
## [1.1.26](https://github.com/payloadcms/payload/compare/v1.1.25...v1.1.26) (2022-11-15)
### Bug Fixes
* [#1414](https://github.com/payloadcms/payload/issues/1414) ([50bcf00](https://github.com/payloadcms/payload/commit/50bcf001ea613c65cfe0545e7257d5b13ca688f3))
## [1.1.25](https://github.com/payloadcms/payload/compare/v1.1.24...v1.1.25) (2022-11-15)
### Bug Fixes
* add slug to DocumentInfo context ([#1389](https://github.com/payloadcms/payload/issues/1389)) ([4d8cc97](https://github.com/payloadcms/payload/commit/4d8cc97475c73e5131699ef03dca275a17535a25))
* adds unique key to upload cards to prevent old images being shown while navigating to new page ([5e8a8b2](https://github.com/payloadcms/payload/commit/5e8a8b2df9af435f0df8a8a07dddf7dcc24cf9ac))
* ensures admin components is defaulted ([d103f6c](https://github.com/payloadcms/payload/commit/d103f6c94f91b5359aea722c2d7781bf144f6a26))
* global afterRead and afterChange execution ([#1405](https://github.com/payloadcms/payload/issues/1405)) ([cdaa8cc](https://github.com/payloadcms/payload/commit/cdaa8cc29f58308a387375ec41eafd0d38b13bcb))
### Features
* admin UI logout extensibility ([#1274](https://github.com/payloadcms/payload/issues/1274)) ([a345ef0](https://github.com/payloadcms/payload/commit/a345ef0d3179000a2930f8b09886e06fd0801d21))
* let textarea grow based on value ([#1398](https://github.com/payloadcms/payload/issues/1398)) ([0f27b10](https://github.com/payloadcms/payload/commit/0f27b103b44935480b8ffe17427fc5ed05b92446))
* saves tab index to user preferences ([5eb8e4a](https://github.com/payloadcms/payload/commit/5eb8e4a28f34a1c51790d4eabfb21606b7fb41c6))
## [1.1.24](https://github.com/payloadcms/payload/compare/v1.1.23...v1.1.24) (2022-11-14)
### Bug Fixes
* cursor jumping while typing in inputs ([216b9f8](https://github.com/payloadcms/payload/commit/216b9f88d988c692d6acdf920ee4dbb9903020ae)), closes [#1393](https://github.com/payloadcms/payload/issues/1393)
## [1.1.23](https://github.com/payloadcms/payload/compare/v1.1.22...v1.1.23) (2022-11-12)
### Bug Fixes
* [#1361](https://github.com/payloadcms/payload/issues/1361), ensures collection auth depth works while retrieving static assets ([2f68404](https://github.com/payloadcms/payload/commit/2f684040fc9ca717d48b0d95cbd3468c35973993))
### Features
* optimizes field performance by storing internal values in useField hook ([66210b8](https://github.com/payloadcms/payload/commit/66210b856b97139f9959fac47154bca44f0a4de0))
## [1.1.22](https://github.com/payloadcms/payload/compare/v1.1.21...v1.1.22) (2022-11-12)
### Bug Fixes
* [#1353](https://github.com/payloadcms/payload/issues/1353), ensures errors returned from server make their way to UI ([3f28a69](https://github.com/payloadcms/payload/commit/3f28a69959be9c98869f81bcd379b8c7cd505a12))
* [#1357](https://github.com/payloadcms/payload/issues/1357), nested arrays and blocks sometimes not allowing save ([86855d6](https://github.com/payloadcms/payload/commit/86855d68f65dfadbf51050bdaf6a28c3220add6f))
* [#1358](https://github.com/payloadcms/payload/issues/1358), allows listSearchableFields to work when indicated fields are nested ([eb0023e](https://github.com/payloadcms/payload/commit/eb0023e9617894873fe75748de187d85279498c8))
* [#1360](https://github.com/payloadcms/payload/issues/1360), relationship field onMenuScrollToBottom not working in some browsers ([7136db4](https://github.com/payloadcms/payload/commit/7136db4c718b70833fa75f5c8e9ae596298b3aa9))
* [#1367](https://github.com/payloadcms/payload/issues/1367), allows custom global components within schema validation ([1d76e97](https://github.com/payloadcms/payload/commit/1d76e973bb8e6e33e40b469bd410042ae4b90e2e))
* 1309, duplicative logout in admin UI ([35f91b0](https://github.com/payloadcms/payload/commit/35f91b038b66d74468dad250dbe7cbf1ea88b444))
* fixed GraphQL Access query resolver to return the correct data ([#1339](https://github.com/payloadcms/payload/issues/1339)) ([cfef68f](https://github.com/payloadcms/payload/commit/cfef68f36477e34b9943d9334c65fa46ee3eb339))
## [1.1.21](https://github.com/payloadcms/payload/compare/v1.1.20...v1.1.21) (2022-11-05)
## [1.1.20](https://github.com/payloadcms/payload/compare/v1.1.19...v1.1.20) (2022-11-05)
### Features
* optimizes blocks and arrays by removing some additional rerenders ([483adf0](https://github.com/payloadcms/payload/commit/483adf08c4131d0401e47ec45d72200b9dc60de2))
## [1.1.19](https://github.com/payloadcms/payload/compare/v1.1.18...v1.1.19) (2022-10-31)
### Bug Fixes
* [#1307](https://github.com/payloadcms/payload/issues/1307), [#1321](https://github.com/payloadcms/payload/issues/1321) - bug with disableFormData and blocks field ([2a09f15](https://github.com/payloadcms/payload/commit/2a09f15a158ff30e89c5454f81aa140448f15d30))
* [#1311](https://github.com/payloadcms/payload/issues/1311), select existing upload modal always updates state ([e2ec2f7](https://github.com/payloadcms/payload/commit/e2ec2f7b97ed308c4ff7deefbc58cf0df6ff0602))
* [#1318](https://github.com/payloadcms/payload/issues/1318), improves popup positioning and logic ([c651835](https://github.com/payloadcms/payload/commit/c6518350617d14818dfc537b5b0a147274c1119b))
* custom pino logger options ([#1299](https://github.com/payloadcms/payload/issues/1299)) ([2500026](https://github.com/payloadcms/payload/commit/25000261bd6ecb0f05ae79de9a0693078a0e3e0d))
## [1.1.18](https://github.com/payloadcms/payload/compare/v1.1.17...v1.1.18) (2022-10-25)
## [1.1.17](https://github.com/payloadcms/payload/compare/v1.1.16...v1.1.17) (2022-10-25)
### Bug Fixes
* [#1286](https://github.com/payloadcms/payload/issues/1286), uses defaultDepth in graphql rich text depth ([66bf8c3](https://github.com/payloadcms/payload/commit/66bf8c3cbd080ee5a28b7af521d427d3aae59ba2))
* [#1290](https://github.com/payloadcms/payload/issues/1290), renders more than one rich text leaf where applicable ([a9f2f0e](https://github.com/payloadcms/payload/commit/a9f2f0ec03383ef4c3ef3ba98274b0abaaf962ed))
* [#1291](https://github.com/payloadcms/payload/issues/1291), add inline relationship drafts ([3967c12](https://github.com/payloadcms/payload/commit/3967c1233fda00b48e9df15276502a6b14b737ff))
* enforces depth: 0 in graphql resolvers ([3301f59](https://github.com/payloadcms/payload/commit/3301f598223d517ac310909bb74e455891c27693))
* ensures field updates when disableFormData changes ([c929725](https://github.com/payloadcms/payload/commit/c929725dd565de08871dad655442ee9ac4f29dd5))
* group + group styles within collapsible ([17dbbc7](https://github.com/payloadcms/payload/commit/17dbbc77757a7cd6e517bac443859561fee86e32))
### Features
* added beforeLogin hook ([#1289](https://github.com/payloadcms/payload/issues/1289)) ([09d7939](https://github.com/payloadcms/payload/commit/09d793926dbb642bbcb6ab975735d069df355a8a))
* adds default max length for text-based fields ([6a1b25a](https://github.com/payloadcms/payload/commit/6a1b25ab302cbdf7f312012b29b78288815810af))
* specify node 14+ and yarn classic LTS ([#1240](https://github.com/payloadcms/payload/issues/1240)) ([9181477](https://github.com/payloadcms/payload/commit/91814777b0bf3830c4a468b76783ff6f42ad824a))
## [1.1.16](https://github.com/payloadcms/payload/compare/v1.1.15...v1.1.16) (2022-10-21)
### Bug Fixes
* indexSortableFields not respected ([785b992](https://github.com/payloadcms/payload/commit/785b992c3ea31f7818f1c87c816b8b8de644851d))
* obscure bug where upload collection has upload field relating to itself ([36ef378](https://github.com/payloadcms/payload/commit/36ef3789fbe00cafe8b3587d6c370e28efd5a187))
## [1.1.15](https://github.com/payloadcms/payload/compare/v1.1.14...v1.1.15) (2022-10-14)
### Bug Fixes
* ensures svg mime type is always image/svg+xml ([0b0d971](https://github.com/payloadcms/payload/commit/0b0d9714917b1a56fb899a053e2e35c878a00992))
## [1.1.14](https://github.com/payloadcms/payload/compare/v1.1.13...v1.1.14) (2022-10-14)
## [1.1.11](https://github.com/payloadcms/payload/compare/v1.1.10...v1.1.11) (2022-10-12)
### Bug Fixes
* ensures arrays and blocks mount as disableFormData: true, fixes [#1242](https://github.com/payloadcms/payload/issues/1242) ([5ca5aba](https://github.com/payloadcms/payload/commit/5ca5abab422ad1cdb1b449a8298f439c57dda464))
### Features
* builds beforeDuplicate admin hook, closes [#1243](https://github.com/payloadcms/payload/issues/1243) ([6f6f2f8](https://github.com/payloadcms/payload/commit/6f6f2f8e7b83821ae2f2d30d08460439746cc0c6))
## [1.1.10](https://github.com/payloadcms/payload/compare/v1.1.9...v1.1.10) (2022-10-11)
## [1.1.9](https://github.com/payloadcms/payload/compare/v1.1.8...v1.1.9) (2022-10-11)
### Features
* improves access control typing ([5322ada](https://github.com/payloadcms/payload/commit/5322ada9e690544c4864abba202a14ec1f2f5e9d))
## [1.1.8](https://github.com/payloadcms/payload/compare/v1.1.7...v1.1.8) (2022-10-11)
### Features
* adds ability to create related docs while editing another ([1e048fe](https://github.com/payloadcms/payload/commit/1e048fe03787577fe4d584cec9c2d7c78bc90a17))
* implements use-context-selector for form field access ([5c1a3fa](https://github.com/payloadcms/payload/commit/5c1a3fabeef48b78f173af084f9117515e1297ba))
## [1.1.7](https://github.com/payloadcms/payload/compare/v1.1.6...v1.1.7) (2022-10-06)
## [1.1.6](https://github.com/payloadcms/payload/compare/v1.1.5...v1.1.6) (2022-10-06)
### Bug Fixes
* [#1184](https://github.com/payloadcms/payload/issues/1184) ([c2ec54a](https://github.com/payloadcms/payload/commit/c2ec54a7cbd8cd94bcd4a68d885e35986fec7f18))
* [#1189](https://github.com/payloadcms/payload/issues/1189) ([3641dfd](https://github.com/payloadcms/payload/commit/3641dfd38a147b24e0e3ef93a125b12ad7763f66))
* [#1204](https://github.com/payloadcms/payload/issues/1204) ([b4becd1](https://github.com/payloadcms/payload/commit/b4becd1493d55aae887008ab573ab710c400103a))
* [#940](https://github.com/payloadcms/payload/issues/940) ([7926083](https://github.com/payloadcms/payload/commit/7926083732fbaec78d87f67742cdbd8bd00cd48a))
* ajusts how disabled states are being set on anchors and buttons ([00ef170](https://github.com/payloadcms/payload/commit/00ef1700ae41e68ff0831a587bf3f09fe6c2c966))
* remove min-width from fileupload ([73848b6](https://github.com/payloadcms/payload/commit/73848b603790b3c3d8ad8c9dac81b33c0b65fc7e))
* resize textarea only vertically ([6e1dfff](https://github.com/payloadcms/payload/commit/6e1dfff1b8195a1f81e6ea6ccf3b36dd5359c039))
* richText e2e test, specific selectors ([09a8144](https://github.com/payloadcms/payload/commit/09a8144f3cc63f7ec15fd75f51b8ac8d0cf3f1b5))
* styles readOnly RichTextEditor, removes interactivity within when readOnly ([9181304](https://github.com/payloadcms/payload/commit/918130486e1e38a3d57fb993f466207209c5c0bb))
* **style:** system dark scrollbars ([a30d9dc](https://github.com/payloadcms/payload/commit/a30d9dc1d70340cc6c5ac5b3415a6f57bec117ae))
* threads readOnly to ReactSelect ([b454811](https://github.com/payloadcms/payload/commit/b454811698c7ea0cee944ed50030c13163cf72c9))
* upload xls renaming ext ([7fd8124](https://github.com/payloadcms/payload/commit/7fd8124df68d208813de46172c5cd3f479b9b8be))
### Features
* async admin access control ([1cfce87](https://github.com/payloadcms/payload/commit/1cfce8754947487e6c598ed5bc881526295acabf))
* sort select and relationship fields by default ([813c46c](https://github.com/payloadcms/payload/commit/813c46c86d86f8b0a3ba7280d31f24e844c916b6))
## [1.1.5](https://github.com/payloadcms/payload/compare/v1.1.4...v1.1.5) (2022-09-29)
### Bug Fixes
* bug in useThrottledEffect ([3ce8ee4](https://github.com/payloadcms/payload/commit/3ce8ee4661bfa3825c5b8c41232d5da57f7591ed))
## [1.1.4](https://github.com/payloadcms/payload/compare/v1.1.3...v1.1.4) (2022-09-24)
### Bug Fixes
* field level access for nested fields ([22ea98c](https://github.com/payloadcms/payload/commit/22ea98ca33770a0ec6652f814726454abb6da24e))
* refine type generation for relationships ([ef83bdb](https://github.com/payloadcms/payload/commit/ef83bdb709ebde008b90930a6875b24f042a41b0))
### Features
* supports root endpoints ([52cd3b4](https://github.com/payloadcms/payload/commit/52cd3b4a7ed9bc85e93d753a3aaf190489ca98cd))
## [1.1.3](https://github.com/payloadcms/payload/compare/v1.1.2...v1.1.3) (2022-09-16)
### Bug Fixes
* adjust prevPage and nextPage graphql typing ([#1140](https://github.com/payloadcms/payload/issues/1140)) ([b3bb421](https://github.com/payloadcms/payload/commit/b3bb421c6ca4176974488b3270384386a151560c))
* duplicate with relationships ([eabb981](https://github.com/payloadcms/payload/commit/eabb981243e005facb5fff6d9222903d4704ca55))
## [1.1.2](https://github.com/payloadcms/payload/compare/v1.1.1...v1.1.2) (2022-09-14)
### Bug Fixes
* resize images without local storage ([1496679](https://github.com/payloadcms/payload/commit/14966796ae0d0bcff8cb56b62e3a21c2de2176da))
* resize images without local storage ([7b756f3](https://github.com/payloadcms/payload/commit/7b756f3421f02d1ff55374a72396e15e9f3e23d7))
## [1.1.1](https://github.com/payloadcms/payload/compare/v1.1.0...v1.1.1) (2022-09-13)
### Bug Fixes
* conditions on collapsible fields ([9c4f2b6](https://github.com/payloadcms/payload/commit/9c4f2b68b07bbdd2ac9a6dee280f50379638fc50))
* dashboard links to globals ([dcc8dad](https://github.com/payloadcms/payload/commit/dcc8dad53b006f86e93150f9439eafc8d9e01d79))
# [1.1.0](https://github.com/payloadcms/payload/compare/v1.0.36...v1.1.0) (2022-09-13)
### Bug Fixes
* [#1106](https://github.com/payloadcms/payload/issues/1106) ([9a461b8](https://github.com/payloadcms/payload/commit/9a461b853689fdbc8229c8e103c5e237e451425f))
* word boundaries, no regex lookbehind support for Safari ([#1114](https://github.com/payloadcms/payload/issues/1114)) ([391c9d8](https://github.com/payloadcms/payload/commit/391c9d8682175ea37f1f7b2bb9d1361dc4ac8140))
### Features
* [#1001](https://github.com/payloadcms/payload/issues/1001) - builds a way to allow list view to search multiple fields ([a108372](https://github.com/payloadcms/payload/commit/a1083727ef54ec15ea2c3b4dfd114567639dfef1))
* collection groups ([dffeaf6](https://github.com/payloadcms/payload/commit/dffeaf6a69746b944bf36bd172da3cc19fa025a0))
* globals groups ([59af872](https://github.com/payloadcms/payload/commit/59af8725b4625f8e08aaab730fce177e870279ca))
* hide nav labels with no un-grouped collections ([c40e232](https://github.com/payloadcms/payload/commit/c40e232ac67e7bc1ced3775060beb835efff46b9))
* implement gravatar ([#1107](https://github.com/payloadcms/payload/issues/1107)) ([ca434b8](https://github.com/payloadcms/payload/commit/ca434b8a929af081bb3b92b51f35058a23ce5e37))
* support localized tab fields ([a83921a](https://github.com/payloadcms/payload/commit/a83921a2fe927d59562272cb111c68a840b1914f))
* tabs support localization at the tab level ([6a6a691](https://github.com/payloadcms/payload/commit/6a6a69190fe13bebf3e0b089265d71be2a691488))
* WIP tab compatible with traverseFields ([2ae33b6](https://github.com/payloadcms/payload/commit/2ae33b603abaec4ff80261a465781f508b4a1e06))
## [1.0.36](https://github.com/payloadcms/payload/compare/v1.0.35...v1.0.36) (2022-09-10)
### Bug Fixes
* bug with account view ([ada1871](https://github.com/payloadcms/payload/commit/ada1871993bae92bc7a30f48029b437d63eb3871))
## [1.0.35](https://github.com/payloadcms/payload/compare/v1.0.34...v1.0.35) (2022-09-10)
### Bug Fixes
* [#1059](https://github.com/payloadcms/payload/issues/1059) ([13dc39d](https://github.com/payloadcms/payload/commit/13dc39dc6da4cb7c450477f539b09a3cb54ed5af))
* add height/width if imageSizes not specified ([8bd2a0e](https://github.com/payloadcms/payload/commit/8bd2a0e6c9a9cd05c7b162ade47f3bb111236ba3))
* incorrect auth strategy type ([c8b37f4](https://github.com/payloadcms/payload/commit/c8b37f40cbdc766a45dbe21573b1848bfc091901))
* rich text link with no selection ([5a19f69](https://github.com/payloadcms/payload/commit/5a19f6915a17dbb072b89f63f32705d5f0fc75ce))
### Features
* allows rich text links to link to other docs ([a99d9c9](https://github.com/payloadcms/payload/commit/a99d9c98c3f92d6fbeb65c384ca4d43b82184bfd))
* improves rich text link ux ([91000d7](https://github.com/payloadcms/payload/commit/91000d7fdaa9628650c737fc3f7f6a900b7447d4))
## [1.0.34](https://github.com/payloadcms/payload/compare/v1.0.33...v1.0.34) (2022-09-07)
### Bug Fixes
* pins faceless ui modal ([b38b642](https://github.com/payloadcms/payload/commit/b38b6427b8b813487922db0bb7d3762cc41d3447))
## [1.0.33](https://github.com/payloadcms/payload/compare/v1.0.30...v1.0.33) (2022-09-07)
### Bug Fixes
* [#1062](https://github.com/payloadcms/payload/issues/1062) ([05d1b14](https://github.com/payloadcms/payload/commit/05d1b141b22f66cb9007f20f2ae9d8e31db4f32f))
* [#948](https://github.com/payloadcms/payload/issues/948) ([8df9ee7](https://github.com/payloadcms/payload/commit/8df9ee7b2dfcb2f77f049d02788a5c60c45f8c12))
* [#981](https://github.com/payloadcms/payload/issues/981) ([d588843](https://github.com/payloadcms/payload/commit/d58884312132e109ae3f6619be2e0d7bab3f3111))
* accented label char sanitization for GraphQL ([#1080](https://github.com/payloadcms/payload/issues/1080)) ([888734d](https://github.com/payloadcms/payload/commit/888734dcdf775f416395f8830561c47235bb9019))
* children of conditional fields required in graphql schema ([#1055](https://github.com/payloadcms/payload/issues/1055)) ([29e82ec](https://github.com/payloadcms/payload/commit/29e82ec845f69bf5a09b682739e88529ebc53c16))
* ensures adding new media to upload works when existing doc does not exist ([5ae666b](https://github.com/payloadcms/payload/commit/5ae666b0e08b128bdf2d576428e8638c2b8c2ed8))
* implement the same word boundary search as the like query ([#1038](https://github.com/payloadcms/payload/issues/1038)) ([c3a0bd8](https://github.com/payloadcms/payload/commit/c3a0bd86254dfc3f49e46d4e41bdf717424ea342))
* reorder plugin wrapping ([#1051](https://github.com/payloadcms/payload/issues/1051)) ([cd8edba](https://github.com/payloadcms/payload/commit/cd8edbaa1faa5a94166396918089a01058a4e75e))
* require min 1 option in field schema validation ([#1082](https://github.com/payloadcms/payload/issues/1082)) ([d56882c](https://github.com/payloadcms/payload/commit/d56882cc20764b793049f20a91864c943e711375))
* update removing a relationship with null ([#1056](https://github.com/payloadcms/payload/issues/1056)) ([44b0073](https://github.com/payloadcms/payload/commit/44b0073834830a9d645a11bcafab3869b4eb1899))
* update removing an upload with null ([#1076](https://github.com/payloadcms/payload/issues/1076)) ([2ee4c7a](https://github.com/payloadcms/payload/commit/2ee4c7ad727b9311578d3049660de81c27dace55))
### Features
* cyrillic like query support ([#1078](https://github.com/payloadcms/payload/issues/1078)) ([b7e5828](https://github.com/payloadcms/payload/commit/b7e5828adc7bc6602da7992b073b005b30aa896f))
* duplicate copies all locales ([51c7770](https://github.com/payloadcms/payload/commit/51c7770b10c34a3e40520ca8d64beedc67693c5c))
* update operator type with contains ([#1045](https://github.com/payloadcms/payload/issues/1045)) ([482cbe7](https://github.com/payloadcms/payload/commit/482cbe71c7b1d39b665fb0b29a7a0b69f454180a))
## [1.0.30](https://github.com/payloadcms/payload/compare/v1.0.29...v1.0.30) (2022-08-30)
@@ -1836,4 +2556,4 @@ If none of your collections or globals should be publicly exposed, you don't nee
* 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)
## [0.0.137](https://github.com/payloadcms/payload/commit/5c1e2846a2694a80cc8707703406c2ac1bb6af8a) (2020-11-12)

102
README.md
View File

@@ -1,30 +1,76 @@
<h1 align="center">Payload</h1>
<p align="center">A free and open-source TypeScript headless CMS & application framework built with Express, MongoDB and React.</p>
<h1 align="center">
<img width="350" src="/src/admin/assets/images/payload-logo-dark.svg#gh-light-mode-only" alt="payload cms">
<img width="350" src="/src/admin/assets/images/payload-logo-light.svg#gh-dark-mode-only" alt="payload cms">
</h1>
<h2 align="center" style="padding-bottom: 24px !important;">The most powerful TypeScript CMS</h2>
<p align="center">Code-first Headless CMS that bridges the gap between CMS and application framework</p>
<h3 align="center">
<br />
<a href="https://payloadcms.com/docs/getting-started/what-is-payload" rel="dofollow"><strong>Explore the docs »</strong></a>
<br />
<br/>
</h3>
<h4 align="center">
<a target="_blank" href="https://github.com/payloadcms/payload/discussions">Request Feature</a>
·
<a target="_blank" href="https://github.com/payloadcms/payload/issues/new?assignees=&labels=possible-bug&template=BUG_REPORT.md">Report Bug</a>
·
<a target="_blank" href="https://discord.com/invite/r6sCXqVk3v">Join Discord</a>
·
<a target="_blank" rel="dofollow" href="https://payloadcms.com/docs/getting-started/what-is-payload">Docs</a>
·
<a target="_blank" rel="dofollow" href="https://payloadcms.com/">Website</a>
</h4>
<br />
<p align="center">
<a href="https://opensource.org/licenses/MIT">
<img src="https://img.shields.io/badge/License-MIT-blue.svg" />
</a>
&nbsp;
<a href="https://github.com/payloadcms/payload/actions">
<img src="https://github.com/payloadcms/payload/workflows/build/badge.svg" />
</a>
&nbsp;
<a href="https://github.com/payloadcms/payload/commits">
<img src="https://img.shields.io/github/commit-activity/m/payloadcms/payload" alt="git commit activity"/>
</a>
&nbsp;
<a href="https://discord.com/invite/r6sCXqVk3v">
<img alt="Discord" src="https://img.shields.io/discord/967097582721572934?label=Discord&color=7289da" />
</a>
&nbsp;
<a href="https://www.npmjs.com/package/payload">
<img alt="npm" src="https://img.shields.io/npm/v/payload" />
</a>
<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>
<a href="https://discord.com/invite/r6sCXqVk3v">
<img alt="Discord" src="https://img.shields.io/discord/967097582721572934?label=Discord" />
&nbsp;
<a href="https://twitter.com/payloadcms">
<img src="https://img.shields.io/twitter/follow/payloadcms?label=Follow" alt="Payload CMS Twitter" />
</a>
</p>
<br />
<a href="https://payloadcms.com">
<img src="https://payloadcms.com/images/og-image.jpg" alt="Payload headless CMS Admin panel built with React" />
<img src="https://cms.payloadcms.com/media/payload-github-header.jpg" alt="Payload headless CMS Admin panel built with React" />
</a>
### Features
<br />
## ⭐ Why Payload?
Payload is a CMS that has been designed for developers from the ground up to deliver them what they need to build great digital products. If you know JavaScript, you know Payload. It's 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.
## ✨ Features
- Completely free and open-source
- [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
@@ -44,40 +90,38 @@
- Intensely fast API
- Highly secure thanks to HTTP-only cookies, CSRF protection, and more
### Code-first
Payload is a CMS that has been designed for developers from the ground up to deliver them what they need to build great digital products. If you know JavaScript, you know Payload. It's 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.
### Quick Start
## 🚀 Quick Start
Before beginning to work with Payload, make sure you have all of the [required software](https://payloadcms.com/docs/getting-started/installation).
From there, the easiest way to get started with Payload is to use the `create-payload-app` package:
```
```text
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
## 🗒️ 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.
### Contributing
## 🙋 Contributing
If you want to add contributions to this repository, please follow the instructions in [contributing.md](./contributing.md).
### Other Resources
## 🚨 Need help?
##### Discussions
There are lots of good conversations and resources in our Github Discussions board & our Discord Server. If you're struggling with something, chances are, someone's already solved what you're up against. :point_down:
There are lots of good conversations and resources in our [GitHub Discussions board](https://github.com/payloadcms/payload/discussions). If you're struggling with something, chances are, someone's already solved what you're up against. Searching Discussions will often provide very helpful tips and tricks.
- [GitHub Discussions](https://github.com/payloadcms/payload/discussions)
- [GitHub Issues](https://github.com/payloadcms/payload/issues)
- [Discord](https://t.co/30APlsQUPB)
##### Discord
## ⭐ Like what we're doing? Give us a star
Join [Payload's Discord channel](https://discord.com/invite/r6sCXqVk3v) to interact with Payload developers in realtime.
![payload-github-star](https://cms.payloadcms.com/media/payload-github-star.gif)
## 👏 Thanks to all our contributors
<img align="left" src="https://contributors-img.web.app/image?repo=payloadcms/payload"/>

View File

@@ -1,3 +0,0 @@
const config = require('./src/babel.config');
module.exports = config;

View File

@@ -1,3 +0,0 @@
const babelConfig = require('./dist/babel.config');
exports.config = babelConfig;

View File

@@ -2,4 +2,4 @@ export { default as Button } from '../dist/admin/components/elements/Button';
export { default as Card } from '../dist/admin/components/elements/Card';
export { default as Eyebrow } from '../dist/admin/components/elements/Eyebrow';
export { default as Nav } from '../dist/admin/components/elements/Nav';
export { default as Gutter } from '../dist/admin/components/elements/Gutter';
export { Gutter } from '../dist/admin/components/elements/Gutter';

View File

@@ -1,2 +1 @@
// eslint-disable-next-line import/named
export { Props, RenderArrayProps } from '../../dist/admin/components/forms/field-types/Array/types';
export type { Props } from '../../dist/admin/components/forms/field-types/Array/types';

View File

@@ -1,2 +1 @@
// eslint-disable-next-line import/named
export { Props, RenderBlockProps } from '../../dist/admin/components/forms/field-types/Blocks/types';
export type { Props } from '../../dist/admin/components/forms/field-types/Blocks/types';

View File

@@ -1 +1 @@
export { Props } from '../../dist/admin/components/views/collections/List/Cell/types';
export type { Props } from '../../dist/admin/components/views/collections/List/Cell/types';

View File

@@ -1,2 +1 @@
// eslint-disable-next-line import/named
export { Props } from '../../dist/admin/components/forms/field-types/Checkbox/types';
export type { Props } from '../../dist/admin/components/forms/field-types/Checkbox/types';

View File

@@ -1,2 +1 @@
// eslint-disable-next-line import/named
export { Props } from '../../dist/admin/components/forms/field-types/Code/types';
export type { Props } from '../../dist/admin/components/forms/field-types/Code/types';

View File

@@ -1,2 +1 @@
// eslint-disable-next-line import/named
export { Props } from '../../dist/admin/components/forms/field-types/DateTime/types';
export type { Props } from '../../dist/admin/components/forms/field-types/DateTime/types';

View File

@@ -1,2 +1 @@
// eslint-disable-next-line import/named
export { Props } from '../../dist/admin/components/forms/field-types/Email/types';
export type { Props } from '../../dist/admin/components/forms/field-types/Email/types';

View File

@@ -1,2 +1 @@
// eslint-disable-next-line import/named
export { Props } from '../../dist/admin/components/forms/field-types/Group/types';
export type { Props } from '../../dist/admin/components/forms/field-types/Group/types';

View File

@@ -0,0 +1 @@
export type { Props } from '../../dist/admin/components/forms/field-types/JSON/types';

View File

@@ -1,2 +1 @@
// eslint-disable-next-line import/named
export { Props } from '../../dist/admin/components/forms/field-types/Number/types';
export type { Props } from '../../dist/admin/components/forms/field-types/Number/types';

View File

@@ -1,2 +1 @@
// eslint-disable-next-line import/named
export { Props } from '../../dist/admin/components/forms/field-types/Password/types';
export type { Props } from '../../dist/admin/components/forms/field-types/Password/types';

View File

@@ -1,2 +1 @@
// eslint-disable-next-line import/named
export { Props } from '../../../dist/admin/components/forms/field-types/RadioGroup/RadioInput/types';
export type { Props } from '../../../dist/admin/components/forms/field-types/RadioGroup/RadioInput/types';

View File

@@ -1,2 +1 @@
// eslint-disable-next-line import/named
export { Props } from '../../../dist/admin/components/forms/field-types/RadioGroup/types';
export type { Props } from '../../../dist/admin/components/forms/field-types/RadioGroup/types';

View File

@@ -1,2 +1 @@
// eslint-disable-next-line import/named
export { Props, Option, ValueWithRelation } from '../../dist/admin/components/forms/field-types/Relationship/types';
export type { Props, Option, ValueWithRelation } from '../../dist/admin/components/forms/field-types/Relationship/types';

View File

@@ -1,2 +1 @@
// eslint-disable-next-line import/named
export { Props } from '../../dist/admin/components/forms/field-types/RichText/types';
export type { Props } from '../../dist/admin/components/forms/field-types/RichText/types';

View File

@@ -1,2 +1 @@
// eslint-disable-next-line import/named
export { Props } from '../../dist/admin/components/forms/field-types/Row/types';
export type { Props } from '../../dist/admin/components/forms/field-types/Row/types';

View File

@@ -1,2 +1 @@
// eslint-disable-next-line import/named
export { Props, Option } from '../../dist/admin/components/forms/field-types/Select/types';
export type { Props } from '../../dist/admin/components/forms/field-types/Select/types';

View File

@@ -1,2 +1 @@
// eslint-disable-next-line import/named
export { Props } from '../../dist/admin/components/forms/field-types/Text/types';
export type { Props } from '../../dist/admin/components/forms/field-types/Text/types';

View File

@@ -1,2 +1 @@
// eslint-disable-next-line import/named
export { Props } from '../../dist/admin/components/forms/field-types/Textarea/types';
export type { Props } from '../../dist/admin/components/forms/field-types/Textarea/types';

View File

@@ -1,2 +1 @@
// eslint-disable-next-line import/named
export { Props } from '../../dist/admin/components/forms/field-types/Upload/types';
export type { Props } from '../../dist/admin/components/forms/field-types/Upload/types';

View File

@@ -1,12 +1,21 @@
export {
useForm,
/**
* @deprecated useWatchForm is no longer preferred. If you need all form fields, prefer `useAllFormFields`.
*/
useWatchForm,
useFormFields,
useAllFormFields,
useFormSubmitted,
useFormProcessing,
useFormModified,
} from '../dist/admin/components/forms/Form/context';
export { default as useField } from '../dist/admin/components/forms/useField';
/**
* @deprecated This method is now called useField. The useFieldType alias will be removed in an upcoming version.
*/
export { default as useFieldType } from '../dist/admin/components/forms/useField';
export { default as Form } from '../dist/admin/components/forms/Form';
@@ -24,5 +33,6 @@ export { default as Submit } from '../dist/admin/components/forms/Submit';
export { default as Label } from '../dist/admin/components/forms/Label';
export { default as reduceFieldsToValues } from '../dist/admin/components/forms/Form/reduceFieldsToValues';
export { default as getSiblingData } from '../dist/admin/components/forms/Form/getSiblingData';
export { default as withCondition } from '../dist/admin/components/forms/withCondition';

View File

@@ -3,3 +3,4 @@ export { useLocale } from '../dist/admin/components/utilities/Locale';
export { useDocumentInfo } from '../dist/admin/components/utilities/DocumentInfo';
export { useConfig } from '../dist/admin/components/utilities/Config';
export { useAuth } from '../dist/admin/components/utilities/Auth';
export { useEditDepth } from '../dist/admin/components/utilities/EditDepth';

View File

@@ -1,3 +1,2 @@
export { default as Cell } from '../../dist/admin/components/views/collections/List/Cell';
// eslint-disable-next-line import/named
export { Props } from '../../dist/admin/components/views/collections/List/Cell/types';
export type { Props } from '../../dist/admin/components/views/collections/List/Cell/types';

View File

@@ -1,3 +1,2 @@
export { default as Edit } from '../../dist/admin/components/views/collections/Edit/Default';
// eslint-disable-next-line import/named
export { Props } from '../../dist/admin/components/views/collections/Edit/types';
export type { Props } from '../../dist/admin/components/views/collections/Edit/types';

View File

@@ -1,3 +1,2 @@
export { default as List } from '../../dist/admin/components/views/collections/List/Default';
// eslint-disable-next-line import/named
export { Props } from '../../dist/admin/components/views/collections/Edit/types';
export type { Props } from '../../dist/admin/components/views/collections/Edit/types';

View File

@@ -49,7 +49,9 @@ The directory split up in this way specifically to reduce friction when creating
The following command will start Payload with your config: `yarn dev my-test-dir`. This command will start up Payload using your config and refresh a test database on every restart.
NOTE: It is recommended to add the test credentials to your autofill for `localhost:3000/admin` as this will be required on every nodemon restart.
When switching between test directories, you will want to remove your `node_modules/.cache ` manually or by running `yarn clean:cache`.
NOTE: It is recommended to add the test credentials (located in `test/credentials.ts`) to your autofill for `localhost:3000/admin` as this will be required on every nodemon restart. The default credentials are `dev@payloadcms.com` as E-Mail and `test` as password.
## Pull Requests

View File

@@ -8,6 +8,11 @@ keywords: overview, access control, permissions, documentation, Content Manageme
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.
<YouTube
id="DoPLyXG26Dg"
title="Overview of Payload Access Control"
/>
**Example use cases:**
- Allowing anyone `read` access to all `Post`s

View File

@@ -11,35 +11,39 @@ While designing the Payload Admin panel, we determined it should be as minimal a
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.
<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. |
| **`BeforeDashboard`** | Array of components to inject into the built-in Dashboard, _before_ the default dashboard contents. |
| **`AfterDashboard`** | Array of components to inject into the built-in Dashboard, _after_ the default dashboard contents. [Demo](https://github.com/payloadcms/payload/tree/master/test/admin/components/AfterDashboard/index.tsx)|
| **`BeforeLogin`** | Array of components to inject into the built-in Login, _before_ the default login form. |
| **`AfterLogin`** | Array of components to inject into the built-in Login, _after_ the default login form. |
| **`BeforeNavLinks`** | Array of components to inject into the built-in Nav, _before_ the links themselves. |
| **`AfterNavLinks`** | Array of components to inject into the built-in Nav, _after_ the links. |
| **`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. |
| **`routes`** | Define your own routes to add to the Payload Admin UI. [More](#custom-routes) |
| **`providers`** | Define your own provider components that will wrap the Payload Admin UI. [More](#custom-providers) |
| Path | Description |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`Nav`** | Contains the sidebar and mobile Nav in its entirety. |
| **`logout.Button`** | A custom React component.
| **`BeforeDashboard`** | Array of components to inject into the built-in Dashboard, _before_ the default dashboard contents. |
| **`AfterDashboard`** | Array of components to inject into the built-in Dashboard, _after_ the default dashboard contents. [Demo](https://github.com/payloadcms/payload/tree/master/test/admin/components/AfterDashboard/index.tsx) |
| **`BeforeLogin`** | Array of components to inject into the built-in Login, _before_ the default login form. |
| **`AfterLogin`** | Array of components to inject into the built-in Login, _after_ the default login form. |
| **`BeforeNavLinks`** | Array of components to inject into the built-in Nav, _before_ the links themselves. |
| **`AfterNavLinks`** | Array of components to inject into the built-in Nav, _after_ the links. |
| **`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. |
| **`routes`** | Define your own routes to add to the Payload Admin UI. [More](#custom-routes) |
| **`providers`** | Define your own provider components that will wrap the Payload Admin UI. [More](#custom-providers) |
#### Full example:
`payload.config.js`
```ts
import { buildConfig } from 'payload/config'
import { buildConfig } from "payload/config";
import {
MyCustomNav,
MyCustomLogo,
@@ -47,7 +51,7 @@ import {
MyCustomAccount,
MyCustomDashboard,
MyProvider,
} from './customComponents';
} from "./customComponents";
export default buildConfig({
admin: {
@@ -67,134 +71,132 @@ export default buildConfig({
});
```
*For more examples regarding how to customize components, look at the following [examples](https://github.com/payloadcms/payload/tree/master/test/admin/components).*
_For more examples regarding how to customize components, look at the following [examples](https://github.com/payloadcms/payload/tree/master/test/admin/components)._
### 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. |
| 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. |
| 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.
<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. |
| 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. [More](#cell-component) |
| **`Field`** | Swap out the field itself within all `Edit` views. [More](#field-component) |
## Cell Component
These are the props that will be passed to your custom Cell to use in your own components.
| Property | Description |
| ---------------- | ----------------------------------------------------------------- |
| **`field`** | An object that includes the field configuration. |
| **`colIndex`** | A unique number for the column in the list. |
| **`collection`** | An object with the config of the collection that the field is in. |
| **`cellData`** | The data for the field that the cell represents. |
| **`rowData`** | An object with all the field values for the row. |
#### Example
```tsx
import React from "react";
import "./index.scss";
const baseClass = "custom-cell";
const CustomCell: React.FC<Props> = (props) => {
const { field, colIndex, collection, cellData, rowData } = props;
return <span className={baseClass}>{cellData}</span>;
};
```
## Field Component
When writing your own custom components you can make use of a number of hooks to set data, get reactive changes to other fields, get the id of the document or interact with a context from a custom provider.
### 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 `useField` hook as follows:
```tsx
import { useField } from 'payload/components/forms'
import { useField } from "payload/components/forms";
type Props = { path: string }
type Props = { path: string };
const CustomTextField: React.FC<Props> = ({ path }) => {
// highlight-start
const { value, setValue } = useField<Props>({ path })
const { value, setValue } = useField<Props>({ path });
// highlight-end
return <input onChange={e => setValue(e.target.value)} value={value.path} />
}
```
### Getting other field values from the form
There are times when a custom field component needs to have access to data from other fields. This can be done using `getDataByPath` from `useWatchForm` as follows:
```tsx
import { useWatchForm } from 'payload/components/forms';
const DisplayFee: React.FC = () => {
const { getDataByPath } = useWatchForm();
const amount = getDataByPath('amount');
const feePercentage = getDataByPath('feePercentage');
if (amount && feePercentage) {
return (
<span>The fee is ${(amount * feePercentage) / 100}</span>
);
}
};
```
### Getting the document ID
The document ID can be very useful for certain custom components. You can get the `id` from the `useDocumentInfo` hook. Here is an example of a `UI` field using `id` to link to related collections:
```tsx
import { useDocumentInfo } from 'payload/components/utilities';
const LinkFromCategoryToPosts: React.FC = () => {
// highlight-start
const { id } = useDocumentInfo();
// highlight-end
// id will be undefined on the create form
if (!id) {
return null;
}
return (
<a href={`/admin/collections/posts?where[or][0][and][0][category][in][0]=[${id}]`} >
View posts
</a>
)
<input onChange={(e) => setValue(e.target.value)} value={value.path} />
);
};
```
<Banner type="success">
For more information regarding the hooks that are available to you while you
build custom components, including the <strong>useField</strong> hook, <a href="/docs/admin/hooks" style={{ color: "black" }}>click here</a>.
</Banner>
## Custom routes
You can easily add your own custom routes to the Payload Admin panel using the `admin.components.routes` property. Payload currently uses the extremely powerful React Router v5.x and custom routes support all the properties of the React Router `<Route />` component.
**Custom routes support the following properties:**
| Property | Description |
| ----------------- | -------------|
| **`Component`** * | Pass in the component that should be rendered when a user navigates to this route. |
| **`path`** * | React Router `path`. [See the React Router docs](https://v5.reactrouter.com/web/api/Route/path-string-string) for more info. |
| **`exact`** | React Router `exact` property. [More](https://v5.reactrouter.com/web/api/Route/exact-bool) |
| **`strict`** | React Router `strict` property. [More](https://v5.reactrouter.com/web/api/Route/strict-bool) |
| **`sensitive`** | React Router `sensitive` property. [More](https://v5.reactrouter.com/web/api/Route/sensitive-bool) |
| Property | Description |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
| **`Component`** \* | Pass in the component that should be rendered when a user navigates to this route. |
| **`path`** \* | React Router `path`. [See the React Router docs](https://v5.reactrouter.com/web/api/Route/path-string-string) for more info. |
| **`exact`** | React Router `exact` property. [More](https://v5.reactrouter.com/web/api/Route/exact-bool) |
| **`strict`** | React Router `strict` property. [More](https://v5.reactrouter.com/web/api/Route/strict-bool) |
| **`sensitive`** | React Router `sensitive` property. [More](https://v5.reactrouter.com/web/api/Route/sensitive-bool) |
*\* An asterisk denotes that a property is required.*
_\* An asterisk denotes that a property is required._
#### Custom route components
Your custom route components will be given all the props that a React Router `<Route />` typically would receive, as well as two props from Payload:
| Prop | Description |
| ---------------------- | -------------|
| **`user`** | The currently logged in user. Will be `null` if no user is logged in. |
| **`canAccessAdmin`** * | If the currently logged in user is allowed to access the admin panel or not. |
| Prop | Description |
| ----------------------- | ---------------------------------------------------------------------------- |
| **`user`** | The currently logged in user. Will be `null` if no user is logged in. |
| **`canAccessAdmin`** \* | If the currently logged in user is allowed to access the admin panel or not. |
<Banner type="warning">
<strong>Note:</strong><br/>
It's up to you to secure your custom routes. If your route requires a user to be logged in or to have certain access rights, you should handle that within your route component yourself.
<strong>Note:</strong>
<br />
It's up to you to secure your custom routes. If your route requires a user to
be logged in or to have certain access rights, you should handle that within
your route component yourself.
</Banner>
#### Example
@@ -210,7 +212,10 @@ To see how to pass in your custom views to create custom routes of your own, tak
As your admin customizations gets more complex you may want to share state between fields or other components. You can add custom providers to do add your own context to any Payload app for use in other custom components within the admin panel. Within your config add `admin.components.providers`, these can be used to share context or provide other custom functionality. Read the [React context](https://reactjs.org/docs/context.html) docs to learn more.
<Banner type="warning"><strong>Reminder:</strong> Don't forget to pass the **children** prop through the provider component for the admin UI to show</Banner>
<Banner type="warning">
<strong>Reminder:</strong> Don't forget to pass the **children** prop through
the provider component for the admin UI to show
</Banner>
### Styling Custom Components
@@ -222,12 +227,35 @@ To make use of Payload SCSS variables / mixins to use directly in your own compo
@import '~payload/scss';
```
### Getting the current language
When developing custom components you can support multiple languages to be consistent with Payload's i18n support. The best way to do this is to add your translation resources to the [i18n configuration](https://payloadcms.com/docs/configuration/i18n) and import `useTranslation` from `react-i18next` in your components.
For example:
```tsx
import { useTranslation } from 'react-i18next';
const CustomComponent: React.FC = () => {
// highlight-start
const { t, i18n } = useTranslation('namespace1');
// highlight-end
return (
<ul>
<li>{ t('key', { variable: 'value' }) }</li>
<li>{ t('namespace2:key', { variable: 'value' }) }</li>
<li>{ i18n.language }</li>
</ul>
);
};
```
### Getting the current locale
In any custom component you can get the selected locale with the `useLocale` hook. Here is a simple example:
```tsx
import { useLocale } from 'payload/components/utilities';
import { useLocale } from "payload/components/utilities";
const Greeting: React.FC = () => {
// highlight-start
@@ -235,12 +263,10 @@ const Greeting: React.FC = () => {
// highlight-end
const trans = {
en: 'Hello',
es: 'Hola',
en: "Hello",
es: "Hola",
};
return (
<span> { trans[locale] } </span>
);
return <span> {trans[locale]} </span>;
};
```

View File

@@ -1,7 +1,7 @@
---
title: Customizing CSS & SCSS
label: Customizing CSS
order: 30
order: 40
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
---

291
docs/admin/hooks.mdx Normal file
View File

@@ -0,0 +1,291 @@
---
title: React Hooks
label: React Hooks
order: 30
desc: Make use of all of the powerful React hooks that Payload provides.
keywords: admin, components, custom, documentation, Content Management System, cms, headless, javascript, node, react, express
---
Payload provides a variety of powerful hooks that can be used within your own React components. With them, you can interface with Payload itself and build just about any type of complex customization you can think of—directly in familiar React code.
### useField
The `useField` hook is used internally within every applicable Payload field component, and it manages sending and receiving a field's state from its parent form.
Outside of internal use, its most common use-case is in custom `Field` components. When you build a custom React `Field` component, you'll be responsible for sending and receiving the field's `value` from the form itself. To do so, import the `useField` hook as follows:
```tsx
import { useField } from 'payload/components/forms'
type Props = { path: string }
const CustomTextField: React.FC<Props> = ({ path }) => {
// highlight-start
const { value, setValue } = useField<string>({ path })
// highlight-end
return <input onChange={e => setValue(e.target.value)} value={value.path} />
}
```
The `useField` hook accepts an `args` object and sends back information and helpers for you to make use of:
```ts
const field = useField<string>({
path: 'fieldPathHere', // required
validate: myValidateFunc, // optional
disableFormData?: false, // if true, the field's data will be ignored
condition?: myConditionHere, // optional, used to skip validation if condition fails
})
// Here is what `useField` sends back
const {
showError, // whether or not the field should show as errored
errorMessage, // the error message to show, if showError
value, // the current value of the field from the form
formSubmitted, // if the form has been submitted
formProcessing, // if the form is currently processing
setValue, // method to set the field's value in form state
initialValue, // the initial value that the field mounted with
} = field;
// The rest of your component goes here
```
### useFormFields
There are times when a custom field component needs to have access to data from other fields, and you have a few options to do so. The `useFormFields` hook is a powerful and highly performant way to retrieve a form's field state, as well as to retrieve the `dispatchFields` method, which can be helpful for setting other fields' form states from anywhere within a form.
<Banner type="success">
<strong>This hook is great for retrieving only certain fields from form state</strong> because it ensures that it will only cause a rerender when the items that you ask for change.
</Banner>
Thanks to the awesome package [`use-context-selector`](https://github.com/dai-shi/use-context-selector), you can retrieve a specific field's state easily. This is ideal because you can ensure you have an up-to-date field state, and your component will only re-render when _that field's state_ changes.
You can pass a Redux-like selector into the hook, which will ensure that you retrieve only the field that you want. The selector takes an argument with type of `[fields: Fields, dispatch: React.Dispatch<Action>]]`.
```tsx
import { useFormFields } from 'payload/components/forms';
const MyComponent: React.FC = () => {
// Get only the `amount` field state, and only cause a rerender when that field changes
const amount = useFormFields(([fields, dispatch]) => fields.amount);
// Do the same thing as above, but to the `feePercentage` field
const feePercentage = useFormFields(([fields, dispatch]) => fields.feePercentage);
if (typeof amount?.value !== 'undefined' && typeof feePercentage?.value !== 'undefined') {
return (
<span>The fee is ${(amount.value * feePercentage.value) / 100}</span>
);
}
};
```
### useAllFormFields
**To retrieve more than one field**, you can use the `useAllFormFields` hook. Your component will re-render when _any_ field changes, so use this hook only if you absolutely need to. Unlike the `useFormFields` hook, this hook does not accept a "selector", and it always returns an array with type of `[fields: Fields, dispatch: React.Dispatch<Action>]]`.
You can do lots of powerful stuff by retrieving the full form state, like using built-in helper functions to reduce field state to values only, or to retrieve sibling data by path.
```tsx
import { useAllFormFields, reduceFieldsToValues, getSiblingData } from 'payload/components/forms';
const ExampleComponent: React.FC = () => {
// the `fields` const will be equal to all fields' state,
// and the `dispatchFields` method is usable to send field state up to the form
const [fields, dispatchFields] = useAllFormFields();
// Pass in fields, and indicate if you'd like to "unflatten" field data.
// The result below will reflect the data stored in the form at the given time
const formData = reduceFieldsToValues(fields, true);
// Pass in field state and a path,
// and you will be sent all sibling data of the path that you've specified
const siblingData = getSiblingData(fields, 'someFieldName');
return (
// return some JSX here if necessary
)
};
```
##### Updating other fields' values
If you are building a custom component, then you should use `setValue` which is returned from the `useField` hook to programmatically set your field's value. But if you're looking to update _another_ field's value, you can use `dispatchFields` returned from `useFormFields`.
You can send the following actions to the `dispatchFields` function.
| Action | Description |
|------------------------|----------------------------------------------------------------------------|
| **`ADD_ROW`** | Adds a row of data (useful in array / block field data) |
| **`DUPLICATE_ROW`** | Duplicates a row of data (useful in array / block field data) |
| **`MODIFY_CONDITION`** | Updates a field's conditional logic result (true / false) |
| **`MOVE_ROW`** | Moves a row of data (useful in array / block field data) |
| **`REMOVE`** | Removes a field from form state |
| **`REMOVE_ROW`** | Removes a row of data from form state (useful in array / block field data) |
| **`REPLACE_STATE`** | Completely replaces form state |
| **`UPDATE`** | Update any property of a specific field's state |
To see types for each action supported within the `dispatchFields` hook, check out the Form types [here](https://github.com/payloadcms/payload/blob/master/src/admin/components/forms/Form/types.ts).
### useForm
The `useForm` hook can be used to interact with the form itself, and sends back many methods that can be used to reactively fetch form state without causing rerenders within your components each time a field is changed. This is useful if you have action-based callbacks that your components fire, and need to interact with form state _based on a user action_.
<Banner type="warning">
<strong>Warning:</strong><br/>
This hook is optimized to avoid causing rerenders when fields change, and as such, its `fields` property will be out of date. You should only leverage this hook if you need to perform actions against the form in response to your users' actions. Do not rely on its returned "fields" as being up-to-date. They will be removed from this hook's response in an upcoming version.
</Banner>
The `useForm` hook returns an object with the following properties:
| Action | Description |
|----------------------|---------------------------------------------------------------------|
| **`fields`** | Deprecated. This property cannot be relied on as up-to-date. |
| **`submit`** | Method to trigger the form to submit |
| **`dispatchFields`** | Dispatch actions to the form field state |
| **`validateForm`** | Trigger a validation of the form state |
| **`createFormData`** | Create a `multipart/form-data` object from the current form's state |
| **`disabled`** | Boolean denoting whether or not the form is disabled |
| **`getFields`** | Gets all fields from state |
| **`getField`** | Gets a single field from state by path |
| **`getData`** | Returns the data stored in the form |
| **`getSiblingData`** | Returns form sibling data for the given field path |
| **`setModified`** | Set the form's `modified` state |
| **`setProcessing`** | Set the form's `processing` state |
| **`setSubmitted`** | Set the form's `submitted` state |
| **`formRef`** | The ref from the form HTML element |
| **`reset`** | Method to reset the form to its initial state |
### useDocumentInfo
The `useDocumentInfo` hook provides lots of information about the document currently being edited, including the following:
| Property | Description |
|---------------------------|--------------------------------------------------------------------------------------------------------------------| |
| **`collection`** | If the doc is a collection, its collection config will be returned |
| **`global`** | If the doc is a global, its global config will be returned |
| **`type`** | The type of document being edited (collection or global) |
| **`id`** | If the doc is a collection, its ID will be returned |
| **`preferencesKey`** | The `preferences` key to use when interacting with document-level user preferences |
| **`versions`** | Versions of the current doc |
| **`unpublishedVersions`** | Unpublished versions of the current doc |
| **`publishedDoc`** | The currently published version of the doc being edited |
| **`getVersions`** | Method to trigger the retrieval of document versions |
| **`docPermissions`** | The current documents permissions. Collection document permissions fallback when no id is present (i.e. on create) |
| **`getDocPermissions`** | Method to trigger the retrieval of document level permissions |
**Example:**
```tsx
import { useDocumentInfo } from 'payload/components/utilities';
const LinkFromCategoryToPosts: React.FC = () => {
// highlight-start
const { id } = useDocumentInfo();
// highlight-end
// id will be undefined on the create form
if (!id) {
return null;
}
return (
<a href={`/admin/collections/posts?where[or][0][and][0][category][in][0]=[${id}]`} >
View posts
</a>
)
};
```
### useLocale
In any custom component you can get the selected locale with the `useLocale` hook. Here is a simple example:
```tsx
import { useLocale } from 'payload/components/utilities';
const Greeting: React.FC = () => {
// highlight-start
const locale = useLocale();
// highlight-end
const trans = {
en: 'Hello',
es: 'Hola',
};
return (
<span> { trans[locale] } </span>
);
};
```
### useAuth
Useful to retrieve info about the currently logged in user as well as methods for interacting with it. It sends back an object with the following properties:
| Property | Description |
|---------------------|-----------------------------------------------------------------------------------------|
| **`user`** | The currently logged in user |
| **`logOut`** | A method to log out the currently logged in user |
| **`refreshCookie`** | A method to trigger the silent refreshing of a user's auth token |
| **`setToken`** | Set the token of the user, to be decoded and used to reset the user and token in memory |
| **`token`** | The logged in user's token (useful for creating preview links, etc.) |
| **`permissions`** | The permissions of the current user |
```tsx
import { useAuth } from 'payload/components/utilities';
import { User } from '../payload-types.ts';
const Greeting: React.FC = () => {
// highlight-start
const { user } = useConfig<User>();
// highlight-end
return (
<span>Hi, {user.email}!</span>
);
};
```
### useConfig
Used to easily fetch the full Payload config.
```tsx
import { useConfig } from 'payload/components/utilities';
const MyComponent: React.FC = () => {
// highlight-start
const config = useConfig();
// highlight-end
return (
<span>{config.serverURL}</span>
);
};
```
### useEditDepth
Sends back how many editing levels "deep" the current component is. Edit depth is relevant while adding new documents / editing documents in modal windows and other cases.
```tsx
import { useEditDepth } from 'payload/components/utilities';
const MyComponent: React.FC = () => {
// highlight-start
const editDepth = useEditDepth();
// highlight-end
return (
<span>My component is {editDepth} levels deep</span>
)
}
```
### usePreferences
Returns methods to set and get user preferences. More info can be found [here](https://payloadcms.com/docs/admin/preferences).

View File

@@ -14,7 +14,7 @@ The Payload Admin panel is built with Webpack, code-split, highly performant (ev
The Admin panel is meant to be simple enough to give you a starting point but not bring too much complexity, so that you can easily customize it to suit the needs of your application and your editors.
</Banner>
![Payload's Admin panel built in React](https://payloadcms.com/images/admin.jpg)
![Payload's Admin panel built in React](https://payloadcms.com/images/docs/admin.jpg)
*Screenshot of the Admin panel while editing a document from an example `AllFields` collection*
@@ -22,17 +22,20 @@ The Payload Admin panel is built with Webpack, code-split, highly performant (ev
All options for the Admin panel are defined in your base Payload config file.
| Option | Description |
| -------------------- | -------------|
| `user` | The `slug` of a Collection that you want be used to log in to the Admin dashboard. [More](/docs/admin/overview#the-admin-user-collection) |
| `meta` | Base meta data to use for the Admin panel. Included properties are `titleSuffix`, `ogImage`, and `favicon`. |
| `disable` | If set to `true`, the entire Admin panel will be disabled. |
| `indexHTML` | Optionally replace the entirety of the `index.html` file used by the Admin panel. Reference the [base index.html file](https://github.com/payloadcms/payload/blob/master/src/admin/index.html) to ensure your replacement has the appropriate HTML elements. |
| `css` | Absolute path to a stylesheet that you can use to override / customize the Admin panel styling. [More](/docs/admin/customizing-css). |
| `scss` | Absolute path to a Sass variables / mixins stylesheet meant to override Payload styles to make for an easy re-skinning of the Admin panel. [More](/docs/admin/customizing-css#overriding-scss-variables). |
| `dateFormat` | Global date format that will be used for all dates in the Admin panel. Any valid [date-fns](https://date-fns.org/) format pattern can be used.
| `components` | Component overrides that affect the entirety of the Admin panel. [More](/docs/admin/components) |
| `webpack` | Customize the Webpack config that's used to generate the Admin panel. [More](/docs/admin/webpack) |
| Option | Description |
| --------------------- | -------------|
| `user` | The `slug` of a Collection that you want be used to log in to the Admin dashboard. [More](/docs/admin/overview#the-admin-user-collection) |
| `meta` | Base meta data to use for the Admin panel. Included properties are `titleSuffix`, `ogImage`, and `favicon`. |
| `disable` | If set to `true`, the entire Admin panel will be disabled. |
| `indexHTML` | Optionally replace the entirety of the `index.html` file used by the Admin panel. Reference the [base index.html file](https://github.com/payloadcms/payload/blob/master/src/admin/index.html) to ensure your replacement has the appropriate HTML elements. |
| `css` | Absolute path to a stylesheet that you can use to override / customize the Admin panel styling. [More](/docs/admin/customizing-css). |
| `scss` | Absolute path to a Sass variables / mixins stylesheet meant to override Payload styles to make for an easy re-skinning of the Admin panel. [More](/docs/admin/customizing-css#overriding-scss-variables). |
| `dateFormat` | Global date format that will be used for all dates in the Admin panel. Any valid [date-fns](https://date-fns.org/) format pattern can be used. |
| `avatar` | Set account profile picture. Options: `gravatar`, `default` or a custom React component. |
| `components` | Component overrides that affect the entirety of the Admin panel. [More](/docs/admin/components) |
| `webpack` | Customize the Webpack config that's used to generate the Admin panel. [More](/docs/admin/webpack) | |
| **`logoutRoute`** | The route for the `logout` page. |
| **`inactivityRoute`** | The route for the `logout` inactivity page. |
### The Admin User Collection

View File

@@ -1,7 +1,7 @@
---
title: Managing User Preferences
label: Preferences
order: 40
order: 50
desc: Store the preferences of your users as they interact with the Admin panel.
keywords: admin, preferences, custom, customize, documentation, Content Management System, cms, headless, javascript, node, react, express
---

View File

@@ -1,7 +1,7 @@
---
title: Webpack
label: Webpack
order: 50
order: 60
desc: The Payload admin panel uses Webpack 5 and supports many common functionalities such as SCSS and Typescript out of the box to give you more freedom.
keywords: admin, webpack, documentation, Content Management System, cms, headless, javascript, node, react, express
---
@@ -155,6 +155,11 @@ export default {};
Now, when Webpack sees that you're attempting to import your `createStripeSubscriptionPath` file, it'll disregard that actual file and load your mock file instead. Not only will your Admin panel now bundle successfully, you will have optimized its filesize by removing unnecessary code! And you might have learned something about Webpack, too.
<Banner type="success">
<strong>Tip:</strong><br/>
If changes to your Webpack aliases are not surfacing, they might be [cached](https://webpack.js.org/configuration/cache/) in `node_modules/.cache/webpack`. Try deleting that folder and restarting your server.
</Banner>
## Admin environment vars
<Banner type="warning">

View File

@@ -17,7 +17,7 @@ To enable Authentication on a collection, define an `auth` property and set it t
| **`useAPIKey`** | Payload Authentication provides for API keys to be set on each user within an Authentication-enabled Collection. [More](/docs/authentication/config#api-keys) |
| **`tokenExpiration`** | How long (in seconds) to keep the user logged in. JWTs and HTTP-only cookies will both expire at the same time. |
| **`maxLoginAttempts`** | Only allow a user to attempt logging in X amount of times. Automatically locks out a user from authenticating if this limit is passed. Set to `0` to disable. |
| **`lockTime`** | Set the time that a user should be locked out if they fail authentication more times than `maxLoginAttempts` allows for. |
| **`lockTime`** | Set the time (in milliseconds) that a user should be locked out if they fail authentication more times than `maxLoginAttempts` allows for. |
| **`depth`** | How many levels deep a `user` document should be populated when creating the JWT and binding the `user` to the express `req`. Defaults to `0` and should only be modified if absolutely necessary, as this will affect performance. |
| **`cookies`** | Set cookie options, including `secure`, `sameSite`, and `domain`. For advanced users. |
| **`forgotPassword`** | Customize the way that the `forgotPassword` operation functions. [More](/docs/authentication/config#forgot-password) |
@@ -43,16 +43,18 @@ To enable API keys on a collection, set the `useAPIKey` auth option to `true`. F
is compromised, your API keys will not be.
</Banner>
##### Authenticating via API Key
#### Authenticating via API Key
To utilize your API key while interacting with the REST or GraphQL API, add the `Authorization` header.
To authenticate REST or GraphQL API requests using an API key, set the `Authorization` header. The header is case-sensitive and needs the slug of the `auth.useAPIKey` enabled collection, then " API-Key ", followed by the `apiKey` that has been assigned. Payload's built-in middleware will then assign the user document to `req.user` and handle requests with the proper access control.
**For example, using Fetch:**
```ts
import User from '../collections/User';
const response = await fetch("http://localhost:3000/api/pages", {
headers: {
Authorization: `${collection.labels.singular} API-Key ${YOUR_API_KEY}`,
Authorization: `${User.slug} API-Key ${YOUR_API_KEY}`,
},
});
```

View File

@@ -66,6 +66,8 @@ query {
}
```
Document access can also be queried on a collection/global basis. Access on a global can queried like `http://localhost:3000/api/global-slug/access`, Collection document access can be queried like `http://localhost:3000/api/collection-slug/access/:id`.
### Me
Returns either a logged in user with token or null when there is no logged in user.

View File

@@ -12,7 +12,7 @@ keywords: authentication, config, configuration, overview, documentation, Conten
Authentication is used within the Payload Admin panel itself as well as throughout your app(s) themselves however you determine necessary.
![Authentication admin panel functionality](https://payloadcms.com/images/auth-admin.jpg)
![Authentication admin panel functionality](https://payloadcms.com/images/docs/auth-admin.jpg)
*Admin panel screenshot depicting an Admins Collection with Auth enabled*
**Here are some common use cases of Authentication outside of Payload's dashboard itself:**
@@ -62,7 +62,7 @@ const Admins: CollectionConfig = {
}
```
**By enabling Authetication on a config, the following modifications will automatically be made to your Collection:**
**By enabling Authentication on a config, the following modifications will automatically be made to your Collection:**
1. `email` as well as password `salt` & `hash` fields will be added to your Collection's schema
1. The Admin panel will feature a new set of corresponding UI to allow for changing password and editing email

View File

@@ -12,20 +12,21 @@ It's often best practice to write your Collections in separate files and then im
## Options
| Option | Description |
| ---------------- | -------------|
| **`slug`** * | Unique, URL-friendly string that will act as an identifier for this Collection. |
| Option | Description |
|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`slug`** * | Unique, URL-friendly string that will act as an identifier for this Collection. |
| **`fields`** * | Array of field types that will determine the structure and functionality of the data stored within this Collection. [Click here](/docs/fields/overview) for a full list of field types as well as how to configure them. |
| **`labels`** | Singular and plural labels for use in identifying this Collection throughout Payload. Auto-generated from slug if not defined. |
| **`description`**| Text or React component to display below the Collection label in the List view to give editors more information. |
| **`admin`** | Admin-specific configuration. See below for [more detail](#admin-options). |
| **`hooks`** | Entry points to "tie in" to Collection actions at specific points. [More](/docs/hooks/overview#collection-hooks) |
| **`access`** | Provide access control functions to define exactly who should be able to do what with Documents in this Collection. [More](/docs/access-control/overview/#collections) |
| **`auth`** | Specify options if you would like this Collection to feature authentication. For more, consult the [Authentication](/docs/authentication/config) documentation. |
| **`upload`** | Specify options if you would like this Collection to support file uploads. For more, consult the [Uploads](/docs/upload/overview) documentation. |
| **`timestamps`** | Set to false to disable documents' automatically generated `createdAt` and `updatedAt` timestamps. |
| **`versions`** | Set to true to enable default options, or configure with object properties. [More](/docs/versions/overview#collection-config)|
| **`endpoints`** | Add custom routes to the REST API. [More](/docs/rest-api/overview#custom-endpoints) |
| **`labels`** | Singular and plural labels for use in identifying this Collection throughout Payload. Auto-generated from slug if not defined. |
| **`admin`** | Admin-specific configuration. See below for [more detail](#admin-options). |
| **`hooks`** | Entry points to "tie in" to Collection actions at specific points. [More](/docs/hooks/overview#collection-hooks) |
| **`access`** | Provide access control functions to define exactly who should be able to do what with Documents in this Collection. [More](/docs/access-control/overview/#collections) |
| **`auth`** | Specify options if you would like this Collection to feature authentication. For more, consult the [Authentication](/docs/authentication/config) documentation. |
| **`upload`** | Specify options if you would like this Collection to support file uploads. For more, consult the [Uploads](/docs/upload/overview) documentation. |
| **`timestamps`** | Set to false to disable documents' automatically generated `createdAt` and `updatedAt` timestamps. |
| **`versions`** | Set to true to enable default options, or configure with object properties. [More](/docs/versions/overview#collection-config) |
| **`endpoints`** | Add custom routes to the REST API. [More](/docs/rest-api/overview#custom-endpoints) |
| **`graphQL`** | An object with `singularName` and `pluralName` strings used in schema generation. Auto-generated from slug if not defined. |
| **`typescript`** | An object with property `interface` as the text used in schema generation. Auto-generated from slug if not defined. |
*\* An asterisk denotes that a property is required.*
@@ -60,14 +61,18 @@ You can find an assortment of [example collection configs](https://github.com/pa
You can customize the way that the Admin panel behaves on a collection-by-collection basis by defining the `admin` property on a collection's config.
| Option | Description |
| ---------------------------- | -------------|
| `useAsTitle` | Specify a top-level field to use for a document title throughout the Admin panel. If no field is defined, the ID of the document is used as the title. |
| `defaultColumns` | Array of field names that correspond to which columns to show by default in this collection's List view. |
| `disableDuplicate ` | Disables the "Duplicate" button while editing documents within this collection. |
| Option | Description |
| --------------------------- | -------------|
| `group` | Text used as a label for grouping collection links together in the navigation. |
| `hooks` | Admin-specific hooks for this collection. [More](#admin-hooks) |
| `useAsTitle` | Specify a top-level field to use for a document title throughout the Admin panel. If no field is defined, the ID of the document is used as the title. |
| `description` | Text or React component to display below the Collection label in the List view to give editors more information. |
| `defaultColumns` | Array of field names that correspond to which columns to show by default in this collection's List view. |
| `disableDuplicate ` | Disables the "Duplicate" button while editing documents within this collection. |
| `enableRichTextRelationship` | The [Rich Text](/docs/fields/rich-text) field features a `Relationship` element which allows for users to automatically reference related documents within their rich text. Set to `true` by default. |
| `preview` | Function to generate preview URLS within the Admin panel that can point to your app. [More](#preview). |
| `components` | Swap in your own React components to be used within this collection. [More](/docs/admin/components#collections) |
| `preview` | Function to generate preview URLS within the Admin panel that can point to your app. [More](#preview). |
| `components` | Swap in your own React components to be used within this collection. [More](/docs/admin/components#collections) |
| `listSearchableFields` | Specify which fields should be searched in the List search view. [More](#list-searchable-fields) |
### Preview
@@ -78,7 +83,7 @@ If the function is specified, a Preview button will automatically appear in the
**The preview function accepts two arguments:**
1. The document being edited
1. An `options` object, containing `locale` and `token` properties. The `token` is the currently logged in user's JWT.
1. An `options` object, containing `locale` and `token` properties. The `token` is the currently logged-in user's JWT.
**Example collection with preview function:**
@@ -118,6 +123,61 @@ Hooks are a powerful way to extend collection functionality and execute your own
Collections support all field types that Payload has to offer—including simple fields like text and checkboxes all the way to more complicated layout-building field groups like Blocks. [Click here](/docs/fields/overview) to learn more about field types.
### List Searchable Fields
In the List view, there is a "search" box that allows you to quickly find a document with a search. By default, it searches on the ID field. If you have `admin.useAsTitle` defined, the list search will use that field. However, you can define more than one field to search to make it easier on your admin editors to find the data they need.
For example, let's say you have a Posts collection with `title`, `metaDescription`, and `tags` fields - and you want all three of those fields to be searchable in the List view. You can simply add `admin.listSearchableFields: ['title', 'metaDescription', 'tags']` - and the admin UI will automatically search on those three fields plus the ID field.
<Banner type="warning">
<strong>Note:</strong><br/>
If you are adding <strong>listSearchableFields</strong>, make sure you index each of these fields so your admin queries can remain performant.
</Banner>
### Admin Hooks
In addition to collection hooks themselves, Payload provides for admin UI-specific hooks that you can leverage.
**`beforeDuplicate`**
The `beforeDuplicate` hook is an async function that accepts an object containing the data to duplicate, as well as the locale of the doc to duplicate. Within this hook, you can modify the data to be duplicated, which is useful in cases where you have unique fields that need to be incremented or similar, as well as if you want to automatically modify a document's `title`.
Example:
```ts
import { BeforeDuplicate, CollectionConfig } from 'payload/types';
// Your auto-generated Page type
import { Page } from '../payload-types.ts';
const beforeDuplicate: BeforeDuplicate<Page> = ({ data }) => {
return {
...data,
title: `${data.title} Copy`,
uniqueField: data.uniqueField ? `${data.uniqueField}-copy` : '',
};
};
export const Page: CollectionConfig = {
slug: 'pages',
admin: {
hooks: {
beforeDuplicate,
}
},
fields: [
{
name: 'title',
type: 'text',
},
{
name: 'uniqueField',
type: 'text',
unique: true,
}
]
}
```
### TypeScript
You can import collection types as follows:

View File

@@ -6,49 +6,51 @@ desc: Set up your Global config for your needs by defining fields, adding slugs
keywords: globals, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
---
Global configs are in many ways similar to [Collections](/docs/configuration/collections). The big difference is that Collections will potentially contain *many* documents, while a Global is a "one-off". Globals are perfect for things like header nav, site-wide banner alerts, app-wide localized strings, and other "global" data that your site or app might rely on.
Global configs are in many ways similar to [Collections](/docs/configuration/collections). The big difference is that Collections will potentially contain _many_ documents, while a Global is a "one-off". Globals are perfect for things like header nav, site-wide banner alerts, app-wide localized strings, and other "global" data that your site or app might rely on.
As with Collection configs, it's often best practice to write your Globals in separate files and then import them into the main Payload config.
## Options
| Option | Description |
| ---------------- | -------------|
| **`slug`** * | Unique, URL-friendly string that will act as an identifier for this Global. |
| **`fields`** * | Array of field types that will determine the structure and functionality of the data stored within this Global. [Click here](/docs/fields/overview) for a full list of field types as well as how to configure them. |
| **`label`** | Singular label for use in identifying this Global throughout Payload. Auto-generated from slug if not defined. |
| **`description`**| Text or React component to display below the Global header to give editors more information. |
| **`admin`** | Admin-specific configuration. See below for [more detail](/docs/configuration/globals#admin-options). |
| **`hooks`** | Entry points to "tie in" to collection actions at specific points. [More](/docs/hooks/overview#global-hooks) |
| **`access`** | Provide access control functions to define exactly who should be able to do what with this Global. [More](/docs/access-control/overview/#globals) |
| **`versions`** | Set to true to enable default options, or configure with object properties. [More](/docs/versions/overview#globals-config)|
| **`endpoints`** | Add custom routes to the REST API. [More](/docs/rest-api/overview#custom-endpoints)|
| Option | Description |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`slug`** \* | Unique, URL-friendly string that will act as an identifier for this Global. |
| **`fields`** \* | Array of field types that will determine the structure and functionality of the data stored within this Global. [Click here](/docs/fields/overview) for a full list of field types as well as how to configure them. |
| **`label`** | Text for the name in the Admin panel or an object with keys for each language. Auto-generated from slug if not defined. |
| **`description`** | Text or React component to display below the Global header to give editors more information. |
| **`admin`** | Admin-specific configuration. See below for [more detail](/docs/configuration/globals#admin-options). |
| **`hooks`** | Entry points to "tie in" to collection actions at specific points. [More](/docs/hooks/overview#global-hooks) |
| **`access`** | Provide access control functions to define exactly who should be able to do what with this Global. [More](/docs/access-control/overview/#globals) |
| **`versions`** | Set to true to enable default options, or configure with object properties. [More](/docs/versions/overview#globals-config) |
| **`endpoints`** | Add custom routes to the REST API. [More](/docs/rest-api/overview#custom-endpoints) |
| **`graphQL.name`** | Text used in schema generation. Auto-generated from slug if not defined. |
| **`typescript`** | An object with property `interface` as the text used in schema generation. Auto-generated from slug if not defined. |
*\* An asterisk denotes that a property is required.*
_\* An asterisk denotes that a property is required._
#### Simple Global example
```ts
import { GlobalConfig } from 'payload/types';
import { GlobalConfig } from "payload/types";
const Nav: GlobalConfig = {
slug: 'nav',
fields: [
{
name: 'items',
type: 'array',
required: true,
maxRows: 8,
fields: [
{
name: 'page',
type: 'relationship',
relationTo: 'pages', // "pages" is the slug of an existing collection
required: true,
}
]
},
]
slug: "nav",
fields: [
{
name: "items",
type: "array",
required: true,
maxRows: 8,
fields: [
{
name: "page",
type: "relationship",
relationTo: "pages", // "pages" is the slug of an existing collection
required: true,
},
],
},
],
};
export default Nav;
@@ -62,9 +64,47 @@ You can find an [example Global config](https://github.com/payloadcms/public-dem
You can customize the way that the Admin panel behaves on a Global-by-Global basis by defining the `admin` property on a Global's config.
| Option | Description |
| ---------------------------- | -------------|
| `components` | Swap in your own React components to be used within this Global. [More](/docs/admin/components#globals) |
| Option | Description |
| ------------ | ----------------------------------------------------------------------------------------------------------------------- |
| `components` | Swap in your own React components to be used within this Global. [More](/docs/admin/components#globals) |
| `preview` | Function to generate a preview URL within the Admin panel for this global that can point to your app. [More](#preview). |
### Preview
Global `admin` options can accept a `preview` function that will be used to generate a link pointing to the frontend of your app to preview data.
If the function is specified, a Preview button will automatically appear in the corresponding global's Edit view. Clicking the Preview button will link to the URL that is generated by the function.
**The preview function accepts two arguments:**
1. The document being edited
1. An `options` object, containing `locale` and `token` properties. The `token` is the currently logged-in user's JWT.
**Example global with preview function:**
```ts
import { GlobalConfig } from "payload/types";
const MyGlobal: CollectionConfig = {
slug: "my-global",
fields: [
{
name: "slug",
type: "text",
required: true,
},
],
admin: {
preview: (doc, { locale }) => {
if (doc?.slug) {
return `https://bigbird.com/preview/${doc.slug}?locale=${locale}`;
}
return null;
},
},
};
```
### Access control
@@ -83,14 +123,14 @@ Globals support all field types that Payload has to offer—including simple fie
You can import global types as follows:
```ts
import { GlobalConfig } from 'payload/types';
import { GlobalConfig } from "payload/types";
// This is the type used for incoming global configs.
// Only the bare minimum properties are marked as required.
```
```ts
import { SanitizedGlobalConfig } from 'payload/types';
import { SanitizedGlobalConfig } from "payload/types";
// This is the type used after an incoming global config is fully sanitized.
// Generally, this is only used internally by Payload.

100
docs/configuration/i18n.mdx Normal file
View File

@@ -0,0 +1,100 @@
---
title: I18n
label: I18n
order: 40
desc: Manage and customize internationalization support in your CMS editor experience
keywords: internationalization, i18n, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
---
Not only does Payload support managing localized content, it also has internationalization support so that admin users can work in their preferred language. Payload's i18n support is built on top of [i18next](https://www.i18next.com). It comes included by default and can be extended in your config.
While Payload's built-in features come translated, you may want to also translate parts of your project's configuration too. This is possible in places like collections and globals labels and groups, field labels, descriptions and input placeholder text. The admin UI will display all the correct translations you provide based on the user's language.
Here is an example of a simple collection supporting both English and Spanish editors:
```ts
const Articles: CollectionConfig = {
slug: 'articles',
labels: {
singular: {
en: 'Article', es: 'Artículo',
},
plural: {
en: 'Articles', es: 'Artículos',
},
},
admin: {
group: { en: 'Content', es: 'Contenido' },
},
fields: [
{
name: 'title',
type: 'text',
label: {
en: 'Title', es: 'Título',
},
admin: {
placeholder: { en: 'Enter title', es: 'Introduce el título' }
}
},
{
name: 'type',
type: 'radio',
options: [{
value: 'news',
label: { en: 'News', es: 'Noticias' },
}, // etc...
],
},
],
}
```
### Admin UI
The Payload admin panel reads the language settings of a user's browser and display all text in that language, or will fall back to English if the user's language is not yet supported.
After a user logs in, they can change their language selection in the `/account` view.
<Banner>
<strong>Note:</strong><br/>
If there is a language that Payload does not yet support, we accept code <a href="https://github.com/payloadcms/payload/blob/master/contributing.md">contributions</a>.
</Banner>
### Node Express
Payload's backend uses express middleware to set the language on incoming requests before they are handled. This allows backend validation to return error messages in the user's own language or system generated emails to be sent using the correct translation. You can make HTTP requests with the `accept-language` header and Payload will use that language.
Anywhere in your Payload app that you have access to the `req` object, you can access i18next's extensive internationalization features assigned to `req.i18n`. To access text translations you can use `req.t('namespace:key')`.
Read the i18next [API documentation](https://www.i18next.com/overview/api) to learn more.
### Configuration Options
In your Payload config, you can add translations and customize the settings in `i18n`. Payload will use your custom options and merge it with the default, allowing you to override the settings Payload provides.
**Example Payload config extending i18n:**
```ts
import { buildConfig } from 'payload/config'
export default buildConfig({
//...
i18n: {
fallbackLng: 'en', // default
debug: false, // default
resources: {
en: {
custom: { // namespace can be anything you want
key1: 'Translation with {{variable}}', // translation
},
// override existing translation keys
general: {
dashboard: 'Home',
},
},
},
},
//...
});
```
See the i18next [configuration options](https://www.i18next.com/overview/configuration-options) to learn more.

View File

@@ -8,7 +8,7 @@ keywords: overview, config, configuration, documentation, Content Management Sys
Payload is a *config-based*, code-first CMS and application framework. The Payload config is central to everything that Payload does. It scaffolds the data that Payload stores as well as maintains custom React components, hook logic, custom validations, and much more. The config itself and all of its dependencies are run through Babel, so you can take full advantage of newer JavaScript features and even directly import React components containing JSX.
<strong>Also, because the Payload source code is fully written in TypeScript, its configs are strongly typed—meaning that even if you aren't using TypeScript to build your project, your IDE (such as VSCode) may still provide helpful information like type-ahead suggestions while you write your config.</strong>
**Also, because the Payload source code is fully written in TypeScript, its configs are strongly typed—meaning that even if you aren't using TypeScript to build your project, your IDE (such as VSCode) may still provide helpful information like type-ahead suggestions while you write your config.**
<Banner type="warning">
<strong>Important:</strong><br />This file is included in the Payload admin bundle, so make sure you do not embed any sensitive information.
@@ -39,7 +39,7 @@ Payload is a *config-based*, code-first CMS and application framework. The Paylo
| `rateLimit` | Control IP-based rate limiting for all Payload resources. Used to prevent DDoS attacks and [more](/docs/production/preventing-abuse#rate-limiting-requests). |
| `hooks` | Tap into Payload-wide hooks. [More](/docs/hooks/overview) |
| `plugins` | An array of Payload plugins. [More](/docs/plugins/overview) |
| `endpoints` | An array of custom API endpoints added to the Payload router. [More](/docs/plugins/overview) |
| `endpoints` | An array of custom API endpoints added to the Payload router. [More](/docs/rest-api/overview#custom-endpoints) |
#### Simple example

View File

@@ -16,29 +16,39 @@ keywords: array, fields, config, configuration, documentation, Content Managemen
- Navigational structures where editors can specify nav items containing pages ([relationship field](/docs/fields/relationship)), an "open in new tab" [checkbox field](/docs/fields/checkbox)
- Event agenda "timeslots" where you need to specify start & end time ([date field](/docs/fields/date)), label ([text field](/docs/fields/text)), and Learn More page [relationship](/docs/fields/relationship)
![Array field in Payload admin panel](https://payloadcms.com/images/fields/array.jpg)
![Array field in Payload admin panel](https://payloadcms.com/images/docs/fields/array.jpg)
*Admin panel screenshot of an Array field with a Row containing two text fields, a read-only text field and a checkbox*
### Config
| Option | Description |
| ---------------- | ----------- |
| **`name`** * | To be used as the property name when stored and retrieved from the database. |
| **`label`** | Used as a heading in the Admin panel and to name the generated GraphQL type. Auto-generated from name if not defined. |
| **`fields`** * | Array of field types to correspond to each row of the Array. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`saveToJWT`** | If this field is top-level and nested in a config supporting [Authentication](/docs/authentication/config), include its data in the user JWT. |
| **`hooks`** | Provide field-based hooks to control logic for this field. [More](/docs/fields/overview#field-level-hooks) |
| **`access`** | Provide field-based access control to denote what users can see and do with this field's data. [More](/docs/fields/overview#field-level-access-control) |
| **`hidden`** | Restrict this field's visibility from all APIs entirely. Will still be saved to the database, but will not appear in any API or the Admin panel. |
| **`defaultValue`** | Provide an array of row data to be used for this field's default value. [More](/docs/fields/overview#default-values) |
| Option | Description |
| ---------------- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`name`** * | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`label`** | Text used as the heading in the Admin panel or an object with keys for each language. Auto-generated from name if not defined. |
| **`fields`** * | Array of field types to correspond to each row of the Array. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`saveToJWT`** | If this field is top-level and nested in a config supporting [Authentication](/docs/authentication/config), include its data in the user JWT. |
| **`hooks`** | Provide field-based hooks to control logic for this field. [More](/docs/fields/overview#field-level-hooks) |
| **`access`** | Provide field-based access control to denote what users can see and do with this field's data. [More](/docs/fields/overview#field-level-access-control) |
| **`hidden`** | Restrict this field's visibility from all APIs entirely. Will still be saved to the database, but will not appear in any API or the Admin panel. |
| **`defaultValue`** | Provide an array of row data to be used for this field's default value. [More](/docs/fields/overview#default-values) |
| **`localized`** | Enable localization for this field. Requires [localization to be enabled](/docs/configuration/localization) in the Base config. If enabled, a separate, localized set of all data within this Array will be kept, so there is no need to specify each nested field as `localized`. |
| **`required`** | Require this field to have a value. |
| **`labels`** | Customize the row labels appearing in the Admin dashboard. |
| **`admin`** | Admin-specific configuration. See the [default field admin config](/docs/fields/overview#admin-config) for more details. |
| **`required`** | Require this field to have a value. |
| **`labels`** | Customize the row labels appearing in the Admin dashboard. |
| **`admin`** | Admin-specific configuration. See below for [more detail](#admin-config). |
*\* An asterisk denotes that a property is required.*
### Admin Config
In addition to the default [field admin config](/docs/fields/overview#admin-config), you can adjust the following properties:
| Option | Description |
| ---------------------- | ------------------------------- |
| **`initCollapsed`** | Set the initial collapsed state |
| **`components.RowLabel`** | Function or React component to be rendered as the label on the array row. Receives `({ data, index, path })` as args |
### Example
`collections/ExampleCollection.ts`
@@ -59,6 +69,10 @@ const ExampleCollection: CollectionConfig = {
plural: 'Slides',
},
fields: [ // required
{
name: 'title',
type: 'text',
},
{
name: 'image',
type: 'upload',
@@ -69,7 +83,14 @@ const ExampleCollection: CollectionConfig = {
name: 'caption',
type: 'text',
}
]
],
admin: {
components: {
RowLabel: ({ data, index }) => {
return data?.title || `Slide ${String(index).padStart(2, '0')}`;
},
},
},
}
]
};

View File

@@ -16,30 +16,38 @@ keywords: blocks, fields, config, configuration, documentation, Content Manageme
- A form builder tool where available block configs might be `Text`, `Select`, or `Checkbox`.
- Virtual event agenda "timeslots" where a timeslot could either be a `Break`, a `Presentation`, or a `BreakoutSession`.
![Blocks field in Payload admin panel](https://payloadcms.com/images/fields/blocks.jpg)
![Blocks field in Payload admin panel](https://payloadcms.com/images/docs/fields/blocks.jpg)
*Admin panel screenshot of a Blocks field type with Call to Action and Number block examples*
### Field config
| Option | Description |
| ---------------- | ----------- |
| **`name`** * | To be used as the property name when stored and retrieved from the database. |
| **`label`** | Used as a heading in the Admin panel and to name the generated GraphQL type. |
| **`blocks`** * | Array of [block configs](/docs/fields/blocks#block-configs) to be made available to this field. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`saveToJWT`** | If this field is top-level and nested in a config supporting [Authentication](/docs/authentication/config), include its data in the user JWT. |
| **`hooks`** | Provide field-level hooks to control logic for this field. [More](/docs/fields/overview#field-level-hooks) |
| **`access`** | Provide field-level access control to denote what users can see and do with this field's data. [More](/docs/fields/overview#field-level-access-control) |
| **`hidden`** | Restrict this field's visibility from all APIs entirely. Will still be saved to the database, but will not appear in any API response or the Admin panel. |
| **`defaultValue`** | Provide an array of block data to be used for this field's default value. [More](/docs/fields/overview#default-values) |
| **`localized`** | Enable localization for this field. Requires [localization to be enabled](/docs/configuration/localization) in the Base config. If enabled, a separate, localized set of all data within this field will be kept, so there is no need to specify each nested field as `localized`. || **`required`** | Require this field to have a value. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |
| **`labels`** | Customize the block row labels appearing in the Admin dashboard. |
| **`admin`** | Admin-specific configuration. See the [default field admin config](/docs/fields/overview#admin-config) for more details. |
| Option | Description |
|-------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`name`** * | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`label`** | Text used as the heading in the Admin panel or an object with keys for each language. Auto-generated from name if not defined. |
| **`blocks`** * | Array of [block configs](/docs/fields/blocks#block-configs) to be made available to this field. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`saveToJWT`** | If this field is top-level and nested in a config supporting [Authentication](/docs/authentication/config), include its data in the user JWT. |
| **`hooks`** | Provide field-level hooks to control logic for this field. [More](/docs/fields/overview#field-level-hooks) |
| **`access`** | Provide field-level access control to denote what users can see and do with this field's data. [More](/docs/fields/overview#field-level-access-control) |
| **`hidden`** | Restrict this field's visibility from all APIs entirely. Will still be saved to the database, but will not appear in any API response or the Admin panel. |
| **`defaultValue`** | Provide an array of block data to be used for this field's default value. [More](/docs/fields/overview#default-values) |
| **`localized`** | Enable localization for this field. Requires [localization to be enabled](/docs/configuration/localization) in the Base config. If enabled, a separate, localized set of all data within this field will be kept, so there is no need to specify each nested field as `localized`. || **`required`** | Require this field to have a value. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |
| **`labels`** | Customize the block row labels appearing in the Admin dashboard. |
| **`admin`** | Admin-specific configuration. See below for [more detail](#admin-config). |
*\* An asterisk denotes that a property is required.*
### Admin Config
In addition to the default [field admin config](/docs/fields/overview#admin-config), you can adjust the following properties:
| Option | Description |
| ---------------------- | ------------------------------- |
| **`initCollapsed`** | Set the initial collapsed state |
### Block configs
Blocks are defined as separate configs of their own.
@@ -49,13 +57,14 @@ Blocks are defined as separate configs of their own.
Best practice is to define each block config in its own file, and then import them into your Blocks field as necessary. This way each block config can be easily shared between fields. For instance, using the "layout builder" example, you might want to feature a few of the same blocks in a Post collection as well as a Page collection. Abstracting into their own files trivializes their reusability.
</Banner>
| Option | Description |
| ---------------- | ----------- |
| **`slug`** * | Identifier for this block type. Will be saved on each block as the `blockType` property. |
| **`fields`** * | Array of fields to be stored in this block. |
| **`labels`** | Customize the block labels that appear in the Admin dashboard. Also used to name corresponding GraphQL schema types. Auto-generated from slug if not defined. |
| **`imageURL`** | Provide a custom image thumbnail to help editors identify this block in the Admin UI. |
| **`imageAltText`** | Customize this block's image thumbnail alt text. |
| Option | Description |
|----------------------------|---------------------------------------------------------------------------------------------------------|
| **`slug`** * | Identifier for this block type. Will be saved on each block as the `blockType` property. |
| **`fields`** * | Array of fields to be stored in this block. |
| **`labels`** | Customize the block labels that appear in the Admin dashboard. Auto-generated from slug if not defined. |
| **`imageURL`** | Provide a custom image thumbnail to help editors identify this block in the Admin UI. |
| **`imageAltText`** | Customize this block's image thumbnail alt text. |
| **`graphQL.singularName`** | Text to use for the GraphQL schema name. Auto-generated from slug if not defined |
#### Auto-generated data per block

View File

@@ -14,8 +14,8 @@ keywords: checkbox, fields, config, configuration, documentation, Content Manage
| Option | Description |
| ---------------- | ----------- |
| **`name`** * | To be used as the property name when stored and retrieved from the database. |
| **`label`** | Used as a field label in the Admin panel and to name the generated GraphQL type. |
| **`name`** * | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`index`** | Build a [MongoDB index](https://docs.mongodb.com/manual/indexes/) for this field to produce faster queries. Set this field to `true` if your users will perform queries on this field's data often. |
| **`saveToJWT`** | If this field is top-level and nested in a config supporting [Authentication](/docs/authentication/config), include its data in the user JWT. |

View File

@@ -11,14 +11,14 @@ keywords: code, fields, config, configuration, documentation, Content Management
The Code field type saves a string in the database, but provides the Admin panel with a code editor styled interface.
</Banner>
This field uses `prismjs` for syntax highlighting and `react-simple-code-editor` for the editor itself.
This field uses the `monaco-react` editor syntax highlighting.
### Config
| Option | Description |
| ---------------- | ----------- |
| **`name`** * | To be used as the property name when stored and retrieved from the database. |
| **`label`** | Used as a field label in the Admin panel and to name the generated GraphQL type. |
| **`name`** * | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |
| **`index`** | Build a [MongoDB index](https://docs.mongodb.com/manual/indexes/) for this field to produce faster queries. Set this field to `true` if your users will perform queries on this field's data often. |
| **`minLength`** | Used by the default validation function to ensure values are of a minimum character length. |
@@ -33,25 +33,16 @@ This field uses `prismjs` for syntax highlighting and `react-simple-code-editor`
| **`required`** | Require this field to have a value. |
| **`admin`** | Admin-specific configuration. See below for [more detail](#admin-config). |
*\* An asterisk denotes that a property is required.*
_\* An asterisk denotes that a property is required._
### Admin config
### Admin Config
In addition to the default [field admin config](/docs/fields/overview#admin-config), the Code field type also allows for the customization of a `language` property.
In addition to the default [field admin config](/docs/fields/overview#admin-config), you can adjust the following properties:
The following `prismjs` plugins are imported, enabling the `language` property to accept the following values:
| Plugin | Language |
| ---------------------------- | ----------- |
| **`prism-css`** | `css` |
| **`prism-clike`** | `clike` |
| **`prism-markup`** | `markup`, `html`, `xml`, `svg`, `mathml`, `ssml`, `atom`, `rss` |
| **`prism-javascript`** | `javascript`, `js` |
| **`prism-json`** | `json` |
| **`prism-jsx`** | `jsx` |
| **`prism-typescript`** | `typescript`, `ts` |
| **`prism-tsx`** | `tsx` |
| **`prism-yaml`** | `yaml`, `yml` |
| Option | Description |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`language`** | This property can be set to any language listed [here](https://github.com/microsoft/monaco-editor/tree/main/src/basic-languages). |
| **`editorOptions`** | Options that can be passed to the monaco editor, [view the full list](https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.IDiffEditorConstructionOptions.html). |
### Example
@@ -67,7 +58,7 @@ const ExampleCollection: CollectionConfig = {
type: 'code', // required
required: true,
admin: {
language: 'js'
language: 'javascript'
}
}
]

View File

@@ -12,14 +12,22 @@ keywords: row, fields, config, configuration, documentation, Content Management
### Config
| Option | Description |
| ---------------- | ----------- |
| **`label`** * | A label to render within the header of the collapsible component. |
| **`fields`** * | Array of field types to nest within this Collapsible. |
| **`admin`** | Admin-specific configuration. See the [default field admin config](/docs/fields/overview#admin-config) for more details. |
| Option | Description |
| -------------- | ------------------------------------------------------------------------- |
| **`label`** * | A label to render within the header of the collapsible component. This can be a string, function or react component. Function/components receive `({ data, path })` as args. |
| **`fields`** * | Array of field types to nest within this Collapsible. |
| **`admin`** | Admin-specific configuration. See below for [more detail](#admin-config). |
*\* An asterisk denotes that a property is required.*
### Admin Config
In addition to the default [field admin config](/docs/fields/overview#admin-config), you can adjust the following properties:
| Option | Description |
| ---------------------- | ------------------------------- |
| **`initCollapsed`** | Set the initial collapsed state |
### Example
`collections/ExampleCollection.ts`
@@ -30,9 +38,14 @@ const ExampleCollection: CollectionConfig = {
slug: 'example-collection',
fields: [
{
label: 'Header of collapsible goes here',
label: ({ data }) => data?.title || 'Untitled',
type: 'collapsible', // required
fields: [ // required
{
name: 'title',
type: 'text',
required: true,
},
{
name: 'someTextField',
type: 'text',

View File

@@ -17,8 +17,8 @@ This field uses [`react-datepicker`](https://www.npmjs.com/package/react-datepic
| Option | Description |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`name`** \* | To be used as the property name when stored and retrieved from the database. |
| **`label`** | Used as a field label in the Admin panel and to name the generated GraphQL type. |
| **`name`** \* | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`index`** | Build a [MongoDB index](https://docs.mongodb.com/manual/indexes/) for this field to produce faster queries. Set this field to `true` if your users will perform queries on this field's data often. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`saveToJWT`** | If this field is top-level and nested in a config supporting [Authentication](/docs/authentication/config), include its data in the user JWT. |

View File

@@ -14,8 +14,8 @@ keywords: email, fields, config, configuration, documentation, Content Managemen
| Option | Description |
| ---------------- | ----------- |
| **`name`** * | To be used as the property name when stored and retrieved from the database. |
| **`label`** | Used as a field label in the Admin panel and to name the generated GraphQL type. |
| **`name`** * | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |
| **`index`** | Build a [MongoDB index](https://docs.mongodb.com/manual/indexes/) for this field to produce faster queries. Set this field to `true` if your users will perform queries on this field's data often. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |

View File

@@ -14,7 +14,7 @@ keywords: group, fields, config, configuration, documentation, Content Managemen
| Option | Description |
| ---------------- | ----------- |
| **`name`** * | To be used as the property name when stored and retrieved from the database. |
| **`name`** * | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`fields`** * | Array of field types to nest within this Group. |
| **`label`** | Used as a heading in the Admin panel and to name the generated GraphQL type. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |

60
docs/fields/json.mdx Normal file
View File

@@ -0,0 +1,60 @@
---
title: JSON Field
label: JSON
order: 50
desc: The JSON field type will store any string in the Database. Learn how to use JSON fields, see examples and options.
keywords: json, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
---
<Banner >
The JSON field type saves actual JSON in the database, which differs from the Code field that saves the value as a string in the database.
</Banner>
This field uses the `monaco-react` editor syntax highlighting.
### Config
| Option | Description |
| ---------------- | ----------- |
| **`name`** * | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |
| **`index`** | Build a [MongoDB index](https://docs.mongodb.com/manual/indexes/) for this field to produce faster queries. Set this field to `true` if your users will perform queries on this field's data often. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`saveToJWT`** | If this field is top-level and nested in a config supporting [Authentication](/docs/authentication/config), include its data in the user JWT. |
| **`hooks`** | Provide field-based hooks to control logic for this field. [More](/docs/fields/overview#field-level-hooks) |
| **`access`** | Provide field-based access control to denote what users can see and do with this field's data. [More](/docs/fields/overview#field-level-access-control) |
| **`hidden`** | Restrict this field's visibility from all APIs entirely. Will still be saved to the database, but will not appear in any API or the Admin panel. |
| **`defaultValue`** | Provide data to be used for this field's default value. [More](/docs/fields/overview#default-values) |
| **`localized`** | Enable localization for this field. Requires [localization to be enabled](/docs/configuration/localization) in the Base config. |
| **`required`** | Require this field to have a value. |
| **`admin`** | Admin-specific configuration. See below for [more detail](#admin-config). |
_\* An asterisk denotes that a property is required._
### Admin Config
In addition to the default [field admin config](/docs/fields/overview#admin-config), you can adjust the following properties:
| Option | Description |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`editorOptions`** | Options that can be passed to the monaco editor, [view the full list](https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.IDiffEditorConstructionOptions.html). |
### Example
`collections/ExampleCollection.ts
```ts
import { CollectionConfig } from 'payload/types';
const ExampleCollection: CollectionConfig = {
slug: 'example-collection',
fields: [
{
name: 'customerJSON', // required
type: 'json', // required
required: true,
}
]
};
```

View File

@@ -14,8 +14,8 @@ keywords: number, fields, config, configuration, documentation, Content Manageme
| Option | Description |
| ---------------- | ----------- |
| **`name`** * | To be used as the property name when stored and retrieved from the database. |
| **`label`** | Used as a field label in the Admin panel and to name the generated GraphQL type. |
| **`name`** * | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`min`** | Minimum value accepted. Used in the default `validation` function. |
| **`max`** | Maximum value accepted. Used in the default `validation` function. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |

View File

@@ -64,6 +64,10 @@ One of the most powerful parts about Payload is its ability for you to define fi
In addition to being able to define access control on a document-level, you can define extremely granular permissions on a field by field level. For more information about field-level access control, [click here](/docs/access-control/overview#fields).
### Field names
Some fields use their `name` property as a unique identifier to store and retrieve from the database. `__v`, `salt`, and `hash` are all reserved field names which are sanitized from Payload's config and cannot be used.
### Validation
Field validation is enforced automatically based on the field type and other properties such as `required` or `min` and `max` value constraints on certain field types. This default behavior can be replaced by providing your own validate function for any field. It will be used on both the frontend and the backend, so it should not rely on any Node-specific packages. The validation function can be either synchronous or asynchronous and expects to return either `true` or a string error message to display in both API responses and within the Admin panel.
@@ -72,14 +76,15 @@ There are two arguments available to custom validation functions.
1. The value which is currently assigned to the field
2. An optional object with dynamic properties for more complex validation having the following:
| Property | Description |
| ------------- | -------------|
| `data` | An object of the full collection or global document |
| `siblingData` | An object of the document data limited to fields within the same parent to the field |
| `operation` | Will be "create" or "update" depending on the UI action or API call |
| `id` | The value of the collection `id`, will be `undefined` on create request |
| `user` | The currently authenticated user object |
| `payload` | If the `validate` function is being executed on the server, Payload will be exposed for easily running local operations. |
| Property | Description |
|---------------|--------------------------------------------------------------------------------------------------------------------------|
| `data` | An object of the full collection or global document. |
| `siblingData` | An object of the document data limited to fields within the same parent to the field. |
| `operation` | Will be "create" or "update" depending on the UI action or API call. |
| `id` | The value of the collection `id`, will be `undefined` on create request. |
| `t` | The function for translating text, [more](/docs/configuration/i18n). |
| `user` | The currently authenticated user object. |
| `payload` | If the `validate` function is being executed on the server, Payload will be exposed for easily running local operations. |
Example:
```ts
@@ -225,11 +230,9 @@ const translation: {
const field = {
name: 'attribution',
type: 'text',
admin: {
// highlight-start
defaultValue: ({ user, locale }) => (`${translation[locale]} ${user.name}`)
// highlight-end
}
// highlight-start
defaultValue: ({ user, locale }) => (`${translation[locale]} ${user.name}`)
// highlight-end
};
```

View File

@@ -17,7 +17,7 @@ The data structure in the database matches the GeoJSON structure to represent po
| Option | Description |
| ---------------- | ----------- |
| **`name`** * | To be used as the property name when stored and retrieved from the database. |
| **`name`** * | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`label`** | Used as a field label in the Admin panel and to name the generated GraphQL type. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |
| **`index`** | Build a [MongoDB index](https://docs.mongodb.com/manual/indexes/) for this field to produce faster queries. To support location queries, point index defaults to `2dsphere`, to disable the index set to `false`. |

View File

@@ -14,16 +14,16 @@ keywords: radio, fields, config, configuration, documentation, Content Managemen
| Option | Description |
| ---------------- | ----------- |
| **`name`** * | To be used as the property name when stored and retrieved from the database. |
| **`name`** * | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`options`** * | Array of options to allow the field to store. Can either be an array of strings, or an array of objects containing an `label` string and a `value` string. |
| **`label`** | Used as a field label in the Admin panel and to name the generated GraphQL type. |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`index`** | Build a [MongoDB index](https://docs.mongodb.com/manual/indexes/) for this field to produce faster queries. Set this field to `true` if your users will perform queries on this field's data often. |
| **`saveToJWT`** | If this field is top-level and nested in a config supporting [Authentication](/docs/authentication/config), include its data in the user JWT. |
| **`hooks`** | Provide field-based hooks to control logic for this field. [More](/docs/fields/overview#field-level-hooks) |
| **`access`** | Provide field-based access control to denote what users can see and do with this field's data. [More](/docs/fields/overview#field-level-access-control) |
| **`hidden`** | Restrict this field's visibility from all APIs entirely. Will still be saved to the database, but will not appear in any API or the Admin panel. |
| **`defaultValue`** | Provide data to be used for this field's default value. [More](/docs/fields/overview#default-values) |
| **`defaultValue`** | Provide data to be used for this field's default value. The default value must exist within provided values in `options`. [More](/docs/fields/overview#default-values) |
| **`localized`** | Enable localization for this field. Requires [localization to be enabled](/docs/configuration/localization) in the Base config. |
| **`required`** | Require this field to have a value. |
| **`admin`** | Admin-specific configuration. See below for [more detail](#admin-config). |
@@ -41,7 +41,7 @@ In addition to the default [field admin config](/docs/fields/overview#admin-conf
**`layout`**
The `layout` property allows for the radio group to be styled as a horizonally or vertically distributed list.
The `layout` property allows for the radio group to be styled as a horizonally or vertically distributed list. The default value is `horizontal`.
### Example
@@ -65,7 +65,7 @@ const ExampleCollection: CollectionConfig = {
value: 'dark_gray',
},
],
defaultValue: 'option_1',
defaultValue: 'mint', // The first value in options.
admin: {
layout: 'horizontal',
}

View File

@@ -20,12 +20,12 @@ keywords: relationship, fields, config, configuration, documentation, Content Ma
| Option | Description |
| ---------------- | ----------- |
| **`name`** * | To be used as the property name when stored and retrieved from the database. |
| **`name`** * | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`relationTo`** * | Provide one or many collection `slug`s to be able to assign relationships to. |
| **`filterOptions`** | A query to filter which options appear in the UI and validate against. [More](#filtering-relationship-options). |
| **`hasMany`** | Boolean when, if set to `true`, allows this field to have many relations instead of only one. |
| **`maxDepth`** | Sets a number limit on iterations of related documents to populate when queried. [Depth](/docs/getting-started/concepts#depth) |
| **`label`** | Used as a field label in the Admin panel and to name the generated GraphQL type. |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`index`** | Build a [MongoDB index](https://docs.mongodb.com/manual/indexes/) for this field to produce faster queries. Set this field to `true` if your users will perform queries on this field's data often. |
@@ -78,7 +78,7 @@ const relationshipField = {
// returns a Where query dynamically by the type of relationship
if (relationTo === 'products') {
return {
'stock': { is_greater_than: siblingData.quantity }
'stock': { greater_than: siblingData.quantity }
}
}

View File

@@ -20,8 +20,8 @@ The Admin component is built on the powerful [`slatejs`](https://docs.slatejs.or
| Option | Description |
| ---------------- | ----------- |
| **`name`** * | To be used as the property name when stored and retrieved from the database. |
| **`label`** | Used as a field label in the Admin panel and to name the generated GraphQL type. |
| **`name`** * | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`saveToJWT`** | If this field is top-level and nested in a config supporting [Authentication](/docs/authentication/config), include its data in the user JWT. |
| **`hooks`** | Provide field-based hooks to control logic for this field. [More](/docs/fields/overview#field-level-hooks) |
@@ -77,14 +77,21 @@ The default `leaves` available in Payload are:
Set this property to `true` to hide this field's gutter within the admin panel. The field gutter is rendered as a vertical line and padding, but often if this field is nested within a Group, Block, or Array, you may want to hide the gutter.
**`link.fields`**
This allows [fields](/docs/fields/overview) to be saved as extra fields on a link inside the Rich Text Editor. When this is present, the fields will render inside a modal that can be opened by clicking the "edit" button on the link element.
![RichText link fields](https://payloadcms.com/images/docs/fields/richText/rte-link-fields-modal.jpg)
*RichText link with custom fields*
**`upload.collections[collection-name].fields`**
This allows [fields](/docs/fields/overview) to be saved as meta data on an upload field inside the Rich Text Editor. When this is present, the fields will render inside a modal that can be opened by clicking the "edit" button on the upload element.
![RichText upload element](https://payloadcms.com/images/fields/richText/rte-upload-element.jpg)
![RichText upload element](https://payloadcms.com/images/docs/fields/richText/rte-upload-element.jpg)
*RichText field using the upload element*
![RichText upload element modal](https://payloadcms.com/images/fields/richText/rte-upload-fields-modal.jpg)
![RichText upload element modal](https://payloadcms.com/images/docs/fields/richText/rte-upload-fields-modal.jpg)
*RichText upload element modal displaying fields from the config*
### Relationship element
@@ -167,6 +174,20 @@ const ExampleCollection: CollectionConfig = {
]
}
],
link: {
// Inject your own fields into the Link element
fields: [
{
name: 'rel',
label: 'Rel Attribute',
type: 'select',
hasMany: true,
options: [
'noopener', 'noreferrer', 'nofollow',
],
},
],
},
upload: {
collections: {
media: {

View File

@@ -14,11 +14,11 @@ keywords: select, multi-select, fields, config, configuration, documentation, Co
### Config
| Option | Description |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`name`** \* | To be used as the property name when stored and retrieved from the database. |
| ------------------ |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`name`** \* | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`options`** \* | Array of options to allow the field to store. Can either be an array of strings, or an array of objects containing a `label` string and a `value` string. |
| **`hasMany`** | Boolean when, if set to `true`, allows this field to have many selections instead of only one. |
| **`label`** | Used as a field label in the Admin panel and to name the generated GraphQL type. |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`index`** | Build a [MongoDB index](https://docs.mongodb.com/manual/indexes/) for this field to produce faster queries. Set this field to `true` if your users will perform queries on this field's data often. |

View File

@@ -7,10 +7,10 @@ keywords: tabs, fields, config, configuration, documentation, Content Management
---
<Banner >
The Tabs field is presentational-only and only affects the Admin panel. By using it, you can place fields within a nice layout component that separates certain sub-fields by a tabbed interface.
The Tabs field is presentational-only and only affects the Admin panel (unless a tab is named). By using it, you can place fields within a nice layout component that separates certain sub-fields by a tabbed interface.
</Banner>
![Tabs field type used to separate Hero fields from Page Layout](https://payloadcms.com/images/fields/tabs/tabs.jpg)
![Tabs field type used to separate Hero fields from Page Layout](https://payloadcms.com/images/docs/fields/tabs/tabs.jpg)
*Tabs field type used to separate Hero fields from Page Layout*
### Config
@@ -26,6 +26,7 @@ Each tab has its own required `label` and `fields` array. You can also optionall
| Option | Description |
| ----------------- | ----------- |
| **`name`** | An optional property name to be used when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`label`** * | The label to render on the tab itself. |
| **`fields`** * | The fields to render within this tab. |
| **`description`** | Optionally render a description within this tab to describe the contents of the tab itself. |
@@ -56,10 +57,11 @@ const ExampleCollection: CollectionConfig = {
],
},
{
name: 'tabTwo',
label: 'Tab Two Label', // required
fields: [ // required
{
name: 'numberField',
name: 'numberField', // accessible via tabTwo.numberField
type: 'number',
required: true,
},

View File

@@ -14,8 +14,8 @@ keywords: text, fields, config, configuration, documentation, Content Management
| Option | Description |
| ---------------- | ----------- |
| **`name`** * | To be used as the property name when stored and retrieved from the database. |
| **`label`** | Used as a field label in the Admin panel and to name the generated GraphQL type. |
| **`name`** * | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |
| **`minLength`** | Used by the default validation function to ensure values are of a minimum character length. |
| **`maxLength`** | Used by the default validation function to ensure values are of a maximum character length. |

View File

@@ -14,8 +14,8 @@ keywords: textarea, fields, config, configuration, documentation, Content Manage
| Option | Description |
| ---------------- | ----------- |
| **`name`** * | To be used as the property name when stored and retrieved from the database. |
| **`label`** | Used as a field label in the Admin panel and to name the generated GraphQL type. |
| **`name`** * | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |
| **`minLength`** | Used by the default validation function to ensure values are of a minimum character length. |
| **`maxLength`** | Used by the default validation function to ensure values are of a maximum character length. |

View File

@@ -23,12 +23,12 @@ With this field, you can also inject custom `Cell` components that appear as add
### Config
| Option | Description |
| ---------------------------- | ----------- |
| **`name`** * | A unique identifier for this field. |
| **`label`** | Human-readable label for this UI field. |
| **`admin.components.Field`** | React component to be rendered for this field within the Edit view. |
| **`admin.components.Cell`** | React component to be rendered as a Cell within collection List views. |
| Option | Description |
| ---------------------------- |-------------------------------------------------------------------------------------------------------------------|
| **`name`** * | A unique identifier for this field. |
| **`label`** | Human-readable label for this UI field. |
| **`admin.components.Field`** | React component to be rendered for this field within the Edit view. [More](/docs/admin/components/#field-component) |
| **`admin.components.Cell`** | React component to be rendered as a Cell within collection List views. [More](/docs/admin/components/#field-component) |
*\* An asterisk denotes that a property is required.*

View File

@@ -23,24 +23,24 @@ keywords: upload, images media, fields, config, configuration, documentation, Co
### Config
| Option | Description |
| ---------------- | ----------- |
| **`name`** * | To be used as the property name when stored and retrieved from the database. |
| **`*relationTo`** * | Provide a single collection `slug` to allow this field to accept a relation to. <strong>Note: the related collection must be configured to support Uploads.</strong> |
| **`filterOptions`** | A query to filter which options appear in the UI and validate against. [More](#filtering-relationship-options). |
| **`maxDepth`** | Sets a number limit on iterations of related documents to populate when queried. [Depth](/docs/getting-started/concepts#depth) |
| **`label`** | Used as a field label in the Admin panel and to name the generated GraphQL type. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| Option | Description |
| ---------------- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`name`** * | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`*relationTo`** * | Provide a single collection `slug` to allow this field to accept a relation to. <strong>Note: the related collection must be configured to support Uploads.</strong> |
| **`filterOptions`** | A query to filter which options appear in the UI and validate against. [More](#filtering-upload-options). |
| **`maxDepth`** | Sets a number limit on iterations of related documents to populate when queried. [Depth](/docs/getting-started/concepts#depth) |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`index`** | Build a [MongoDB index](https://docs.mongodb.com/manual/indexes/) for this field to produce faster queries. Set this field to `true` if your users will perform queries on this field's data often. |
| **`saveToJWT`** | If this field is top-level and nested in a config supporting [Authentication](/docs/authentication/config), include its data in the user JWT. |
| **`hooks`** | Provide field-based hooks to control logic for this field. [More](/docs/fields/overview#field-level-hooks) |
| **`access`** | Provide field-based access control to denote what users can see and do with this field's data. [More](/docs/fields/overview#field-level-access-control) |
| **`hidden`** | Restrict this field's visibility from all APIs entirely. Will still be saved to the database, but will not appear in any API or the Admin panel. |
| **`defaultValue`** | Provide data to be used for this field's default value. [More](/docs/fields/overview#default-values) |
| **`localized`** | Enable localization for this field. Requires [localization to be enabled](/docs/configuration/localization) in the Base config. |
| **`required`** | Require this field to have a value. |
| **`admin`** | Admin-specific configuration. See the [default field admin config](/docs/fields/overview#admin-config) for more details. |
| **`saveToJWT`** | If this field is top-level and nested in a config supporting [Authentication](/docs/authentication/config), include its data in the user JWT. |
| **`hooks`** | Provide field-based hooks to control logic for this field. [More](/docs/fields/overview#field-level-hooks) |
| **`access`** | Provide field-based access control to denote what users can see and do with this field's data. [More](/docs/fields/overview#field-level-access-control) |
| **`hidden`** | Restrict this field's visibility from all APIs entirely. Will still be saved to the database, but will not appear in any API or the Admin panel. |
| **`defaultValue`** | Provide data to be used for this field's default value. [More](/docs/fields/overview#default-values) |
| **`localized`** | Enable localization for this field. Requires [localization to be enabled](/docs/configuration/localization) in the Base config. |
| **`required`** | Require this field to have a value. |
| **`admin`** | Admin-specific configuration. See the [default field admin config](/docs/fields/overview#admin-config) for more details. |
*\* An asterisk denotes that a property is required.*
@@ -63,3 +63,37 @@ const ExampleCollection: CollectionConfig = {
}
```
### Filtering upload options
Options can be dynamically limited by supplying a [query constraint](/docs/queries/overview), which will be used both for validating input and filtering available uploads in the UI.
The `filterOptions` property can either be a `Where` query directly, or a function that returns one. When using a function, it will be called with an argument object with the following properties:
| Property | Description |
| ------------- | -------------|
| `relationTo` | The `relationTo` to filter against (as defined on the field) |
| `data` | An object of the full collection or global document currently being edited |
| `siblingData` | An object of the document data limited to fields within the same parent to the field |
| `id` | The value of the collection `id`, will be `undefined` on create request |
| `user` | The currently authenticated user object |
**Example:**
```ts
const uploadField = {
name: 'image',
type: 'upload',
relationTo: 'media',
filterOptions: {
mimeType: { contains: 'image' },
},
};
```
You can learn more about writing queries [here](/docs/queries/overview).
<Banner type="warning">
<strong>Note:</strong><br/>
When an upload field has both <strong>filterOptions</strong> and a custom <strong>validate</strong> function, the api will not validate <strong>filterOptions</strong> unless you call the default upload field validation function imported from <strong>payload/fields/validations</strong> in your validate function.
</Banner>

View File

@@ -70,7 +70,7 @@ For more, visit the [Access Control documentation](/docs/access-control/overview
You can specify population `depth` via query parameter in the REST API and by an option in the local API. *Depth has no effect in the GraphQL API, because there, depth is based on the shape of your queries.*
It is also possible to limit the depth for specific `relation` and `upload` fields using the `maxDepth` property in your configuration.
**For example, let's look the following Collections:** `departments`, `users`, `posts`
**For example, let's look at the following Collections:** `departments`, `users`, `posts`
```
// type: 'relationship' fields are equal to 1 depth level

View File

@@ -131,3 +131,7 @@ A function that is called immediately following startup that receives the Payloa
After you've gotten this far, it's time to boot up Payload. At the command line, run `npm install` and then `node server.js` in your application's folder to start up your app and initialize Payload.
After it starts, you can go to `http://localhost:3000/admin` to create your first Payload user!
### Docker
Looking to deploy Payload with Docker? New projects with `create-payload-app` come with a Dockerfile and docker-compose.yml file ready to go. Examples of these files can be seen in our [Deployment docs](/docs/deployment#Docker).

View File

@@ -48,7 +48,7 @@ The team behind Payload has been building websites and apps with existing conten
- Secure
- Fully flexible and extensible
Payload is our silver bullet solution. It represents over two years of passionate development and brings everything we need when we build new apps and websites:
Payload is our silver bullet solution. We've blended the best parts of our experience with other CMS and app frameworks into Payload, and we finally have everything we need when we build new apps and websites:
- A beautiful, dynamic, customizable admin UI
- Extensible and reusable authentication

View File

@@ -14,7 +14,7 @@ The labels you provide for your Collections and Globals are used to name the Gra
## GraphQL Options
At the top of your Payload config you can define all the options to manage GraphQL. The
At the top of your Payload config you can define all the options to manage GraphQL.
| Option | Description |
| -------------------- | -------------|
@@ -22,7 +22,7 @@ At the top of your Payload config you can define all the options to manage Graph
| `queries` | Any custom Queries to be added in addition to what Payload provides. [More](/docs/graphql/extending) |
| `maxComplexity` | A number used to set the maximum allowed complexity allowed by requests [More](/docs/graphql/overview#query-complexity-limits) |
| `disablePlaygroundInProduction` | A boolean that if false will enable the graphQL playground, defaults to true. [More](/docs/graphql/overview#graphql-playground) |
| `disable` | A boolean that if false will disable the graphQL entirely, defaults to false. |
| `disable` | A boolean that if true will disable the graphQL entirely, defaults to false. |
| `schemaOutputFile` | A string for the file path used by the generate schema command. Defaults to `graphql.schema` next to `payload.config.ts` [More](/docs/graphql/graphql-schema) |
## Collections
@@ -35,10 +35,6 @@ import { CollectionConfig } from 'payload/types';
const PublicUser: CollectionConfig = {
slug: 'public-users',
auth: true, // Auth is enabled
labels: {
singular: 'Public User',
plural: 'Public Users',
},
fields: [
...
],
@@ -120,7 +116,7 @@ You can even log in using the `login[collection-singular-label-here]` mutation t
<Banner type="success">
<strong>Tip:</strong><br/>
To see more regarding how the above queries and mutations are used, visit your GraphQL playground (by default at <a href="http://localhost:3000/api/graphql-playground">(http://localhost:3000/api/graphql-playground)</a> while your server is running. There, you can use the "Schema" and "Docs" buttons on the right to see a ton of detail about how GraphQL operates within Payload.
To see more regarding how the above queries and mutations are used, visit your GraphQL playground (by default at <a href="http://localhost:3000/api/graphql-playground">(http://localhost:3000/api/graphql-playground</a>) while your server is running. There, you can use the "Schema" and "Docs" buttons on the right to see a ton of detail about how GraphQL operates within Payload.
</Banner>
## Query complexity limits

View File

@@ -38,7 +38,7 @@ const ExampleHooks: CollectionConfig = {
slug: 'example-hooks',
fields: [
{ name: 'name', type: 'text'},
]
],
hooks: {
beforeOperation: [(args) => {...}],
beforeValidate: [(args) => {...}],
@@ -56,7 +56,7 @@ const ExampleHooks: CollectionConfig = {
afterRefresh: [(args) => {...}],
afterMe: [(args) => {...}],
afterForgotPassword: [(args) => {...}],
}
},
}
```
@@ -121,6 +121,7 @@ import { CollectionAfterChangeHook } from 'payload/types';
const afterChangeHook: CollectionAfterChangeHook = async ({
doc, // full document data
req, // full express request
previousDoc, // document data before updating the collection
operation, // name of the operation ie. 'create', 'update'
}) => {
return doc;
@@ -189,7 +190,7 @@ const afterDeleteHook: CollectionAfterDeleteHook = async ({
### beforeLogin
For auth-enabled Collections, this hook runs after successful `login` operations. You can optionally modify the user that is returned.
For auth-enabled Collections, this hook runs during `login` operations where a user with the provided credentials exist, but before a token is generated and added to the response. You can optionally modify the user that is returned, or throw an error in order to deny the login operation.
```ts
import { CollectionBeforeLoginHook } from 'payload/types';
@@ -197,7 +198,6 @@ import { CollectionBeforeLoginHook } from 'payload/types';
const beforeLoginHook: CollectionBeforeLoginHook = async ({
req, // full express request
user, // user being logged in
token, // user token
}) => {
return user;
}
@@ -212,6 +212,8 @@ import { CollectionAfterLoginHook } from 'payload/types';
const afterLoginHook: CollectionAfterLoginHook = async ({
req, // full express request
user, // user that was logged in
token, // user token
}) => {...}
```

View File

@@ -27,9 +27,9 @@ Field-level hooks offer incredible potential for encapsulating your logic. They
Example field configuration:
```ts
import { CollectionConfig } from 'payload/types';
import { Field } from 'payload/types';
const ExampleCollection: CollectionConfig = {
const ExampleField: Field = {
name: 'name',
type: 'text',
// highlight-start
@@ -56,15 +56,17 @@ All field-level hooks are formatted to accept the same arguments, although some
Field Hooks receive one `args` argument that contains the following properties:
| Option | Description |
| ----------------- | -------------|
| **`data`** | The data passed to update the document within `create` and `update` operations, and the full document itself in the `afterRead` hook. |
| **`findMany`** | Boolean to denote if this hook is running against finding one, or finding many within the `afterRead` hook. |
| **`operation`** | A string relating to which operation the field type is currently executing within. Useful within `beforeValidate`, `beforeChange`, and `afterChange` hooks to differentiate between `create` and `update` operations. |
| **`originalDoc`** | The full original document in `update` operations. |
| **`req`** | The Express `request` object. It is mocked for Local API operations. |
| **`siblingData`** | The sibling data passed to a field that the hook is running against. |
| **`value`** | The value of the field. |
| Option | Description |
|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`data`** | The data passed to update the document within `create` and `update` operations, and the full document itself in the `afterRead` hook. |
| **`siblingData`** | The sibling data passed to a field that the hook is running against. |
| **`findMany`** | Boolean to denote if this hook is running against finding one, or finding many within the `afterRead` hook. |
| **`operation`** | A string relating to which operation the field type is currently executing within. Useful within `beforeValidate`, `beforeChange`, and `afterChange` hooks to differentiate between `create` and `update` operations. |
| **`originalDoc`** | The full original document in `update` operations. In the `afterChange` hook, this is the resulting document of the operation. |
| **`previousDoc`** | The document before changes were applied, only in `afterChange` hooks. |
| **`previousSiblingDoc`** | The sibling data from the previous document in `afterChange` hook. |
| **`req`** | The Express `request` object. It is mocked for Local API operations. |
| **`value`** | The value of the field. |
#### Return value

View File

@@ -78,6 +78,7 @@ import { GlobalAfterChangeHook } from 'payload/types'
const afterChangeHook: GlobalAfterChangeHook = async ({
doc, // full document data
previousDoc, // document data before updating the collection
req, // full express request
}) => {
return data;

View File

@@ -63,8 +63,8 @@ You can specify more options within the Local API vs. REST or GraphQL due to the
| `depth` | [Control auto-population](/docs/getting-started/concepts#depth) of nested relationship and upload fields. |
| `locale` | Specify [locale](/docs/configuration/localization) for any returned documents. |
| `fallbackLocale` | Specify a [fallback locale](/docs/configuration/localization) to use for any returned documents. |
| `overrideAccess` | Skip access control. By default, this property is set to false. |
| `user` | If you re-enable access control, you can specify a user to use against the access control checks. |
| `overrideAccess` | Skip access control. By default, this property is set to true within all Local API operations. |
| `user` | If you set `overrideAccess` to `false`, you can pass a user to use against the access control checks. |
| `showHiddenFields` | Opt-in to receiving hidden fields. By default, they are hidden from returned documents in accordance to your config. |
| `pagination` | Set to false to return all documents and avoid querying for document counts. |
@@ -323,7 +323,7 @@ const result = await payload.updateGlobal({
## TypeScript
Local API calls also support passing in a generic. This is especially useful if you generate your TS types using a [generate types script](/docs/typescript/generate-types).
Local API calls also support passing in a generic. This is especially useful if you generate your TS types using a [generate types script](/docs/typescript/generating-types).
Here is an example of usage:

View File

@@ -27,7 +27,7 @@ Writing plugins is no more complex than writing regular JavaScript. If you know
### How to install plugins
The base Payload config allows for a `plugins` property which takes an `array` of [`Plugin`s](https://github.com/payloadcms/payload/blob/master/src/config/types.ts#L21).
The base Payload config allows for a `plugins` property which takes an `array` of [`Plugins`](https://github.com/payloadcms/payload/blob/master/src/config/types.ts#L21).
```js
import { buildConfig } from 'payload/config';
@@ -134,8 +134,8 @@ const addLastModified: Plugin = (incomingConfig: Config): Config => {
export default addLastModified;
```
#### Available Plugins
### Available Plugins
You can discover existing plugins by browsing the `payload-plugin` topic on [Github](https://github.com/topics/payload-plugin).
You can discover existing plugins by browsing the `payload-plugin` topic on [GitHub](https://github.com/topics/payload-plugin).
For maintainers building plugins for others to use, please add the topic to help others find it. If you would like one to be built by the core Payload team, [open a Feature Request](https://github.com/payloadcms/payload/discussions) in our GitHub Discussions board. We would be happy to review your code and maybe feature you and your plugin where appropriate.

View File

@@ -128,3 +128,77 @@ DigitalOcean provides extremely helpful documentation that can walk you through
1. [Install and secure MongoDB](https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-20-04)
1. [Create a new MongoDB and user](https://medium.com/@mhagemann/how-to-add-a-new-user-to-a-mongodb-database-d896776b5362)
1. [Set up Node for production](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-20-04)
## Docker
This is an example of a multi-stage docker build of Payload for production. Ensure you are setting your environment variables on deployment, like `PAYLOAD_SECRET`, `PAYLOAD_CONFIG_PATH`, and `MONGODB_URI` if needed.
```dockerfile
FROM node:18-alpine as base
FROM base as builder
WORKDIR /home/node
COPY package*.json ./
COPY . .
RUN yarn install
RUN yarn build
FROM base as runtime
ENV NODE_ENV=production
WORKDIR /home/node
COPY package*.json ./
RUN yarn install --production
COPY --from=builder /home/node/dist ./dist
COPY --from=builder /home/node/build ./build
EXPOSE 3000
CMD ["node", "dist/server.js"]
```
## Docker Compose
Here is an example of a docker-compose.yml file that can be used for development
```yml
version: '3'
services:
payload:
image: node:18-alpine
ports:
- "3000:3000"
volumes:
- .:/home/node/app
- node_modules:/home/node/app/node_modules
working_dir: /home/node/app/
command: sh -c "yarn install && yarn dev"
depends_on:
- mongo
environment:
MONGODB_URI: mongodb://mongo:27017/payload
PORT: 3000
NODE_ENV: development
PAYLOAD_SECRET: TESTING
mongo:
image: mongo:latest
ports:
- "27017:27017"
command:
- --storageEngine=wiredTiger
volumes:
- data:/data/db
logging:
driver: none
volumes:
data:
node_modules:
```

View File

@@ -18,12 +18,12 @@ Set the max number of failed login attempts before a user account is locked out
To prevent DDoS, brute-force, and similar attacks, you can set IP-based rate limits so that once a certain threshold of requests has been hit by a single IP, further requests from the same IP will be ignored. The Payload config `rateLimit` property accepts an object with the following properties:
| Option | Description |
| ---------------------------- | -------------|
| **`window`** | Time in milliseconds to track requests per IP |
| **`max`** | Number of requests served from a single IP before limiting |
| **`skip`** | Express middleware function that can return true (or promise resulting in true) that will bypass limit |
| **`trustProxy`** | True or false, to enable to allow requests to pass through a proxy such as a load balancer or an `nginx` reverse proxy |
| Option | Description |
| ---------------------------- | ----------- |
| **`window`** | Time in milliseconds to track requests per IP. Defaults to `90000` (15 minutes). |
| **`max`** | Number of requests served from a single IP before limiting. Defaults to `500`. |
| **`skip`** | Express middleware function that can return true (or promise resulting in true) that will bypass limit. |
| **`trustProxy`** | True or false, to enable to allow requests to pass through a proxy such as a load balancer or an `nginx` reverse proxy. |
<Banner type="warning">
<strong>Warning:</strong><br/>

View File

@@ -22,15 +22,17 @@ All Payload API routes are mounted prefixed to your config's `routes.api` URL se
Each collection is mounted using its `slug` value. For example, if a collection's slug is `users`, all corresponding routes will be mounted on `/api/users`.
Note: Collection slugs must be formatted in kebab-case
**All CRUD operations are exposed as follows:**
| Method | Path | Description |
| -------- | --------------------------- | -------------------------------------- |
| `GET` | `/api/{collectionSlug}` | Find paginated documents |
| `GET` | `/api/{collectionSlug}/:id` | Find a specific document by ID |
| `POST` | `/api/{collectionSlug}` | Create a new document |
| `PATCH` | `/api/{collectionSlug}/:id` | Update a document by ID |
| `DELETE` | `/api/{collectionSlug}/:id` | Delete an existing document by ID |
| `GET` | `/api/{collection-slug}` | Find paginated documents |
| `GET` | `/api/{collection-slug}/:id` | Find a specific document by ID |
| `POST` | `/api/{collection-slug}` | Create a new document |
| `PATCH` | `/api/{collection-slug}/:id` | Update a document by ID |
| `DELETE` | `/api/{collection-slug}/:id` | Delete an existing document by ID |
##### Additional `find` query parameters
@@ -47,14 +49,14 @@ Auth enabled collections are also given the following endpoints:
| Method | Path | Description |
| -------- | --------------------------- | ----------- |
| `POST` | `/api/{collectionSlug}/verify/:token` | [Email verification](/docs/authentication/operations#verify-by-email), if enabled. |
| `POST` | `/api/{collectionSlug}/unlock` | [Unlock a user's account](/docs/authentication/operations#unlock), if enabled. |
| `POST` | `/api/{collectionSlug}/login` | [Logs in](/docs/authentication/operations#login) a user with email / password. |
| `POST` | `/api/{collectionSlug}/logout` | [Logs out](/docs/authentication/operations#logout) a user. |
| `POST` | `/api/{collectionSlug}/refresh-token` | [Refreshes a token](/docs/authentication/operations#refresh) that has not yet expired. |
| `GET` | `/api/{collectionSlug}/me` | [Returns the currently logged in user with token](/docs/authentication/operations#me). |
| `POST` | `/api/{collectionSlug}/forgot-password` | [Password reset workflow](/docs/authentication/operations#forgot-password) entry point. |
| `POST` | `/api/{collectionSlug}/reset-password` | [To reset the user's password](/docs/authentication/operations#reset-password). |
| `POST` | `/api/{collection-slug}/verify/:token` | [Email verification](/docs/authentication/operations#verify-by-email), if enabled. |
| `POST` | `/api/{collection-slug}/unlock` | [Unlock a user's account](/docs/authentication/operations#unlock), if enabled. |
| `POST` | `/api/{collection-slug}/login` | [Logs in](/docs/authentication/operations#login) a user with email / password. |
| `POST` | `/api/{collection-slug}/logout` | [Logs out](/docs/authentication/operations#logout) a user. |
| `POST` | `/api/{collection-slug}/refresh-token` | [Refreshes a token](/docs/authentication/operations#refresh) that has not yet expired. |
| `GET` | `/api/{collection-slug}/me` | [Returns the currently logged in user with token](/docs/authentication/operations#me). |
| `POST` | `/api/{collection-slug}/forgot-password` | [Password reset workflow](/docs/authentication/operations#forgot-password) entry point. |
| `POST` | `/api/{collection-slug}/reset-password` | [To reset the user's password](/docs/authentication/operations#reset-password). |
## Globals
@@ -86,6 +88,7 @@ Each endpoint object needs to have:
| **`path`** | A string for the endpoint route after the collection or globals slug |
| **`method`** | The lowercase HTTP verb to use: 'get', 'head', 'post', 'put', 'delete', 'connect' or 'options' |
| **`handler`** | A function or array of functions to be called with **req**, **res** and **next** arguments. [Express](https://expressjs.com/en/guide/routing.html#route-handlers) |
| **`root`** | When `true`, defines the endpoint on the root Express app, bypassing Payload handlers and the `routes.api` subpath. Note: this only applies to top-level endpoints of your Payload config, endpoints defined on `collections` or `globals` cannot be root. |
Example:

View File

@@ -12,7 +12,7 @@ keywords: uploads, images, media, overview, documentation, Content Management Sy
control.
</Banner>
![Upload admin panel functionality](https://payloadcms.com/images/upload-admin.jpg)
![Upload admin panel functionality](https://payloadcms.com/images/docs/upload-admin.jpg)
_Admin panel screenshot depicting a Media Collection with Upload enabled_
**Here are some common use cases of Uploads:**
@@ -45,6 +45,8 @@ Every Payload Collection can opt-in to supporting Uploads by specifying the `upl
| **`staticURL`** \* | The base URL path to use to access your uploads. Example: `/media` |
| **`staticDir`** \* | The folder directory to use to store media in. Can be either an absolute path or relative to the directory that contains your config. |
| **`imageSizes`** | If specified, image uploads will be automatically resized in accordance to these image sizes. [More](#image-sizes) |
| **`formatOptions`** | An object with `format` and `options` that are used with the Sharp image library to format the upload file. [More](https://sharp.pixelplumbing.com/api-output#toformat) |
| **`resizeOptions`** | An object passed to the the Sharp image library to resize the uploaded file. [More](https://sharp.pixelplumbing.com/api-resize) |
| **`adminThumbnail`** | Set the way that the Admin panel will display thumbnails for this Collection. [More](#admin-thumbnails) |
| **`mimeTypes`** | Restrict mimeTypes in the file picker. Array of valid mimetypes or mimetype wildcards [More](#mimetypes) |
| **`disableLocalStorage`** | Completely disable uploading files to disk locally. [More](#disabling-local-upload-storage) |
@@ -68,13 +70,13 @@ const Media: CollectionConfig = {
name: 'thumbnail',
width: 400,
height: 300,
crop: 'centre',
position: 'centre',
},
{
name: 'card',
width: 768,
height: 1024,
crop: 'centre',
position: 'centre',
},
{
name: 'tablet',
@@ -84,7 +86,7 @@ const Media: CollectionConfig = {
// but it will retain its original aspect ratio
// and calculate a height automatically.
height: null,
crop: 'centre',
position: 'centre',
},
],
adminThumbnail: 'thumbnail',

View File

@@ -1,8 +1,12 @@
module.exports = {
verbose: true,
testTimeout: 15000,
testEnvironment: 'jsdom',
testRegex: '(/src/admin/.*\\.(test|spec))\\.[jt]sx?$',
setupFilesAfterEnv: ['<rootDir>/test/componentsSetup.js'],
transform: {
'^.+\\.(t|j)sx?$': ['@swc/jest'],
},
testPathIgnorePatterns: [
'node_modules',
'dist',

View File

@@ -5,6 +5,9 @@ module.exports = {
'**/src/**/*.spec.ts',
'**/test/**/*int.spec.ts',
],
transform: {
'^.+\\.(t|j)sx?$': ['@swc/jest'],
},
globalSetup: './test/jest.setup.ts',
testTimeout: 90000,
moduleNameMapper: {

View File

@@ -1,8 +1,12 @@
{
"name": "payload",
"version": "1.0.30",
"version": "1.5.6",
"description": "Node, React and MongoDB Headless CMS and Application Framework",
"license": "MIT",
"engines": {
"node": ">=14",
"yarn": ">=1.22 <2"
},
"author": {
"email": "info@payloadcms.com",
"name": "Payload CMS",
@@ -28,10 +32,10 @@
},
"scripts": {
"copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png}\" dist/",
"build:tsc": "tsc --p tsconfig.admin.json && tsc --p tsconfig.server.json",
"build:tsc": "tsc",
"build:components": "webpack --config dist/webpack/components.config.js",
"build": "yarn copyfiles && yarn build:tsc && yarn build:components",
"build:watch": "nodemon --watch 'src/**' --ext 'ts,tsx' --exec 'yarn build:tsc'",
"build:watch": "nodemon --watch 'src/**' --ext 'ts,tsx' --exec \"yarn build:tsc\"",
"dev": "nodemon",
"dev:generate-types": "node ./test/generateTypes.js",
"pretest": "yarn build",
@@ -41,12 +45,14 @@
"test:e2e:headed": "cross-env DISABLE_LOGGING=true playwright test --headed",
"test:e2e:debug": "cross-env PWDEBUG=1 DISABLE_LOGGING=true playwright test",
"test:components": "cross-env jest --config=jest.components.config.js",
"clean:cache": "rimraf node_modules/.cache",
"clean": "rimraf dist",
"release": "release-it",
"release:patch": "release-it patch",
"release:minor": "release-it minor",
"release:major": "release-it major",
"release:beta": "release-it prepatch --config .release-it.beta.json",
"fix": "eslint \"src/**/*.ts\" --fix",
"lint": "eslint \"src/**/*.ts\""
},
"bugs": {
@@ -74,23 +80,15 @@
"auth"
],
"dependencies": {
"@babel/cli": "^7.12.8",
"@babel/core": "^7.11.6",
"@babel/node": "^7.12.6",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.2",
"@babel/plugin-transform-runtime": "^7.11.5",
"@babel/preset-env": "^7.8.3",
"@babel/preset-react": "^7.8.3",
"@babel/preset-typescript": "^7.12.1",
"@babel/register": "^7.11.5",
"@date-io/date-fns": "^2.10.6",
"@faceless-ui/modal": "^1.1.7",
"@dnd-kit/core": "^6.0.5",
"@dnd-kit/sortable": "^7.0.1",
"@faceless-ui/modal": "^2.0.1",
"@faceless-ui/scroll-info": "^1.2.3",
"@faceless-ui/window-info": "^2.0.2",
"@types/is-plain-object": "^2.0.4",
"babel-jest": "^26.3.0",
"babel-loader": "^8.1.0",
"@monaco-editor/react": "^4.4.6",
"@swc/core": "^1.3.24",
"@swc/register": "^0.1.10",
"body-parser": "^1.19.0",
"bson-objectid": "^2.0.1",
"compression": "^1.7.4",
@@ -107,29 +105,31 @@
"express-fileupload": "1.4.0",
"express-graphql": "0.12.0",
"express-rate-limit": "^5.1.3",
"falsey": "^1.0.0",
"file-loader": "^6.2.0",
"file-type": "16.5.4",
"find-up": "4.1.0",
"flatley": "^5.2.0",
"fs-extra": "^10.0.0",
"graphql": "15.4.0",
"graphql": "^16.6.0",
"graphql-playground-middleware-express": "^1.7.14",
"graphql-query-complexity": "^0.7.0",
"graphql-scalars": "^1.4.0",
"graphql-type-json": "^0.3.1",
"html-webpack-plugin": "^5.0.0-alpha.14",
"http-status": "^1.4.2",
"i18next": "^22.0.1",
"i18next-browser-languagedetector": "^6.1.8",
"i18next-http-middleware": "^3.2.1",
"is-hotkey": "^0.2.0",
"is-plain-object": "^5.0.0",
"isomorphic-fetch": "^3.0.0",
"jest": "^26.6.3",
"joi": "^17.3.0",
"json-schema-to-typescript": "^11.0.2",
"jsonwebtoken": "^8.5.1",
"jsonwebtoken": "^9.0.0",
"jwt-decode": "^3.1.2",
"md5": "^2.3.0",
"method-override": "^3.0.0",
"micro-memoize": "^4.0.9",
"mime": "^2.5.0",
"mini-css-extract-plugin": "1.3.3",
"minimist": "^1.2.0",
"mkdirp": "^1.0.4",
@@ -145,7 +145,7 @@
"passport-local-mongoose": "^7.0.0",
"path-browserify": "^1.0.1",
"pino": "^6.4.1",
"pino-pretty": "^4.3.0",
"pino-pretty": "^9.1.1",
"pluralize": "^8.0.0",
"postcss": "^8.4.6",
"postcss-loader": "^6.2.1",
@@ -162,24 +162,27 @@
"react-diff-viewer": "^3.1.1",
"react-dom": "^18.0.0",
"react-helmet": "^6.1.0",
"react-i18next": "^11.18.6",
"react-router-dom": "^5.1.2",
"react-router-navigation-prompt": "^1.9.6",
"react-select": "^3.0.8",
"react-simple-code-editor": "^0.11.0",
"react-sortable-hoc": "^2.0.0",
"react-toastify": "^8.2.0",
"sanitize-filename": "^1.6.3",
"sass": "^1.52.1",
"sass": "^1.55.0",
"sass-loader": "^12.6.0",
"sharp": "^0.29.3",
"sharp": "^0.31.1",
"slate": "^0.72.8",
"slate-history": "^0.66.0",
"slate-hyperscript": "^0.66.0",
"slate-react": "^0.72.1",
"style-loader": "^2.0.0",
"swc-loader": "^0.2.3",
"swc-minify-webpack-plugin": "^1.0.1",
"terser-webpack-plugin": "^5.0.3",
"ts-essentials": "^7.0.1",
"url-loader": "^4.1.1",
"use-context-selector": "^1.4.1",
"uuid": "^8.1.0",
"webpack": "^5.6.0",
"webpack-bundle-analyzer": "^4.4.1",
@@ -188,16 +191,13 @@
"webpack-hot-middleware": "^2.25.0"
},
"devDependencies": {
"@bahmutov/cy-api": "^2.1.3",
"@playwright/test": "^1.23.1",
"@release-it/conventional-changelog": "^2.0.0",
"@release-it/conventional-changelog": "^5.1.1",
"@swc/jest": "^0.2.24",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^13.0.1",
"@trbl/eslint-config": "^1.2.4",
"@types/asap": "^2.0.0",
"@types/babel__core": "^7.1.12",
"@types/babel__plugin-transform-runtime": "^7.9.1",
"@types/babel__preset-env": "^7.9.1",
"@types/body-parser": "^1.19.0",
"@types/compression": "^1.7.0",
"@types/conf": "^3.0.0",
@@ -222,6 +222,7 @@
"@types/mini-css-extract-plugin": "^1.2.1",
"@types/minimist": "^1.2.1",
"@types/mkdirp": "^1.0.1",
"@types/mongoose-aggregate-paginate-v2": "^1.0.5",
"@types/mongoose-paginate-v2": "^1.3.8",
"@types/node-fetch": "^2.5.7",
"@types/nodemailer": "^6.4.0",
@@ -232,6 +233,7 @@
"@types/passport-jwt": "^3.0.3",
"@types/passport-local": "^1.0.33",
"@types/pino": "^6.3.4",
"@types/pino-std-serializers": "^4.0.0",
"@types/pluralize": "^0.0.29",
"@types/prismjs": "^1.16.2",
"@types/prop-types": "^15.7.3",
@@ -256,8 +258,6 @@
"@types/webpack-hot-middleware": "2.25.3",
"@typescript-eslint/eslint-plugin": "^4.8.1",
"@typescript-eslint/parser": "4.0.1",
"babel-eslint": "^10.0.1",
"babel-plugin-ignore-html-and-css-imports": "^0.1.0",
"copyfiles": "^2.4.0",
"cross-env": "^7.0.2",
"eslint": "^6.8.0",
@@ -272,10 +272,13 @@
"get-port": "5.1.1",
"glob": "^8.0.3",
"graphql-request": "^3.4.0",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
"mongodb-memory-server": "^7.2.0",
"node-fetch": "2",
"nodemon": "^2.0.6",
"passport-strategy": "^1.0.0",
"release-it": "^14.2.2",
"release-it": "^15.5.0",
"rimraf": "^3.0.2",
"serve-static": "^1.14.2",
"shelljs": "^0.8.5",

View File

@@ -1,17 +1,28 @@
import qs from 'qs';
type GetOptions = RequestInit & {
params?: Record<string, unknown>
}
export const requests = {
get: (url: string, params: unknown = {}): Promise<Response> => {
const query = qs.stringify(params, { addQueryPrefix: true });
return fetch(`${url}${query}`);
get: (url: string, options: GetOptions = { headers: {} }): Promise<Response> => {
let query = '';
if (options.params) {
query = qs.stringify(options.params, { addQueryPrefix: true });
}
return fetch(`${url}${query}`, {
credentials: 'include',
headers: options.headers,
});
},
post: (url: string, options: RequestInit = { headers: {} }): Promise<Response> => {
const headers = options && options.headers ? { ...options.headers } : {};
const formattedOptions = {
const formattedOptions: RequestInit = {
...options,
method: 'post',
credentials: 'include',
headers: {
...headers,
},
@@ -23,9 +34,10 @@ export const requests = {
put: (url: string, options: RequestInit = { headers: {} }): Promise<Response> => {
const headers = options && options.headers ? { ...options.headers } : {};
const formattedOptions = {
const formattedOptions: RequestInit = {
...options,
method: 'put',
credentials: 'include',
headers: {
...headers,
},
@@ -37,9 +49,10 @@ export const requests = {
patch: (url: string, options: RequestInit = { headers: {} }): Promise<Response> => {
const headers = options && options.headers ? { ...options.headers } : {};
const formattedOptions = {
const formattedOptions: RequestInit = {
...options,
method: 'PATCH',
credentials: 'include',
headers: {
...headers,
},
@@ -50,12 +63,16 @@ export const requests = {
delete: (url: string, options: RequestInit = { headers: {} }): Promise<Response> => {
const headers = options && options.headers ? { ...options.headers } : {};
return fetch(url, {
const formattedOptions: RequestInit = {
...options,
method: 'delete',
credentials: 'include',
headers: {
...headers,
},
});
};
return fetch(url, formattedOptions);
},
};

View File

@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 124 30" style="enable-background:new 0 0 124 30;" xml:space="preserve">
<style type="text/css">
.st0{fill:#333333;}
</style>
<path class="st0" d="M34.813099,6.555H41.3451c1.385273-0.070708,2.751808,0.344133,3.863998,1.173
c1.039825,0.899059,1.586941,2.241208,1.472,3.611c0.111458,1.37593-0.434399,2.723513-1.472,3.634
c-1.118271,0.814574-2.4823,1.220535-3.863998,1.15h-4.461998V23h-2.07L34.813099,6.555z M41.483101,14.283
c0.822922,0.06823,1.639957-0.18761,2.277-0.713c0.549107-0.607606,0.823647-1.41459,0.758999-2.231
c0.067909-0.809881-0.207489-1.611044-0.758999-2.208c-0.630104-0.539837-1.450134-0.804896-2.277-0.736h-4.599998v5.888
L41.483101,14.283z M51.1646,23.321999c-1.024158,0.052488-2.03162-0.275143-2.828999-0.92
c-0.688705-0.609777-1.068405-1.495747-1.035-2.414999c-0.036377-0.737299,0.174046-1.465687,0.598-2.07
c0.430389-0.544542,1.003754-0.958641,1.655998-1.195999c0.89489-0.325996,1.819183-0.564774,2.759998-0.712999
c0.58239-0.095267,1.158451-0.225842,1.724998-0.391c0.333458-0.086607,0.64114-0.252282,0.896999-0.483
c0.209099-0.241613,0.316288-0.554937,0.299-0.874c0-1.150001-0.812668-1.725001-2.438-1.725
c-0.591373-0.020433-1.182041,0.057286-1.748001,0.23c-0.385189,0.128752-0.706268,0.400434-0.896999,0.759
c-0.208683,0.431378-0.32613,0.901169-0.345001,1.38h-1.931999c0.013546-1.106599,0.488823-2.157211,1.311001-2.898
c1.053455-0.797718,2.362473-1.182241,3.68-1.081c1.069542-0.048652,2.123863,0.267645,2.990002,0.897
c0.835869,0.720024,1.272713,1.799289,1.173,2.898v5.635c-0.016964,0.358055,0.029758,0.716278,0.138,1.058001
c0.066074,0.196636,0.252625,0.327223,0.459999,0.322001l0.276001-0.023001V23c-0.293846,0.071281-0.594673,0.10985-0.896999,0.115
c-0.448277,0.029144-0.891262-0.110313-1.242001-0.391001c-0.327774-0.411825-0.506161-0.922657-0.506001-1.448999h-0.046001
c-0.384689,0.646172-0.942337,1.171953-1.610001,1.518C52.844852,23.164421,52.008141,23.345972,51.1646,23.321999z
M49.232601,19.894999c-0.036285,0.504335,0.148373,0.999548,0.506001,1.357c0.461899,0.345982,1.035038,0.509735,1.610001,0.459999
c0.998661,0.049717,1.98558-0.233416,2.806-0.805c0.737389-0.586956,1.141094-1.497444,1.081001-2.438v-1.862997
c-0.836132,0.516708-1.781067,0.831686-2.759998,0.92c-0.881981,0.135984-1.731636,0.432194-2.507,0.874001
C49.478649,18.735281,49.199535,19.302231,49.232601,19.894999z M60.820301,27.116999
c-0.408855-0.003748-0.816658-0.042219-1.219002-0.115V25.438c0.305218,0.039368,0.612324,0.062401,0.919998,0.069
c0.560413-0.003313,1.097176-0.226274,1.494999-0.621c0.540234-0.546392,0.901249-1.244356,1.035-2.000999L58.290298,11.27h2.07
l3.611,9.338001h0.045998l3.449997-9.338h1.977997l-4.737999,12.075c-0.363663,1.095852-0.959949,2.100128-1.748001,2.944
C62.381443,26.833206,61.613956,27.130299,60.820301,27.116999z M70.9216,6.555h1.839996V23H70.9216V6.555z M80.542297,23.345001
c-1.079521,0.026121-2.145523-0.244358-3.082001-0.782c-0.857864-0.520388-1.54528-1.279743-1.977997-2.184999
c-0.473877-1.014378-0.709877-2.123568-0.690002-3.243c-0.021645-1.112206,0.214523-2.214319,0.690002-3.22
c0.42762-0.914654,1.1157-1.682744,1.977997-2.208c0.936478-0.537642,2.00248-0.80812,3.082001-0.782
c1.06498-0.026295,2.116249,0.244486,3.036003,0.782c0.872543,0.519647,1.569481,1.28868,2.000999,2.208
c0.475479,1.005681,0.711647,2.107795,0.690002,3.22c0.019875,1.119432-0.216125,2.228622-0.690002,3.243
c-0.436684,0.909891-1.132935,1.670162-2.000999,2.184999C82.658546,23.100515,81.607277,23.371294,80.542297,23.345001z
M76.724297,17.135002c-0.046257,1.179615,0.292839,2.342216,0.966003,3.312c1.374138,1.568766,3.759834,1.72654,5.328598,0.3524
c0.125099-0.109579,0.242821-0.227301,0.352402-0.3524c0.673164-0.969784,1.01226-2.132385,0.966003-3.312
c0.048729-1.172768-0.290817-2.328851-0.966003-3.289c-1.337448-1.568765-3.693398-1.756284-5.262161-0.418835
c-0.15049,0.128296-0.290543,0.268349-0.418839,0.418835C77.015114,14.80615,76.675568,15.962234,76.724297,17.135002z
M91.527,23.322001c-1.024162,0.052523-2.031639-0.275112-2.829002-0.92c-0.688705-0.609776-1.068413-1.495747-1.035004-2.415001
c-0.03643-0.737303,0.174004-1.465708,0.598-2.07c0.430344-0.544586,1.003731-0.958694,1.655998-1.195999
c0.894882-0.326023,1.819183-0.564798,2.760002-0.712999c0.582382-0.09529,1.158447-0.225863,1.724998-0.391
c0.333443-0.086654,0.641113-0.252322,0.897003-0.483c0.209061-0.241635,0.316246-0.554943,0.299004-0.874
c0-1.150001-0.812668-1.725001-2.438004-1.725c-0.59137-0.020441-1.182045,0.057279-1.748001,0.23
c-0.385193,0.128751-0.706268,0.400434-0.897003,0.759c-0.208679,0.431378-0.326126,0.901169-0.345001,1.38h-1.931992
c0.013458-1.106618,0.488747-2.157265,1.310997-2.898c1.053444-0.797748,2.362473-1.182275,3.68-1.081
c1.069534-0.048619,2.123848,0.267673,2.989998,0.897c0.835869,0.720024,1.272713,1.799289,1.172997,2.898v5.635
c-0.016968,0.358055,0.029762,0.716278,0.138,1.058001c0.066048,0.196655,0.252617,0.327251,0.459999,0.322001l0.276001-0.023001V23
c-0.293846,0.07127-0.594681,0.109838-0.897003,0.115c-0.44828,0.029177-0.891273-0.110285-1.241997-0.391001
c-0.32782-0.411802-0.50621-0.922649-0.505997-1.448999h-0.045998c-0.384743,0.646128-0.942375,1.171896-1.610001,1.518
C93.207245,23.1644,92.370537,23.345951,91.527,23.322001z M89.595001,19.895c-0.036331,0.504341,0.148331,0.999575,0.505997,1.357
c0.461891,0.345993,1.035042,0.509748,1.610001,0.459999c0.998657,0.049686,1.985565-0.233444,2.806-0.805
c0.73735-0.586985,1.141045-1.497452,1.081001-2.438v-1.862999c-0.836136,0.516708-1.781067,0.831686-2.760002,0.92
c-0.881989,0.135948-1.731651,0.432159-2.507004,0.874001C89.841019,18.73526,89.561897,19.302227,89.595001,19.895z
M104.834999,23.322001c-0.947945,0.009354-1.879768-0.245502-2.691002-0.736c-0.8218-0.53285-1.482002-1.280552-1.908997-2.162001
c-0.480354-1.028526-0.716568-2.154137-0.690201-3.289c-0.026367-1.134863,0.209846-2.260472,0.690201-3.289
c0.423233-0.877855,1.084732-1.61905,1.908997-2.139c0.806282-0.504401,1.739983-0.767752,2.691002-0.759
c1.464203-0.073218,2.860054,0.624707,3.68,1.84h0.045998V6.555h1.839996V23h-1.839996v-1.448999h-0.045998
C107.654121,22.710478,106.278236,23.372623,104.834999,23.322001z M101.476997,17.135
c-0.005173,0.768642,0.127243,1.532007,0.390999,2.254c0.23764,0.658501,0.651306,1.239225,1.195999,1.679001
c0.556534,0.43626,1.248146,0.664085,1.955002,0.643999c1.011169,0.03722,1.975395-0.427675,2.575996-1.242001
c0.683739-0.973391,1.023643-2.146864,0.966003-3.335001c0.060226-1.181292-0.280151-2.348316-0.966003-3.312
c-1.090065-1.404866-3.103142-1.680769-4.530998-0.621c-0.548683,0.445539-0.962761,1.034796-1.195999,1.702
C101.602959,15.617669,101.470459,16.373734,101.476997,17.135z M4.67358,7.05762L14.7263,13.5488v12.336999l7.560599-4.7103
V8.83849L12.2462,2.33875L4.67358,7.05762z M11.4765,25.201799v-9.627l-7.5766,4.7189L11.4765,25.201799z M117.998001,8.75976
c-0.004463-0.341642,0.059807-0.680696,0.189003-0.997c0.120857-0.290308,0.29792-0.553858,0.521004-0.77549
c0.22216-0.217432,0.485695-0.388062,0.775002-0.50178c0.304459-0.122437,0.629852-0.184414,0.958-0.18247
c0.326248-0.002423,0.649773,0.059586,0.952003,0.18247c0.585327,0.233346,1.050858,0.694288,1.290001,1.27727
c0.261337,0.636756,0.261337,1.350824,0,1.98758c-0.120064,0.290741-0.297226,0.554445-0.521004,0.77551
c-0.220543,0.214946-0.482063,0.383349-0.768997,0.4952c-0.303246,0.118704-0.626358,0.178439-0.952003,0.176
c-0.327545,0.001974-0.652542-0.057732-0.958-0.176c-0.288139-0.112983-0.551407-0.281204-0.775002-0.4952
c-0.221207-0.223182-0.39801-0.486349-0.521004-0.77551C118.058205,9.436166,117.993927,9.099288,117.998001,8.75976z
M118.480003,8.75976c-0.00351,0.28082,0.047432,0.559659,0.150002,0.8211c0.098404,0.234851,0.239838,0.449244,0.417,0.63214
c0.179451,0.174817,0.391914,0.312154,0.625,0.404c0.497253,0.191203,1.047745,0.191203,1.544998,0
c0.473839-0.185051,0.847771-0.561208,1.029999-1.03614c0.198669-0.531618,0.198669-1.117102,0-1.64872
c-0.184547-0.474923-0.557365-0.852327-1.029999-1.04267c-0.495613-0.199844-1.049385-0.199844-1.544998,0
c-0.234268,0.092577-0.446999,0.232318-0.625,0.41055c-0.179039,0.181376-0.320724,0.396147-0.417,0.63212
C118.527046,8.195745,118.476112,8.47679,118.480003,8.75976z M120.520004,8.97476h-0.496002v0.99053h-0.533997v-2.6001h0.794998
c0.172218-0.001235,0.344307,0.009652,0.514999,0.03258c0.134796,0.016075,0.265205,0.058123,0.384003,0.12382
c0.102715,0.05436,0.186691,0.138377,0.240997,0.24112c0.061989,0.127668,0.091194,0.268765,0.084999,0.41055
c0.000862,0.140271-0.03759,0.277979-0.111,0.39751c-0.086395,0.13219-0.211388,0.234577-0.358002,0.29325l0.598999,1.10132
h-0.593002L120.520004,8.97476z M120.976006,8.17976c0.014854-0.129661-0.053123-0.254731-0.169998-0.3128
c-0.137817-0.057799-0.286682-0.084499-0.435997-0.0782h-0.346001v0.77549h0.377998
c0.152237,0.012898,0.304764-0.02122,0.436996-0.09775c0.091606-0.065936,0.14325-0.174038,0.136993-0.28673L120.976006,8.17976z"/>
</svg>

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 124 30" style="enable-background:new 0 0 124 30;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FFFFFF;}
</style>
<path class="st0" d="M34.813099,6.555H41.3451c1.385273-0.070708,2.751808,0.344133,3.863998,1.173
c1.039825,0.899059,1.586941,2.241208,1.472,3.611c0.111458,1.37593-0.434399,2.723513-1.472,3.634
c-1.118271,0.814574-2.4823,1.220535-3.863998,1.15h-4.461998V23h-2.07L34.813099,6.555z M41.483101,14.283
c0.822922,0.06823,1.639957-0.18761,2.277-0.713c0.549107-0.607606,0.823647-1.41459,0.758999-2.231
c0.067909-0.809881-0.207489-1.611044-0.758999-2.208c-0.630104-0.539837-1.450134-0.804896-2.277-0.736h-4.599998v5.888
L41.483101,14.283z M51.1646,23.321999c-1.024158,0.052488-2.03162-0.275143-2.828999-0.92
c-0.688705-0.609777-1.068405-1.495747-1.035-2.414999c-0.036377-0.737299,0.174046-1.465687,0.598-2.07
c0.430389-0.544542,1.003754-0.958641,1.655998-1.195999c0.89489-0.325996,1.819183-0.564774,2.759998-0.712999
c0.58239-0.095267,1.158451-0.225842,1.724998-0.391c0.333458-0.086607,0.64114-0.252282,0.896999-0.483
c0.209099-0.241613,0.316288-0.554937,0.299-0.874c0-1.150001-0.812668-1.725001-2.438-1.725
c-0.591373-0.020433-1.182041,0.057286-1.748001,0.23c-0.385189,0.128752-0.706268,0.400434-0.896999,0.759
c-0.208683,0.431378-0.32613,0.901169-0.345001,1.38h-1.931999c0.013546-1.106599,0.488823-2.157211,1.311001-2.898
c1.053455-0.797718,2.362473-1.182241,3.68-1.081c1.069542-0.048652,2.123863,0.267645,2.990002,0.897
c0.835869,0.720024,1.272713,1.799289,1.173,2.898v5.635c-0.016964,0.358055,0.029758,0.716278,0.138,1.058001
c0.066074,0.196636,0.252625,0.327223,0.459999,0.322001l0.276001-0.023001V23c-0.293846,0.071281-0.594673,0.10985-0.896999,0.115
c-0.448277,0.029144-0.891262-0.110313-1.242001-0.391001c-0.327774-0.411825-0.506161-0.922657-0.506001-1.448999h-0.046001
c-0.384689,0.646172-0.942337,1.171953-1.610001,1.518C52.844852,23.164421,52.008141,23.345972,51.1646,23.321999z
M49.232601,19.894999c-0.036285,0.504335,0.148373,0.999548,0.506001,1.357c0.461899,0.345982,1.035038,0.509735,1.610001,0.459999
c0.998661,0.049717,1.98558-0.233416,2.806-0.805c0.737389-0.586956,1.141094-1.497444,1.081001-2.438v-1.862997
c-0.836132,0.516708-1.781067,0.831686-2.759998,0.92c-0.881981,0.135984-1.731636,0.432194-2.507,0.874001
C49.478649,18.735281,49.199535,19.302231,49.232601,19.894999z M60.820301,27.116999
c-0.408855-0.003748-0.816658-0.042219-1.219002-0.115V25.438c0.305218,0.039368,0.612324,0.062401,0.919998,0.069
c0.560413-0.003313,1.097176-0.226274,1.494999-0.621c0.540234-0.546392,0.901249-1.244356,1.035-2.000999L58.290298,11.27h2.07
l3.611,9.338001h0.045998l3.449997-9.338h1.977997l-4.737999,12.075c-0.363663,1.095852-0.959949,2.100128-1.748001,2.944
C62.381443,26.833206,61.613956,27.130299,60.820301,27.116999z M70.9216,6.555h1.839996V23H70.9216V6.555z M80.542297,23.345001
c-1.079521,0.026121-2.145523-0.244358-3.082001-0.782c-0.857864-0.520388-1.54528-1.279743-1.977997-2.184999
c-0.473877-1.014378-0.709877-2.123568-0.690002-3.243c-0.021645-1.112206,0.214523-2.214319,0.690002-3.22
c0.42762-0.914654,1.1157-1.682744,1.977997-2.208c0.936478-0.537642,2.00248-0.80812,3.082001-0.782
c1.06498-0.026295,2.116249,0.244486,3.036003,0.782c0.872543,0.519647,1.569481,1.28868,2.000999,2.208
c0.475479,1.005681,0.711647,2.107795,0.690002,3.22c0.019875,1.119432-0.216125,2.228622-0.690002,3.243
c-0.436684,0.909891-1.132935,1.670162-2.000999,2.184999C82.658546,23.100515,81.607277,23.371294,80.542297,23.345001z
M76.724297,17.135002c-0.046257,1.179615,0.292839,2.342216,0.966003,3.312c1.374138,1.568766,3.759834,1.72654,5.328598,0.3524
c0.125099-0.109579,0.242821-0.227301,0.352402-0.3524c0.673164-0.969784,1.01226-2.132385,0.966003-3.312
c0.048729-1.172768-0.290817-2.328851-0.966003-3.289c-1.337448-1.568765-3.693398-1.756284-5.262161-0.418835
c-0.15049,0.128296-0.290543,0.268349-0.418839,0.418835C77.015114,14.80615,76.675568,15.962234,76.724297,17.135002z
M91.527,23.322001c-1.024162,0.052523-2.031639-0.275112-2.829002-0.92c-0.688705-0.609776-1.068413-1.495747-1.035004-2.415001
c-0.03643-0.737303,0.174004-1.465708,0.598-2.07c0.430344-0.544586,1.003731-0.958694,1.655998-1.195999
c0.894882-0.326023,1.819183-0.564798,2.760002-0.712999c0.582382-0.09529,1.158447-0.225863,1.724998-0.391
c0.333443-0.086654,0.641113-0.252322,0.897003-0.483c0.209061-0.241635,0.316246-0.554943,0.299004-0.874
c0-1.150001-0.812668-1.725001-2.438004-1.725c-0.59137-0.020441-1.182045,0.057279-1.748001,0.23
c-0.385193,0.128751-0.706268,0.400434-0.897003,0.759c-0.208679,0.431378-0.326126,0.901169-0.345001,1.38h-1.931992
c0.013458-1.106618,0.488747-2.157265,1.310997-2.898c1.053444-0.797748,2.362473-1.182275,3.68-1.081
c1.069534-0.048619,2.123848,0.267673,2.989998,0.897c0.835869,0.720024,1.272713,1.799289,1.172997,2.898v5.635
c-0.016968,0.358055,0.029762,0.716278,0.138,1.058001c0.066048,0.196655,0.252617,0.327251,0.459999,0.322001l0.276001-0.023001V23
c-0.293846,0.07127-0.594681,0.109838-0.897003,0.115c-0.44828,0.029177-0.891273-0.110285-1.241997-0.391001
c-0.32782-0.411802-0.50621-0.922649-0.505997-1.448999h-0.045998c-0.384743,0.646128-0.942375,1.171896-1.610001,1.518
C93.207245,23.1644,92.370537,23.345951,91.527,23.322001z M89.595001,19.895c-0.036331,0.504341,0.148331,0.999575,0.505997,1.357
c0.461891,0.345993,1.035042,0.509748,1.610001,0.459999c0.998657,0.049686,1.985565-0.233444,2.806-0.805
c0.73735-0.586985,1.141045-1.497452,1.081001-2.438v-1.862999c-0.836136,0.516708-1.781067,0.831686-2.760002,0.92
c-0.881989,0.135948-1.731651,0.432159-2.507004,0.874001C89.841019,18.73526,89.561897,19.302227,89.595001,19.895z
M104.834999,23.322001c-0.947945,0.009354-1.879768-0.245502-2.691002-0.736c-0.8218-0.53285-1.482002-1.280552-1.908997-2.162001
c-0.480354-1.028526-0.716568-2.154137-0.690201-3.289c-0.026367-1.134863,0.209846-2.260472,0.690201-3.289
c0.423233-0.877855,1.084732-1.61905,1.908997-2.139c0.806282-0.504401,1.739983-0.767752,2.691002-0.759
c1.464203-0.073218,2.860054,0.624707,3.68,1.84h0.045998V6.555h1.839996V23h-1.839996v-1.448999h-0.045998
C107.654121,22.710478,106.278236,23.372623,104.834999,23.322001z M101.476997,17.135
c-0.005173,0.768642,0.127243,1.532007,0.390999,2.254c0.23764,0.658501,0.651306,1.239225,1.195999,1.679001
c0.556534,0.43626,1.248146,0.664085,1.955002,0.643999c1.011169,0.03722,1.975395-0.427675,2.575996-1.242001
c0.683739-0.973391,1.023643-2.146864,0.966003-3.335001c0.060226-1.181292-0.280151-2.348316-0.966003-3.312
c-1.090065-1.404866-3.103142-1.680769-4.530998-0.621c-0.548683,0.445539-0.962761,1.034796-1.195999,1.702
C101.602959,15.617669,101.470459,16.373734,101.476997,17.135z M4.67358,7.05762L14.7263,13.5488v12.336999l7.560599-4.7103
V8.83849L12.2462,2.33875L4.67358,7.05762z M11.4765,25.201799v-9.627l-7.5766,4.7189L11.4765,25.201799z M117.998001,8.75976
c-0.004463-0.341642,0.059807-0.680696,0.189003-0.997c0.120857-0.290308,0.29792-0.553858,0.521004-0.77549
c0.22216-0.217432,0.485695-0.388062,0.775002-0.50178c0.304459-0.122437,0.629852-0.184414,0.958-0.18247
c0.326248-0.002423,0.649773,0.059586,0.952003,0.18247c0.585327,0.233346,1.050858,0.694288,1.290001,1.27727
c0.261337,0.636756,0.261337,1.350824,0,1.98758c-0.120064,0.290741-0.297226,0.554445-0.521004,0.77551
c-0.220543,0.214946-0.482063,0.383349-0.768997,0.4952c-0.303246,0.118704-0.626358,0.178439-0.952003,0.176
c-0.327545,0.001974-0.652542-0.057732-0.958-0.176c-0.288139-0.112983-0.551407-0.281204-0.775002-0.4952
c-0.221207-0.223182-0.39801-0.486349-0.521004-0.77551C118.058205,9.436166,117.993927,9.099288,117.998001,8.75976z
M118.480003,8.75976c-0.00351,0.28082,0.047432,0.559659,0.150002,0.8211c0.098404,0.234851,0.239838,0.449244,0.417,0.63214
c0.179451,0.174817,0.391914,0.312154,0.625,0.404c0.497253,0.191203,1.047745,0.191203,1.544998,0
c0.473839-0.185051,0.847771-0.561208,1.029999-1.03614c0.198669-0.531618,0.198669-1.117102,0-1.64872
c-0.184547-0.474923-0.557365-0.852327-1.029999-1.04267c-0.495613-0.199844-1.049385-0.199844-1.544998,0
c-0.234268,0.092577-0.446999,0.232318-0.625,0.41055c-0.179039,0.181376-0.320724,0.396147-0.417,0.63212
C118.527046,8.195745,118.476112,8.47679,118.480003,8.75976z M120.520004,8.97476h-0.496002v0.99053h-0.533997v-2.6001h0.794998
c0.172218-0.001235,0.344307,0.009652,0.514999,0.03258c0.134796,0.016075,0.265205,0.058123,0.384003,0.12382
c0.102715,0.05436,0.186691,0.138377,0.240997,0.24112c0.061989,0.127668,0.091194,0.268765,0.084999,0.41055
c0.000862,0.140271-0.03759,0.277979-0.111,0.39751c-0.086395,0.13219-0.211388,0.234577-0.358002,0.29325l0.598999,1.10132
h-0.593002L120.520004,8.97476z M120.976006,8.17976c0.014854-0.129661-0.053123-0.254731-0.169998-0.3128
c-0.137817-0.057799-0.286682-0.084499-0.435997-0.0782h-0.346001v0.77549h0.377998
c0.152237,0.012898,0.304764-0.02122,0.436996-0.09775c0.091606-0.065936,0.14325-0.174038,0.136993-0.28673L120.976006,8.17976z"/>
</svg>

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

@@ -2,6 +2,7 @@ import React, { Suspense, lazy, useState, useEffect } from 'react';
import {
Route, Switch, withRouter, Redirect,
} from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { useAuth } from './utilities/Auth';
import { useConfig } from './utilities/Config';
import List from './views/collections/List';
@@ -12,6 +13,7 @@ import StayLoggedIn from './modals/StayLoggedIn';
import Versions from './views/Versions';
import Version from './views/Version';
import { DocumentInfoProvider } from './utilities/DocumentInfo';
import { useLocale } from './utilities/Locale';
const Dashboard = lazy(() => import('./views/Dashboard'));
const ForgotPassword = lazy(() => import('./views/ForgotPassword'));
@@ -29,12 +31,17 @@ const Account = lazy(() => import('./views/Account'));
const Routes = () => {
const [initialized, setInitialized] = useState(null);
const { user, permissions, refreshCookie } = useAuth();
const { i18n } = useTranslation();
const locale = useLocale();
const canAccessAdmin = permissions?.canAccessAdmin;
const config = useConfig();
const {
admin: {
user: userSlug,
logoutRoute,
inactivityRoute: logoutInactivityRoute,
components: {
routes: customRoutes,
} = {},
@@ -42,7 +49,8 @@ const Routes = () => {
routes,
collections,
globals,
} = useConfig();
} = config;
const userCollection = collections.find(({ slug }) => slug === userSlug);
@@ -50,7 +58,11 @@ const Routes = () => {
const { slug } = userCollection;
if (!userCollection.auth.disableLocalStrategy) {
requests.get(`${routes.api}/${slug}/init`).then((res) => res.json().then((data) => {
requests.get(`${routes.api}/${slug}/init`, {
headers: {
'Accept-Language': i18n.language,
},
}).then((res) => res.json().then((data) => {
if (data && 'initialized' in data) {
setInitialized(data.initialized);
}
@@ -58,7 +70,7 @@ const Routes = () => {
} else {
setInitialized(true);
}
}, [routes, userCollection]);
}, [i18n.language, routes, userCollection]);
return (
<Suspense fallback={<Loading />}>
@@ -103,10 +115,10 @@ const Routes = () => {
<Route path={`${match.url}/login`}>
<Login />
</Route>
<Route path={`${match.url}/logout`}>
<Route path={`${match.url}${logoutRoute}`}>
<Logout />
</Route>
<Route path={`${match.url}/logout-inactivity`}>
<Route path={`${match.url}${logoutInactivityRoute}`}>
<Logout inactivity />
</Route>
@@ -208,6 +220,7 @@ const Routes = () => {
if (permissions?.collections?.[collection.slug]?.read?.permission) {
return (
<DocumentInfoProvider
key={`${collection.slug}-edit-${id}-${locale}`}
collection={collection}
id={id}
>
@@ -280,7 +293,10 @@ const Routes = () => {
render={(routeProps) => {
if (permissions?.globals?.[global.slug]?.read?.permission) {
return (
<DocumentInfoProvider global={global}>
<DocumentInfoProvider
global={global}
key={`${global.slug}-${locale}`}
>
<EditGlobal
{...routeProps}
global={global}

View File

@@ -1,4 +1,5 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import Popup from '../Popup';
import More from '../../icons/More';
import Chevron from '../../icons/Chevron';
@@ -19,6 +20,7 @@ export const ArrayAction: React.FC<Props> = ({
duplicateRow,
removeRow,
}) => {
const { t } = useTranslation('general');
return (
<Popup
horizontalAlign="center"
@@ -38,7 +40,7 @@ export const ArrayAction: React.FC<Props> = ({
}}
>
<Chevron />
Move Up
{t('moveUp')}
</button>
)}
{index < rowCount - 1 && (
@@ -51,7 +53,7 @@ export const ArrayAction: React.FC<Props> = ({
}}
>
<Chevron />
Move Down
{t('moveDown')}
</button>
)}
<button
@@ -63,7 +65,7 @@ export const ArrayAction: React.FC<Props> = ({
}}
>
<Plus />
Add Below
{t('addBelow')}
</button>
<button
className={`${baseClass}__action ${baseClass}__duplicate`}
@@ -74,7 +76,7 @@ export const ArrayAction: React.FC<Props> = ({
}}
>
<Copy />
Duplicate
{t('duplicate')}
</button>
<button
className={`${baseClass}__action ${baseClass}__remove`}
@@ -85,7 +87,7 @@ export const ArrayAction: React.FC<Props> = ({
}}
>
<X />
Remove
{t('remove')}
</button>
</React.Fragment>
);

View File

@@ -1,9 +1,9 @@
import { formatDistance } from 'date-fns';
import { useHistory } from 'react-router-dom';
import { toast } from 'react-toastify';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useConfig } from '../../utilities/Config';
import { useWatchForm, useFormModified } from '../../forms/Form/context';
import { useFormModified, useAllFormFields } from '../../forms/Form/context';
import { useLocale } from '../../utilities/Locale';
import { Props } from './types';
import reduceFieldsToValues from '../../forms/Form/reduceFieldsToValues';
@@ -17,10 +17,11 @@ const baseClass = 'autosave';
const Autosave: React.FC<Props> = ({ collection, global, id, publishedDocUpdatedAt }) => {
const { serverURL, routes: { api, admin } } = useConfig();
const { versions, getVersions } = useDocumentInfo();
const { fields, dispatchFields } = useWatchForm();
const [fields] = useAllFormFields();
const modified = useFormModified();
const locale = useLocale();
const { replace } = useHistory();
const { t, i18n } = useTranslation('version');
let interval = 800;
if (collection?.versions.drafts && collection.versions?.drafts?.autosave) interval = collection.versions.drafts.autosave.interval;
@@ -30,17 +31,25 @@ const Autosave: React.FC<Props> = ({ collection, global, id, publishedDocUpdated
const [lastSaved, setLastSaved] = useState<number>();
const debouncedFields = useDebounce(fields, interval);
const fieldRef = useRef(fields);
const modifiedRef = useRef(modified);
// Store fields in ref so the autosave func
// can always retrieve the most to date copies
// after the timeout has executed
fieldRef.current = fields;
// Store modified in ref so the autosave func
// can bail out if modified becomes false while
// timing out during autosave
modifiedRef.current = modified;
const createCollectionDoc = useCallback(async () => {
const res = await fetch(`${serverURL}${api}/${collection.slug}?locale=${locale}&fallback-locale=null&depth=0&draft=true`, {
method: 'POST',
credentials: 'include',
headers: {
'Content-Type': 'application/json',
'Accept-Language': i18n.language,
},
body: JSON.stringify({}),
});
@@ -53,9 +62,9 @@ const Autosave: React.FC<Props> = ({ collection, global, id, publishedDocUpdated
},
});
} else {
toast.error('There was a problem while autosaving this document.');
toast.error(t('error:autosaving'));
}
}, [collection, serverURL, api, admin, locale, replace]);
}, [i18n, serverURL, api, collection, locale, replace, admin, t]);
useEffect(() => {
// If no ID, but this is used for a collection doc,
@@ -87,32 +96,36 @@ const Autosave: React.FC<Props> = ({ collection, global, id, publishedDocUpdated
if (url) {
const body = {
...reduceFieldsToValues(fieldRef.current),
...reduceFieldsToValues(fieldRef.current, true),
_status: 'draft',
};
setTimeout(async () => {
const res = await fetch(url, {
method,
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
});
if (modifiedRef.current) {
const res = await fetch(url, {
method,
credentials: 'include',
headers: {
'Content-Type': 'application/json',
'Accept-Language': i18n.language,
},
body: JSON.stringify(body),
});
if (res.status === 200) {
setLastSaved(new Date().getTime());
getVersions();
}
}
setSaving(false);
if (res.status === 200) {
setLastSaved(new Date().getTime());
getVersions();
}
}, 1000);
}
}
};
autosave();
}, [debouncedFields, modified, serverURL, api, collection, global, id, dispatchFields, getVersions, locale]);
}, [i18n, debouncedFields, modified, serverURL, api, collection, global, id, getVersions, locale, modifiedRef]);
useEffect(() => {
if (versions?.docs?.[0]) {
@@ -124,12 +137,12 @@ const Autosave: React.FC<Props> = ({ collection, global, id, publishedDocUpdated
return (
<div className={baseClass}>
{saving && 'Saving...'}
{saving && t('saving')}
{(!saving && lastSaved) && (
<React.Fragment>
Last saved&nbsp;
{formatDistance(new Date(), new Date(lastSaved))}
&nbsp;ago
{t('lastSavedAgo', {
distance: Math.round((Number(new Date(lastSaved)) - Number(new Date())) / 1000 / 60),
})}
</React.Fragment>
)}
</div>

View File

@@ -6,7 +6,7 @@ import './index.scss';
const baseClass = 'banner';
const Banner: React.FC<Props> = ({
export const Banner: React.FC<Props> = ({
children,
className,
to,

View File

@@ -22,22 +22,6 @@
&--has-tooltip {
position: relative;
}
.btn__tooltip {
opacity: 0;
visibility: hidden;
transform: translate(-50%, -10px);
}
.btn__content {
&:hover {
.btn__tooltip {
opacity: 1;
visibility: visible;
}
}
}
&--icon-style-without-border {

View File

@@ -1,4 +1,4 @@
import React, { isValidElement } from 'react';
import React, { Fragment, isValidElement } from 'react';
import { Link } from 'react-router-dom';
import { Props } from './types';
@@ -21,30 +21,31 @@ const icons = {
const baseClass = 'btn';
const ButtonContents = ({ children, icon, tooltip }) => {
const ButtonContents = ({ children, icon, tooltip, showTooltip }) => {
const BuiltInIcon = icons[icon];
return (
<span
className={`${baseClass}__content`}
>
{tooltip && (
<Tooltip className={`${baseClass}__tooltip`}>
{tooltip}
</Tooltip>
)}
{children && (
<span className={`${baseClass}__label`}>
{children}
</span>
)}
{icon && (
<span className={`${baseClass}__icon`}>
{isValidElement(icon) && icon}
{BuiltInIcon && <BuiltInIcon />}
</span>
)}
</span>
<Fragment>
<Tooltip
className={`${baseClass}__tooltip`}
show={showTooltip}
>
{tooltip}
</Tooltip>
<span className={`${baseClass}__content`}>
{children && (
<span className={`${baseClass}__label`}>
{children}
</span>
)}
{icon && (
<span className={`${baseClass}__icon`}>
{isValidElement(icon) && icon}
{BuiltInIcon && <BuiltInIcon />}
</span>
)}
</span>
</Fragment>
);
};
@@ -53,7 +54,7 @@ const Button: React.FC<Props> = (props) => {
className,
id,
type = 'button',
el,
el = 'button',
to,
url,
children,
@@ -69,6 +70,8 @@ const Button: React.FC<Props> = (props) => {
tooltip,
} = props;
const [showTooltip, setShowTooltip] = React.useState(false);
const classes = [
baseClass,
className && className,
@@ -84,6 +87,7 @@ const Button: React.FC<Props> = (props) => {
].filter(Boolean).join(' ');
function handleClick(event) {
setShowTooltip(false);
if (type !== 'submit' && onClick) event.preventDefault();
if (onClick) onClick(event);
}
@@ -93,6 +97,8 @@ const Button: React.FC<Props> = (props) => {
type,
className: classes,
disabled,
onMouseEnter: tooltip ? () => setShowTooltip(true) : undefined,
onMouseLeave: tooltip ? () => setShowTooltip(false) : undefined,
onClick: !disabled ? handleClick : undefined,
rel: newTab ? 'noopener noreferrer' : undefined,
target: newTab ? '_blank' : undefined,
@@ -108,6 +114,7 @@ const Button: React.FC<Props> = (props) => {
<ButtonContents
icon={icon}
tooltip={tooltip}
showTooltip={showTooltip}
>
{children}
</ButtonContents>
@@ -123,6 +130,7 @@ const Button: React.FC<Props> = (props) => {
<ButtonContents
icon={icon}
tooltip={tooltip}
showTooltip={showTooltip}
>
{children}
</ButtonContents>
@@ -130,18 +138,21 @@ const Button: React.FC<Props> = (props) => {
);
default:
const Tag = el; // eslint-disable-line no-case-declarations
return (
<button
<Tag
type="submit"
{...buttonProps}
>
<ButtonContents
icon={icon}
tooltip={tooltip}
showTooltip={showTooltip}
>
{children}
</ButtonContents>
</button>
</Tag>
);
}
};

View File

@@ -1,10 +1,10 @@
import React, { MouseEvent } from 'react';
import React, { ElementType, MouseEvent } from 'react';
export type Props = {
className?: string,
id?: string,
type?: 'submit' | 'button',
el?: 'link' | 'anchor' | undefined,
el?: 'link' | 'anchor' | ElementType,
to?: string,
url?: string,
children?: React.ReactNode,

View File

@@ -0,0 +1,21 @@
@import '../../../scss/styles';
.code-editor {
@include formInput;
height: auto;
padding: 0;
.monaco-editor {
.view-overlays .current-line {
max-width: calc(100% - 14px);
border-width: 0px;
}
&:focus-within {
.view-overlays .current-line {
border-right: 0;
border-width: 1px;
}
}
}
}

View File

@@ -0,0 +1,44 @@
import React from 'react';
import Editor from '@monaco-editor/react';
import type { Props } from './types';
import { useTheme } from '../../utilities/Theme';
import './index.scss';
const baseClass = 'code-editor';
const CodeEditor: React.FC<Props> = (props) => {
const { readOnly, className, options, ...rest } = props;
const { theme } = useTheme();
const classes = [
baseClass,
className,
rest?.defaultLanguage ? `language--${rest.defaultLanguage}` : '',
].filter(Boolean).join(' ');
return (
<Editor
height="35vh"
className={classes}
theme={theme === 'dark' ? 'vs-dark' : 'vs'}
options={
{
detectIndentation: true,
minimap: {
enabled: false,
},
readOnly: Boolean(readOnly),
scrollBeyondLastLine: false,
tabSize: 2,
wordWrap: 'on',
...options,
}
}
{...rest}
/>
);
};
export default CodeEditor;

View File

@@ -0,0 +1,5 @@
import type { EditorProps } from '@monaco-editor/react';
export type Props = EditorProps & {
readOnly?: boolean
}

View File

@@ -15,6 +15,10 @@
position: relative;
}
&--nested {
margin-bottom: $baseline !important;
}
&--hovered {
>.collapsible__toggle-wrap>.collapsible__drag {
opacity: 1;
@@ -102,7 +106,7 @@
background-color: var(--theme-elevation-0);
border-bottom-left-radius: $style-radius-s;
border-bottom-right-radius: $style-radius-s;
padding: $baseline;
padding: $baseline $baseline 0 $baseline;
}
@include small-break {

Some files were not shown because too many files have changed in this diff Show More