@open-mercato/core 0.5.1-develop.2953.6647bb2c43 → 0.5.1-develop.2954.610bab2d08
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/dist/helpers/integration/salesUi.js +25 -23
- package/dist/helpers/integration/salesUi.js.map +2 -2
- package/dist/modules/api_docs/frontend/docs/api/Explorer.js +24 -24
- package/dist/modules/api_docs/frontend/docs/api/Explorer.js.map +2 -2
- package/dist/modules/attachments/components/AttachmentPartitionSettings.js +15 -7
- package/dist/modules/attachments/components/AttachmentPartitionSettings.js.map +2 -2
- package/dist/modules/attachments/fields/attachment.js +4 -6
- package/dist/modules/attachments/fields/attachment.js.map +2 -2
- package/dist/modules/auth/backend/users/create/page.js +26 -26
- package/dist/modules/auth/backend/users/create/page.js.map +2 -2
- package/dist/modules/business_rules/components/ActionRow.js +36 -25
- package/dist/modules/business_rules/components/ActionRow.js.map +2 -2
- package/dist/modules/business_rules/components/ConditionGroup.js +14 -5
- package/dist/modules/business_rules/components/ConditionGroup.js.map +2 -2
- package/dist/modules/business_rules/components/ConditionRow.js +19 -10
- package/dist/modules/business_rules/components/ConditionRow.js.map +2 -2
- package/dist/modules/business_rules/components/RuleSetMembers.js +16 -10
- package/dist/modules/business_rules/components/RuleSetMembers.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js +30 -34
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/create/page.js +220 -223
- package/dist/modules/catalog/backend/catalog/products/create/page.js.map +2 -2
- package/dist/modules/catalog/components/PriceKindSettings.js +20 -19
- package/dist/modules/catalog/components/PriceKindSettings.js.map +2 -2
- package/dist/modules/catalog/components/products/ProductUomSection.js +42 -37
- package/dist/modules/catalog/components/products/ProductUomSection.js.map +2 -2
- package/dist/modules/catalog/components/products/VariantBuilder.js +22 -18
- package/dist/modules/catalog/components/products/VariantBuilder.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js +18 -26
- package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js +4 -6
- package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js.map +2 -2
- package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js +5 -4
- package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js.map +2 -2
- package/dist/modules/customers/backend/config/customers/pipeline-stages/page.js +19 -7
- package/dist/modules/customers/backend/config/customers/pipeline-stages/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/pipeline/page.js +24 -21
- package/dist/modules/customers/backend/customers/deals/pipeline/page.js.map +2 -2
- package/dist/modules/customers/components/AddressEditor.js +24 -7
- package/dist/modules/customers/components/AddressEditor.js.map +2 -2
- package/dist/modules/customers/components/AddressFormatSettings.js +35 -25
- package/dist/modules/customers/components/AddressFormatSettings.js.map +2 -2
- package/dist/modules/customers/components/detail/ActivityForm.js +20 -12
- package/dist/modules/customers/components/detail/ActivityForm.js.map +2 -2
- package/dist/modules/customers/components/detail/AnnualRevenueField.js +2 -2
- package/dist/modules/customers/components/detail/AnnualRevenueField.js.map +2 -2
- package/dist/modules/customers/components/detail/DealForm.js +19 -14
- package/dist/modules/customers/components/detail/DealForm.js.map +2 -2
- package/dist/modules/customers/components/formConfig.js +16 -12
- package/dist/modules/customers/components/formConfig.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js +3 -2
- package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js +18 -10
- package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js +3 -2
- package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js +3 -2
- package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js.map +2 -2
- package/dist/modules/dashboards/components/WidgetVisibilityEditor.js +27 -28
- package/dist/modules/dashboards/components/WidgetVisibilityEditor.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js +14 -6
- package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js +14 -6
- package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js +3 -2
- package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js +3 -2
- package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js +17 -8
- package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js.map +2 -2
- package/dist/modules/data_sync/backend/data-sync/page.js +40 -23
- package/dist/modules/data_sync/backend/data-sync/page.js.map +2 -2
- package/dist/modules/data_sync/components/IntegrationScheduleTab.js +15 -6
- package/dist/modules/data_sync/components/IntegrationScheduleTab.js.map +2 -2
- package/dist/modules/dictionaries/components/AppearanceSelector.js +4 -4
- package/dist/modules/dictionaries/components/AppearanceSelector.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js +4 -5
- package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionaryEntrySelect.js +22 -14
- package/dist/modules/dictionaries/components/DictionaryEntrySelect.js.map +2 -2
- package/dist/modules/dictionaries/fields/dictionary.js +18 -13
- package/dist/modules/dictionaries/fields/dictionary.js.map +2 -2
- package/dist/modules/entities/components/EncryptionManager.js +23 -19
- package/dist/modules/entities/components/EncryptionManager.js.map +2 -2
- package/dist/modules/feature_toggles/components/formConfig.js +17 -9
- package/dist/modules/feature_toggles/components/formConfig.js.map +2 -2
- package/dist/modules/feature_toggles/components/overrideFormConfig.js +17 -9
- package/dist/modules/feature_toggles/components/overrideFormConfig.js.map +2 -2
- package/dist/modules/inbox_ops/backend/inbox-ops/settings/page.js +15 -8
- package/dist/modules/inbox_ops/backend/inbox-ops/settings/page.js.map +2 -2
- package/dist/modules/inbox_ops/components/proposals/EditActionDialog.js +37 -22
- package/dist/modules/inbox_ops/components/proposals/EditActionDialog.js.map +2 -2
- package/dist/modules/integrations/backend/integrations/[id]/page.js +22 -17
- package/dist/modules/integrations/backend/integrations/[id]/page.js.map +2 -2
- package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js +12 -6
- package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js.map +2 -2
- package/dist/modules/planner/components/AvailabilityRulesEditor.js +19 -12
- package/dist/modules/planner/components/AvailabilityRulesEditor.js.map +2 -2
- package/dist/modules/resources/components/ResourceCrudForm.js +15 -10
- package/dist/modules/resources/components/ResourceCrudForm.js.map +3 -3
- package/dist/modules/sales/backend/sales/documents/[id]/page.js +15 -18
- package/dist/modules/sales/backend/sales/documents/[id]/page.js.map +2 -2
- package/dist/modules/sales/components/ProviderFieldInput.js +23 -20
- package/dist/modules/sales/components/ProviderFieldInput.js.map +2 -2
- package/dist/modules/sales/components/ShippingMethodsSettings.js +25 -17
- package/dist/modules/sales/components/ShippingMethodsSettings.js.map +3 -3
- package/dist/modules/sales/components/channels/ChannelOfferForm.js +35 -42
- package/dist/modules/sales/components/channels/ChannelOfferForm.js.map +2 -2
- package/dist/modules/sales/components/documents/AddressesSection.js +87 -90
- package/dist/modules/sales/components/documents/AddressesSection.js.map +2 -2
- package/dist/modules/sales/components/documents/AdjustmentDialog.js +17 -6
- package/dist/modules/sales/components/documents/AdjustmentDialog.js.map +3 -3
- package/dist/modules/sales/components/documents/LineItemDialog.js +42 -25
- package/dist/modules/sales/components/documents/LineItemDialog.js.map +2 -2
- package/dist/modules/sales/components/documents/SalesDocumentForm.js +96 -87
- package/dist/modules/sales/components/documents/SalesDocumentForm.js.map +2 -2
- package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js +20 -11
- package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js.map +2 -2
- package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js +20 -11
- package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js.map +2 -2
- package/dist/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.js +36 -22
- package/dist/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.js.map +2 -2
- package/dist/modules/staff/components/TeamMemberForm.js +14 -9
- package/dist/modules/staff/components/TeamMemberForm.js.map +3 -3
- package/dist/modules/workflows/backend/tasks/[id]/page.js +42 -21
- package/dist/modules/workflows/backend/tasks/[id]/page.js.map +2 -2
- package/dist/modules/workflows/components/ActivitiesEditor.js +14 -6
- package/dist/modules/workflows/components/ActivitiesEditor.js.map +3 -3
- package/dist/modules/workflows/components/DefinitionTriggersEditor.js +25 -17
- package/dist/modules/workflows/components/DefinitionTriggersEditor.js.map +3 -3
- package/dist/modules/workflows/components/EdgeEditDialog.js +48 -45
- package/dist/modules/workflows/components/EdgeEditDialog.js.map +2 -2
- package/dist/modules/workflows/components/NodeEditDialog.js +90 -90
- package/dist/modules/workflows/components/NodeEditDialog.js.map +2 -2
- package/dist/modules/workflows/components/StepsEditor.js +14 -6
- package/dist/modules/workflows/components/StepsEditor.js.map +3 -3
- package/dist/modules/workflows/components/TransitionsEditor.js +31 -26
- package/dist/modules/workflows/components/TransitionsEditor.js.map +3 -3
- package/dist/modules/workflows/components/fields/ActivityArrayEditor.js +19 -11
- package/dist/modules/workflows/components/fields/ActivityArrayEditor.js.map +3 -3
- package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js +12 -14
- package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js.map +2 -2
- package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js +24 -16
- package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js.map +3 -3
- package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js +12 -13
- package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js.map +2 -2
- package/dist/modules/workflows/components/mobile/MobileTaskForm.js +12 -8
- package/dist/modules/workflows/components/mobile/MobileTaskForm.js.map +2 -2
- package/dist/modules/workflows/frontend/checkout-demo/page.js +43 -46
- package/dist/modules/workflows/frontend/checkout-demo/page.js.map +2 -2
- package/package.json +3 -3
- package/src/helpers/integration/salesUi.ts +40 -30
- package/src/modules/api_docs/frontend/docs/api/Explorer.tsx +25 -19
- package/src/modules/attachments/components/AttachmentPartitionSettings.tsx +21 -11
- package/src/modules/attachments/fields/attachment.tsx +4 -6
- package/src/modules/auth/backend/users/create/page.tsx +16 -20
- package/src/modules/business_rules/components/ActionRow.tsx +51 -32
- package/src/modules/business_rules/components/ConditionGroup.tsx +20 -9
- package/src/modules/business_rules/components/ConditionRow.tsx +24 -15
- package/src/modules/business_rules/components/RuleSetMembers.tsx +23 -13
- package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +47 -53
- package/src/modules/catalog/backend/catalog/products/create/page.tsx +84 -87
- package/src/modules/catalog/components/PriceKindSettings.tsx +9 -9
- package/src/modules/catalog/components/products/ProductUomSection.tsx +85 -83
- package/src/modules/catalog/components/products/VariantBuilder.tsx +49 -33
- package/src/modules/customer_accounts/backend/customer_accounts/users/[id]/page.tsx +12 -27
- package/src/modules/customer_accounts/backend/customer_accounts/users/page.tsx +4 -6
- package/src/modules/customer_accounts/widgets/injection/account-status/widget.client.tsx +5 -4
- package/src/modules/customers/backend/config/customers/pipeline-stages/page.tsx +28 -15
- package/src/modules/customers/backend/customers/deals/pipeline/page.tsx +37 -26
- package/src/modules/customers/components/AddressEditor.tsx +30 -16
- package/src/modules/customers/components/AddressFormatSettings.tsx +25 -19
- package/src/modules/customers/components/detail/ActivityForm.tsx +35 -23
- package/src/modules/customers/components/detail/AnnualRevenueField.tsx +2 -2
- package/src/modules/customers/components/detail/DealForm.tsx +33 -20
- package/src/modules/customers/components/formConfig.tsx +25 -17
- package/src/modules/customers/widgets/dashboard/customer-todos/widget.client.tsx +3 -2
- package/src/modules/customers/widgets/dashboard/new-customers/widget.client.tsx +21 -11
- package/src/modules/customers/widgets/dashboard/new-deals/widget.client.tsx +3 -2
- package/src/modules/customers/widgets/dashboard/next-interactions/widget.client.tsx +3 -2
- package/src/modules/dashboards/components/WidgetVisibilityEditor.tsx +17 -22
- package/src/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.tsx +17 -7
- package/src/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.tsx +20 -10
- package/src/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.tsx +3 -2
- package/src/modules/dashboards/widgets/dashboard/top-customers/widget.client.tsx +3 -2
- package/src/modules/dashboards/widgets/dashboard/top-products/widget.client.tsx +20 -9
- package/src/modules/data_sync/backend/data-sync/page.tsx +64 -38
- package/src/modules/data_sync/components/IntegrationScheduleTab.tsx +18 -7
- package/src/modules/dictionaries/components/AppearanceSelector.tsx +4 -4
- package/src/modules/dictionaries/components/DictionaryEntriesEditor.tsx +3 -4
- package/src/modules/dictionaries/components/DictionaryEntrySelect.tsx +27 -21
- package/src/modules/dictionaries/fields/dictionary.tsx +36 -23
- package/src/modules/entities/components/EncryptionManager.tsx +49 -33
- package/src/modules/feature_toggles/components/formConfig.tsx +20 -10
- package/src/modules/feature_toggles/components/overrideFormConfig.tsx +20 -10
- package/src/modules/inbox_ops/backend/inbox-ops/settings/page.tsx +19 -10
- package/src/modules/inbox_ops/components/proposals/EditActionDialog.tsx +49 -26
- package/src/modules/integrations/backend/integrations/[id]/page.tsx +20 -11
- package/src/modules/integrations/backend/integrations/bundle/[id]/page.tsx +19 -9
- package/src/modules/planner/components/AvailabilityRulesEditor.tsx +34 -21
- package/src/modules/resources/components/ResourceCrudForm.tsx +24 -15
- package/src/modules/sales/backend/sales/documents/[id]/page.tsx +12 -15
- package/src/modules/sales/components/ProviderFieldInput.tsx +26 -17
- package/src/modules/sales/components/ShippingMethodsSettings.tsx +28 -20
- package/src/modules/sales/components/channels/ChannelOfferForm.tsx +51 -46
- package/src/modules/sales/components/documents/AddressesSection.tsx +78 -76
- package/src/modules/sales/components/documents/AdjustmentDialog.tsx +27 -15
- package/src/modules/sales/components/documents/LineItemDialog.tsx +69 -51
- package/src/modules/sales/components/documents/SalesDocumentForm.tsx +98 -87
- package/src/modules/sales/widgets/dashboard/new-orders/widget.client.tsx +23 -12
- package/src/modules/sales/widgets/dashboard/new-quotes/widget.client.tsx +23 -12
- package/src/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.tsx +35 -19
- package/src/modules/staff/components/TeamMemberForm.tsx +23 -14
- package/src/modules/workflows/backend/tasks/[id]/page.tsx +51 -23
- package/src/modules/workflows/components/ActivitiesEditor.tsx +20 -10
- package/src/modules/workflows/components/DefinitionTriggersEditor.tsx +28 -18
- package/src/modules/workflows/components/EdgeEditDialog.tsx +51 -40
- package/src/modules/workflows/components/NodeEditDialog.tsx +81 -77
- package/src/modules/workflows/components/StepsEditor.tsx +20 -10
- package/src/modules/workflows/components/TransitionsEditor.tsx +61 -44
- package/src/modules/workflows/components/fields/ActivityArrayEditor.tsx +22 -12
- package/src/modules/workflows/components/fields/BusinessRuleConditionsEditor.tsx +9 -13
- package/src/modules/workflows/components/fields/FormFieldArrayEditor.tsx +27 -17
- package/src/modules/workflows/components/fields/StartPreConditionsEditor.tsx +9 -12
- package/src/modules/workflows/components/mobile/MobileTaskForm.tsx +19 -11
- package/src/modules/workflows/frontend/checkout-demo/page.tsx +71 -60
|
@@ -5,7 +5,15 @@ import Link from 'next/link'
|
|
|
5
5
|
import { useRouter } from 'next/navigation'
|
|
6
6
|
import { Page, PageBody } from '@open-mercato/ui/backend/Page'
|
|
7
7
|
import { Button } from '@open-mercato/ui/primitives/button'
|
|
8
|
+
import { Input } from '@open-mercato/ui/primitives/input'
|
|
8
9
|
import { FormHeader } from '@open-mercato/ui/backend/forms'
|
|
10
|
+
import {
|
|
11
|
+
Select,
|
|
12
|
+
SelectContent,
|
|
13
|
+
SelectItem,
|
|
14
|
+
SelectTrigger,
|
|
15
|
+
SelectValue,
|
|
16
|
+
} from '@open-mercato/ui/primitives/select'
|
|
9
17
|
import { Spinner } from '@open-mercato/ui/primitives/spinner'
|
|
10
18
|
import { Separator } from '@open-mercato/ui/primitives/separator'
|
|
11
19
|
import { JsonDisplay } from '@open-mercato/ui/backend/JsonDisplay'
|
|
@@ -24,6 +32,10 @@ export default function UserTaskDetailPage({ params }: { params: { id: string }
|
|
|
24
32
|
const [formData, setFormData] = React.useState<Record<string, string | number | boolean>>({})
|
|
25
33
|
const [comments, setComments] = React.useState('')
|
|
26
34
|
const [submitting, setSubmitting] = React.useState(false)
|
|
35
|
+
// Tracks the first required field that failed validation so we can mark the
|
|
36
|
+
// field with aria-invalid + a red ring (Radix Select can't carry HTML
|
|
37
|
+
// `required`, so we enforce constraint validation in JS instead).
|
|
38
|
+
const [invalidField, setInvalidField] = React.useState<string | null>(null)
|
|
27
39
|
|
|
28
40
|
const { data: task, isLoading, error } = useQuery({
|
|
29
41
|
queryKey: ['workflow-task', params.id],
|
|
@@ -45,6 +57,8 @@ export default function UserTaskDetailPage({ params }: { params: { id: string }
|
|
|
45
57
|
...prev,
|
|
46
58
|
[fieldName]: value,
|
|
47
59
|
}))
|
|
60
|
+
// Clear invalid state once the user touches the offending field.
|
|
61
|
+
if (invalidField === fieldName) setInvalidField(null)
|
|
48
62
|
}
|
|
49
63
|
|
|
50
64
|
const handleSubmit = async (e: React.FormEvent) => {
|
|
@@ -52,15 +66,27 @@ export default function UserTaskDetailPage({ params }: { params: { id: string }
|
|
|
52
66
|
|
|
53
67
|
if (!task) return
|
|
54
68
|
|
|
55
|
-
// Validate required fields
|
|
69
|
+
// Validate required fields. Radix Select doesn't expose HTML `required`,
|
|
70
|
+
// so we enforce constraint validation here and surface it visually via
|
|
71
|
+
// `invalidField` + aria-invalid on the offending field.
|
|
56
72
|
if (task.formSchema?.required) {
|
|
57
73
|
for (const requiredField of task.formSchema.required) {
|
|
58
74
|
if (!formData[requiredField] || formData[requiredField] === '') {
|
|
59
|
-
|
|
75
|
+
const fieldSchema = task.formSchema.properties?.[requiredField]
|
|
76
|
+
const fieldLabel = fieldSchema?.title ?? requiredField
|
|
77
|
+
flash(t('workflows.tasks.detail.validation.requiredField', { field: fieldLabel }), 'error')
|
|
78
|
+
setInvalidField(requiredField)
|
|
79
|
+
// Scroll + focus the trigger so the user sees what's missing.
|
|
80
|
+
if (typeof document !== 'undefined') {
|
|
81
|
+
const trigger = document.getElementById(requiredField)
|
|
82
|
+
trigger?.scrollIntoView({ behavior: 'smooth', block: 'center' })
|
|
83
|
+
trigger?.focus()
|
|
84
|
+
}
|
|
60
85
|
return
|
|
61
86
|
}
|
|
62
87
|
}
|
|
63
88
|
}
|
|
89
|
+
setInvalidField(null)
|
|
64
90
|
|
|
65
91
|
setSubmitting(true)
|
|
66
92
|
|
|
@@ -119,20 +145,26 @@ export default function UserTaskDetailPage({ params }: { params: { id: string }
|
|
|
119
145
|
{fieldDescription && (
|
|
120
146
|
<p className="text-xs text-muted-foreground">{fieldDescription}</p>
|
|
121
147
|
)}
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
onChange={(e) => handleFieldChange(fieldName, e.target.value)}
|
|
126
|
-
required={required}
|
|
127
|
-
className={inputClasses}
|
|
148
|
+
<Select
|
|
149
|
+
value={fieldValue(fieldName) ? String(fieldValue(fieldName)) : undefined}
|
|
150
|
+
onValueChange={(value) => handleFieldChange(fieldName, value ?? '')}
|
|
128
151
|
>
|
|
129
|
-
<
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
152
|
+
<SelectTrigger
|
|
153
|
+
id={fieldName}
|
|
154
|
+
className={`${inputClasses} ${invalidField === fieldName ? 'ring-2 ring-status-error-border border-status-error-border' : ''}`}
|
|
155
|
+
aria-required={required}
|
|
156
|
+
aria-invalid={invalidField === fieldName ? true : undefined}
|
|
157
|
+
>
|
|
158
|
+
<SelectValue placeholder={t('workflows.tasks.detail.form.selectOption')} />
|
|
159
|
+
</SelectTrigger>
|
|
160
|
+
<SelectContent>
|
|
161
|
+
{enumValues.map((value: any) => (
|
|
162
|
+
<SelectItem key={value} value={value}>
|
|
163
|
+
{value}
|
|
164
|
+
</SelectItem>
|
|
165
|
+
))}
|
|
166
|
+
</SelectContent>
|
|
167
|
+
</Select>
|
|
136
168
|
</div>
|
|
137
169
|
)
|
|
138
170
|
}
|
|
@@ -150,13 +182,12 @@ export default function UserTaskDetailPage({ params }: { params: { id: string }
|
|
|
150
182
|
{fieldDescription && (
|
|
151
183
|
<p className="text-xs text-muted-foreground">{fieldDescription}</p>
|
|
152
184
|
)}
|
|
153
|
-
<
|
|
185
|
+
<Input
|
|
154
186
|
type="email"
|
|
155
187
|
id={fieldName}
|
|
156
188
|
value={fieldValue(fieldName)}
|
|
157
189
|
onChange={(e) => handleFieldChange(fieldName, e.target.value)}
|
|
158
190
|
required={required}
|
|
159
|
-
className={inputClasses}
|
|
160
191
|
/>
|
|
161
192
|
</div>
|
|
162
193
|
)
|
|
@@ -212,13 +243,12 @@ export default function UserTaskDetailPage({ params }: { params: { id: string }
|
|
|
212
243
|
{fieldDescription && (
|
|
213
244
|
<p className="text-xs text-muted-foreground">{fieldDescription}</p>
|
|
214
245
|
)}
|
|
215
|
-
<
|
|
246
|
+
<Input
|
|
216
247
|
type="text"
|
|
217
248
|
id={fieldName}
|
|
218
249
|
value={fieldValue(fieldName)}
|
|
219
250
|
onChange={(e) => handleFieldChange(fieldName, e.target.value)}
|
|
220
251
|
required={required}
|
|
221
|
-
className={inputClasses}
|
|
222
252
|
/>
|
|
223
253
|
</div>
|
|
224
254
|
)
|
|
@@ -234,14 +264,13 @@ export default function UserTaskDetailPage({ params }: { params: { id: string }
|
|
|
234
264
|
{fieldDescription && (
|
|
235
265
|
<p className="text-xs text-muted-foreground">{fieldDescription}</p>
|
|
236
266
|
)}
|
|
237
|
-
<
|
|
267
|
+
<Input
|
|
238
268
|
type="number"
|
|
239
269
|
id={fieldName}
|
|
240
270
|
value={fieldValue(fieldName)}
|
|
241
271
|
onChange={(e) => handleFieldChange(fieldName, e.target.value ? Number(e.target.value) : '')}
|
|
242
272
|
required={required}
|
|
243
273
|
step={fieldType === 'integer' ? 1 : 'any'}
|
|
244
|
-
className={inputClasses}
|
|
245
274
|
/>
|
|
246
275
|
</div>
|
|
247
276
|
)
|
|
@@ -278,13 +307,12 @@ export default function UserTaskDetailPage({ params }: { params: { id: string }
|
|
|
278
307
|
{fieldDescription && (
|
|
279
308
|
<p className="text-xs text-muted-foreground">{fieldDescription}</p>
|
|
280
309
|
)}
|
|
281
|
-
<
|
|
310
|
+
<Input
|
|
282
311
|
type="text"
|
|
283
312
|
id={fieldName}
|
|
284
313
|
value={fieldValue(fieldName)}
|
|
285
314
|
onChange={(e) => handleFieldChange(fieldName, e.target.value)}
|
|
286
315
|
required={required}
|
|
287
|
-
className={inputClasses}
|
|
288
316
|
/>
|
|
289
317
|
</div>
|
|
290
318
|
)
|
|
@@ -4,6 +4,13 @@ import * as React from 'react'
|
|
|
4
4
|
import { Button } from '@open-mercato/ui/primitives/button'
|
|
5
5
|
import { Input } from '@open-mercato/ui/primitives/input'
|
|
6
6
|
import { Label } from '@open-mercato/ui/primitives/label'
|
|
7
|
+
import {
|
|
8
|
+
Select,
|
|
9
|
+
SelectContent,
|
|
10
|
+
SelectItem,
|
|
11
|
+
SelectTrigger,
|
|
12
|
+
SelectValue,
|
|
13
|
+
} from '@open-mercato/ui/primitives/select'
|
|
7
14
|
import { Textarea } from '@open-mercato/ui/primitives/textarea'
|
|
8
15
|
import { Trash2, Plus, ChevronUp, ChevronDown } from 'lucide-react'
|
|
9
16
|
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
@@ -181,18 +188,21 @@ export function ActivitiesEditor({ value = [], onChange, error }: ActivitiesEdit
|
|
|
181
188
|
<Label htmlFor={`activity-${index}-type`} className="text-xs">
|
|
182
189
|
{t('workflows.activities.activityType')} *
|
|
183
190
|
</Label>
|
|
184
|
-
<
|
|
185
|
-
id={`activity-${index}-type`}
|
|
191
|
+
<Select
|
|
186
192
|
value={activity.activityType}
|
|
187
|
-
|
|
188
|
-
className="mt-1 w-full px-3 py-2 border border-gray-300 rounded-md text-sm"
|
|
193
|
+
onValueChange={(value) => updateActivity(index, 'activityType', value)}
|
|
189
194
|
>
|
|
190
|
-
{
|
|
191
|
-
<
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
195
|
+
<SelectTrigger id={`activity-${index}-type`} className="mt-1">
|
|
196
|
+
<SelectValue />
|
|
197
|
+
</SelectTrigger>
|
|
198
|
+
<SelectContent>
|
|
199
|
+
{ACTIVITY_TYPES.map((type) => (
|
|
200
|
+
<SelectItem key={type.value} value={type.value}>
|
|
201
|
+
{t(`workflows.activities.types.${type.value}`)}
|
|
202
|
+
</SelectItem>
|
|
203
|
+
))}
|
|
204
|
+
</SelectContent>
|
|
205
|
+
</Select>
|
|
196
206
|
</div>
|
|
197
207
|
<div>
|
|
198
208
|
<Label htmlFor={`activity-${index}-timeout`} className="text-xs">
|
|
@@ -6,7 +6,14 @@ import { Button } from '@open-mercato/ui/primitives/button'
|
|
|
6
6
|
import { Input } from '@open-mercato/ui/primitives/input'
|
|
7
7
|
import { Textarea } from '@open-mercato/ui/primitives/textarea'
|
|
8
8
|
import { Label } from '@open-mercato/ui/primitives/label'
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
Select,
|
|
11
|
+
SelectContent,
|
|
12
|
+
SelectItem,
|
|
13
|
+
SelectTrigger,
|
|
14
|
+
SelectValue,
|
|
15
|
+
} from '@open-mercato/ui/primitives/select'
|
|
16
|
+
import { SwitchField } from '@open-mercato/ui/primitives/switch-field'
|
|
10
17
|
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
11
18
|
import {
|
|
12
19
|
Dialog,
|
|
@@ -403,14 +410,13 @@ export function DefinitionTriggersEditor({
|
|
|
403
410
|
</div>
|
|
404
411
|
|
|
405
412
|
{/* Enabled Switch */}
|
|
406
|
-
<
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
</div>
|
|
413
|
+
<SwitchField
|
|
414
|
+
id="trigger-enabled"
|
|
415
|
+
label={t('workflows.triggers.fields.enabled', 'Enabled')}
|
|
416
|
+
flip
|
|
417
|
+
checked={formValues.enabled}
|
|
418
|
+
onCheckedChange={checked => setFormValues(prev => ({ ...prev, enabled: checked }))}
|
|
419
|
+
/>
|
|
414
420
|
|
|
415
421
|
{/* Filter Conditions */}
|
|
416
422
|
<div className="space-y-2">
|
|
@@ -432,17 +438,21 @@ export function DefinitionTriggersEditor({
|
|
|
432
438
|
placeholder="status"
|
|
433
439
|
className="w-full sm:w-1/3"
|
|
434
440
|
/>
|
|
435
|
-
<
|
|
441
|
+
<Select
|
|
436
442
|
value={fc.operator}
|
|
437
|
-
|
|
438
|
-
className="h-10 w-full sm:w-[140px] rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
|
443
|
+
onValueChange={(value) => updateFilterCondition(index, 'operator', value)}
|
|
439
444
|
>
|
|
440
|
-
|
|
441
|
-
<
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
445
|
+
<SelectTrigger size="lg" className="w-full sm:w-[140px]">
|
|
446
|
+
<SelectValue />
|
|
447
|
+
</SelectTrigger>
|
|
448
|
+
<SelectContent>
|
|
449
|
+
{FILTER_OPERATORS.map(op => (
|
|
450
|
+
<SelectItem key={op.value} value={op.value}>
|
|
451
|
+
{op.label}
|
|
452
|
+
</SelectItem>
|
|
453
|
+
))}
|
|
454
|
+
</SelectContent>
|
|
455
|
+
</Select>
|
|
446
456
|
<Input
|
|
447
457
|
value={fc.value}
|
|
448
458
|
onChange={e => updateFilterCondition(index, 'value', e.target.value)}
|
|
@@ -13,6 +13,13 @@ import {
|
|
|
13
13
|
import {Button} from '@open-mercato/ui/primitives/button'
|
|
14
14
|
import {Input} from '@open-mercato/ui/primitives/input'
|
|
15
15
|
import {Label} from '@open-mercato/ui/primitives/label'
|
|
16
|
+
import {
|
|
17
|
+
Select,
|
|
18
|
+
SelectContent,
|
|
19
|
+
SelectItem,
|
|
20
|
+
SelectTrigger,
|
|
21
|
+
SelectValue,
|
|
22
|
+
} from '@open-mercato/ui/primitives/select'
|
|
16
23
|
import {Badge} from '@open-mercato/ui/primitives/badge'
|
|
17
24
|
import {Separator} from '@open-mercato/ui/primitives/separator'
|
|
18
25
|
import {Plus, Trash2} from 'lucide-react'
|
|
@@ -355,17 +362,17 @@ export function EdgeEditDialog({ edge, isOpen, onClose, onSave, onDelete }: Edge
|
|
|
355
362
|
{/* Trigger Type */}
|
|
356
363
|
<div className="space-y-2">
|
|
357
364
|
<Label htmlFor="trigger">{t('workflows.edgeEditor.triggerType')}</Label>
|
|
358
|
-
<
|
|
359
|
-
id="trigger"
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
</
|
|
365
|
+
<Select value={trigger} onValueChange={(value) => setTrigger(value)}>
|
|
366
|
+
<SelectTrigger id="trigger">
|
|
367
|
+
<SelectValue />
|
|
368
|
+
</SelectTrigger>
|
|
369
|
+
<SelectContent>
|
|
370
|
+
<SelectItem value="auto">{t('workflows.transitions.triggers.auto')}</SelectItem>
|
|
371
|
+
<SelectItem value="manual">{t('workflows.transitions.triggers.manual')}</SelectItem>
|
|
372
|
+
<SelectItem value="signal">{t('workflows.transitions.triggers.signal')}</SelectItem>
|
|
373
|
+
<SelectItem value="timer">{t('workflows.transitions.triggers.timer')}</SelectItem>
|
|
374
|
+
</SelectContent>
|
|
375
|
+
</Select>
|
|
369
376
|
<p className="text-xs text-muted-foreground">
|
|
370
377
|
{t(`workflows.edgeEditor.triggerDescriptions.${trigger}`)}
|
|
371
378
|
</p>
|
|
@@ -483,11 +490,11 @@ export function EdgeEditDialog({ edge, isOpen, onClose, onSave, onDelete }: Edge
|
|
|
483
490
|
<div className="px-4 pb-4 space-y-3 border-t border-gray-200 bg-white">
|
|
484
491
|
<div className="pt-3">
|
|
485
492
|
<label className="block text-xs font-medium text-gray-700 mb-1">{t('workflows.edgeEditor.ruleId')}</label>
|
|
486
|
-
<
|
|
493
|
+
<Input
|
|
487
494
|
type="text"
|
|
495
|
+
size="sm"
|
|
488
496
|
value={condition.ruleId}
|
|
489
497
|
onChange={(e) => updatePreCondition(index, 'ruleId', e.target.value)}
|
|
490
|
-
className="w-full px-2 py-1.5 border border-gray-300 rounded text-xs focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring"
|
|
491
498
|
/>
|
|
492
499
|
</div>
|
|
493
500
|
|
|
@@ -635,11 +642,11 @@ export function EdgeEditDialog({ edge, isOpen, onClose, onSave, onDelete }: Edge
|
|
|
635
642
|
<div className="px-4 pb-4 space-y-3 border-t border-gray-200 bg-white">
|
|
636
643
|
<div className="pt-3">
|
|
637
644
|
<label className="block text-xs font-medium text-gray-700 mb-1">{t('workflows.edgeEditor.ruleId')}</label>
|
|
638
|
-
<
|
|
645
|
+
<Input
|
|
639
646
|
type="text"
|
|
647
|
+
size="sm"
|
|
640
648
|
value={condition.ruleId}
|
|
641
649
|
onChange={(e) => updatePostCondition(index, 'ruleId', e.target.value)}
|
|
642
|
-
className="w-full px-2 py-1.5 border border-gray-300 rounded text-xs focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring"
|
|
643
650
|
/>
|
|
644
651
|
</div>
|
|
645
652
|
|
|
@@ -772,11 +779,11 @@ export function EdgeEditDialog({ edge, isOpen, onClose, onSave, onDelete }: Edge
|
|
|
772
779
|
{/* Activity ID */}
|
|
773
780
|
<div className="pt-3">
|
|
774
781
|
<label className="block text-xs font-medium text-gray-700 mb-1">{t('workflows.edgeEditor.activityId')} *</label>
|
|
775
|
-
<
|
|
782
|
+
<Input
|
|
776
783
|
type="text"
|
|
784
|
+
size="sm"
|
|
777
785
|
value={activity.activityId}
|
|
778
786
|
onChange={(e) => updateActivity(index, 'activityId', e.target.value)}
|
|
779
|
-
className="w-full px-2 py-1.5 border border-gray-300 rounded text-xs focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring"
|
|
780
787
|
placeholder={t('workflows.edgeEditor.activityIdPlaceholder')}
|
|
781
788
|
/>
|
|
782
789
|
</div>
|
|
@@ -784,11 +791,11 @@ export function EdgeEditDialog({ edge, isOpen, onClose, onSave, onDelete }: Edge
|
|
|
784
791
|
{/* Activity Name */}
|
|
785
792
|
<div>
|
|
786
793
|
<label className="block text-xs font-medium text-gray-700 mb-1">{t('workflows.edgeEditor.activityName')} *</label>
|
|
787
|
-
<
|
|
794
|
+
<Input
|
|
788
795
|
type="text"
|
|
796
|
+
size="sm"
|
|
789
797
|
value={activity.activityName || ''}
|
|
790
798
|
onChange={(e) => updateActivity(index, 'activityName', e.target.value)}
|
|
791
|
-
className="w-full px-2 py-1.5 border border-gray-300 rounded text-xs focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring"
|
|
792
799
|
placeholder={t('workflows.edgeEditor.activityNamePlaceholder')}
|
|
793
800
|
/>
|
|
794
801
|
</div>
|
|
@@ -796,29 +803,33 @@ export function EdgeEditDialog({ edge, isOpen, onClose, onSave, onDelete }: Edge
|
|
|
796
803
|
{/* Activity Type */}
|
|
797
804
|
<div>
|
|
798
805
|
<label className="block text-xs font-medium text-gray-700 mb-1">{t('workflows.edgeEditor.activityType')} *</label>
|
|
799
|
-
<
|
|
806
|
+
<Select
|
|
800
807
|
value={activity.activityType}
|
|
801
|
-
|
|
802
|
-
className="w-full px-2 py-1.5 border border-gray-300 rounded text-xs focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring"
|
|
808
|
+
onValueChange={(value) => updateActivity(index, 'activityType', value)}
|
|
803
809
|
>
|
|
804
|
-
<
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
<
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
810
|
+
<SelectTrigger size="sm">
|
|
811
|
+
<SelectValue />
|
|
812
|
+
</SelectTrigger>
|
|
813
|
+
<SelectContent>
|
|
814
|
+
<SelectItem value="SEND_EMAIL">{t('workflows.activities.types.SEND_EMAIL')}</SelectItem>
|
|
815
|
+
<SelectItem value="CALL_API">{t('workflows.activities.types.CALL_API')}</SelectItem>
|
|
816
|
+
<SelectItem value="UPDATE_ENTITY">{t('workflows.activities.types.UPDATE_ENTITY')}</SelectItem>
|
|
817
|
+
<SelectItem value="EMIT_EVENT">{t('workflows.activities.types.EMIT_EVENT')}</SelectItem>
|
|
818
|
+
<SelectItem value="CALL_WEBHOOK">{t('workflows.activities.types.CALL_WEBHOOK')}</SelectItem>
|
|
819
|
+
<SelectItem value="EXECUTE_FUNCTION">{t('workflows.activities.types.EXECUTE_FUNCTION')}</SelectItem>
|
|
820
|
+
<SelectItem value="WAIT">{t('workflows.activities.types.WAIT')}</SelectItem>
|
|
821
|
+
</SelectContent>
|
|
822
|
+
</Select>
|
|
812
823
|
</div>
|
|
813
824
|
|
|
814
825
|
{/* Timeout */}
|
|
815
826
|
<div>
|
|
816
827
|
<label className="block text-xs font-medium text-gray-700 mb-1">{t('workflows.edgeEditor.timeout')}</label>
|
|
817
|
-
<
|
|
828
|
+
<Input
|
|
818
829
|
type="text"
|
|
830
|
+
size="sm"
|
|
819
831
|
value={activity.timeout || ''}
|
|
820
832
|
onChange={(e) => updateActivity(index, 'timeout', e.target.value)}
|
|
821
|
-
className="w-full px-2 py-1.5 border border-gray-300 rounded text-xs focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring"
|
|
822
833
|
placeholder={t('workflows.edgeEditor.timeoutPlaceholder')}
|
|
823
834
|
/>
|
|
824
835
|
<p className="text-xs text-gray-500 mt-0.5">{t('workflows.edgeEditor.timeoutHint')}</p>
|
|
@@ -830,11 +841,11 @@ export function EdgeEditDialog({ edge, isOpen, onClose, onSave, onDelete }: Edge
|
|
|
830
841
|
<div className="grid grid-cols-1 sm:grid-cols-2 gap-2">
|
|
831
842
|
<div>
|
|
832
843
|
<label className="block text-xs font-medium text-gray-700 mb-1">{t('workflows.edgeEditor.maxAttempts')}</label>
|
|
833
|
-
<
|
|
844
|
+
<Input
|
|
834
845
|
type="number"
|
|
846
|
+
size="sm"
|
|
835
847
|
value={activity.retryPolicy?.maxAttempts || ''}
|
|
836
848
|
onChange={(e) => updateActivityRetryPolicy(index, 'maxAttempts', parseInt(e.target.value) || 0)}
|
|
837
|
-
className="w-full px-2 py-1.5 border border-gray-300 rounded text-xs focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring"
|
|
838
849
|
placeholder="3"
|
|
839
850
|
min="1"
|
|
840
851
|
max="10"
|
|
@@ -842,23 +853,23 @@ export function EdgeEditDialog({ edge, isOpen, onClose, onSave, onDelete }: Edge
|
|
|
842
853
|
</div>
|
|
843
854
|
<div>
|
|
844
855
|
<label className="block text-xs font-medium text-gray-700 mb-1">{t('workflows.edgeEditor.initialInterval')}</label>
|
|
845
|
-
<
|
|
856
|
+
<Input
|
|
846
857
|
type="number"
|
|
858
|
+
size="sm"
|
|
847
859
|
value={activity.retryPolicy?.initialIntervalMs || ''}
|
|
848
860
|
onChange={(e) => updateActivityRetryPolicy(index, 'initialIntervalMs', parseInt(e.target.value) || 0)}
|
|
849
|
-
className="w-full px-2 py-1.5 border border-gray-300 rounded text-xs focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring"
|
|
850
861
|
placeholder="1000"
|
|
851
862
|
min="0"
|
|
852
863
|
/>
|
|
853
864
|
</div>
|
|
854
865
|
<div>
|
|
855
866
|
<label className="block text-xs font-medium text-gray-700 mb-1">{t('workflows.edgeEditor.backoffCoefficient')}</label>
|
|
856
|
-
<
|
|
867
|
+
<Input
|
|
857
868
|
type="number"
|
|
869
|
+
size="sm"
|
|
858
870
|
step="0.1"
|
|
859
871
|
value={activity.retryPolicy?.backoffCoefficient || ''}
|
|
860
872
|
onChange={(e) => updateActivityRetryPolicy(index, 'backoffCoefficient', parseFloat(e.target.value) || 1)}
|
|
861
|
-
className="w-full px-2 py-1.5 border border-gray-300 rounded text-xs focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring"
|
|
862
873
|
placeholder="2"
|
|
863
874
|
min="1"
|
|
864
875
|
max="10"
|
|
@@ -866,11 +877,11 @@ export function EdgeEditDialog({ edge, isOpen, onClose, onSave, onDelete }: Edge
|
|
|
866
877
|
</div>
|
|
867
878
|
<div>
|
|
868
879
|
<label className="block text-xs font-medium text-gray-700 mb-1">{t('workflows.edgeEditor.maxInterval')}</label>
|
|
869
|
-
<
|
|
880
|
+
<Input
|
|
870
881
|
type="number"
|
|
882
|
+
size="sm"
|
|
871
883
|
value={activity.retryPolicy?.maxIntervalMs || ''}
|
|
872
884
|
onChange={(e) => updateActivityRetryPolicy(index, 'maxIntervalMs', parseInt(e.target.value) || 0)}
|
|
873
|
-
className="w-full px-2 py-1.5 border border-gray-300 rounded text-xs focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring"
|
|
874
885
|
placeholder="10000"
|
|
875
886
|
min="0"
|
|
876
887
|
/>
|