@open-mercato/core 0.5.1-develop.2953.6647bb2c43 → 0.5.1-develop.2964.d5ac4a6ebb
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
|
@@ -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'
|
|
@@ -254,54 +261,61 @@ export function TransitionsEditor({ value = [], onChange, steps = [], error }: T
|
|
|
254
261
|
<Label htmlFor={`transition-${index}-from`} className="text-xs">
|
|
255
262
|
{t('workflows.transitions.fromStep')} *
|
|
256
263
|
</Label>
|
|
257
|
-
<
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
onChange={(e) => updateTransition(index, 'fromStepId', e.target.value)}
|
|
261
|
-
className="mt-1 w-full px-3 py-2 border border-border rounded-md text-sm"
|
|
264
|
+
<Select
|
|
265
|
+
value={transition.fromStepId || undefined}
|
|
266
|
+
onValueChange={(value) => updateTransition(index, 'fromStepId', value ?? '')}
|
|
262
267
|
>
|
|
263
|
-
<
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
268
|
+
<SelectTrigger id={`transition-${index}-from`} className="mt-1">
|
|
269
|
+
<SelectValue placeholder={t('workflows.form.selectStep')} />
|
|
270
|
+
</SelectTrigger>
|
|
271
|
+
<SelectContent>
|
|
272
|
+
{steps.map((step: any) => (
|
|
273
|
+
<SelectItem key={step.stepId} value={step.stepId}>
|
|
274
|
+
{step.stepName || step.stepId}
|
|
275
|
+
</SelectItem>
|
|
276
|
+
))}
|
|
277
|
+
</SelectContent>
|
|
278
|
+
</Select>
|
|
270
279
|
</div>
|
|
271
280
|
<div>
|
|
272
281
|
<Label htmlFor={`transition-${index}-to`} className="text-xs">
|
|
273
282
|
{t('workflows.transitions.toStep')} *
|
|
274
283
|
</Label>
|
|
275
|
-
<
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
onChange={(e) => updateTransition(index, 'toStepId', e.target.value)}
|
|
279
|
-
className="mt-1 w-full px-3 py-2 border border-border rounded-md text-sm"
|
|
284
|
+
<Select
|
|
285
|
+
value={transition.toStepId || undefined}
|
|
286
|
+
onValueChange={(value) => updateTransition(index, 'toStepId', value ?? '')}
|
|
280
287
|
>
|
|
281
|
-
<
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
+
<SelectTrigger id={`transition-${index}-to`} className="mt-1">
|
|
289
|
+
<SelectValue placeholder={t('workflows.form.selectStep')} />
|
|
290
|
+
</SelectTrigger>
|
|
291
|
+
<SelectContent>
|
|
292
|
+
{steps.map((step: any) => (
|
|
293
|
+
<SelectItem key={step.stepId} value={step.stepId}>
|
|
294
|
+
{step.stepName || step.stepId}
|
|
295
|
+
</SelectItem>
|
|
296
|
+
))}
|
|
297
|
+
</SelectContent>
|
|
298
|
+
</Select>
|
|
288
299
|
</div>
|
|
289
300
|
<div>
|
|
290
301
|
<Label htmlFor={`transition-${index}-trigger`} className="text-xs">
|
|
291
302
|
{t('workflows.transitions.trigger')} *
|
|
292
303
|
</Label>
|
|
293
|
-
<
|
|
294
|
-
id={`transition-${index}-trigger`}
|
|
304
|
+
<Select
|
|
295
305
|
value={transition.trigger}
|
|
296
|
-
|
|
297
|
-
className="mt-1 w-full px-3 py-2 border border-border rounded-md text-sm"
|
|
306
|
+
onValueChange={(value) => updateTransition(index, 'trigger', value)}
|
|
298
307
|
>
|
|
299
|
-
{
|
|
300
|
-
<
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
308
|
+
<SelectTrigger id={`transition-${index}-trigger`} className="mt-1">
|
|
309
|
+
<SelectValue />
|
|
310
|
+
</SelectTrigger>
|
|
311
|
+
<SelectContent>
|
|
312
|
+
{TRIGGER_TYPES.map((type) => (
|
|
313
|
+
<SelectItem key={type.value} value={type.value}>
|
|
314
|
+
{t(`workflows.transitions.triggers.${type.value}`)}
|
|
315
|
+
</SelectItem>
|
|
316
|
+
))}
|
|
317
|
+
</SelectContent>
|
|
318
|
+
</Select>
|
|
305
319
|
</div>
|
|
306
320
|
</div>
|
|
307
321
|
|
|
@@ -424,18 +438,21 @@ export function TransitionsEditor({ value = [], onChange, steps = [], error }: T
|
|
|
424
438
|
<Label htmlFor={`activity-${index}-${activityIndex}-type`} className="text-xs">
|
|
425
439
|
{t('workflows.activities.activityType')} *
|
|
426
440
|
</Label>
|
|
427
|
-
<
|
|
428
|
-
id={`activity-${index}-${activityIndex}-type`}
|
|
441
|
+
<Select
|
|
429
442
|
value={activity.activityType}
|
|
430
|
-
|
|
431
|
-
className="mt-1 w-full px-2 py-1 border border-border rounded-md text-xs h-8"
|
|
443
|
+
onValueChange={(value) => updateActivity(index, activityIndex, 'activityType', value)}
|
|
432
444
|
>
|
|
433
|
-
{
|
|
434
|
-
<
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
445
|
+
<SelectTrigger id={`activity-${index}-${activityIndex}-type`} size="sm" className="mt-1">
|
|
446
|
+
<SelectValue />
|
|
447
|
+
</SelectTrigger>
|
|
448
|
+
<SelectContent>
|
|
449
|
+
{ACTIVITY_TYPES.map((type) => (
|
|
450
|
+
<SelectItem key={type.value} value={type.value}>
|
|
451
|
+
{t(`workflows.activities.types.${type.value}`)}
|
|
452
|
+
</SelectItem>
|
|
453
|
+
))}
|
|
454
|
+
</SelectContent>
|
|
455
|
+
</Select>
|
|
439
456
|
</div>
|
|
440
457
|
<div>
|
|
441
458
|
<Label htmlFor={`activity-${index}-${activityIndex}-timeout`} className="text-xs">
|
|
@@ -6,6 +6,13 @@ import { Button } from '@open-mercato/ui/primitives/button'
|
|
|
6
6
|
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
7
7
|
import { Input } from '@open-mercato/ui/primitives/input'
|
|
8
8
|
import { Label } from '@open-mercato/ui/primitives/label'
|
|
9
|
+
import {
|
|
10
|
+
Select,
|
|
11
|
+
SelectContent,
|
|
12
|
+
SelectItem,
|
|
13
|
+
SelectTrigger,
|
|
14
|
+
SelectValue,
|
|
15
|
+
} from '@open-mercato/ui/primitives/select'
|
|
9
16
|
import { ChevronDown, Plus, Trash2 } from 'lucide-react'
|
|
10
17
|
import { JsonBuilder } from '@open-mercato/ui/backend/JsonBuilder'
|
|
11
18
|
import type { CrudCustomFieldRenderProps } from '@open-mercato/ui/backend/CrudForm'
|
|
@@ -216,21 +223,24 @@ export function ActivityArrayEditor({ id, value = [], error, setValue, disabled
|
|
|
216
223
|
<Label htmlFor={`${id}-${index}-activityType`} className="text-xs font-medium mb-1">
|
|
217
224
|
{t('workflows.fieldEditors.activities.activityType')} *
|
|
218
225
|
</Label>
|
|
219
|
-
<
|
|
220
|
-
id={`${id}-${index}-activityType`}
|
|
226
|
+
<Select
|
|
221
227
|
value={activity.activityType}
|
|
222
|
-
|
|
223
|
-
className="flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-xs shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
228
|
+
onValueChange={(value) => updateActivity(index, 'activityType', value)}
|
|
224
229
|
disabled={disabled}
|
|
225
230
|
>
|
|
226
|
-
<
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
<
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
231
|
+
<SelectTrigger id={`${id}-${index}-activityType`}>
|
|
232
|
+
<SelectValue />
|
|
233
|
+
</SelectTrigger>
|
|
234
|
+
<SelectContent>
|
|
235
|
+
<SelectItem value="SEND_EMAIL">{t('workflows.activities.types.SEND_EMAIL')}</SelectItem>
|
|
236
|
+
<SelectItem value="CALL_API">{t('workflows.activities.types.CALL_API')}</SelectItem>
|
|
237
|
+
<SelectItem value="UPDATE_ENTITY">{t('workflows.activities.types.UPDATE_ENTITY')}</SelectItem>
|
|
238
|
+
<SelectItem value="EMIT_EVENT">{t('workflows.activities.types.EMIT_EVENT')}</SelectItem>
|
|
239
|
+
<SelectItem value="CALL_WEBHOOK">{t('workflows.activities.types.CALL_WEBHOOK')}</SelectItem>
|
|
240
|
+
<SelectItem value="EXECUTE_FUNCTION">{t('workflows.activities.types.EXECUTE_FUNCTION')}</SelectItem>
|
|
241
|
+
<SelectItem value="WAIT">{t('workflows.activities.types.WAIT')}</SelectItem>
|
|
242
|
+
</SelectContent>
|
|
243
|
+
</Select>
|
|
234
244
|
</div>
|
|
235
245
|
|
|
236
246
|
{/* Timeout */}
|
|
@@ -4,14 +4,13 @@ import { useState, useEffect } from 'react'
|
|
|
4
4
|
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
5
5
|
import { Button } from '@open-mercato/ui/primitives/button'
|
|
6
6
|
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
7
|
-
import { Label } from '@open-mercato/ui/primitives/label'
|
|
8
7
|
import { Plus, Trash2, AlertCircle } from 'lucide-react'
|
|
9
8
|
import type { CrudCustomFieldRenderProps } from '@open-mercato/ui/backend/CrudForm'
|
|
10
9
|
import { BusinessRulesSelector, type BusinessRule } from '../BusinessRulesSelector'
|
|
11
10
|
import { apiFetch } from '@open-mercato/ui/backend/utils/api'
|
|
12
11
|
import { EmptyState } from '@open-mercato/ui/backend/EmptyState'
|
|
13
12
|
import { Spinner } from '@open-mercato/ui/primitives/spinner'
|
|
14
|
-
import {
|
|
13
|
+
import { SwitchField } from '@open-mercato/ui/primitives/switch-field'
|
|
15
14
|
import { ConfirmDialog } from '@open-mercato/ui/backend/confirm-dialog'
|
|
16
15
|
|
|
17
16
|
/**
|
|
@@ -219,17 +218,14 @@ export function BusinessRuleConditionsEditor({
|
|
|
219
218
|
</div>
|
|
220
219
|
|
|
221
220
|
{/* Required Toggle */}
|
|
222
|
-
<
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
{t('workflows.fieldEditors.businessRuleConditions.requiredLabel')}
|
|
231
|
-
</Label>
|
|
232
|
-
</div>
|
|
221
|
+
<SwitchField
|
|
222
|
+
id={`${id}-${index}-required`}
|
|
223
|
+
label={t('workflows.fieldEditors.businessRuleConditions.requiredLabel')}
|
|
224
|
+
flip
|
|
225
|
+
checked={normalized.required}
|
|
226
|
+
onCheckedChange={() => toggleRequired(index)}
|
|
227
|
+
disabled={disabled}
|
|
228
|
+
/>
|
|
233
229
|
</div>
|
|
234
230
|
|
|
235
231
|
{/* Delete Button */}
|
|
@@ -7,6 +7,13 @@ import { Button } from '@open-mercato/ui/primitives/button'
|
|
|
7
7
|
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
8
8
|
import { Input } from '@open-mercato/ui/primitives/input'
|
|
9
9
|
import { Label } from '@open-mercato/ui/primitives/label'
|
|
10
|
+
import {
|
|
11
|
+
Select,
|
|
12
|
+
SelectContent,
|
|
13
|
+
SelectItem,
|
|
14
|
+
SelectTrigger,
|
|
15
|
+
SelectValue,
|
|
16
|
+
} from '@open-mercato/ui/primitives/select'
|
|
10
17
|
import { Alert, AlertDescription } from '@open-mercato/ui/primitives/alert'
|
|
11
18
|
import { ChevronDown, Plus, Trash2, Info } from 'lucide-react'
|
|
12
19
|
import type { CrudCustomFieldRenderProps } from '@open-mercato/ui/backend/CrudForm'
|
|
@@ -217,26 +224,29 @@ export function FormFieldArrayEditor({
|
|
|
217
224
|
<Label htmlFor={`${id}-${index}-type`} className="text-xs font-medium mb-1">
|
|
218
225
|
{t('workflows.fieldEditors.formFields.fieldType')} *
|
|
219
226
|
</Label>
|
|
220
|
-
<
|
|
221
|
-
id={`${id}-${index}-type`}
|
|
227
|
+
<Select
|
|
222
228
|
value={field.type}
|
|
223
|
-
|
|
224
|
-
className="flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-xs shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
229
|
+
onValueChange={(value) => updateFormField(index, 'type', value)}
|
|
225
230
|
disabled={disabled}
|
|
226
231
|
>
|
|
227
|
-
<
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
<
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
232
|
+
<SelectTrigger id={`${id}-${index}-type`}>
|
|
233
|
+
<SelectValue />
|
|
234
|
+
</SelectTrigger>
|
|
235
|
+
<SelectContent>
|
|
236
|
+
<SelectItem value="text">{t('workflows.form.fieldTypes.text')}</SelectItem>
|
|
237
|
+
<SelectItem value="number">{t('workflows.form.fieldTypes.number')}</SelectItem>
|
|
238
|
+
<SelectItem value="email">{t('workflows.form.fieldTypes.email')}</SelectItem>
|
|
239
|
+
<SelectItem value="tel">{t('workflows.form.fieldTypes.tel')}</SelectItem>
|
|
240
|
+
<SelectItem value="url">{t('workflows.form.fieldTypes.url')}</SelectItem>
|
|
241
|
+
<SelectItem value="textarea">{t('workflows.form.fieldTypes.textarea')}</SelectItem>
|
|
242
|
+
<SelectItem value="select">{t('workflows.form.fieldTypes.select')}</SelectItem>
|
|
243
|
+
<SelectItem value="radio">{t('workflows.form.fieldTypes.radio')}</SelectItem>
|
|
244
|
+
<SelectItem value="checkbox">{t('workflows.form.fieldTypes.checkbox')}</SelectItem>
|
|
245
|
+
<SelectItem value="date">{t('workflows.form.fieldTypes.date')}</SelectItem>
|
|
246
|
+
<SelectItem value="time">{t('workflows.form.fieldTypes.time')}</SelectItem>
|
|
247
|
+
<SelectItem value="datetime-local">{t('workflows.form.fieldTypes.datetime-local')}</SelectItem>
|
|
248
|
+
</SelectContent>
|
|
249
|
+
</Select>
|
|
240
250
|
</div>
|
|
241
251
|
|
|
242
252
|
{/* Placeholder */}
|
|
@@ -11,7 +11,7 @@ import { BusinessRulesSelector, type BusinessRule } from '../BusinessRulesSelect
|
|
|
11
11
|
import { apiFetch } from '@open-mercato/ui/backend/utils/api'
|
|
12
12
|
import { EmptyState } from '@open-mercato/ui/backend/EmptyState'
|
|
13
13
|
import { Spinner } from '@open-mercato/ui/primitives/spinner'
|
|
14
|
-
import {
|
|
14
|
+
import { SwitchField } from '@open-mercato/ui/primitives/switch-field'
|
|
15
15
|
import { ConfirmDialog } from '@open-mercato/ui/backend/confirm-dialog'
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -341,17 +341,14 @@ export function StartPreConditionsEditor({
|
|
|
341
341
|
</div>
|
|
342
342
|
|
|
343
343
|
{/* Required toggle */}
|
|
344
|
-
<
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
{t('workflows.fieldEditors.preConditions.requiredLabel')}
|
|
353
|
-
</Label>
|
|
354
|
-
</div>
|
|
344
|
+
<SwitchField
|
|
345
|
+
id={`precondition-${index}-required`}
|
|
346
|
+
label={t('workflows.fieldEditors.preConditions.requiredLabel')}
|
|
347
|
+
flip
|
|
348
|
+
checked={conditions[index]?.required ?? true}
|
|
349
|
+
onCheckedChange={(checked) => updateCondition(index, { required: checked })}
|
|
350
|
+
disabled={disabled}
|
|
351
|
+
/>
|
|
355
352
|
|
|
356
353
|
{/* Validation Messages */}
|
|
357
354
|
<div>
|
|
@@ -7,6 +7,13 @@ import { Input } from '@open-mercato/ui/primitives/input'
|
|
|
7
7
|
import { Textarea } from '@open-mercato/ui/primitives/textarea'
|
|
8
8
|
import { Checkbox } from '@open-mercato/ui/primitives/checkbox'
|
|
9
9
|
import { Label } from '@open-mercato/ui/primitives/label'
|
|
10
|
+
import {
|
|
11
|
+
Select,
|
|
12
|
+
SelectContent,
|
|
13
|
+
SelectItem,
|
|
14
|
+
SelectTrigger,
|
|
15
|
+
SelectValue,
|
|
16
|
+
} from '@open-mercato/ui/primitives/select'
|
|
10
17
|
import { Separator } from '@open-mercato/ui/primitives/separator'
|
|
11
18
|
import { JsonDisplay } from '@open-mercato/ui/backend/JsonDisplay'
|
|
12
19
|
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
@@ -63,18 +70,19 @@ export function MobileTaskForm({
|
|
|
63
70
|
{required && <span className="text-status-error-text ml-1">*</span>}
|
|
64
71
|
</Label>
|
|
65
72
|
{fieldDescription && <p className="text-xs text-muted-foreground">{fieldDescription}</p>}
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
onChange={(e) => onFieldChange(fieldName, e.target.value)}
|
|
70
|
-
required={required}
|
|
71
|
-
className="w-full h-11 px-3 py-2 border border-border rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring text-base"
|
|
73
|
+
<Select
|
|
74
|
+
value={fieldValue(fieldName) ? String(fieldValue(fieldName)) : undefined}
|
|
75
|
+
onValueChange={(value) => onFieldChange(fieldName, value ?? '')}
|
|
72
76
|
>
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
<SelectTrigger id={fieldName} size="lg" aria-required={required}>
|
|
78
|
+
<SelectValue placeholder={t('workflows.tasks.detail.form.selectOption')} />
|
|
79
|
+
</SelectTrigger>
|
|
80
|
+
<SelectContent>
|
|
81
|
+
{enumValues.map((value: string) => (
|
|
82
|
+
<SelectItem key={value} value={value}>{value}</SelectItem>
|
|
83
|
+
))}
|
|
84
|
+
</SelectContent>
|
|
85
|
+
</Select>
|
|
78
86
|
</div>
|
|
79
87
|
)
|
|
80
88
|
}
|
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import { useState, useEffect, useCallback } from 'react'
|
|
4
4
|
import { Button } from '@open-mercato/ui/primitives/button'
|
|
5
|
+
import { Input } from '@open-mercato/ui/primitives/input'
|
|
6
|
+
import {
|
|
7
|
+
Select,
|
|
8
|
+
SelectContent,
|
|
9
|
+
SelectItem,
|
|
10
|
+
SelectTrigger,
|
|
11
|
+
SelectValue,
|
|
12
|
+
} from '@open-mercato/ui/primitives/select'
|
|
5
13
|
import Link from 'next/link'
|
|
6
14
|
import { useQuery, useQueryClient } from '@tanstack/react-query'
|
|
7
15
|
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
@@ -726,20 +734,21 @@ export default function CheckoutDemoPage() {
|
|
|
726
734
|
{fieldDescription && (
|
|
727
735
|
<p className="text-xs text-gray-500 mb-1">{fieldDescription}</p>
|
|
728
736
|
)}
|
|
729
|
-
<
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
onChange={(e) => handleFieldChange(fieldName, e.target.value)}
|
|
733
|
-
required={required}
|
|
734
|
-
className={inputClasses}
|
|
737
|
+
<Select
|
|
738
|
+
value={(formData[fieldName] as string) || undefined}
|
|
739
|
+
onValueChange={(value) => handleFieldChange(fieldName, value ?? '')}
|
|
735
740
|
>
|
|
736
|
-
<
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
741
|
+
<SelectTrigger id={fieldName} className={inputClasses} aria-required={required}>
|
|
742
|
+
<SelectValue placeholder={t('workflows.checkoutDemo.formField.selectOption', '-- Select an option --')} />
|
|
743
|
+
</SelectTrigger>
|
|
744
|
+
<SelectContent>
|
|
745
|
+
{enumValues.map((value: any) => (
|
|
746
|
+
<SelectItem key={value} value={value}>
|
|
747
|
+
{value}
|
|
748
|
+
</SelectItem>
|
|
749
|
+
))}
|
|
750
|
+
</SelectContent>
|
|
751
|
+
</Select>
|
|
743
752
|
</div>
|
|
744
753
|
)
|
|
745
754
|
}
|
|
@@ -757,13 +766,12 @@ export default function CheckoutDemoPage() {
|
|
|
757
766
|
{fieldDescription && (
|
|
758
767
|
<p className="text-xs text-gray-500 mb-1">{fieldDescription}</p>
|
|
759
768
|
)}
|
|
760
|
-
<
|
|
769
|
+
<Input
|
|
761
770
|
type="email"
|
|
762
771
|
id={fieldName}
|
|
763
772
|
value={formData[fieldName] || ''}
|
|
764
773
|
onChange={(e) => handleFieldChange(fieldName, e.target.value)}
|
|
765
774
|
required={required}
|
|
766
|
-
className={inputClasses}
|
|
767
775
|
/>
|
|
768
776
|
</div>
|
|
769
777
|
)
|
|
@@ -819,13 +827,12 @@ export default function CheckoutDemoPage() {
|
|
|
819
827
|
{fieldDescription && (
|
|
820
828
|
<p className="text-xs text-gray-500 mb-1">{fieldDescription}</p>
|
|
821
829
|
)}
|
|
822
|
-
<
|
|
830
|
+
<Input
|
|
823
831
|
type="text"
|
|
824
832
|
id={fieldName}
|
|
825
833
|
value={formData[fieldName] || ''}
|
|
826
834
|
onChange={(e) => handleFieldChange(fieldName, e.target.value)}
|
|
827
835
|
required={required}
|
|
828
|
-
className={inputClasses}
|
|
829
836
|
/>
|
|
830
837
|
</div>
|
|
831
838
|
)
|
|
@@ -841,14 +848,13 @@ export default function CheckoutDemoPage() {
|
|
|
841
848
|
{fieldDescription && (
|
|
842
849
|
<p className="text-xs text-gray-500 mb-1">{fieldDescription}</p>
|
|
843
850
|
)}
|
|
844
|
-
<
|
|
851
|
+
<Input
|
|
845
852
|
type="number"
|
|
846
853
|
id={fieldName}
|
|
847
854
|
value={formData[fieldName] || ''}
|
|
848
855
|
onChange={(e) => handleFieldChange(fieldName, e.target.value ? Number(e.target.value) : '')}
|
|
849
856
|
required={required}
|
|
850
857
|
step={fieldType === 'integer' ? 1 : 'any'}
|
|
851
|
-
className={inputClasses}
|
|
852
858
|
/>
|
|
853
859
|
</div>
|
|
854
860
|
)
|
|
@@ -885,13 +891,12 @@ export default function CheckoutDemoPage() {
|
|
|
885
891
|
{fieldDescription && (
|
|
886
892
|
<p className="text-xs text-gray-500 mb-1">{fieldDescription}</p>
|
|
887
893
|
)}
|
|
888
|
-
<
|
|
894
|
+
<Input
|
|
889
895
|
type="text"
|
|
890
896
|
id={fieldName}
|
|
891
897
|
value={formData[fieldName] || ''}
|
|
892
898
|
onChange={(e) => handleFieldChange(fieldName, e.target.value)}
|
|
893
899
|
required={required}
|
|
894
|
-
className={inputClasses}
|
|
895
900
|
/>
|
|
896
901
|
</div>
|
|
897
902
|
)
|
|
@@ -937,34 +942,39 @@ export default function CheckoutDemoPage() {
|
|
|
937
942
|
</div>
|
|
938
943
|
) : (
|
|
939
944
|
<>
|
|
940
|
-
<
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
onChange={(e) => setSelectedCustomerId(e.target.value)}
|
|
944
|
-
className="w-full px-3 py-2 border border-gray-300 rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring text-sm"
|
|
945
|
+
<Select
|
|
946
|
+
value={selectedCustomerId || undefined}
|
|
947
|
+
onValueChange={(value) => setSelectedCustomerId(value ?? '')}
|
|
945
948
|
>
|
|
946
|
-
<
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
949
|
+
<SelectTrigger id="customer-select">
|
|
950
|
+
<SelectValue placeholder={t('workflows.checkoutDemo.customer.selectPlaceholder', '-- Select a customer --')} />
|
|
951
|
+
</SelectTrigger>
|
|
952
|
+
<SelectContent>
|
|
953
|
+
{customers.map((customer: any) => (
|
|
954
|
+
<SelectItem key={customer.id} value={customer.id}>
|
|
955
|
+
{customer.display_name || customer.id}
|
|
956
|
+
</SelectItem>
|
|
957
|
+
))}
|
|
958
|
+
</SelectContent>
|
|
959
|
+
</Select>
|
|
953
960
|
<div className="mt-2">
|
|
954
961
|
<label htmlFor="currency-select" className="block text-xs font-medium text-gray-600 mb-1">
|
|
955
962
|
{t('workflows.checkoutDemo.currency.label', 'Currency')}
|
|
956
963
|
</label>
|
|
957
|
-
<
|
|
958
|
-
id="currency-select"
|
|
964
|
+
<Select
|
|
959
965
|
value={selectedCurrency}
|
|
960
|
-
|
|
961
|
-
className="w-full px-3 py-2 border border-gray-300 rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring text-sm"
|
|
966
|
+
onValueChange={(value) => setSelectedCurrency(value)}
|
|
962
967
|
>
|
|
963
|
-
<
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
<
|
|
967
|
-
|
|
968
|
+
<SelectTrigger id="currency-select">
|
|
969
|
+
<SelectValue />
|
|
970
|
+
</SelectTrigger>
|
|
971
|
+
<SelectContent>
|
|
972
|
+
<SelectItem value="USD">USD - US Dollar</SelectItem>
|
|
973
|
+
<SelectItem value="EUR">EUR - Euro</SelectItem>
|
|
974
|
+
<SelectItem value="GBP">GBP - British Pound</SelectItem>
|
|
975
|
+
<SelectItem value="PLN">PLN - Polish Zloty</SelectItem>
|
|
976
|
+
</SelectContent>
|
|
977
|
+
</Select>
|
|
968
978
|
</div>
|
|
969
979
|
</>
|
|
970
980
|
)}
|
|
@@ -986,33 +996,34 @@ export default function CheckoutDemoPage() {
|
|
|
986
996
|
</div>
|
|
987
997
|
) : (
|
|
988
998
|
<div className="space-y-2">
|
|
989
|
-
<
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
const product = products.find((p: any) => p.id ===
|
|
999
|
+
<Select
|
|
1000
|
+
value={undefined}
|
|
1001
|
+
onValueChange={(value) => {
|
|
1002
|
+
const product = products.find((p: any) => p.id === value)
|
|
993
1003
|
if (product) {
|
|
994
1004
|
addToCart({
|
|
995
1005
|
id: product.id,
|
|
996
1006
|
title: product.title || product.display_name || 'Untitled Product',
|
|
997
1007
|
pricing: product.pricing || null,
|
|
998
1008
|
})
|
|
999
|
-
e.target.value = '' // Reset selection
|
|
1000
1009
|
}
|
|
1001
1010
|
}}
|
|
1002
|
-
className="w-full px-3 py-2 border border-gray-300 rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring text-sm"
|
|
1003
|
-
value=""
|
|
1004
1011
|
>
|
|
1005
|
-
<
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1012
|
+
<SelectTrigger id="product-select">
|
|
1013
|
+
<SelectValue placeholder={t('workflows.checkoutDemo.product.selectPlaceholder', '-- Select a product to add --')} />
|
|
1014
|
+
</SelectTrigger>
|
|
1015
|
+
<SelectContent>
|
|
1016
|
+
{products.map((product: any) => {
|
|
1017
|
+
const basePrice = product.pricing?.unit_price_gross || product.pricing?.unit_price_net || 99.99
|
|
1018
|
+
const displayPrice = (basePrice * exchangeRate).toFixed(2)
|
|
1019
|
+
return (
|
|
1020
|
+
<SelectItem key={product.id} value={product.id}>
|
|
1021
|
+
{product.title || product.display_name || 'Untitled'} - {currencySymbol}{displayPrice}
|
|
1022
|
+
</SelectItem>
|
|
1023
|
+
)
|
|
1024
|
+
})}
|
|
1025
|
+
</SelectContent>
|
|
1026
|
+
</Select>
|
|
1016
1027
|
{cart.length === 0 && (
|
|
1017
1028
|
<p className="text-xs text-gray-500 mt-1">
|
|
1018
1029
|
{t('workflows.checkoutDemo.cart.selectHint', 'Select products from the dropdown to add them to your cart')}
|