@aglyn/plugins-workflows 1.0.0-beta.220 → 1.0.0-beta.222
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -14
- package/package.json +12 -12
- package/src/lib/components/automation-step-fields.component.d.ts +1 -15
- package/src/lib/components/automation-step-fields.component.js +93 -10
- package/src/lib/components/automation-step-fields.component.js.map +1 -1
- package/src/lib/components/automation-trigger-conditions.component.d.ts +2 -1
- package/src/lib/components/automation-trigger-conditions.component.js.map +1 -1
- package/src/lib/components/host-actions-card.component.js +85 -77
- package/src/lib/components/host-actions-card.component.js.map +1 -1
- package/src/lib/components/host-webhooks-card.component.js +2 -1
- package/src/lib/components/host-webhooks-card.component.js.map +1 -1
- package/src/lib/components/host-workflows-card.component.js.map +1 -1
- package/src/lib/components/org-automation-editor.component.d.ts +2 -1
- package/src/lib/components/org-automation-editor.component.js.map +1 -1
- package/src/lib/components/org-automations-card.component.js +2 -1
- package/src/lib/components/org-automations-card.component.js.map +1 -1
- package/src/lib/components/run-quota-line.component.d.ts +17 -4
- package/src/lib/components/run-quota-line.component.js +16 -7
- package/src/lib/components/run-quota-line.component.js.map +1 -1
- package/src/lib/components/site-org-automations-panel.component.js +2 -1
- package/src/lib/components/site-org-automations-panel.component.js.map +1 -1
- package/src/lib/components/workflows-console-page.js +18 -7
- package/src/lib/components/workflows-console-page.js.map +1 -1
- package/src/lib/declarations.d.ts +28 -0
- package/src/lib/declarations.js +37 -0
- package/src/lib/declarations.js.map +1 -0
- package/src/lib/declarations.server.js +17 -0
- package/src/lib/declarations.server.js.map +1 -1
- package/src/lib/engine/run-event-actions.d.ts +5 -10
- package/src/lib/engine/run-event-actions.js +147 -330
- package/src/lib/engine/run-event-actions.js.map +1 -1
- package/src/lib/engine/run-event-automations.d.ts +1 -1
- package/src/lib/engine/run-event-automations.js.map +1 -1
- package/src/lib/engine/run-event-workflows.d.ts +2 -1
- package/src/lib/engine/run-event-workflows.js +27 -22
- package/src/lib/engine/run-event-workflows.js.map +1 -1
- package/src/lib/engine/run-meter.d.ts +98 -0
- package/src/lib/engine/run-meter.js +121 -0
- package/src/lib/engine/run-meter.js.map +1 -0
- package/src/lib/engine/run-org-automations.d.ts +3 -2
- package/src/lib/engine/run-org-automations.js +14 -11
- package/src/lib/engine/run-org-automations.js.map +1 -1
- package/src/lib/engine/workflow-steps.d.ts +1 -1
- package/src/lib/engine/workflow-steps.js +3 -2
- package/src/lib/engine/workflow-steps.js.map +1 -1
- package/src/lib/model/host-actions.d.ts +231 -0
- package/src/lib/model/host-actions.js +268 -0
- package/src/lib/model/host-actions.js.map +1 -0
- package/src/lib/model/org-automations.d.ts +2 -1
- package/src/lib/model/org-automations.js +6 -3
- package/src/lib/model/org-automations.js.map +1 -1
- package/src/lib/model/step-outcomes.d.ts +2 -2
- package/src/lib/model/step-outcomes.js +1 -1
- package/src/lib/model/step-outcomes.js.map +1 -1
- package/src/lib/plugin.js +10 -0
- package/src/lib/plugin.js.map +1 -1
- package/src/lib/server/action-test-run-route.d.ts +3 -2
- package/src/lib/server/action-test-run-route.js +3 -2
- package/src/lib/server/action-test-run-route.js.map +1 -1
- package/src/lib/server/org-automations-routes.d.ts +42 -1
- package/src/lib/server/org-automations-routes.js +120 -72
- package/src/lib/server/org-automations-routes.js.map +1 -1
- package/src/lib/server-automation-drafts.d.ts +2 -2
- package/src/lib/server-automation-drafts.js +9 -6
- package/src/lib/server-automation-drafts.js.map +1 -1
- package/src/lib/server.js +19 -13
- package/src/lib/server.js.map +1 -1
- package/src/lib/testing/stand-in-crm-steps.d.ts +45 -0
- package/src/lib/testing/stand-in-crm-steps.js +97 -0
- package/src/lib/testing/stand-in-crm-steps.js.map +1 -0
- package/src/lib/testing/stand-in-dataset-list.js +11 -3
- package/src/lib/testing/stand-in-dataset-list.js.map +1 -1
- package/src/lib/testing/stand-in-dataset-steps.d.ts +43 -0
- package/src/lib/testing/stand-in-dataset-steps.js +65 -0
- package/src/lib/testing/stand-in-dataset-steps.js.map +1 -0
- package/src/lib/testing/stand-in-person-records.d.ts +35 -0
- package/src/lib/testing/stand-in-person-records.js +54 -0
- package/src/lib/testing/stand-in-person-records.js.map +1 -0
- package/src/lib/testing/stand-in-recipes.d.ts +35 -0
- package/src/lib/testing/stand-in-recipes.js +201 -0
- package/src/lib/testing/stand-in-recipes.js.map +1 -0
- package/src/lib/transfer/org-automations-package.d.ts +54 -0
- package/src/lib/transfer/org-automations-package.js +167 -0
- package/src/lib/transfer/org-automations-package.js.map +1 -0
- package/src/lib/transfer/org-automations-package.server.d.ts +38 -0
- package/src/lib/transfer/org-automations-package.server.js +296 -0
- package/src/lib/transfer/org-automations-package.server.js.map +1 -0
- package/src/lib/usage-axes.js +5 -1
- package/src/lib/usage-axes.js.map +1 -1
- package/src/lib/engine/crm-action-steps.d.ts +0 -142
- package/src/lib/engine/crm-action-steps.js +0 -452
- package/src/lib/engine/crm-action-steps.js.map +0 -1
package/README.md
CHANGED
|
@@ -26,13 +26,15 @@ runs an automation:
|
|
|
26
26
|
- `run-event-workflows.ts` and `run-event-actions.ts` — the runners. A host
|
|
27
27
|
event runs the workflows triggered by it and the actions listening for it;
|
|
28
28
|
the site-event dispatch runs one action a published page fired.
|
|
29
|
-
- `run-event-actions.ts` also holds the step executors —
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
- `run-event-actions.ts` also holds the step executors — email, webhooks,
|
|
30
|
+
lists, campaigns, alerts, custom events — and the flow steps — behind
|
|
31
|
+
`runServerStep`, one step at a time, which is what lets a workflow perform
|
|
32
|
+
an Actions step without a second copy of any of them. A step that writes
|
|
33
|
+
another plugin's records — a dataset row, a contact's stage — is handed to
|
|
34
|
+
the executor that plugin registered on the server-step seam
|
|
35
|
+
(`plugin-server-steps`). Its `executeWorkflow` is the workflow half:
|
|
36
|
+
function calls through the pure evaluator, Actions steps through that
|
|
37
|
+
executor, in one scope.
|
|
36
38
|
- `flow-enrollments.ts` — where a person waits between one step of a flow and
|
|
37
39
|
the next, resumed by the `resume-flow-waits` job. A workflow's enrollment id
|
|
38
40
|
is kept apart from an action's, so the two kinds never share a row.
|
|
@@ -75,13 +77,17 @@ the page view is core's own, and every other event is declared under
|
|
|
75
77
|
`hostEvents` by the plugin whose doors raise it. What only the engine reads
|
|
76
78
|
is this plugin's: the run history's past-tense step phrases
|
|
77
79
|
(`model/step-outcomes.ts`), a webhook's stored shape and its URL guard
|
|
78
|
-
(`model/webhooks.ts`)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
this plugin
|
|
80
|
+
(`model/webhooks.ts`) and the event-chaining depth (`model/workflows.ts`). The
|
|
81
|
+
automation vocabulary — the server steps' shapes, the flow's bounds and each
|
|
82
|
+
server step's checks — is this plugin's too (`model/host-actions.ts`). The
|
|
83
|
+
plugins that write automations without loading this one meet it through core
|
|
84
|
+
seams: each step's name, hold and typed fields are declared under
|
|
85
|
+
`interactionSteps` in `plugins.config.json`; the checks are registered from
|
|
86
|
+
this plugin's `declarations` entry (`interaction-step-checks`), so a recipe the
|
|
87
|
+
CRM installs or a draft the AI grades is refused as this editor would refuse
|
|
88
|
+
it; the stored shape and the slice a visitor's page receives are core's
|
|
89
|
+
(`site-interactions`); and a drafted automation is handed over through the
|
|
90
|
+
`automation` resource's draft writer (`server-automation-drafts.ts`).
|
|
85
91
|
|
|
86
92
|
## Entry points
|
|
87
93
|
|
|
@@ -90,6 +96,8 @@ this plugin.
|
|
|
90
96
|
flow-resume job, the automation draft writer, the org automation doors, and
|
|
91
97
|
the Actions card's test run (`automations/actions/test-run`, console only —
|
|
92
98
|
the page runtime's `events/dispatch` is a tenant route).
|
|
99
|
+
- `./declarations` — the server steps' checks, registered in both apps and in
|
|
100
|
+
the console's browser before any surface loads.
|
|
93
101
|
- `./declarations.server` — the boot registration above.
|
|
94
102
|
|
|
95
103
|
## License
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/plugins-workflows",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.222",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://aglyn.com",
|
|
6
6
|
"repository": {
|
|
@@ -25,17 +25,17 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aglyn/aglyn": "1.0.0-beta.
|
|
29
|
-
"@aglyn/shared-data-mdi": "1.0.0-beta.
|
|
30
|
-
"@aglyn/shared-ui-jsx": "1.0.0-beta.
|
|
31
|
-
"@aglyn/shared-ui-next": "1.0.0-beta.
|
|
32
|
-
"@aglyn/shared-ui-snackstack": "1.0.0-beta.
|
|
33
|
-
"@aglyn/shared-util-email": "1.0.0-beta.
|
|
34
|
-
"@aglyn/shared-util-http": "1.0.0-beta.
|
|
35
|
-
"@aglyn/shared-util-timestamp": "1.0.0-beta.
|
|
36
|
-
"@aglyn/tenant-data-admin": "1.0.0-beta.
|
|
37
|
-
"@aglyn/tenant-feature-instance": "1.0.0-beta.
|
|
38
|
-
"@aglyn/tenant-runtime": "1.0.0-beta.
|
|
28
|
+
"@aglyn/aglyn": "1.0.0-beta.222",
|
|
29
|
+
"@aglyn/shared-data-mdi": "1.0.0-beta.222",
|
|
30
|
+
"@aglyn/shared-ui-jsx": "1.0.0-beta.222",
|
|
31
|
+
"@aglyn/shared-ui-next": "1.0.0-beta.222",
|
|
32
|
+
"@aglyn/shared-ui-snackstack": "1.0.0-beta.222",
|
|
33
|
+
"@aglyn/shared-util-email": "1.0.0-beta.222",
|
|
34
|
+
"@aglyn/shared-util-http": "1.0.0-beta.222",
|
|
35
|
+
"@aglyn/shared-util-timestamp": "1.0.0-beta.222",
|
|
36
|
+
"@aglyn/tenant-data-admin": "1.0.0-beta.222",
|
|
37
|
+
"@aglyn/tenant-feature-instance": "1.0.0-beta.222",
|
|
38
|
+
"@aglyn/tenant-runtime": "1.0.0-beta.222",
|
|
39
39
|
"@swc/helpers": "0.5.23"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ONE STEP EDITOR FOR BOTH AUTOMATION BUILDERS (AGL-3105).
|
|
3
|
-
*
|
|
4
|
-
* A step's fields belong to the step, not to the card the step is edited on.
|
|
5
|
-
* The Actions builder and the Workflows builder both hold an ordered list of
|
|
6
|
-
* steps, and a workflow step may be any server-side Actions step, so the
|
|
7
|
-
* fields it takes — which dataset, which campaign, how long to wait, what to
|
|
8
|
-
* say — are asked here and in one place. A second copy would be two editors
|
|
9
|
-
* of one vocabulary, drifting a field at a time.
|
|
10
|
-
*
|
|
11
|
-
* What the card keeps is the list: what "Add step" builds, how many are
|
|
12
|
-
* allowed, and what a kind the Actions vocabulary does not hold looks like —
|
|
13
|
-
* a workflow's function call, handed in as `fields`.
|
|
14
|
-
*/
|
|
15
|
-
import { type HostActionStep, type HostActionStepType } from '@aglyn/aglyn';
|
|
16
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { HostActionStep, HostActionStepType } from '../model/host-actions';
|
|
17
3
|
/**
|
|
18
4
|
* What a field holding a placeholder shows: an error state and what to do
|
|
19
5
|
* about it. A placeholder is a value a person still has to supply, written in
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/ 'use client';
|
|
17
17
|
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
18
|
+
import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
|
|
18
19
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
20
|
/**
|
|
20
21
|
* ONE STEP EDITOR FOR BOTH AUTOMATION BUILDERS (AGL-3105).
|
|
@@ -29,9 +30,23 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
29
30
|
* What the card keeps is the list: what "Add step" builds, how many are
|
|
30
31
|
* allowed, and what a kind the Actions vocabulary does not hold looks like —
|
|
31
32
|
* a workflow's function call, handed in as `fields`.
|
|
32
|
-
*/ import { CONTACT_LIFECYCLE_STAGE_LABELS, CONTACT_LIFECYCLE_STAGES, CONTACT_TAG_MAX_LENGTH, CRM_ACTIVITY_KIND_LABELS, CRM_ACTIVITY_KINDS, CRM_TASK_KIND_LABELS, CRM_TASK_KINDS, CRM_TASK_MAX_DUE_DAYS, HOST_EVENT_TYPES, hostEventLabel, isInteractionAttributeAllowed } from "@aglyn/aglyn";
|
|
33
|
-
import { automationPlaceholderIn } from "@aglyn/aglyn/app-utils/automation-placeholders";
|
|
33
|
+
*/ import { CONTACT_LIFECYCLE_STAGE_LABELS, CONTACT_LIFECYCLE_STAGES, CONTACT_TAG_MAX_LENGTH, CRM_ACTIVITY_DIRECTION_LABELS, CRM_ACTIVITY_DIRECTIONS, CRM_ACTIVITY_KIND_LABELS, CRM_ACTIVITY_KINDS, CRM_TASK_KIND_LABELS, CRM_TASK_KINDS, CRM_TASK_MAX_DUE_DAYS, HOST_EVENT_TYPES, hostEventLabel, isInteractionAttributeAllowed } from "@aglyn/aglyn";
|
|
34
34
|
import { IconButton, MenuItem, Stack, TextField, Typography } from "@mui/material";
|
|
35
|
+
import { draftPlaceholderIn } from "@aglyn/aglyn/app-utils/draft-placeholders";
|
|
36
|
+
/** A task's priorities, by meaning, as the create-task step offers them (AGL-3517). */ const TASK_PRIORITY_OPTIONS = [
|
|
37
|
+
{
|
|
38
|
+
value: 'high',
|
|
39
|
+
label: 'High'
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
value: 'normal',
|
|
43
|
+
label: 'Normal'
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
value: 'low',
|
|
47
|
+
label: 'Low'
|
|
48
|
+
}
|
|
49
|
+
];
|
|
35
50
|
/**
|
|
36
51
|
* The durations a wait may be set to, from the picker.
|
|
37
52
|
*
|
|
@@ -120,7 +135,7 @@ import { IconButton, MenuItem, Stack, TextField, Typography } from "@mui/materia
|
|
|
120
135
|
* square brackets where it belongs — an automation drafted for review carries
|
|
121
136
|
* one wherever it could not name a real record or did not know a fact.
|
|
122
137
|
*/ export function placeholderState(value, help) {
|
|
123
|
-
return
|
|
138
|
+
return draftPlaceholderIn(value) ? {
|
|
124
139
|
error: true,
|
|
125
140
|
helperText: help
|
|
126
141
|
} : {};
|
|
@@ -129,7 +144,7 @@ import { IconButton, MenuItem, Stack, TextField, Typography } from "@mui/materia
|
|
|
129
144
|
* A picker whose stored reference is a placeholder name and no id: the record
|
|
130
145
|
* the draft asked for, which the site did not have when it was written.
|
|
131
146
|
*/ function placeholderReference(name, id, noun) {
|
|
132
|
-
const words = String(id != null ? id : '').trim() ? null :
|
|
147
|
+
const words = String(id != null ? id : '').trim() ? null : draftPlaceholderIn(name);
|
|
133
148
|
return words ? {
|
|
134
149
|
error: true,
|
|
135
150
|
helperText: `Pick the ${noun} — the draft asked for “${words}”`
|
|
@@ -327,8 +342,8 @@ export function defaultStep(type) {
|
|
|
327
342
|
* One step's row: its number, what it does, the fields that kind takes, and
|
|
328
343
|
* the condition that gates it.
|
|
329
344
|
*/ export function AutomationStepFields({ step, index, kind, kinds, stepForKind, pickers, onSteps, fields }) {
|
|
330
|
-
var _ref, _step_workflowId, _step_severity, _ref1, _step_webhookId, _ref2, _step_datasetId, _step_overlayId, _step_selector, _step_selector1, _step_className, _step_selector2, _step_selector3, _step_offsetPx, _step_selector4, _step_name, _step_value, _step_drawerNodeId, _step_menuNodeId, _step_html, _step_code, _step_url, _step_eventName, _step_subject, _step_body, _step_title, _step_listId, _step_campaignId, _step_lifecycleStage, _step_tag, _step_title1, _step_kind, _step_dueInDays, _step_kind1, _step_body1, _step_eventName1, _step_timeoutMinutes, _step_delayMinutes, _ref3, _step_when_conditions__field, _step_when_conditions__value;
|
|
331
|
-
var _workflowOptions_find, _webhookOptions_find, _datasetOptions_find, _step_when_conditions_, _step_when_conditions, _step_when, _step_when_conditions_1, _step_when_conditions1, _step_when1, _step_when_conditions_2, _step_when_conditions2, _step_when2, _step_when_conditions_3, _step_when_conditions3, _step_when3;
|
|
345
|
+
var _ref, _step_workflowId, _step_severity, _ref1, _step_webhookId, _ref2, _step_datasetId, _step_overlayId, _step_selector, _step_selector1, _step_className, _step_selector2, _step_selector3, _step_offsetPx, _step_selector4, _step_name, _step_value, _step_drawerNodeId, _step_menuNodeId, _step_html, _step_code, _step_url, _step_eventName, _step_subject, _step_body, _step_title, _step_listId, _step_campaignId, _step_lifecycleStage, _step_tag, _step_title1, _step_kind, _step_priority, _step_dueInDays, _step_kind1, _step_direction, _CRM_ACTIVITY_DIRECTIONS_step_kind, _step_body1, _step_eventName1, _step_timeoutMinutes, _step_delayMinutes, _ref3, _step_when_conditions__field, _step_when_conditions__value;
|
|
346
|
+
var _workflowOptions_find, _webhookOptions_find, _datasetOptions_find, _CRM_ACTIVITY_DIRECTIONS_step_kind1, _step_when_conditions_, _step_when_conditions, _step_when, _step_when_conditions_1, _step_when_conditions1, _step_when1, _step_when_conditions_2, _step_when_conditions2, _step_when2, _step_when_conditions_3, _step_when_conditions3, _step_when3;
|
|
332
347
|
const { workflowOptions, datasetOptions, overlayOptions, listOptions, campaignOptions, webhookOptions } = pickers;
|
|
333
348
|
/*
|
|
334
349
|
* The list, edited as a draft holding it — the shape both cards' own
|
|
@@ -962,7 +977,7 @@ export function defaultStep(type) {
|
|
|
962
977
|
})),
|
|
963
978
|
/*#__PURE__*/ _jsx(TextField, {
|
|
964
979
|
select: true,
|
|
965
|
-
label: "
|
|
980
|
+
label: "Type",
|
|
966
981
|
value: (_step_kind = step.kind) != null ? _step_kind : '',
|
|
967
982
|
onChange: (event)=>patch((previous)=>_extends({}, previous, {
|
|
968
983
|
steps: previous.steps.map((s, index2)=>index2 === index && s.type === 'createCrmTask' ? _extends({}, s, {
|
|
@@ -978,6 +993,24 @@ export function defaultStep(type) {
|
|
|
978
993
|
children: CRM_TASK_KIND_LABELS[kind]
|
|
979
994
|
}, kind))
|
|
980
995
|
}),
|
|
996
|
+
/*#__PURE__*/ _jsx(TextField, {
|
|
997
|
+
select: true,
|
|
998
|
+
label: "Priority",
|
|
999
|
+
value: (_step_priority = step.priority) != null ? _step_priority : 'normal',
|
|
1000
|
+
onChange: (event)=>patch((previous)=>_extends({}, previous, {
|
|
1001
|
+
steps: previous.steps.map((s, index2)=>index2 === index && s.type === 'createCrmTask' ? _extends({}, s, {
|
|
1002
|
+
priority: event.target.value
|
|
1003
|
+
}) : s)
|
|
1004
|
+
})),
|
|
1005
|
+
size: "small",
|
|
1006
|
+
sx: {
|
|
1007
|
+
minWidth: 110
|
|
1008
|
+
},
|
|
1009
|
+
children: TASK_PRIORITY_OPTIONS.map((option)=>/*#__PURE__*/ _jsx(MenuItem, {
|
|
1010
|
+
value: option.value,
|
|
1011
|
+
children: option.label
|
|
1012
|
+
}, option.value))
|
|
1013
|
+
}),
|
|
981
1014
|
/*#__PURE__*/ _jsx(TextField, {
|
|
982
1015
|
type: "number",
|
|
983
1016
|
label: "Due in (days)",
|
|
@@ -1012,9 +1045,21 @@ export function defaultStep(type) {
|
|
|
1012
1045
|
label: "Kind",
|
|
1013
1046
|
value: (_step_kind1 = step.kind) != null ? _step_kind1 : '',
|
|
1014
1047
|
onChange: (event)=>patch((previous)=>_extends({}, previous, {
|
|
1015
|
-
steps: previous.steps.map((s, index2)=>
|
|
1016
|
-
|
|
1017
|
-
|
|
1048
|
+
steps: previous.steps.map((s, index2)=>{
|
|
1049
|
+
var _CRM_ACTIVITY_DIRECTIONS_kind;
|
|
1050
|
+
if (index2 !== index || s.type !== 'logCrmActivity') return s;
|
|
1051
|
+
const kind = event.target.value;
|
|
1052
|
+
// A direction the new kind does not take goes with the old one.
|
|
1053
|
+
const { direction } = s, rest = _object_without_properties_loose(s, [
|
|
1054
|
+
"direction"
|
|
1055
|
+
]);
|
|
1056
|
+
return direction && ((_CRM_ACTIVITY_DIRECTIONS_kind = CRM_ACTIVITY_DIRECTIONS[kind]) != null ? _CRM_ACTIVITY_DIRECTIONS_kind : []).includes(direction) ? _extends({}, rest, {
|
|
1057
|
+
kind,
|
|
1058
|
+
direction
|
|
1059
|
+
}) : _extends({}, rest, {
|
|
1060
|
+
kind
|
|
1061
|
+
});
|
|
1062
|
+
})
|
|
1018
1063
|
})),
|
|
1019
1064
|
size: "small",
|
|
1020
1065
|
sx: {
|
|
@@ -1025,6 +1070,44 @@ export function defaultStep(type) {
|
|
|
1025
1070
|
children: CRM_ACTIVITY_KIND_LABELS[kind]
|
|
1026
1071
|
}, kind))
|
|
1027
1072
|
}),
|
|
1073
|
+
((_CRM_ACTIVITY_DIRECTIONS_step_kind1 = CRM_ACTIVITY_DIRECTIONS[step.kind]) == null ? void 0 : _CRM_ACTIVITY_DIRECTIONS_step_kind1.length) ? /*#__PURE__*/ _jsxs(TextField, {
|
|
1074
|
+
select: true,
|
|
1075
|
+
label: "Direction",
|
|
1076
|
+
value: (_step_direction = step.direction) != null ? _step_direction : '',
|
|
1077
|
+
onChange: (event)=>patch((previous)=>_extends({}, previous, {
|
|
1078
|
+
steps: previous.steps.map((s, index2)=>{
|
|
1079
|
+
if (index2 !== index || s.type !== 'logCrmActivity') return s;
|
|
1080
|
+
const { direction: _direction } = s, rest = _object_without_properties_loose(s, [
|
|
1081
|
+
"direction"
|
|
1082
|
+
]);
|
|
1083
|
+
return event.target.value ? _extends({}, rest, {
|
|
1084
|
+
direction: event.target.value
|
|
1085
|
+
}) : rest;
|
|
1086
|
+
})
|
|
1087
|
+
})),
|
|
1088
|
+
size: "small",
|
|
1089
|
+
sx: {
|
|
1090
|
+
minWidth: 120
|
|
1091
|
+
},
|
|
1092
|
+
slotProps: {
|
|
1093
|
+
select: {
|
|
1094
|
+
displayEmpty: true
|
|
1095
|
+
},
|
|
1096
|
+
inputLabel: {
|
|
1097
|
+
shrink: true
|
|
1098
|
+
}
|
|
1099
|
+
},
|
|
1100
|
+
children: [
|
|
1101
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
1102
|
+
value: "",
|
|
1103
|
+
children: 'Not said'
|
|
1104
|
+
}),
|
|
1105
|
+
((_CRM_ACTIVITY_DIRECTIONS_step_kind = CRM_ACTIVITY_DIRECTIONS[step.kind]) != null ? _CRM_ACTIVITY_DIRECTIONS_step_kind : []).map((direction)=>/*#__PURE__*/ _jsx(MenuItem, {
|
|
1106
|
+
value: direction,
|
|
1107
|
+
children: CRM_ACTIVITY_DIRECTION_LABELS[direction]
|
|
1108
|
+
}, direction))
|
|
1109
|
+
]
|
|
1110
|
+
}) : null,
|
|
1028
1111
|
/*#__PURE__*/ _jsx(TextField, _extends({
|
|
1029
1112
|
label: "What happened"
|
|
1030
1113
|
}, placeholderState(step.body, 'Fill in the placeholders'), {
|