@open-mercato/core 0.6.6-develop.6184.1.b7e55f8d61 → 0.6.6-develop.6198.1.0822f97cc6
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/.turbo/turbo-build.log +1 -1
- package/dist/modules/auth/frontend/login.js +5 -5
- package/dist/modules/auth/frontend/login.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.js +3 -2
- package/dist/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.js.map +2 -2
- package/dist/modules/catalog/widgets/injection/product-seo/widget.client.js +26 -14
- package/dist/modules/catalog/widgets/injection/product-seo/widget.client.js.map +2 -2
- package/dist/modules/customers/api/deals/[id]/route.js +169 -149
- package/dist/modules/customers/api/deals/[id]/route.js.map +3 -3
- package/dist/modules/customers/components/detail/InlineEditors.js +9 -4
- package/dist/modules/customers/components/detail/InlineEditors.js.map +2 -2
- package/dist/modules/integrations/backend/integrations/[id]/page.js +13 -9
- package/dist/modules/integrations/backend/integrations/[id]/page.js.map +2 -2
- package/dist/modules/integrations/backend/integrations/detail-page-refresh.js +17 -0
- package/dist/modules/integrations/backend/integrations/detail-page-refresh.js.map +7 -0
- package/dist/modules/sales/components/documents/SalesDocumentForm.js +299 -297
- package/dist/modules/sales/components/documents/SalesDocumentForm.js.map +2 -2
- package/dist/modules/workflows/components/EdgeEditDialog.js +120 -141
- package/dist/modules/workflows/components/EdgeEditDialog.js.map +2 -2
- package/dist/modules/workflows/components/NodeEditDialog.js +114 -118
- package/dist/modules/workflows/components/NodeEditDialog.js.map +2 -2
- package/dist/modules/workflows/frontend/checkout-demo/page.js +155 -260
- package/dist/modules/workflows/frontend/checkout-demo/page.js.map +2 -2
- package/package.json +7 -7
- package/src/modules/auth/frontend/login.tsx +5 -5
- package/src/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.tsx +4 -3
- package/src/modules/catalog/widgets/injection/product-seo/widget.client.tsx +27 -17
- package/src/modules/customers/api/deals/[id]/route.ts +208 -174
- package/src/modules/customers/components/detail/InlineEditors.tsx +6 -10
- package/src/modules/integrations/backend/integrations/[id]/page.tsx +13 -9
- package/src/modules/integrations/backend/integrations/detail-page-refresh.ts +36 -0
- package/src/modules/sales/components/documents/SalesDocumentForm.tsx +351 -327
- package/src/modules/workflows/components/EdgeEditDialog.tsx +132 -157
- package/src/modules/workflows/components/NodeEditDialog.tsx +116 -121
- package/src/modules/workflows/frontend/checkout-demo/page.tsx +172 -239
- package/src/modules/workflows/i18n/de.json +2 -0
- package/src/modules/workflows/i18n/en.json +2 -0
- package/src/modules/workflows/i18n/es.json +2 -0
- package/src/modules/workflows/i18n/pl.json +2 -0
|
@@ -3,15 +3,13 @@
|
|
|
3
3
|
import * as React from 'react'
|
|
4
4
|
import Link from 'next/link'
|
|
5
5
|
import { AtSign, Briefcase, Loader2, Pencil, X } from 'lucide-react'
|
|
6
|
-
import ReactMarkdown from 'react-markdown'
|
|
7
6
|
import { Button } from '@open-mercato/ui/primitives/button'
|
|
8
|
-
import
|
|
7
|
+
import { MarkdownContent } from '@open-mercato/ui/backend/markdown'
|
|
9
8
|
import { flash } from '@open-mercato/ui/backend/FlashMessages'
|
|
10
9
|
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
11
10
|
import { cn } from '@open-mercato/shared/lib/utils'
|
|
12
11
|
import { useQueryClient } from '@tanstack/react-query'
|
|
13
12
|
import { useOrganizationScopeVersion } from '@open-mercato/shared/lib/frontend/useOrganizationScope'
|
|
14
|
-
import remarkGfm from 'remark-gfm'
|
|
15
13
|
import { useEmailDuplicateCheck } from '../../backend/hooks/useEmailDuplicateCheck'
|
|
16
14
|
import { lookupPhoneDuplicate } from '../../utils/phoneDuplicates'
|
|
17
15
|
import {
|
|
@@ -172,8 +170,6 @@ export function InlineTextEditor(props: InlineFieldProps) {
|
|
|
172
170
|
export const InlineMultilineEditor = UiInlineMultilineEditor
|
|
173
171
|
export const InlineSelectEditor = UiInlineSelectEditor
|
|
174
172
|
|
|
175
|
-
const MARKDOWN_PREVIEW_PLUGINS: PluggableList = [remarkGfm]
|
|
176
|
-
|
|
177
173
|
function createSocialRenderDisplay(IconComponent: typeof Briefcase): NonNullable<InlineFieldProps['renderDisplay']> {
|
|
178
174
|
// eslint-disable-next-line react/display-name
|
|
179
175
|
return ({ value, emptyLabel }) => {
|
|
@@ -206,11 +202,11 @@ export const renderMultilineMarkdownDisplay: InlineMultilineDisplayRenderer = ({
|
|
|
206
202
|
return <span className="text-muted-foreground">{emptyLabel}</span>
|
|
207
203
|
}
|
|
208
204
|
return (
|
|
209
|
-
<
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
205
|
+
<MarkdownContent
|
|
206
|
+
format="markdown"
|
|
207
|
+
body={raw}
|
|
208
|
+
className="text-sm text-foreground [&>*]:mb-2 [&>*:last-child]:mb-0 [&_ul]:ml-4 [&_ul]:list-disc [&_ol]:ml-4 [&_ol]:list-decimal [&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_pre]:rounded-md [&_pre]:bg-muted [&_pre]:p-3 [&_pre]:text-xs"
|
|
209
|
+
/>
|
|
214
210
|
)
|
|
215
211
|
}
|
|
216
212
|
|
|
@@ -47,6 +47,10 @@ import {
|
|
|
47
47
|
resolveIntegrationDetailWidgetSpotId,
|
|
48
48
|
resolveRequestedIntegrationDetailTab,
|
|
49
49
|
} from '../detail-page-widgets'
|
|
50
|
+
import {
|
|
51
|
+
refreshIntegrationDetailPanels,
|
|
52
|
+
refreshIntegrationRunActivityPanels,
|
|
53
|
+
} from '../detail-page-refresh'
|
|
50
54
|
import { isValidCredentialUrl } from '../../../lib/credentials-field-validation'
|
|
51
55
|
|
|
52
56
|
type CredentialField = IntegrationCredentialField
|
|
@@ -531,8 +535,7 @@ export default function IntegrationDetailPage({ params }: IntegrationDetailPageP
|
|
|
531
535
|
spotId: detailWidgetSpotId,
|
|
532
536
|
})
|
|
533
537
|
const refreshDetail = React.useCallback(async () => {
|
|
534
|
-
await
|
|
535
|
-
await loadCredentials()
|
|
538
|
+
await refreshIntegrationDetailPanels({ loadDetail, loadCredentials })
|
|
536
539
|
}, [loadCredentials, loadDetail])
|
|
537
540
|
const refreshLogs = React.useCallback(async () => {
|
|
538
541
|
await loadLogs()
|
|
@@ -549,13 +552,14 @@ export default function IntegrationDetailPage({ params }: IntegrationDetailPageP
|
|
|
549
552
|
}
|
|
550
553
|
if (options?.showLoading) setIsRefreshingRunActivity(true)
|
|
551
554
|
try {
|
|
552
|
-
const call = await
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
555
|
+
const [call] = await Promise.all([
|
|
556
|
+
apiCall<DataSyncRunDetail>(
|
|
557
|
+
`/api/data_sync/runs/${encodeURIComponent(runIdFromUrl)}`,
|
|
558
|
+
undefined,
|
|
559
|
+
{ fallback: null },
|
|
560
|
+
),
|
|
561
|
+
refreshIntegrationRunActivityPanels({ loadLogs, loadDetail }),
|
|
562
|
+
])
|
|
559
563
|
if (call.ok && call.result) {
|
|
560
564
|
setActiveRunDetail(call.result)
|
|
561
565
|
setActiveRunRefreshedAt(new Date().toISOString())
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
type ShowLoadingOption = { showLoading?: boolean }
|
|
2
|
+
type IntegrationDetailLoader = (options?: ShowLoadingOption) => Promise<void>
|
|
3
|
+
type IntegrationPanelLoader = () => Promise<void>
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Refresh the integration detail and credential panels concurrently.
|
|
7
|
+
*
|
|
8
|
+
* Detail and credentials are served by independent endpoints with no data
|
|
9
|
+
* dependency between them, so the two requests start together instead of
|
|
10
|
+
* waiting for the detail load to resolve before credentials begins.
|
|
11
|
+
*/
|
|
12
|
+
export async function refreshIntegrationDetailPanels(loaders: {
|
|
13
|
+
loadDetail: IntegrationDetailLoader
|
|
14
|
+
loadCredentials: IntegrationPanelLoader
|
|
15
|
+
}): Promise<void> {
|
|
16
|
+
await Promise.all([
|
|
17
|
+
loaders.loadDetail({ showLoading: false }),
|
|
18
|
+
loaders.loadCredentials(),
|
|
19
|
+
])
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Refresh the run-activity panels (logs and detail) concurrently.
|
|
24
|
+
*
|
|
25
|
+
* loadLogs and loadDetail hit independent endpoints and neither consumes the
|
|
26
|
+
* other's result, so the two reloads start together.
|
|
27
|
+
*/
|
|
28
|
+
export async function refreshIntegrationRunActivityPanels(loaders: {
|
|
29
|
+
loadLogs: IntegrationPanelLoader
|
|
30
|
+
loadDetail: IntegrationDetailLoader
|
|
31
|
+
}): Promise<void> {
|
|
32
|
+
await Promise.all([
|
|
33
|
+
loaders.loadLogs(),
|
|
34
|
+
loaders.loadDetail({ showLoading: false }),
|
|
35
|
+
])
|
|
36
|
+
}
|