create-mercato-app 0.9.1-develop.7499.1.fcec456e4e → 0.9.1-develop.7515.1.e2712c8b00
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/agentic/guides/module-facts.json +192 -154
- package/dist/agentic/guides/module-facts.v2.json +192 -154
- package/dist/agentic/guides/modules/agent_orchestrator/index.md +1 -1
- package/dist/agentic/guides/modules/ai_assistant/index.md +1 -1
- package/dist/agentic/guides/modules/api_docs/index.md +1 -1
- package/dist/agentic/guides/modules/api_keys/index.md +1 -1
- package/dist/agentic/guides/modules/attachments/index.md +1 -1
- package/dist/agentic/guides/modules/audit_logs/index.md +1 -1
- package/dist/agentic/guides/modules/auth/index.md +1 -1
- package/dist/agentic/guides/modules/availability/index.md +1 -1
- package/dist/agentic/guides/modules/business_rules/index.md +1 -1
- package/dist/agentic/guides/modules/catalog/index.md +1 -1
- package/dist/agentic/guides/modules/channel_apns/index.md +1 -1
- package/dist/agentic/guides/modules/channel_discord/index.md +1 -1
- package/dist/agentic/guides/modules/channel_expo/index.md +1 -1
- package/dist/agentic/guides/modules/channel_fcm/index.md +1 -1
- package/dist/agentic/guides/modules/channel_gmail/index.md +1 -1
- package/dist/agentic/guides/modules/channel_imap/index.md +1 -1
- package/dist/agentic/guides/modules/channel_resend/index.md +1 -1
- package/dist/agentic/guides/modules/channel_ses/index.md +1 -1
- package/dist/agentic/guides/modules/checkout/index.md +1 -1
- package/dist/agentic/guides/modules/communication_channels/index.md +1 -1
- package/dist/agentic/guides/modules/configs/index.md +1 -1
- package/dist/agentic/guides/modules/content/index.md +1 -1
- package/dist/agentic/guides/modules/currencies/index.md +1 -1
- package/dist/agentic/guides/modules/customer_accounts/index.md +1 -1
- package/dist/agentic/guides/modules/customer_groups/index.md +1 -1
- package/dist/agentic/guides/modules/customers/index.md +1 -1
- package/dist/agentic/guides/modules/dashboards/index.md +1 -1
- package/dist/agentic/guides/modules/data_sync/index.md +1 -1
- package/dist/agentic/guides/modules/design_system/index.md +1 -1
- package/dist/agentic/guides/modules/devices/index.md +1 -1
- package/dist/agentic/guides/modules/dictionaries/index.md +1 -1
- package/dist/agentic/guides/modules/directory/index.md +1 -1
- package/dist/agentic/guides/modules/documents/index.md +1 -1
- package/dist/agentic/guides/modules/ecommerce/index.md +1 -1
- package/dist/agentic/guides/modules/entities/index.md +1 -1
- package/dist/agentic/guides/modules/eudr/index.md +1 -1
- package/dist/agentic/guides/modules/events/index.md +1 -1
- package/dist/agentic/guides/modules/feature_toggles/index.md +1 -1
- package/dist/agentic/guides/modules/forms/index.md +1 -1
- package/dist/agentic/guides/modules/gateway_stripe/index.md +1 -1
- package/dist/agentic/guides/modules/gateway_tpay/index.md +1 -1
- package/dist/agentic/guides/modules/generators/index.md +1 -1
- package/dist/agentic/guides/modules/inbox_ops/index.md +1 -1
- package/dist/agentic/guides/modules/integrations/index.md +1 -1
- package/dist/agentic/guides/modules/messages/index.md +1 -1
- package/dist/agentic/guides/modules/notifications/index.md +1 -1
- package/dist/agentic/guides/modules/onboarding/index.md +1 -1
- package/dist/agentic/guides/modules/payment_gateways/index.md +1 -1
- package/dist/agentic/guides/modules/perspectives/index.md +1 -1
- package/dist/agentic/guides/modules/phone_calls/index.md +1 -1
- package/dist/agentic/guides/modules/planner/index.md +1 -1
- package/dist/agentic/guides/modules/portal/index.md +1 -1
- package/dist/agentic/guides/modules/progress/index.md +1 -1
- package/dist/agentic/guides/modules/push_notifications/index.md +1 -1
- package/dist/agentic/guides/modules/query_index/index.md +1 -1
- package/dist/agentic/guides/modules/record_locks/index.md +1 -1
- package/dist/agentic/guides/modules/resources/index.md +1 -1
- package/dist/agentic/guides/modules/sales/index.md +1 -1
- package/dist/agentic/guides/modules/scheduler/index.md +1 -1
- package/dist/agentic/guides/modules/search/index.md +1 -1
- package/dist/agentic/guides/modules/security/index.md +1 -1
- package/dist/agentic/guides/modules/seeds/index.md +1 -1
- package/dist/agentic/guides/modules/shipping_carriers/exact-override-targets.md +1 -1
- package/dist/agentic/guides/modules/shipping_carriers/index.md +1 -1
- package/dist/agentic/guides/modules/shipping_carriers/workers.md +1 -1
- package/dist/agentic/guides/modules/sso/index.md +1 -1
- package/dist/agentic/guides/modules/staff/index.md +1 -1
- package/dist/agentic/guides/modules/storage_s3/index.md +1 -1
- package/dist/agentic/guides/modules/sync_akeneo/index.md +1 -1
- package/dist/agentic/guides/modules/sync_excel/index.md +1 -1
- package/dist/agentic/guides/modules/system_status_overlays/index.md +1 -1
- package/dist/agentic/guides/modules/telemetry/index.md +1 -1
- package/dist/agentic/guides/modules/tillio/index.md +1 -1
- package/dist/agentic/guides/modules/translations/index.md +1 -1
- package/dist/agentic/guides/modules/warranty_claims/index.md +1 -1
- package/dist/agentic/guides/modules/webhooks/index.md +1 -1
- package/dist/agentic/guides/modules/wms/events.md +2 -1
- package/dist/agentic/guides/modules/wms/index.md +1 -1
- package/dist/agentic/guides/modules/wms/umes-hosts.md +1 -0
- package/dist/agentic/guides/modules/workflows/index.md +1 -1
- package/dist/agentic/guides/reference-module-facts.json +177 -3
- package/dist/agentic/guides/reference-modules/example/active-extension-bindings.md +1 -0
- package/dist/agentic/guides/reference-modules/example/contribution-resolutions.md +2 -0
- package/dist/agentic/guides/reference-modules/example/exact-override-targets.md +2 -0
- package/dist/agentic/guides/reference-modules/example/index.md +1 -1
- package/dist/agentic/guides/reference-modules/example/umes-contributions.md +2 -0
- package/dist/agentic/guides/reference-modules/example/umes-hosts.md +1 -0
- package/dist/agentic/guides/upstream/manifest.json +1 -1
- package/package.json +3 -3
- package/template/.ds-check-ignore +0 -114
- package/template/src/i18n/de.json +5 -0
- package/template/src/i18n/en.json +5 -0
- package/template/src/i18n/es.json +5 -0
- package/template/src/i18n/ko.json +5 -0
- package/template/src/i18n/pl.json +5 -0
- package/template/src/modules/example/__integration__/TC-UMES-004.spec.ts +1 -1
- package/template/src/modules/example/__integration__/TC-UMES-023-client-override-dispatch.spec.ts +76 -0
- package/template/src/modules/example/__tests__/extension-points.test.ts +1 -0
- package/template/src/modules/example/backend/umes-extensions/page.tsx +25 -6
- package/template/src/modules/example/extension-points.ts +6 -0
- package/template/src/modules/example/i18n/de.json +6 -0
- package/template/src/modules/example/i18n/en.json +6 -0
- package/template/src/modules/example/i18n/es.json +6 -0
- package/template/src/modules/example/i18n/ko.json +6 -0
- package/template/src/modules/example/i18n/pl.json +6 -0
- package/template/src/modules/example/widgets/__tests__/injection-table.test.ts +1 -0
- package/template/src/modules/example/widgets/injection/override-probe/widget.client.tsx +16 -0
- package/template/src/modules/example/widgets/injection/override-probe/widget.ts +27 -0
- package/template/src/modules/example/widgets/injection/override-probe-control/widget.client.tsx +16 -0
- package/template/src/modules/example/widgets/injection/override-probe-control/widget.ts +21 -0
- package/template/src/modules/example/widgets/injection-table.ts +8 -0
|
@@ -651,6 +651,7 @@
|
|
|
651
651
|
"ui.advancedFilter.error.textTooShort": "3자 이상 입력하세요",
|
|
652
652
|
"ui.advancedFilter.fieldPicker.hint": "팁: 입력해 검색, ↑↓로 이동, Enter로 선택",
|
|
653
653
|
"ui.advancedFilter.fieldPicker.search": "필드 검색…",
|
|
654
|
+
"ui.advancedFilter.fieldPicker.ungrouped": "기타",
|
|
654
655
|
"ui.advancedFilter.limitDepthHint": "최대 중첩 깊이({max}단계)에 도달했습니다. 대신 연결어를 사용해 이 그룹의 결합 방식을 전환하세요.",
|
|
655
656
|
"ui.advancedFilter.limitDepthReached": "최대 중첩 깊이에 도달했습니다",
|
|
656
657
|
"ui.advancedFilter.limitTotalReached": "최대 {max}개 조건에 도달했습니다",
|
|
@@ -710,6 +711,10 @@
|
|
|
710
711
|
"ui.advancedFilter.toggle": "고급 필터",
|
|
711
712
|
"ui.advancedFilter.toggleJoin": "필터 결합 연산자 전환",
|
|
712
713
|
"ui.advancedFilter.toggleJoinHint": "클릭하여 AND와 OR 사이를 전환하세요",
|
|
714
|
+
"ui.auth.accessDenied.generic": "접근 거부: 이 작업을 수행할 권한이 없습니다.",
|
|
715
|
+
"ui.auth.accessDenied.missingFeatures": "접근 거부: 필요한 권한 \"{features}\"이(가) 없습니다. 관리자에게 문의하세요.",
|
|
716
|
+
"ui.auth.accessDenied.requiredRoles": "접근 거부: 이 영역에는 \"{roles}\" 역할이 필요합니다. 관리자에게 문의하세요.",
|
|
717
|
+
"ui.auth.sessionExpired": "세션이 만료되었습니다. 로그인 페이지로 이동합니다…",
|
|
713
718
|
"ui.badges.severity.high": "높음",
|
|
714
719
|
"ui.badges.severity.low": "낮음",
|
|
715
720
|
"ui.badges.severity.medium": "중간",
|
|
@@ -651,6 +651,7 @@
|
|
|
651
651
|
"ui.advancedFilter.error.textTooShort": "Wpisz co najmniej 3 znaki",
|
|
652
652
|
"ui.advancedFilter.fieldPicker.hint": "Wskazówka: pisz, aby wyszukać, ↑↓ aby nawigować, Enter aby wybrać",
|
|
653
653
|
"ui.advancedFilter.fieldPicker.search": "Wyszukaj pole…",
|
|
654
|
+
"ui.advancedFilter.fieldPicker.ungrouped": "Więcej",
|
|
654
655
|
"ui.advancedFilter.limitDepthHint": "Osiągnięto maksymalną głębokość zagnieżdżenia ({max} poziomy). Użyj słowa łączącego, aby zmienić łącznik tej grupy.",
|
|
655
656
|
"ui.advancedFilter.limitDepthReached": "Osiągnięto maksymalną głębokość zagnieżdżenia",
|
|
656
657
|
"ui.advancedFilter.limitTotalReached": "Osiągnięto maksimum {max} warunków",
|
|
@@ -710,6 +711,10 @@
|
|
|
710
711
|
"ui.advancedFilter.toggle": "Filtry zaawansowane",
|
|
711
712
|
"ui.advancedFilter.toggleJoin": "Przełącz operator łączenia filtrów",
|
|
712
713
|
"ui.advancedFilter.toggleJoinHint": "Kliknij, aby przełączyć między ORAZ i LUB",
|
|
714
|
+
"ui.auth.accessDenied.generic": "Odmowa dostępu: nie masz uprawnień do wykonania tej czynności.",
|
|
715
|
+
"ui.auth.accessDenied.missingFeatures": "Odmowa dostępu: brakuje wymaganego uprawnienia „{features}”. Skontaktuj się z administratorem.",
|
|
716
|
+
"ui.auth.accessDenied.requiredRoles": "Odmowa dostępu: ten obszar wymaga roli „{roles}”. Skontaktuj się z administratorem.",
|
|
717
|
+
"ui.auth.sessionExpired": "Sesja wygasła. Przekierowanie do logowania…",
|
|
713
718
|
"ui.badges.severity.high": "Wysoki",
|
|
714
719
|
"ui.badges.severity.low": "Niski",
|
|
715
720
|
"ui.badges.severity.medium": "Średni",
|
|
@@ -354,7 +354,7 @@ test.describe('TC-UMES-004: Phase E-H completion', () => {
|
|
|
354
354
|
'Note: red network entries for probes 3-5 are expected and indicate correct fail-closed behavior.',
|
|
355
355
|
)
|
|
356
356
|
await expect(interceptorHint).toBeVisible()
|
|
357
|
-
await expect(interceptorHint.locator('xpath=ancestor::div[1]')).toHaveClass(
|
|
357
|
+
await expect(interceptorHint.locator('xpath=ancestor::div[1]')).toHaveClass(/\bborder-status-warning-border\b/)
|
|
358
358
|
|
|
359
359
|
await expect(page.locator('[data-component-handle="page:/backend/umes-extensions"]')).toHaveCount(1)
|
|
360
360
|
await expect(page.locator('[data-component-handle="data-table:example.umes.extensions"]')).toHaveCount(1)
|
package/template/src/modules/example/__integration__/TC-UMES-023-client-override-dispatch.spec.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TC-UMES-023: `modules.ts` injection-widget overrides survive the client bootstrap.
|
|
3
|
+
*
|
|
4
|
+
* The server bootstrap applies `src/modules.ts` overrides before it registers the
|
|
5
|
+
* injection registry, so the server-rendered HTML has always been correct. The browser
|
|
6
|
+
* re-registers the same registry from `ClientBootstrap`; before #5152 it did so from the
|
|
7
|
+
* raw generated entries, and a widget the app had disabled reappeared the moment
|
|
8
|
+
* hydration finished. Nothing about that failure is observable from Node: it depends on
|
|
9
|
+
* `@/modules` being re-evaluated in a real bundle, where Next inlines no server-only
|
|
10
|
+
* `process.env.OM_*` value. Hence a browser test rather than another unit test (#5844).
|
|
11
|
+
*
|
|
12
|
+
* `example:override-probe` carries two widgets:
|
|
13
|
+
* - `example.injection.override-probe` — disabled in `apps/mercato/src/modules.ts`,
|
|
14
|
+
* keyed by its registry `key` rather than its `widgetId`, so the override has to
|
|
15
|
+
* travel through the alias resolution #5152 added to reach the injection table.
|
|
16
|
+
* - `example.injection.override-probe-control` — not overridden. Its visibility is the
|
|
17
|
+
* hydration barrier AND the second case the issue asks for: without it, an assertion
|
|
18
|
+
* on the first widget's absence would pass just as happily on a spot that renders
|
|
19
|
+
* nothing at all.
|
|
20
|
+
*/
|
|
21
|
+
import { test, expect } from '@playwright/test'
|
|
22
|
+
import { login } from '@open-mercato/core/helpers/integration/auth'
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The client injection registry is re-registered asynchronously and `InjectionSpot`
|
|
26
|
+
* re-renders on every registry change, so a widget removed by the server can still be
|
|
27
|
+
* put back a beat later. Re-checking across this window is what separates "the override
|
|
28
|
+
* held" from "the client bootstrap had not run yet when we looked".
|
|
29
|
+
*/
|
|
30
|
+
const POST_HYDRATION_SETTLE_CHECKS = 4
|
|
31
|
+
const POST_HYDRATION_SETTLE_INTERVAL_MS = 500
|
|
32
|
+
|
|
33
|
+
test.describe('TC-UMES-023: client-side module-override dispatch', () => {
|
|
34
|
+
test.beforeEach(async ({ page }) => {
|
|
35
|
+
// `/backend/umes-extensions` is one of the heaviest example pages, and against a dev
|
|
36
|
+
// server its first compile alone can outlast the default per-test budget.
|
|
37
|
+
test.slow()
|
|
38
|
+
await login(page, 'admin')
|
|
39
|
+
await page.goto('/backend/umes-extensions', { waitUntil: 'domcontentloaded' })
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
test('renders the non-overridden control widget on the probe spot', async ({ page }) => {
|
|
43
|
+
await expect(page.getByTestId('phase-i-override-probe-spot')).toBeVisible()
|
|
44
|
+
await expect(page.getByTestId('example-override-probe-control')).toBeVisible()
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
test('keeps the disabled widget absent after hydration settles', async ({ page }) => {
|
|
48
|
+
// The control comes from the same registry as the disabled widget, so its arrival
|
|
49
|
+
// means the browser registration has completed — the exact point at which the
|
|
50
|
+
// pre-#5152 bug made the disabled widget reappear.
|
|
51
|
+
await expect(page.getByTestId('example-override-probe-control')).toBeVisible()
|
|
52
|
+
|
|
53
|
+
for (let check = 0; check < POST_HYDRATION_SETTLE_CHECKS; check += 1) {
|
|
54
|
+
await expect(page.getByTestId('example-override-probe')).toHaveCount(0)
|
|
55
|
+
await page.waitForTimeout(POST_HYDRATION_SETTLE_INTERVAL_MS)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// The control is still there at the end, so the loop above was not passing simply
|
|
59
|
+
// because the spot had unmounted.
|
|
60
|
+
await expect(page.getByTestId('example-override-probe-control')).toBeVisible()
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
test('survives a client-side navigation back onto the probe page', async ({ page }) => {
|
|
64
|
+
await expect(page.getByTestId('example-override-probe-control')).toBeVisible()
|
|
65
|
+
|
|
66
|
+
// A soft navigation re-runs the registry group loaders without a fresh document, so
|
|
67
|
+
// it exercises the dispatch memoisation rather than the first-load path.
|
|
68
|
+
await page.getByTestId('phase-f-open-customers').click()
|
|
69
|
+
await page.waitForURL('**/backend/customers/people')
|
|
70
|
+
await page.goBack()
|
|
71
|
+
await page.waitForURL('**/backend/umes-extensions')
|
|
72
|
+
|
|
73
|
+
await expect(page.getByTestId('example-override-probe-control')).toBeVisible()
|
|
74
|
+
await expect(page.getByTestId('example-override-probe')).toHaveCount(0)
|
|
75
|
+
})
|
|
76
|
+
})
|
|
@@ -7,10 +7,12 @@ import { Page, PageBody } from '@open-mercato/ui/backend/Page'
|
|
|
7
7
|
import { Button } from '@open-mercato/ui/primitives/button'
|
|
8
8
|
import { DataTable } from '@open-mercato/ui/backend/DataTable'
|
|
9
9
|
import { CrudForm, type CrudField } from '@open-mercato/ui/backend/CrudForm'
|
|
10
|
+
import { InjectionSpot } from '@open-mercato/ui/backend/injection/InjectionSpot'
|
|
10
11
|
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
11
12
|
import { apiCall } from '@open-mercato/ui/backend/utils/apiCall'
|
|
12
13
|
import { ComponentReplacementHandles } from '@open-mercato/shared/modules/widgets/component-registry'
|
|
13
14
|
import type { LegacyColumnDef as ColumnDef } from '@tanstack/react-table/legacy'
|
|
15
|
+
import { extensionPoints } from '../../extension-points'
|
|
14
16
|
|
|
15
17
|
type TodoListProbe = {
|
|
16
18
|
_example?: {
|
|
@@ -50,7 +52,7 @@ const SAMPLE_HANDLES: HandleRow[] = [
|
|
|
50
52
|
]
|
|
51
53
|
|
|
52
54
|
const probeOrder: InterceptorProbeKey[] = ['default', 'wildcard', 'badQuery', 'timeout', 'crash']
|
|
53
|
-
const hintClassName = 'rounded-md border border-
|
|
55
|
+
const hintClassName = 'rounded-md border border-status-warning-border bg-status-warning-bg p-2 text-xs text-status-warning-text'
|
|
54
56
|
|
|
55
57
|
function print(value: unknown): string {
|
|
56
58
|
try {
|
|
@@ -261,7 +263,7 @@ export default function UmesExtensionsPage() {
|
|
|
261
263
|
</p>
|
|
262
264
|
</div>
|
|
263
265
|
<div className={`grid gap-1 ${hintClassName}`}>
|
|
264
|
-
<div className="font-medium text-
|
|
266
|
+
<div className="font-medium text-status-warning-text">{t('example.umes.extensions.hintHeading', 'What should be visible and how it should work')}</div>
|
|
265
267
|
<div>{t('example.umes.extensions.phaseE.hint1', '1. `default` probe: must return `_example.interceptor` metadata in `/api/example/todos` response.')}</div>
|
|
266
268
|
<div>{t('example.umes.extensions.phaseE.hint2', '2. `wildcard` probe: must return `_example.wildcardProbe=true` for wildcard route interceptor.')}</div>
|
|
267
269
|
<div>{t('example.umes.extensions.phaseE.hint3', '3. `bad-query` probe: must fail with HTTP `400` (route schema revalidation after interceptor rewrite).')}</div>
|
|
@@ -301,7 +303,7 @@ export default function UmesExtensionsPage() {
|
|
|
301
303
|
</p>
|
|
302
304
|
</div>
|
|
303
305
|
<div className={`grid gap-1 ${hintClassName}`}>
|
|
304
|
-
<div className="font-medium text-
|
|
306
|
+
<div className="font-medium text-status-warning-text">{t('example.umes.extensions.hintHeading', 'What should be visible and how it should work')}</div>
|
|
305
307
|
<div>{t('example.umes.extensions.phaseF.hint1', '1. On `/backend/customers/people` table: column `Example priority` should be visible.')}</div>
|
|
306
308
|
<div>{t('example.umes.extensions.phaseF.hint2', '2. In filters drawer: select filter `Priority` should be visible.')}</div>
|
|
307
309
|
<div>{t('example.umes.extensions.phaseF.hint3', '3. In row actions menu: action `Open customer` should be visible.')}</div>
|
|
@@ -317,7 +319,7 @@ export default function UmesExtensionsPage() {
|
|
|
317
319
|
/>
|
|
318
320
|
<div className="flex flex-wrap items-center gap-2 text-xs text-muted-foreground">
|
|
319
321
|
<Button asChild type="button" variant="outline">
|
|
320
|
-
<Link href="/backend/customers/people">{t('example.umes.extensions.phaseF.openCustomers', 'Open customers table')}</Link>
|
|
322
|
+
<Link data-testid="phase-f-open-customers" href="/backend/customers/people">{t('example.umes.extensions.phaseF.openCustomers', 'Open customers table')}</Link>
|
|
321
323
|
</Button>
|
|
322
324
|
<span>{t('example.umes.extensions.phaseF.expect', 'Expect: injected column, row action, filters, and bulk action.')}</span>
|
|
323
325
|
</div>
|
|
@@ -331,7 +333,7 @@ export default function UmesExtensionsPage() {
|
|
|
331
333
|
</p>
|
|
332
334
|
</div>
|
|
333
335
|
<div className={`grid gap-1 ${hintClassName}`}>
|
|
334
|
-
<div className="font-medium text-
|
|
336
|
+
<div className="font-medium text-status-warning-text">{t('example.umes.extensions.hintHeading', 'What should be visible and how it should work')}</div>
|
|
335
337
|
<div>{t('example.umes.extensions.phaseG.hint1', '1. Injected widget card `Example Injection Widget` should be visible above form fields.')}</div>
|
|
336
338
|
<div>{t('example.umes.extensions.phaseG.hint2', '2. Saving valid form should update `submitResult` below the form.')}</div>
|
|
337
339
|
<div>{t('example.umes.extensions.phaseG.hint3', '3. In customer detail form (`/backend/customers/people/:id`), injected `_example.priority` field should persist via onSave handler.')}</div>
|
|
@@ -350,13 +352,30 @@ export default function UmesExtensionsPage() {
|
|
|
350
352
|
</div>
|
|
351
353
|
</div>
|
|
352
354
|
|
|
355
|
+
<div className="space-y-3 rounded border border-border p-4">
|
|
356
|
+
<div>
|
|
357
|
+
<h2 className="text-base font-semibold">{t('example.umes.extensions.phaseI.title', 'Phase I — Client-side module overrides')}</h2>
|
|
358
|
+
<p className="text-sm text-muted-foreground">
|
|
359
|
+
{t('example.umes.extensions.phaseI.description', 'Both widgets below sit on the `example:override-probe` spot. `src/modules.ts` disables the first one and leaves the second alone, so this pair shows whether a modules.ts override survives the browser bootstrap that re-registers the injection registry.')}
|
|
360
|
+
</p>
|
|
361
|
+
</div>
|
|
362
|
+
<div className={`grid gap-1 ${hintClassName}`}>
|
|
363
|
+
<div className="font-medium text-status-warning-text">{t('example.umes.extensions.hintHeading', 'What should be visible and how it should work')}</div>
|
|
364
|
+
<div>{t('example.umes.extensions.phaseI.hint1', '1. The control widget should be visible — it proves the spot itself resolved.')}</div>
|
|
365
|
+
<div>{t('example.umes.extensions.phaseI.hint2', '2. The disabled widget should never appear, including after hydration finishes.')}</div>
|
|
366
|
+
</div>
|
|
367
|
+
<div data-testid="phase-i-override-probe-spot" className="grid gap-2">
|
|
368
|
+
<InjectionSpot spotId={extensionPoints.hosts.overrideProbe.spotId} context={{}} />
|
|
369
|
+
</div>
|
|
370
|
+
</div>
|
|
371
|
+
|
|
353
372
|
<div className="space-y-2 rounded border border-border p-4">
|
|
354
373
|
<h2 className="text-base font-semibold">{t('example.umes.extensions.phaseH.title', 'Phase H — Component replacement')}</h2>
|
|
355
374
|
<p className="text-sm text-muted-foreground">
|
|
356
375
|
{t('example.umes.extensions.phaseH.description', 'Active replacement handles in this area: page, DataTable, CrudForm, and the `ui.detail:NotesSection` wrapper declared in `example/widgets/components.ts`.')}
|
|
357
376
|
</p>
|
|
358
377
|
<div className={`grid gap-1 ${hintClassName}`}>
|
|
359
|
-
<div className="font-medium text-
|
|
378
|
+
<div className="font-medium text-status-warning-text">{t('example.umes.extensions.hintHeading', 'What should be visible and how it should work')}</div>
|
|
360
379
|
<div>{t('example.umes.extensions.phaseH.hint1', '1. This page root should expose `data-component-handle="page:/backend/umes-extensions"`.')}</div>
|
|
361
380
|
<div>{t('example.umes.extensions.phaseH.hint2', '2. Handles list table should expose `data-table:example.umes.extensions` replacement handle.')}</div>
|
|
362
381
|
<div>{t('example.umes.extensions.phaseH.hint3', '3. Form should expose `crud-form:example.todo` replacement handle.')}</div>
|
|
@@ -38,6 +38,12 @@ export const extensionPoints = defineModuleExtensionPoints({
|
|
|
38
38
|
supported: ['render-widget'],
|
|
39
39
|
source: 'backend/umes-handlers/page.tsx',
|
|
40
40
|
}),
|
|
41
|
+
overrideProbe: injectionExtensionHost({
|
|
42
|
+
family: 'generic',
|
|
43
|
+
spotId: 'example:override-probe',
|
|
44
|
+
supported: ['render-widget'],
|
|
45
|
+
source: 'backend/umes-extensions/page.tsx',
|
|
46
|
+
}),
|
|
41
47
|
overrideShowcase: componentExtensionHost({
|
|
42
48
|
componentId: 'section:example.overrides.showcase',
|
|
43
49
|
propsContract: 'OverrideShowcaseProps',
|
|
@@ -342,6 +342,12 @@
|
|
|
342
342
|
"example.umes.extensions.phaseH.hint3": "3. Form should expose `crud-form:example.todo` replacement handle.",
|
|
343
343
|
"example.umes.extensions.phaseH.hint4": "4. Customer detail notes section should render wrapped border from `ExampleNotesSectionWrapper`.",
|
|
344
344
|
"example.umes.extensions.phaseH.title": "Phase H — Komponentenersetzung",
|
|
345
|
+
"example.umes.extensions.phaseI.control": "Kontroll-Widget der Override-Probe — kein Override, immer sichtbar.",
|
|
346
|
+
"example.umes.extensions.phaseI.description": "Beide Widgets unten hängen am Spot `example:override-probe`. `src/modules.ts` deaktiviert das erste und lässt das zweite unangetastet. Das Paar zeigt damit, ob ein modules.ts-Override den Browser-Bootstrap übersteht, der die Injection-Registry neu registriert.",
|
|
347
|
+
"example.umes.extensions.phaseI.hint1": "1. Das Kontroll-Widget sollte sichtbar sein — es belegt, dass der Spot selbst aufgelöst wurde.",
|
|
348
|
+
"example.umes.extensions.phaseI.hint2": "2. Das deaktivierte Widget darf nie erscheinen, auch nicht nach abgeschlossener Hydration.",
|
|
349
|
+
"example.umes.extensions.phaseI.probe": "Override-Probe-Widget — über modules.ts deaktiviert.",
|
|
350
|
+
"example.umes.extensions.phaseI.title": "Phase I — Modul-Overrides auf Client-Seite",
|
|
345
351
|
"example.umes.extensions.table.handle": "Handle",
|
|
346
352
|
"example.umes.extensions.table.label": "Bezeichnung",
|
|
347
353
|
"example.umes.extensions.table.title": "Ersetzungs-Handles",
|
|
@@ -342,6 +342,12 @@
|
|
|
342
342
|
"example.umes.extensions.phaseH.hint3": "3. Form should expose `crud-form:example.todo` replacement handle.",
|
|
343
343
|
"example.umes.extensions.phaseH.hint4": "4. Customer detail notes section should render wrapped border from `ExampleNotesSectionWrapper`.",
|
|
344
344
|
"example.umes.extensions.phaseH.title": "Phase H — Component replacement",
|
|
345
|
+
"example.umes.extensions.phaseI.control": "Override probe control widget — no override, always visible.",
|
|
346
|
+
"example.umes.extensions.phaseI.description": "Both widgets below sit on the `example:override-probe` spot. `src/modules.ts` disables the first one and leaves the second alone, so this pair shows whether a modules.ts override survives the browser bootstrap that re-registers the injection registry.",
|
|
347
|
+
"example.umes.extensions.phaseI.hint1": "1. The control widget should be visible — it proves the spot itself resolved.",
|
|
348
|
+
"example.umes.extensions.phaseI.hint2": "2. The disabled widget should never appear, including after hydration finishes.",
|
|
349
|
+
"example.umes.extensions.phaseI.probe": "Override probe widget — disabled through modules.ts.",
|
|
350
|
+
"example.umes.extensions.phaseI.title": "Phase I — Client-side module overrides",
|
|
345
351
|
"example.umes.extensions.table.handle": "Handle",
|
|
346
352
|
"example.umes.extensions.table.label": "Label",
|
|
347
353
|
"example.umes.extensions.table.title": "Replacement Handles",
|
|
@@ -342,6 +342,12 @@
|
|
|
342
342
|
"example.umes.extensions.phaseH.hint3": "3. Form should expose `crud-form:example.todo` replacement handle.",
|
|
343
343
|
"example.umes.extensions.phaseH.hint4": "4. Customer detail notes section should render wrapped border from `ExampleNotesSectionWrapper`.",
|
|
344
344
|
"example.umes.extensions.phaseH.title": "Fase H — Reemplazo de componentes",
|
|
345
|
+
"example.umes.extensions.phaseI.control": "Widget de control de la sonda de override — sin override, siempre visible.",
|
|
346
|
+
"example.umes.extensions.phaseI.description": "Ambos widgets de abajo están en el spot `example:override-probe`. `src/modules.ts` desactiva el primero y deja el segundo intacto, así que la pareja muestra si un override de modules.ts sobrevive al bootstrap del navegador que vuelve a registrar el registro de inyección.",
|
|
347
|
+
"example.umes.extensions.phaseI.hint1": "1. El widget de control debe verse — demuestra que el propio spot se resolvió.",
|
|
348
|
+
"example.umes.extensions.phaseI.hint2": "2. El widget desactivado no debe aparecer nunca, tampoco al terminar la hidratación.",
|
|
349
|
+
"example.umes.extensions.phaseI.probe": "Widget sonda de override — desactivado desde modules.ts.",
|
|
350
|
+
"example.umes.extensions.phaseI.title": "Fase I — Overrides de módulos en el cliente",
|
|
345
351
|
"example.umes.extensions.table.handle": "Handle",
|
|
346
352
|
"example.umes.extensions.table.label": "Etiqueta",
|
|
347
353
|
"example.umes.extensions.table.title": "Handles de reemplazo",
|
|
@@ -342,6 +342,12 @@
|
|
|
342
342
|
"example.umes.extensions.phaseH.hint3": "3. 폼은 `crud-form:example.todo` 교체 핸들을 노출해야 합니다.",
|
|
343
343
|
"example.umes.extensions.phaseH.hint4": "4. 고객 상세 메모 섹션은 `ExampleNotesSectionWrapper`가 적용한 테두리로 렌더링되어야 합니다.",
|
|
344
344
|
"example.umes.extensions.phaseH.title": "Phase H — 컴포넌트 교체",
|
|
345
|
+
"example.umes.extensions.phaseI.control": "오버라이드 프로브 대조 위젯 — 오버라이드 없음, 항상 표시됨.",
|
|
346
|
+
"example.umes.extensions.phaseI.description": "아래 두 위젯은 모두 `example:override-probe` 스팟에 있습니다. `src/modules.ts`가 첫 번째만 비활성화하고 두 번째는 그대로 두므로, 이 쌍은 인젝션 레지스트리를 다시 등록하는 브라우저 부트스트랩 이후에도 modules.ts 오버라이드가 유지되는지 보여 줍니다.",
|
|
347
|
+
"example.umes.extensions.phaseI.hint1": "1. 대조 위젯은 보여야 합니다 — 스팟 자체가 정상적으로 해석되었음을 증명합니다.",
|
|
348
|
+
"example.umes.extensions.phaseI.hint2": "2. 비활성화된 위젯은 하이드레이션이 끝난 뒤에도 절대 나타나면 안 됩니다.",
|
|
349
|
+
"example.umes.extensions.phaseI.probe": "오버라이드 프로브 위젯 — modules.ts에서 비활성화됨.",
|
|
350
|
+
"example.umes.extensions.phaseI.title": "단계 I — 클라이언트 측 모듈 오버라이드",
|
|
345
351
|
"example.umes.extensions.table.handle": "핸들",
|
|
346
352
|
"example.umes.extensions.table.label": "라벨",
|
|
347
353
|
"example.umes.extensions.table.title": "교체 핸들",
|
|
@@ -342,6 +342,12 @@
|
|
|
342
342
|
"example.umes.extensions.phaseH.hint3": "3. Form should expose `crud-form:example.todo` replacement handle.",
|
|
343
343
|
"example.umes.extensions.phaseH.hint4": "4. Customer detail notes section should render wrapped border from `ExampleNotesSectionWrapper`.",
|
|
344
344
|
"example.umes.extensions.phaseH.title": "Faza H — Zastępowanie komponentów",
|
|
345
|
+
"example.umes.extensions.phaseI.control": "Widżet kontrolny sondy nadpisań — bez nadpisania, zawsze widoczny.",
|
|
346
|
+
"example.umes.extensions.phaseI.description": "Oba widżety poniżej są osadzone w spocie `example:override-probe`. `src/modules.ts` wyłącza pierwszy, a drugi zostawia nietknięty, więc ta para pokazuje, czy nadpisanie z modules.ts przetrwa bootstrap przeglądarki, który ponownie rejestruje rejestr injection.",
|
|
347
|
+
"example.umes.extensions.phaseI.hint1": "1. Widżet kontrolny powinien być widoczny — dowodzi, że sam spot się rozwiązał.",
|
|
348
|
+
"example.umes.extensions.phaseI.hint2": "2. Wyłączony widżet nie może pojawić się nigdy, także po zakończeniu hydracji.",
|
|
349
|
+
"example.umes.extensions.phaseI.probe": "Widżet sondy nadpisań — wyłączony przez modules.ts.",
|
|
350
|
+
"example.umes.extensions.phaseI.title": "Faza I — Nadpisania modułów po stronie klienta",
|
|
345
351
|
"example.umes.extensions.table.handle": "Uchwyt",
|
|
346
352
|
"example.umes.extensions.table.label": "Etykieta",
|
|
347
353
|
"example.umes.extensions.table.title": "Uchwyty zastępowania",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
5
|
+
|
|
6
|
+
export default function OverrideProbeWidget() {
|
|
7
|
+
const t = useT()
|
|
8
|
+
return (
|
|
9
|
+
<div
|
|
10
|
+
data-testid="example-override-probe"
|
|
11
|
+
className="rounded border border-border bg-muted/30 p-2 text-xs text-muted-foreground"
|
|
12
|
+
>
|
|
13
|
+
{t('example.umes.extensions.phaseI.probe', 'Override probe widget — disabled through modules.ts.')}
|
|
14
|
+
</div>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { InjectionWidgetModule } from '@open-mercato/shared/modules/widgets/injection'
|
|
2
|
+
import OverrideProbeWidget from './widget.client'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Disabled from `src/modules.ts` (`widgets.injection`) so integration coverage can
|
|
6
|
+
* prove the override reaches the BROWSER registry, not only the server one.
|
|
7
|
+
* `ClientBootstrap` re-registers the injection registry after hydration, and before
|
|
8
|
+
* #5152 that re-registration restored every widget the server had filtered out.
|
|
9
|
+
*
|
|
10
|
+
* The override there is keyed by this widget's registry `key`, the spelling the
|
|
11
|
+
* injection tables do NOT use, so the alias resolution added for #5152 is exercised
|
|
12
|
+
* end to end. `override-probe-control` sits on the same spot with no override and
|
|
13
|
+
* must stay visible, which keeps the absence assertion from passing for the wrong
|
|
14
|
+
* reason (a spot that renders nothing at all).
|
|
15
|
+
*/
|
|
16
|
+
const widget: InjectionWidgetModule = {
|
|
17
|
+
metadata: {
|
|
18
|
+
id: 'example.injection.override-probe',
|
|
19
|
+
title: 'Module Override Probe (disabled)',
|
|
20
|
+
description: 'Disabled through modules.ts; must not render once the client bootstrap has run.',
|
|
21
|
+
priority: 10,
|
|
22
|
+
enabled: true,
|
|
23
|
+
},
|
|
24
|
+
Widget: OverrideProbeWidget,
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default widget
|
package/template/src/modules/example/widgets/injection/override-probe-control/widget.client.tsx
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
5
|
+
|
|
6
|
+
export default function OverrideProbeControlWidget() {
|
|
7
|
+
const t = useT()
|
|
8
|
+
return (
|
|
9
|
+
<div
|
|
10
|
+
data-testid="example-override-probe-control"
|
|
11
|
+
className="rounded border border-border bg-muted/30 p-2 text-xs text-muted-foreground"
|
|
12
|
+
>
|
|
13
|
+
{t('example.umes.extensions.phaseI.control', 'Override probe control widget — no override, always visible.')}
|
|
14
|
+
</div>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { InjectionWidgetModule } from '@open-mercato/shared/modules/widgets/injection'
|
|
2
|
+
import OverrideProbeControlWidget from './widget.client'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Control for `example.injection.override-probe`: same spot, no override. Its
|
|
6
|
+
* appearance is what proves the browser injection registry finished registering,
|
|
7
|
+
* so the sibling's absence means "the override survived hydration" rather than
|
|
8
|
+
* "the spot never rendered".
|
|
9
|
+
*/
|
|
10
|
+
const widget: InjectionWidgetModule = {
|
|
11
|
+
metadata: {
|
|
12
|
+
id: 'example.injection.override-probe-control',
|
|
13
|
+
title: 'Module Override Probe (control)',
|
|
14
|
+
description: 'Not overridden; renders on the same spot to prove the spot itself is live.',
|
|
15
|
+
priority: 20,
|
|
16
|
+
enabled: true,
|
|
17
|
+
},
|
|
18
|
+
Widget: OverrideProbeControlWidget,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default widget
|
|
@@ -33,6 +33,14 @@ export const injectionTable: ModuleInjectionTable = {
|
|
|
33
33
|
priority: 50,
|
|
34
34
|
},
|
|
35
35
|
'example:phase-c-handlers': 'example.injection.crud-validation',
|
|
36
|
+
// Client-side module-override probe (#5152 / #5844). The first widget is disabled
|
|
37
|
+
// from `src/modules.ts`, the second is not; TC-UMES-023 asserts the first stays
|
|
38
|
+
// absent and the second stays visible once the browser bootstrap has re-registered
|
|
39
|
+
// this registry.
|
|
40
|
+
'example:override-probe': [
|
|
41
|
+
{ widgetId: 'example.injection.override-probe', priority: 10 },
|
|
42
|
+
{ widgetId: 'example.injection.override-probe-control', priority: 20 },
|
|
43
|
+
],
|
|
36
44
|
// Selected-row bulk action on the module's own Todo table. The spot id is
|
|
37
45
|
// `data-table:<tableId>:bulk-actions` where `<tableId>` is the host's
|
|
38
46
|
// `extensionTableId`, which DataTable derives from `perspective.tableId`.
|