## Description
Adds a new property to `collection` / `global` configs called
`lockDocuments`.
Set to `true` by default - the lock is automatically triggered when a
user begins editing a document within the Admin Panel and remains in
place until the user exits the editing view or the lock expires due to
inactivity.
Set to `false` to disable document locking entirely - i.e.
`lockDocuments: false`
You can pass an object to this property to configure the `duration` in
seconds, which defines how long the document remains locked without user
interaction. If no edits are made within the specified time (default:
300 seconds), the lock expires, allowing other users to edit / update or
delete the document.
```
lockDocuments: {
duration: 180, // 180 seconds or 3 minutes
}
```
- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.
## Type of change
- [x] New feature (non-breaking change which adds functionality)
## Checklist:
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] Existing test suite passes locally with my changes
- [x] I have made corresponding changes to the documentation
249 lines
7.6 KiB
JSON
249 lines
7.6 KiB
JSON
{
|
|
// Use IntelliSense to learn about possible attributes.
|
|
// Hover to view descriptions of existing attributes.
|
|
"configurations": [
|
|
{
|
|
"command": "pnpm generate:types",
|
|
"name": "Generate Types CLI",
|
|
"request": "launch",
|
|
"type": "node-terminal",
|
|
"cwd": "${workspaceFolder}"
|
|
},
|
|
{
|
|
"command": "node --no-deprecation test/dev.js _community",
|
|
"cwd": "${workspaceFolder}",
|
|
"name": "Run Dev Community",
|
|
"request": "launch",
|
|
"type": "node-terminal"
|
|
},
|
|
{
|
|
"command": "node --no-deprecation test/dev.js storage-uploadthing",
|
|
"cwd": "${workspaceFolder}",
|
|
"name": "Uploadthing",
|
|
"request": "launch",
|
|
"type": "node-terminal",
|
|
"envFile": "${workspaceFolder}/test/storage-uploadthing/.env"
|
|
},
|
|
{
|
|
"command": "node --no-deprecation test/dev.js live-preview",
|
|
"cwd": "${workspaceFolder}",
|
|
"name": "Run Dev Live Preview",
|
|
"request": "launch",
|
|
"type": "node-terminal"
|
|
},
|
|
{
|
|
"command": "node --no-deprecation test/loader/init.js",
|
|
"cwd": "${workspaceFolder}",
|
|
"name": "Run Loader",
|
|
"request": "launch",
|
|
"type": "node-terminal",
|
|
"env": {
|
|
"LOADER_TEST_FILE_PATH": "./dependency-test.js"
|
|
// "LOADER_TEST_FILE_PATH": "../fields/config.ts"
|
|
}
|
|
},
|
|
{
|
|
"command": "node --no-deprecation test/dev.js admin",
|
|
"cwd": "${workspaceFolder}",
|
|
"name": "Run Dev Admin",
|
|
"request": "launch",
|
|
"type": "node-terminal"
|
|
},
|
|
{
|
|
"command": "node --no-deprecation test/dev.js auth",
|
|
"cwd": "${workspaceFolder}",
|
|
"name": "Run Dev Auth",
|
|
"request": "launch",
|
|
"type": "node-terminal"
|
|
},
|
|
{
|
|
"command": "node --no-deprecation test/dev.js fields-relationship",
|
|
"cwd": "${workspaceFolder}",
|
|
"name": "Run Dev Fields-Relationship",
|
|
"request": "launch",
|
|
"type": "node-terminal"
|
|
},
|
|
{
|
|
"command": "node --no-deprecation test/dev.js login-with-username",
|
|
"cwd": "${workspaceFolder}",
|
|
"name": "Run Dev Login-With-Username",
|
|
"request": "launch",
|
|
"type": "node-terminal"
|
|
},
|
|
{
|
|
"command": "pnpm run dev plugin-cloud-storage",
|
|
"cwd": "${workspaceFolder}",
|
|
"name": "Run Dev - plugin-cloud-storage",
|
|
"request": "launch",
|
|
"type": "node-terminal",
|
|
"env": {
|
|
"PAYLOAD_PUBLIC_CLOUD_STORAGE_ADAPTER": "s3"
|
|
}
|
|
},
|
|
{
|
|
"command": "node --no-deprecation test/dev.js collections-graphql",
|
|
"cwd": "${workspaceFolder}",
|
|
"name": "Run Dev GraphQL",
|
|
"request": "launch",
|
|
"type": "node-terminal"
|
|
},
|
|
{
|
|
"command": "node --no-deprecation test/dev.js fields",
|
|
"cwd": "${workspaceFolder}",
|
|
"name": "Run Dev Fields",
|
|
"request": "launch",
|
|
"type": "node-terminal"
|
|
},
|
|
{
|
|
"command": "node --no-deprecation test/dev.js versions",
|
|
"cwd": "${workspaceFolder}",
|
|
"name": "Run Dev Postgres",
|
|
"request": "launch",
|
|
"type": "node-terminal",
|
|
"env": {
|
|
"PAYLOAD_DATABASE": "postgres"
|
|
}
|
|
},
|
|
{
|
|
"command": "node --no-deprecation test/dev.js versions",
|
|
"cwd": "${workspaceFolder}",
|
|
"name": "Run Dev Versions",
|
|
"request": "launch",
|
|
"type": "node-terminal"
|
|
},
|
|
{
|
|
"command": "node --no-deprecation test/dev.js localization",
|
|
"cwd": "${workspaceFolder}",
|
|
"name": "Run Dev Localization",
|
|
"request": "launch",
|
|
"type": "node-terminal"
|
|
},
|
|
{
|
|
"command": "node --no-deprecation test/dev.js locked-documents",
|
|
"cwd": "${workspaceFolder}",
|
|
"name": "Run Dev Locked Documents",
|
|
"request": "launch",
|
|
"type": "node-terminal"
|
|
},
|
|
{
|
|
"command": "node --no-deprecation test/dev.js uploads",
|
|
"cwd": "${workspaceFolder}",
|
|
"name": "Run Dev Uploads",
|
|
"request": "launch",
|
|
"type": "node-terminal"
|
|
},
|
|
{
|
|
"command": "node --no-deprecation test/dev.js field-error-states",
|
|
"cwd": "${workspaceFolder}",
|
|
"name": "Run Dev Field Error States",
|
|
"request": "launch",
|
|
"type": "node-terminal"
|
|
},
|
|
{
|
|
"command": "pnpm run test:int live-preview",
|
|
"cwd": "${workspaceFolder}",
|
|
"name": "Live Preview Int Tests",
|
|
"request": "launch",
|
|
"type": "node-terminal"
|
|
},
|
|
{
|
|
"command": "pnpm run test:int plugin-search",
|
|
"cwd": "${workspaceFolder}",
|
|
"name": "Search Plugin Int Tests",
|
|
"request": "launch",
|
|
"type": "node-terminal"
|
|
},
|
|
{
|
|
"command": "ts-node ./packages/payload/src/bin/index.ts build",
|
|
"env": {
|
|
"PAYLOAD_CONFIG_PATH": "test/fields/config.ts",
|
|
"PAYLOAD_BUNDLER": "vite",
|
|
"DISABLE_SWC": "true" // SWC messes up debugging the bin scripts
|
|
},
|
|
"name": "Build CLI - Vite",
|
|
"outputCapture": "std",
|
|
"request": "launch",
|
|
"type": "node-terminal"
|
|
},
|
|
{
|
|
"command": "ts-node ./packages/payload/src/bin/index.ts build",
|
|
"env": {
|
|
"PAYLOAD_CONFIG_PATH": "test/fields/config.ts",
|
|
"PAYLOAD_ANALYZE_BUNDLE": "true",
|
|
"DISABLE_SWC": "true" // SWC messes up debugging the bin scripts
|
|
},
|
|
"name": "Build CLI - Webpack",
|
|
"outputCapture": "std",
|
|
"request": "launch",
|
|
"type": "node-terminal"
|
|
},
|
|
{
|
|
"command": "ts-node ./packages/payload/src/bin/index.ts migrate:status",
|
|
"env": {
|
|
"PAYLOAD_CONFIG_PATH": "test/migrations-cli/config.ts",
|
|
"PAYLOAD_DATABASE": "postgres",
|
|
"DISABLE_SWC": "true" // SWC messes up debugging the bin scripts
|
|
// "PAYLOAD_DROP_DATABASE": "true",
|
|
},
|
|
"name": "Migrate CLI - status",
|
|
"outputCapture": "std",
|
|
"request": "launch",
|
|
"type": "node-terminal"
|
|
},
|
|
{
|
|
"command": "ts-node ./packages/payload/src/bin/index.ts migrate:create yass",
|
|
"env": {
|
|
"PAYLOAD_CONFIG_PATH": "test/migrations-cli/config.ts",
|
|
"PAYLOAD_DATABASE": "postgres",
|
|
"DISABLE_SWC": "true" // SWC messes up debugging the bin scripts
|
|
// "PAYLOAD_DROP_DATABASE": "true",
|
|
},
|
|
"name": "Migrate CLI - create",
|
|
"outputCapture": "std",
|
|
"request": "launch",
|
|
"type": "node-terminal"
|
|
},
|
|
{
|
|
"command": "ts-node ./packages/payload/src/bin/index.ts migrate:down",
|
|
"env": {
|
|
"PAYLOAD_CONFIG_PATH": "test/migrations-cli/config.ts",
|
|
"PAYLOAD_DATABASE": "mongoose",
|
|
"DISABLE_SWC": "true" // SWC messes up debugging the bin scripts
|
|
// "PAYLOAD_DROP_DATABASE": "true",
|
|
},
|
|
"name": "Migrate CLI - down",
|
|
"outputCapture": "std",
|
|
"request": "launch",
|
|
"type": "node-terminal"
|
|
},
|
|
{
|
|
"command": "ts-node ./packages/payload/src/bin/index.ts migrate:reset",
|
|
"env": {
|
|
"PAYLOAD_CONFIG_PATH": "test/migrations-cli/config.ts",
|
|
"PAYLOAD_DATABASE": "mongoose",
|
|
"DISABLE_SWC": "true" // SWC messes up debugging the bin scripts
|
|
// "PAYLOAD_DROP_DATABASE": "true",
|
|
},
|
|
"name": "Migrate CLI - reset",
|
|
"outputCapture": "std",
|
|
"request": "launch",
|
|
"type": "node-terminal"
|
|
},
|
|
{
|
|
"command": "ts-node ./packages/payload/src/bin/index.ts migrate:refresh",
|
|
"env": {
|
|
"PAYLOAD_CONFIG_PATH": "test/migrations-cli/config.ts",
|
|
"PAYLOAD_DATABASE": "mongoose",
|
|
"DISABLE_SWC": "true" // SWC messes up debugging the bin scripts
|
|
// "PAYLOAD_DROP_DATABASE": "true",
|
|
},
|
|
"name": "Migrate CLI - refresh",
|
|
"outputCapture": "std",
|
|
"request": "launch",
|
|
"type": "node-terminal"
|
|
}
|
|
],
|
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
"version": "0.2.0"
|
|
}
|