mirror of
https://github.com/xtr-dev/payload-automation.git
synced 2025-12-12 09:43:22 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0fb23cb425 | |||
| 45c5847f5a |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@xtr-dev/payload-workflows",
|
"name": "@xtr-dev/payload-workflows",
|
||||||
"version": "0.0.26",
|
"version": "0.0.27",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@xtr-dev/payload-workflows",
|
"name": "@xtr-dev/payload-workflows",
|
||||||
"version": "0.0.26",
|
"version": "0.0.27",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"jsonpath-plus": "^10.3.0",
|
"jsonpath-plus": "^10.3.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@xtr-dev/payload-automation",
|
"name": "@xtr-dev/payload-automation",
|
||||||
"version": "0.0.26",
|
"version": "0.0.27",
|
||||||
"description": "PayloadCMS Automation Plugin - Comprehensive workflow automation system with visual workflow building, execution tracking, and step types",
|
"description": "PayloadCMS Automation Plugin - Comprehensive workflow automation system with visual workflow building, execution tracking, and step types",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -296,34 +296,9 @@ export const createWorkflowCollection: <T extends string>(options: WorkflowsPlug
|
|||||||
required: false
|
required: false
|
||||||
},
|
},
|
||||||
// Virtual fields for custom triggers
|
// Virtual fields for custom triggers
|
||||||
...(triggers || []).flatMap(t => (t.inputs || []).filter(f => 'name' in f && f.name).map(f => ({
|
// Note: Custom trigger fields from trigger-helpers already have unique names
|
||||||
...f,
|
// We just need to pass them through without modification
|
||||||
// Prefix field name with trigger slug to avoid conflicts
|
...(triggers || []).flatMap(t => (t.inputs || []))
|
||||||
name: `__${t.slug}_${(f as any).name}`,
|
|
||||||
admin: {
|
|
||||||
...(f.admin || {}),
|
|
||||||
condition: (...args) => args[1]?.type === t.slug && (
|
|
||||||
f.admin?.condition ?
|
|
||||||
f.admin.condition.call(this, ...args) :
|
|
||||||
true
|
|
||||||
),
|
|
||||||
},
|
|
||||||
hooks: {
|
|
||||||
afterRead: [
|
|
||||||
({ siblingData }) => {
|
|
||||||
return siblingData?.parameters?.[(f as any).name] || undefined
|
|
||||||
}
|
|
||||||
],
|
|
||||||
beforeChange: [
|
|
||||||
({ siblingData, value }) => {
|
|
||||||
if (!siblingData.parameters) {siblingData.parameters = {}}
|
|
||||||
siblingData.parameters[(f as any).name] = value
|
|
||||||
return undefined // Virtual field, don't store directly
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
virtual: true,
|
|
||||||
} as Field)))
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user