@delmaredigital/payload-experiments 0.4.0-rc.6 → 0.4.0-rc.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -12
- package/dist/admin/blocks/BlockPanel.js +6 -4
- package/dist/admin/blocks/inject.js +1 -0
- package/dist/admin/blocks/model.d.ts +3 -2
- package/dist/admin/blocks/model.js +9 -5
- package/dist/admin/copy/blocks.d.ts +3 -2
- package/dist/admin/copy/blocks.js +8 -7
- package/dist/admin/surface/ResultsRoute.js +18 -11
- package/dist/admin/surface/TestsHome.d.ts +2 -1
- package/dist/admin/surface/TestsHome.js +131 -44
- package/dist/admin/surface/TestsSurface.js +3 -0
- package/dist/admin/surface/home.model.d.ts +2 -0
- package/dist/admin/surface/newTest/PageWizard.js +9 -2
- package/dist/admin/surface/newTest/newTest.css +1 -1
- package/dist/admin/surface/results/ResultsHeader.js +11 -6
- package/dist/admin/surface/test/TestPage.js +3 -3
- package/dist/admin/views/TestsSurfaceClient.d.ts +3 -0
- package/dist/admin/views/TestsSurfaceClient.js +11 -0
- package/dist/admin/views/buildSurfaceProps.js +10 -3
- package/dist/blocks/bindings.js +3 -2
- package/dist/blocks/formState.js +1 -1
- package/dist/blocks/placementLanguages.d.ts +7 -0
- package/dist/blocks/placementLanguages.js +27 -0
- package/dist/blocks/placementLocale.d.ts +21 -7
- package/dist/blocks/placementLocale.js +218 -67
- package/dist/collections/experiments/config.js +8 -3
- package/dist/collections/experiments/deleteGuard.js +2 -2
- package/dist/collections/experiments/lockHook.js +21 -2
- package/dist/collections/experiments/pickSlug.js +2 -0
- package/dist/collections/metricsGuards.js +2 -0
- package/dist/collections/serialize.js +5 -4
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/db/adapter.d.ts +9 -1
- package/dist/db/adapter.js +77 -1
- package/dist/db/appends.d.ts +13 -0
- package/dist/db/appends.js +49 -0
- package/dist/db/bulkPlacementRemoval.js +8 -4
- package/dist/db/delete.d.ts +1 -1
- package/dist/db/delete.js +2 -4
- package/dist/db/events.d.ts +9 -0
- package/dist/db/events.js +42 -8
- package/dist/db/executor.d.ts +7 -1
- package/dist/db/executor.js +7 -3
- package/dist/db/results.d.ts +5 -1
- package/dist/db/results.js +21 -5
- package/dist/db/snapshots.d.ts +1 -0
- package/dist/endpoints/contentLocale.d.ts +6 -0
- package/dist/endpoints/contentLocale.js +15 -0
- package/dist/endpoints/deleteImpact.d.ts +6 -0
- package/dist/endpoints/deleteImpact.js +207 -0
- package/dist/endpoints/events.js +103 -39
- package/dist/endpoints/index.js +9 -8
- package/dist/endpoints/pages.js +7 -3
- package/dist/endpoints/placementStatus.js +13 -5
- package/dist/endpoints/preflight.d.ts +1 -1
- package/dist/endpoints/preflight.js +17 -2
- package/dist/endpoints/results.d.ts +1 -1
- package/dist/endpoints/results.js +6 -2
- package/dist/endpoints/routeId.d.ts +2 -2
- package/dist/endpoints/routeId.js +11 -5
- package/dist/endpoints/summary.js +46 -12
- package/dist/endpoints/transitions.js +37 -24
- package/dist/errors.d.ts +4 -0
- package/dist/errors.js +6 -0
- package/dist/events/request.d.ts +6 -2
- package/dist/events/request.js +35 -8
- package/dist/events/rows.d.ts +1 -1
- package/dist/events/rows.js +24 -8
- package/dist/events/writable.d.ts +9 -0
- package/dist/events/writable.js +13 -0
- package/dist/exports/adminClient.d.ts +1 -1
- package/dist/exports/adminClient.js +1 -1
- package/dist/exports/index.d.ts +1 -1
- package/dist/exports/rsc.d.ts +1 -0
- package/dist/exports/rsc.js +1 -0
- package/dist/goals/fairness.js +38 -31
- package/dist/hooks/blockRemovalRule.d.ts +2 -2
- package/dist/hooks/blockRemovalRule.js +16 -14
- package/dist/hooks/hostHook.js +6 -2
- package/dist/hooks/pageGuard.d.ts +3 -0
- package/dist/hooks/pageGuard.js +37 -23
- package/dist/hooks/puckNestedTests.d.ts +8 -0
- package/dist/hooks/puckNestedTests.js +36 -0
- package/dist/lib/fetchAllDocs.d.ts +1 -1
- package/dist/lib/placementPages.d.ts +2 -1
- package/dist/lib/placementPages.js +10 -2
- package/dist/manifest/compile.d.ts +2 -1
- package/dist/manifest/compile.js +13 -6
- package/dist/onInit.js +14 -0
- package/dist/options.js +5 -0
- package/dist/proxy/pageNavigation.d.ts +4 -0
- package/dist/proxy/pageNavigation.js +28 -0
- package/dist/proxy/resolve.js +52 -25
- package/dist/puck/ExperimentPicker.js +40 -37
- package/dist/puck/editor/ConfigureTestDrawer.d.ts +8 -4
- package/dist/puck/editor/ConfigureTestDrawer.js +5 -2
- package/dist/puck/editor/ExperimentSlotEditor.js +313 -158
- package/dist/puck/editor/LeftoverVersions.d.ts +1 -1
- package/dist/puck/editor/LeftoverVersions.js +40 -43
- package/dist/puck/editor/QuickTestActions.d.ts +5 -2
- package/dist/puck/editor/QuickTestActions.js +16 -4
- package/dist/puck/editor/ResultsReadout.d.ts +2 -1
- package/dist/puck/editor/ResultsReadout.js +2 -1
- package/dist/puck/editor/VersionBuilder.d.ts +31 -3
- package/dist/puck/editor/VersionBuilder.js +336 -74
- package/dist/puck/editor/armWrites.js +1 -1
- package/dist/puck/editor/armsCache.js +1 -3
- package/dist/puck/editor/blockClipboard.d.ts +16 -0
- package/dist/puck/editor/blockClipboard.js +20 -0
- package/dist/puck/editor/copy.d.ts +12 -2
- package/dist/puck/editor/copy.js +13 -2
- package/dist/puck/editor/editor.chrome.css +118 -3
- package/dist/puck/editor/editor.css +131 -8
- package/dist/puck/editor/editor.model.d.ts +3 -1
- package/dist/puck/editor/editor.model.js +2 -2
- package/dist/puck/editor/localPlacements.d.ts +1 -0
- package/dist/puck/editor/localPlacements.js +12 -0
- package/dist/puck/editor/placementsCache.d.ts +22 -12
- package/dist/puck/editor/placementsCache.js +62 -49
- package/dist/puck/editor/usePageSaveReadiness.d.ts +9 -0
- package/dist/puck/editor/usePageSaveReadiness.js +34 -0
- package/dist/puck/editor/usePlacementNotice.d.ts +2 -2
- package/dist/puck/editor/usePlacementNotice.js +6 -4
- package/dist/puck/experimentSlug.d.ts +2 -0
- package/dist/puck/experimentSlug.js +3 -0
- package/dist/puck/nestedTestCopy.d.ts +8 -0
- package/dist/puck/nestedTestCopy.js +22 -0
- package/dist/puck/nestedTests.d.ts +17 -0
- package/dist/puck/nestedTests.js +30 -0
- package/dist/puck/slotConfig.d.ts +1 -1
- package/dist/puck/slotConfig.js +17 -4
- package/dist/puck/visibility.d.ts +2 -3
- package/dist/puck/visibility.js +11 -7
- package/dist/results/aggregate.d.ts +6 -3
- package/dist/results/aggregate.js +9 -9
- package/dist/results/health.d.ts +8 -0
- package/dist/results/health.js +28 -0
- package/dist/results/identityCredit.d.ts +1 -0
- package/dist/results/identityCredit.js +4 -1
- package/dist/results/verdict.js +2 -1
- package/dist/runtime/cookie.d.ts +10 -2
- package/dist/runtime/cookie.js +38 -6
- package/dist/runtime/cookieOptions.d.ts +6 -0
- package/dist/runtime/cookieOptions.js +14 -0
- package/dist/runtime/proxyRuntime.d.ts +1 -0
- package/dist/runtime/proxyRuntime.js +18 -8
- package/dist/runtime/signing.d.ts +1 -0
- package/dist/runtime/signing.js +5 -0
- package/dist/sanitizeReadinessDetail.d.ts +2 -2
- package/dist/sanitizeReadinessDetail.js +20 -2
- package/dist/server/getAssignments.js +11 -10
- package/dist/server/recordContentChange.d.ts +1 -1
- package/dist/server/recordContentChange.js +45 -21
- package/dist/server/resolveExperimentBlocks.js +2 -4
- package/dist/server/resolveExperimentData.js +4 -7
- package/dist/server/runResults.js +52 -14
- package/dist/server/startExperiment.d.ts +20 -0
- package/dist/server/startExperiment.js +70 -0
- package/dist/server/trackConversion.js +10 -13
- package/dist/testSurface/PreviewLinks.js +6 -2
- package/dist/testSurface/actions/DecideDialog.d.ts +4 -1
- package/dist/testSurface/actions/DecideDialog.js +32 -14
- package/dist/testSurface/actions/MakeContentResult.d.ts +4 -3
- package/dist/testSurface/actions/MakeContentResult.js +9 -1
- package/dist/testSurface/api.d.ts +11 -8
- package/dist/testSurface/api.js +27 -11
- package/dist/testSurface/contentLocaleURL.d.ts +2 -0
- package/dist/testSurface/contentLocaleURL.js +3 -0
- package/dist/testSurface/copy/actions.d.ts +1 -0
- package/dist/testSurface/copy/actions.js +1 -0
- package/dist/testSurface/copy/common.d.ts +6 -0
- package/dist/testSurface/copy/common.js +11 -5
- package/dist/testSurface/copy/languages.d.ts +12 -0
- package/dist/testSurface/copy/languages.js +8 -0
- package/dist/testSurface/copy/metrics.d.ts +1 -0
- package/dist/testSurface/copy/metrics.js +1 -0
- package/dist/testSurface/copy/readiness.d.ts +13 -2
- package/dist/testSurface/copy/readiness.js +19 -2
- package/dist/testSurface/copy/results.d.ts +5 -2
- package/dist/testSurface/copy/results.js +5 -2
- package/dist/testSurface/copy/testPage.d.ts +40 -1
- package/dist/testSurface/copy/testPage.js +53 -1
- package/dist/testSurface/placementLabel.d.ts +8 -0
- package/dist/testSurface/placementLabel.js +24 -0
- package/dist/testSurface/placements/placementLabels.d.ts +2 -0
- package/dist/testSurface/placements/placementLabels.js +2 -1
- package/dist/testSurface/readPreflight.d.ts +5 -0
- package/dist/testSurface/readPreflight.js +7 -0
- package/dist/testSurface/readinessRead.d.ts +3 -0
- package/dist/testSurface/readinessRead.js +4 -0
- package/dist/testSurface/results/VerdictHero.d.ts +2 -1
- package/dist/testSurface/results/VerdictHero.js +5 -1
- package/dist/testSurface/results/results.css +1 -1
- package/dist/testSurface/results/results.model.d.ts +1 -1
- package/dist/testSurface/results/results.model.js +6 -2
- package/dist/testSurface/surface/contracts.d.ts +10 -1
- package/dist/testSurface/surface/editorPlacement.d.ts +7 -2
- package/dist/testSurface/surface/editorPlacement.js +19 -1
- package/dist/testSurface/surface/pageBlock/pageBlock.model.js +4 -3
- package/dist/testSurface/surface/pageBlock/parts.js +24 -6
- package/dist/testSurface/surface/pagePicker/PageCombobox.js +20 -6
- package/dist/testSurface/surface/readiness/ActionDialogs.d.ts +4 -2
- package/dist/testSurface/surface/readiness/ActionDialogs.js +39 -34
- package/dist/testSurface/surface/readiness/Banner.js +23 -12
- package/dist/testSurface/surface/readiness/SaveStatus.d.ts +4 -3
- package/dist/testSurface/surface/readiness/SaveStatus.js +15 -15
- package/dist/testSurface/surface/readiness/readiness.model.d.ts +6 -1
- package/dist/testSurface/surface/readiness/readiness.model.js +116 -12
- package/dist/testSurface/surface/readiness/useTransition.d.ts +4 -4
- package/dist/testSurface/surface/readiness/useTransition.js +12 -10
- package/dist/testSurface/surface/results/ReleasePages.d.ts +4 -2
- package/dist/testSurface/surface/results/ReleasePages.js +5 -4
- package/dist/testSurface/surface/results/ResultsBody.d.ts +4 -2
- package/dist/testSurface/surface/results/ResultsBody.js +86 -43
- package/dist/testSurface/surface/results/useResults.d.ts +11 -7
- package/dist/testSurface/surface/results/useResults.js +3 -2
- package/dist/testSurface/surface/setting/parts.js +58 -18
- package/dist/testSurface/surface/test/AdvancedSection.js +1 -0
- package/dist/testSurface/surface/test/DeleteTest.d.ts +19 -0
- package/dist/testSurface/surface/test/DeleteTest.js +262 -0
- package/dist/testSurface/surface/test/GoalSection.js +7 -3
- package/dist/testSurface/surface/test/LengthSection.js +3 -0
- package/dist/testSurface/surface/test/PageHoldout.js +4 -1
- package/dist/testSurface/surface/test/ReadinessBar.js +1 -1
- package/dist/testSurface/surface/test/TargetingSection.js +77 -12
- package/dist/testSurface/surface/test/TestSurface.js +97 -15
- package/dist/testSurface/surface/test/VersionsSection.js +56 -29
- package/dist/testSurface/surface/test/fields.d.ts +29 -4
- package/dist/testSurface/surface/test/fields.js +159 -39
- package/dist/testSurface/surface/test/pageParts.js +14 -5
- package/dist/testSurface/surface/test/testPage.model.d.ts +1 -0
- package/dist/testSurface/surface/test/testPage.model.js +6 -0
- package/dist/testSurface/surface/testDocument.model.d.ts +3 -0
- package/dist/testSurface/surface/testDocument.model.js +4 -1
- package/dist/testSurface/surface/useTestDocument.d.ts +23 -4
- package/dist/testSurface/surface/useTestDocument.js +425 -162
- package/dist/testSurface/useApi.d.ts +9 -6
- package/dist/testSurface/useOnTestReturn.d.ts +2 -0
- package/dist/testSurface/useOnTestReturn.js +27 -0
- package/dist/testSurface/useReadinessPolling.js +3 -1
- package/dist/transitions/addMetric.d.ts +1 -4
- package/dist/transitions/allocate.d.ts +2 -2
- package/dist/transitions/allocate.js +3 -1
- package/dist/transitions/archive.d.ts +1 -1
- package/dist/transitions/archive.js +3 -2
- package/dist/transitions/checkStart.d.ts +5 -1
- package/dist/transitions/checkStart.js +130 -16
- package/dist/transitions/contentFields.js +9 -5
- package/dist/transitions/decide.d.ts +1 -1
- package/dist/transitions/decide.js +5 -3
- package/dist/transitions/deleteExperiment.d.ts +2 -2
- package/dist/transitions/deleteExperiment.js +17 -7
- package/dist/transitions/kernel.d.ts +2 -0
- package/dist/transitions/kernel.js +9 -4
- package/dist/transitions/makeContent.d.ts +2 -1
- package/dist/transitions/makeContent.js +17 -12
- package/dist/transitions/nestedPlacementNames.d.ts +5 -0
- package/dist/transitions/nestedPlacementNames.js +32 -0
- package/dist/transitions/pageVersions.js +3 -1
- package/dist/transitions/phaseRecord.d.ts +2 -0
- package/dist/transitions/phaseRecord.js +5 -0
- package/dist/transitions/placementInteractions.d.ts +3 -3
- package/dist/transitions/placementInteractions.js +15 -11
- package/dist/transitions/placements.d.ts +28 -1
- package/dist/transitions/placements.js +223 -60
- package/dist/transitions/preflightData.d.ts +5 -3
- package/dist/transitions/preflightData.js +126 -37
- package/dist/transitions/releaseHoldout.d.ts +2 -1
- package/dist/transitions/releaseHoldout.js +3 -1
- package/dist/transitions/releasePages.d.ts +2 -1
- package/dist/transitions/releasePages.js +3 -1
- package/dist/transitions/resolveCaps.d.ts +2 -4
- package/dist/transitions/start.d.ts +6 -8
- package/dist/transitions/start.js +70 -34
- package/dist/transitions/startReads.d.ts +7 -0
- package/dist/transitions/startReads.js +28 -0
- package/dist/transitions/stop.d.ts +2 -1
- package/dist/transitions/stop.js +3 -2
- package/dist/types/contracts.d.ts +6 -3
- package/dist/types/endpoints.d.ts +86 -9
- package/dist/types/endpoints.js +1 -1
- package/dist/types/runtime.d.ts +15 -9
- package/dist/types/snapshot.d.ts +2 -0
- package/dist/types/surface.d.ts +2 -0
- package/dist/ui/Button.js +2 -2
- package/dist/ui/ChipsInput.d.ts +8 -1
- package/dist/ui/ChipsInput.js +17 -4
- package/dist/ui/Inputs.d.ts +4 -3
- package/dist/ui/Inputs.js +9 -9
- package/dist/ui/SelectControl.d.ts +33 -0
- package/dist/ui/SelectControl.js +504 -0
- package/dist/ui/ui.css +13 -5
- package/package.json +3 -2
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
export declare const API_MESSAGES: {
|
|
2
2
|
readonly testAlreadyDeleted: "This test was already deleted. Reload the page.";
|
|
3
|
+
readonly deleteInvalidStatus: "Only draft and archived tests can be deleted. Open the test to see how to archive it.";
|
|
3
4
|
readonly testNoLongerDraft: "This test is no longer a draft. Reload the page.";
|
|
4
5
|
readonly notFound: "This test no longer exists.";
|
|
5
6
|
readonly goalNotFound: "That goal no longer exists. Choose another goal.";
|
|
6
7
|
readonly roundChanged: "This round has changed. Reload the page.";
|
|
7
8
|
readonly roundNotFound: "That round no longer exists. Choose another round.";
|
|
8
9
|
readonly commitUnverified: "The change may not have been saved. Reload and try again.";
|
|
10
|
+
readonly transactionIsolation: "The site's database settings don't allow this right now. Ask your developer to check the server log.";
|
|
9
11
|
readonly notImplemented: "This isn't available yet.";
|
|
10
12
|
readonly unauthenticated: "Your session has expired. Sign in again.";
|
|
11
13
|
readonly forbidden: "You don't have permission to do this.";
|
|
12
14
|
readonly network: "Couldn't reach the server. Check your connection and try again.";
|
|
13
15
|
readonly failed: "Couldn't complete this change. Try again.";
|
|
14
16
|
readonly unreadable: "Couldn't read the server's response. Reload and try again.";
|
|
17
|
+
readonly deleteImpactUnavailable: "Couldn't check what visitors will see after deletion. Close this dialog and try again.";
|
|
15
18
|
};
|
|
16
19
|
export declare const LOCKED_MESSAGES: {
|
|
17
20
|
readonly creation: "Set when the test was created.";
|
|
@@ -28,3 +31,6 @@ export declare function refusalMessage(code: string | undefined, status: number,
|
|
|
28
31
|
codes?: Readonly<Record<string, string>>;
|
|
29
32
|
fallback?: string;
|
|
30
33
|
}, detail?: unknown): string;
|
|
34
|
+
export declare const INPUT_COPY: {
|
|
35
|
+
readonly selectRequired: "Choose an option.";
|
|
36
|
+
};
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { unpublishedPlacementsCopy } from './readiness.js';
|
|
2
2
|
export const API_MESSAGES = {
|
|
3
3
|
testAlreadyDeleted: 'This test was already deleted. Reload the page.',
|
|
4
|
+
deleteInvalidStatus: 'Only draft and archived tests can be deleted. Open the test to see how to archive it.',
|
|
4
5
|
testNoLongerDraft: 'This test is no longer a draft. Reload the page.',
|
|
5
6
|
notFound: 'This test no longer exists.',
|
|
6
7
|
goalNotFound: 'That goal no longer exists. Choose another goal.',
|
|
7
8
|
roundChanged: 'This round has changed. Reload the page.',
|
|
8
9
|
roundNotFound: 'That round no longer exists. Choose another round.',
|
|
9
10
|
commitUnverified: 'The change may not have been saved. Reload and try again.',
|
|
11
|
+
transactionIsolation: "The site's database settings don't allow this right now. Ask your developer to check the server log.",
|
|
10
12
|
notImplemented: "This isn't available yet.",
|
|
11
13
|
unauthenticated: 'Your session has expired. Sign in again.',
|
|
12
14
|
forbidden: "You don't have permission to do this.",
|
|
13
15
|
network: "Couldn't reach the server. Check your connection and try again.",
|
|
14
16
|
failed: "Couldn't complete this change. Try again.",
|
|
15
|
-
unreadable: "Couldn't read the server's response. Reload and try again."
|
|
17
|
+
unreadable: "Couldn't read the server's response. Reload and try again.",
|
|
18
|
+
deleteImpactUnavailable: "Couldn't check what visitors will see after deletion. Close this dialog and try again."
|
|
16
19
|
};
|
|
17
20
|
export const LOCKED_MESSAGES = {
|
|
18
21
|
creation: 'Set when the test was created.',
|
|
@@ -24,14 +27,17 @@ export const LOCKED_MESSAGES = {
|
|
|
24
27
|
other: "Can't be changed in this state."
|
|
25
28
|
};
|
|
26
29
|
export function refusalMessage(code, status, message, options, detail) {
|
|
27
|
-
//
|
|
30
|
+
// Authorization takes priority over code copy; entry-specific 404s still name the missing entry.
|
|
28
31
|
const mapped = code && options?.codes && Object.hasOwn(options.codes, code) ? options.codes[code] : undefined;
|
|
29
|
-
if (mapped !== undefined) return mapped;
|
|
30
32
|
if (code === 'unauthenticated' || status === 401) return API_MESSAGES.unauthenticated;
|
|
31
|
-
if (code === '
|
|
33
|
+
if (code === 'forbidden' || status === 403) return options?.forbidden ?? API_MESSAGES.forbidden;
|
|
34
|
+
if (code === 'not-found' || status === 404) return mapped ?? options?.notFound ?? API_MESSAGES.notFound;
|
|
32
35
|
if (code === 'commit-unverified') return API_MESSAGES.commitUnverified;
|
|
33
36
|
if (code === 'not-implemented' || status === 501) return API_MESSAGES.notImplemented;
|
|
34
|
-
if (
|
|
37
|
+
if (mapped !== undefined) return mapped;
|
|
35
38
|
if (code === 'placement-unpublished') return unpublishedPlacementsCopy(detail);
|
|
36
39
|
return options?.fallback ?? (message || API_MESSAGES.failed);
|
|
37
40
|
}
|
|
41
|
+
export const INPUT_COPY = {
|
|
42
|
+
selectRequired: 'Choose an option.'
|
|
43
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Shared by server readiness checks and client placement lists. */
|
|
2
|
+
export declare const PLACEMENT_LANGUAGES: {
|
|
3
|
+
readonly labelWithCode: (label: string, code: string) => string;
|
|
4
|
+
readonly allLocales: "All languages";
|
|
5
|
+
readonly locales: (names: string) => string;
|
|
6
|
+
};
|
|
7
|
+
export interface PlacementLanguages {
|
|
8
|
+
locales?: readonly string[];
|
|
9
|
+
allLocales?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Shared suffix for server findings, placement rows, and delete-impact details. */
|
|
12
|
+
export declare function placementLanguageSuffix({ locales, allLocales }: PlacementLanguages): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Shared by server readiness checks and client placement lists. */ export const PLACEMENT_LANGUAGES = {
|
|
2
|
+
labelWithCode: (label, code)=>`${label} (${code})`,
|
|
3
|
+
allLocales: 'All languages',
|
|
4
|
+
locales: (names)=>`Languages: ${names}`
|
|
5
|
+
};
|
|
6
|
+
/** Shared suffix for server findings, placement rows, and delete-impact details. */ export function placementLanguageSuffix({ locales, allLocales }) {
|
|
7
|
+
return allLocales ? ` · ${PLACEMENT_LANGUAGES.allLocales}` : locales?.length ? ` · ${PLACEMENT_LANGUAGES.locales(locales.join(', '))}` : '';
|
|
8
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const METRICS_COPY: {
|
|
2
2
|
readonly source: "Measured by";
|
|
3
|
+
readonly browserWritablePrimary: "Visitors' browsers report this goal. Automated traffic can affect the results. For important decisions, use a goal your server records.";
|
|
3
4
|
readonly revenueHint: "Very large amounts are counted only up to the level that the top 1% of amounts reached in the 90 days before the test starts; totals are always shown in full.";
|
|
4
5
|
};
|
|
5
6
|
export declare const METRIC_KIND_LABELS: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export const METRICS_COPY = {
|
|
2
2
|
source: 'Measured by',
|
|
3
|
+
browserWritablePrimary: "Visitors' browsers report this goal. Automated traffic can affect the results. For important decisions, use a goal your server records.",
|
|
3
4
|
revenueHint: 'Very large amounts are counted only up to the level that the top 1% of amounts reached in the 90 days before the test starts; totals are always shown in full.'
|
|
4
5
|
};
|
|
5
6
|
export const METRIC_KIND_LABELS = {
|
|
@@ -14,13 +14,16 @@ export declare const READINESS_COPY: {
|
|
|
14
14
|
readonly needsAttention: "Needs attention";
|
|
15
15
|
readonly needsAttentionPrefix: "Needs attention: ";
|
|
16
16
|
readonly missingVersions: "This test is missing its saved versions. Open the test and check its setup before changing this page.";
|
|
17
|
+
readonly addMissingVersionContent: "Add content to the empty versions.";
|
|
18
|
+
readonly summaryMissingVersionContent: "Add or publish the missing version content.";
|
|
17
19
|
readonly saveGeneralError: "Couldn't save. Reload to check the saved test.";
|
|
18
20
|
readonly changing: "Saving this change…";
|
|
19
21
|
readonly reloadAfterError: "Couldn't save the test. Reload to check its saved settings before starting.";
|
|
20
22
|
readonly chooseGoalToAdd: "Choose a goal to add it to this test.";
|
|
21
|
-
readonly reloadFirst: "Reload to see the latest
|
|
23
|
+
readonly reloadFirst: "Reload to see the latest settings and discard your unfinished edits.";
|
|
22
24
|
readonly ready: "Ready to start.";
|
|
23
25
|
readonly saveFirst: "Wait for your changes to save.";
|
|
26
|
+
readonly finishEdits: "Finish your edits before starting the test.";
|
|
24
27
|
readonly saving: "Saving…";
|
|
25
28
|
readonly saved: "Saved";
|
|
26
29
|
readonly saveError: "Couldn't save — see the highlighted field";
|
|
@@ -49,6 +52,8 @@ export declare const READINESS_COPY: {
|
|
|
49
52
|
readonly uncheckedPages: "Version pages aren't checked; make sure each one is published.";
|
|
50
53
|
readonly chooseDifferentPage: "Choose a different page";
|
|
51
54
|
readonly choosePages: "Choose pages";
|
|
55
|
+
readonly publishPage: "Publish the page";
|
|
56
|
+
readonly saveAndPublishPage: "Save and publish the page";
|
|
52
57
|
readonly noTargets: "Choose a page for each version.";
|
|
53
58
|
readonly pageVisitors: "Whole-page tests count visitors. Create the test again counting visitors.";
|
|
54
59
|
readonly blockPathRule: "Remove the page-path rule in Who takes part; page block tests run on their page.";
|
|
@@ -71,12 +76,17 @@ export declare const placementFailureCopy: (reason: unknown) => "Couldn't check
|
|
|
71
76
|
export declare const fixFieldsNext: (name: string) => string;
|
|
72
77
|
export declare const nextCopy: (sentence: string) => string;
|
|
73
78
|
export declare const versionsNext: (detail: string) => string;
|
|
74
|
-
export declare const contentNext: (group: string) => string;
|
|
79
|
+
export declare const contentNext: (group: string, page?: string) => string;
|
|
80
|
+
export declare const draftContentNext: (group: string, page: string) => string;
|
|
81
|
+
export declare const unsavedContentNext: (group: string) => string;
|
|
82
|
+
export declare const partialContentNext: (group: string, page: string) => string;
|
|
83
|
+
export declare function summaryContentNext(groups: string[], draftGroups?: string[]): string;
|
|
75
84
|
export declare const parameterNext: (parameter: string, group: string) => string;
|
|
76
85
|
export declare const placementNext: (group: string, detail: string) => string;
|
|
77
86
|
export declare const goalPeopleNext: (people: string) => string;
|
|
78
87
|
export declare const ruleNext: (detail: string) => string;
|
|
79
88
|
export declare const attributeNext: (attribute: string) => string;
|
|
89
|
+
export declare const firstStartOnlyCopy: (status: string) => string;
|
|
80
90
|
export declare const stoppedCopy: (date: string | null) => string;
|
|
81
91
|
export declare const decidedCopy: (date: string | null, winner: string) => string;
|
|
82
92
|
export declare const runningCopy: (date: string | null, people: number | null, days: number | null) => string;
|
|
@@ -105,3 +115,4 @@ export declare const placementUncheckedCopy: (page: string) => string;
|
|
|
105
115
|
export declare const moreBlockers: (count: number) => string;
|
|
106
116
|
export declare const unpublishedPlacementsCopy: (detail?: unknown) => string;
|
|
107
117
|
export declare const unpublishedPlacementCopy: (title?: string) => string;
|
|
118
|
+
export declare const finishEditCopy: (field: string) => string;
|
|
@@ -14,13 +14,16 @@ export const READINESS_COPY = {
|
|
|
14
14
|
needsAttention: 'Needs attention',
|
|
15
15
|
needsAttentionPrefix: 'Needs attention: ',
|
|
16
16
|
missingVersions: 'This test is missing its saved versions. Open the test and check its setup before changing this page.',
|
|
17
|
+
addMissingVersionContent: 'Add content to the empty versions.',
|
|
18
|
+
summaryMissingVersionContent: 'Add or publish the missing version content.',
|
|
17
19
|
saveGeneralError: "Couldn't save. Reload to check the saved test.",
|
|
18
20
|
changing: 'Saving this change…',
|
|
19
21
|
reloadAfterError: "Couldn't save the test. Reload to check its saved settings before starting.",
|
|
20
22
|
chooseGoalToAdd: 'Choose a goal to add it to this test.',
|
|
21
|
-
reloadFirst: 'Reload to see the latest
|
|
23
|
+
reloadFirst: 'Reload to see the latest settings and discard your unfinished edits.',
|
|
22
24
|
ready: 'Ready to start.',
|
|
23
25
|
saveFirst: 'Wait for your changes to save.',
|
|
26
|
+
finishEdits: 'Finish your edits before starting the test.',
|
|
24
27
|
saving: 'Saving…',
|
|
25
28
|
saved: 'Saved',
|
|
26
29
|
saveError: "Couldn't save — see the highlighted field",
|
|
@@ -49,6 +52,8 @@ export const READINESS_COPY = {
|
|
|
49
52
|
uncheckedPages: "Version pages aren't checked; make sure each one is published.",
|
|
50
53
|
chooseDifferentPage: 'Choose a different page',
|
|
51
54
|
choosePages: 'Choose pages',
|
|
55
|
+
publishPage: 'Publish the page',
|
|
56
|
+
saveAndPublishPage: 'Save and publish the page',
|
|
52
57
|
noTargets: 'Choose a page for each version.',
|
|
53
58
|
pageVisitors: 'Whole-page tests count visitors. Create the test again counting visitors.',
|
|
54
59
|
blockPathRule: 'Remove the page-path rule in Who takes part; page block tests run on their page.',
|
|
@@ -68,12 +73,23 @@ const withoutPeriod = (value)=>value.trim().replace(/[.!?]+$/, '');
|
|
|
68
73
|
export const fixFieldsNext = (name)=>`Fix the highlighted fields in ${name}.`;
|
|
69
74
|
export const nextCopy = (sentence)=>`Next: ${sentence}`;
|
|
70
75
|
export const versionsNext = (detail)=>`Fix the versions: ${withoutPeriod(detail)}.`;
|
|
71
|
-
export const contentNext = (group)=>`Add content for ${group} on
|
|
76
|
+
export const contentNext = (group, page = 'the page')=>`Add content for ${group} on ${page}.`;
|
|
77
|
+
export const draftContentNext = (group, page)=>`${group} has content in the draft of ${page}. ${READINESS_COPY.publishPage}.`;
|
|
78
|
+
export const unsavedContentNext = (group)=>`${group} has unsaved content. ${READINESS_COPY.saveAndPublishPage}.`;
|
|
79
|
+
export const partialContentNext = (group, page)=>`Fill ${group} in the empty Experiment blocks on ${page}.`;
|
|
80
|
+
export function summaryContentNext(groups, draftGroups = []) {
|
|
81
|
+
const format = new Intl.ListFormat('en-US');
|
|
82
|
+
return [
|
|
83
|
+
groups.length ? `Add or publish content for ${format.format(groups)}.` : '',
|
|
84
|
+
draftGroups.length ? `Publish the draft content for ${format.format(draftGroups)}.` : ''
|
|
85
|
+
].filter(Boolean).join(' ');
|
|
86
|
+
}
|
|
72
87
|
export const parameterNext = (parameter, group)=>`Set a value for ${parameter} on ${group}.`;
|
|
73
88
|
export const placementNext = (group, detail)=>`Add content for ${group} wherever this setting is used${detail.trim() ? `: ${withoutPeriod(detail)}` : ''}.`;
|
|
74
89
|
export const goalPeopleNext = (people)=>`This goal can't be measured for ${people}. Choose another goal.`;
|
|
75
90
|
export const ruleNext = (detail)=>`Fix the rule: ${withoutPeriod(detail)}.`;
|
|
76
91
|
export const attributeNext = (attribute)=>`Remove the rule on ${attribute}: it isn't available.`;
|
|
92
|
+
export const firstStartOnlyCopy = (status)=>`Only a draft that has never started can start this way. The test is currently ${status === 'draft' ? 'a draft' : status}.`;
|
|
77
93
|
export const stoppedCopy = (date)=>`Stopped${date ? ` ${date}` : ''}. Edit the versions, goal, audience or length below, then start again (results restart).`;
|
|
78
94
|
export const decidedCopy = (date, winner)=>`Decided${date ? ` ${date}` : ''}: ${winner}.`;
|
|
79
95
|
export const runningCopy = (date, people, days)=>[
|
|
@@ -115,3 +131,4 @@ export const unpublishedPlacementsCopy = (detail)=>(Array.isArray(detail) && det
|
|
|
115
131
|
return unpublishedPlacementCopy(title);
|
|
116
132
|
}).join('\n');
|
|
117
133
|
export const unpublishedPlacementCopy = (title = 'this page')=>`The block you're testing is only on a draft of ${title}. Publish the page before you start.`;
|
|
134
|
+
export const finishEditCopy = (field)=>`Finish your edit to “${field}” before starting the test.`;
|
|
@@ -58,13 +58,16 @@ export declare const RESULTS_COPY: {
|
|
|
58
58
|
readonly infeasible: "A clear answer would take more than 90 days at this traffic.";
|
|
59
59
|
readonly noCap: "Not capped: fewer than 20 people had this outcome in the 90 days before Start, so every value counts in full.";
|
|
60
60
|
readonly quality: "Data quality";
|
|
61
|
-
readonly missingWinner: "The stored winner is missing from this round
|
|
61
|
+
readonly missingWinner: "The stored winner is missing from this round's results.";
|
|
62
62
|
readonly missingWinnerNext: "Recompute; if it persists, contact a developer before trusting these results.";
|
|
63
|
-
readonly srm: "Traffic isn't splitting as set.
|
|
63
|
+
readonly srm: "Traffic isn't splitting as set. Caching, a page placed twice, or automated traffic could affect the split.";
|
|
64
|
+
readonly srmAction: "Don't trust these results. Ask a developer to check for caching, a page placed twice, or automated traffic.";
|
|
64
65
|
readonly multiGroup: "People who saw more than one group were excluded.";
|
|
65
66
|
readonly multiGroupNext: "Check for caching or a page placed twice before trusting the results.";
|
|
66
67
|
readonly mismatch: "Beacons that didn't match the assigned group were ignored.";
|
|
67
68
|
readonly mismatchNext: "Check that the page reports the group it actually showed.";
|
|
69
|
+
readonly rapidBrowserEvents: "A larger share of visitors acted within seconds of arriving on one version than on another. One version may make it easier to act quickly, or some activity may be automated.";
|
|
70
|
+
readonly rapidBrowserEventsNext: "Check where the action appears in each version and ask your site team to review the traffic before choosing a winner.";
|
|
68
71
|
readonly identity: "Some linked identities were seen in different groups.";
|
|
69
72
|
readonly identityNext: "Check identity linking at sign-in and registration.";
|
|
70
73
|
readonly tooFew: "Too few people have seen the compared groups.";
|
|
@@ -58,13 +58,16 @@ export const RESULTS_COPY = {
|
|
|
58
58
|
infeasible: 'A clear answer would take more than 90 days at this traffic.',
|
|
59
59
|
noCap: 'Not capped: fewer than 20 people had this outcome in the 90 days before Start, so every value counts in full.',
|
|
60
60
|
quality: 'Data quality',
|
|
61
|
-
missingWinner:
|
|
61
|
+
missingWinner: "The stored winner is missing from this round's results.",
|
|
62
62
|
missingWinnerNext: 'Recompute; if it persists, contact a developer before trusting these results.',
|
|
63
|
-
srm: "Traffic isn't splitting as set.
|
|
63
|
+
srm: "Traffic isn't splitting as set. Caching, a page placed twice, or automated traffic could affect the split.",
|
|
64
|
+
srmAction: "Don't trust these results. Ask a developer to check for caching, a page placed twice, or automated traffic.",
|
|
64
65
|
multiGroup: 'People who saw more than one group were excluded.',
|
|
65
66
|
multiGroupNext: 'Check for caching or a page placed twice before trusting the results.',
|
|
66
67
|
mismatch: "Beacons that didn't match the assigned group were ignored.",
|
|
67
68
|
mismatchNext: 'Check that the page reports the group it actually showed.',
|
|
69
|
+
rapidBrowserEvents: 'A larger share of visitors acted within seconds of arriving on one version than on another. One version may make it easier to act quickly, or some activity may be automated.',
|
|
70
|
+
rapidBrowserEventsNext: 'Check where the action appears in each version and ask your site team to review the traffic before choosing a winner.',
|
|
68
71
|
identity: 'Some linked identities were seen in different groups.',
|
|
69
72
|
identityNext: 'Check identity linking at sign-in and registration.',
|
|
70
73
|
tooFew: 'Too few people have seen the compared groups.',
|
|
@@ -1,10 +1,23 @@
|
|
|
1
|
+
import type { ExperimentKind } from '../../types/contracts.js';
|
|
1
2
|
export declare const TEST_PAGE: {
|
|
2
3
|
readonly noAudienceRules: "No audience choices are available here. Everyone eligible takes part; leave this section as it is.";
|
|
3
4
|
readonly editVersionsOnCanvas: "Edit version content on the canvas.";
|
|
4
5
|
readonly clickPageGroup: "On this test's page";
|
|
5
6
|
readonly clickGoalHelp: "A click shows interest, not the result you want.";
|
|
6
|
-
readonly staleEdit: "
|
|
7
|
+
readonly staleEdit: "This test changed. Reload to see the latest settings and discard your unfinished edits.";
|
|
7
8
|
readonly reload: "Reload";
|
|
9
|
+
readonly reloadAfterError: "Reload to discard your unfinished edits and try again.";
|
|
10
|
+
readonly draftNotSaved: "Your edit is still unsaved.";
|
|
11
|
+
readonly conflictChoice: "Your edit is unsaved. Choose which value to keep. Saving your edit replaces the saved value shown below.";
|
|
12
|
+
readonly keepEdit: "Save my edit";
|
|
13
|
+
readonly retryEdit: "Try saving again";
|
|
14
|
+
readonly editInvalid: "Enter a valid value before saving.";
|
|
15
|
+
readonly detachedEdit: (field: string) => string;
|
|
16
|
+
readonly discardEdit: "Discard edit";
|
|
17
|
+
readonly savedValueChanged: "This field changed while you were editing.";
|
|
18
|
+
readonly savedValue: "Saved value";
|
|
19
|
+
readonly emptyValue: "(empty)";
|
|
20
|
+
readonly useSavedValue: "Use saved value";
|
|
8
21
|
readonly loading: "Loading test…";
|
|
9
22
|
readonly forbidden: "You don't have access to this test.";
|
|
10
23
|
readonly missing: "This test no longer exists.";
|
|
@@ -82,6 +95,7 @@ export declare const TEST_PAGE: {
|
|
|
82
95
|
readonly addRule: "Add a rule";
|
|
83
96
|
readonly removeRule: "Remove rule";
|
|
84
97
|
readonly blockPathRule: "This rule no longer applies to page block tests; remove it.";
|
|
98
|
+
readonly targetingValue: (attribute: string) => string;
|
|
85
99
|
readonly attribute: "Attribute";
|
|
86
100
|
readonly comparison: "Comparison";
|
|
87
101
|
readonly value: "Value";
|
|
@@ -107,3 +121,28 @@ export declare const NUMBER_COMPARISONS: {
|
|
|
107
121
|
readonly lte: "is at most";
|
|
108
122
|
};
|
|
109
123
|
export declare const placementCount: (count: number) => string;
|
|
124
|
+
export declare const DELETE_TEST: {
|
|
125
|
+
readonly blockWinner: (label: string) => string;
|
|
126
|
+
readonly currentSite: "This list reflects the site right now.";
|
|
127
|
+
readonly changedPages: (count: number) => string;
|
|
128
|
+
readonly unreadablePages: (count: number, total: number) => string;
|
|
129
|
+
readonly pageWinner: "These addresses will change where they send visitors:";
|
|
130
|
+
readonly content: "Deleting the test does not delete your page content. An Experiment block that used this test stays on its page and says the test was deleted.";
|
|
131
|
+
readonly archiveFirst: "You can delete this test after it is archived.";
|
|
132
|
+
readonly close: "Close";
|
|
133
|
+
readonly labelWithCode: (label: string, code: string) => string;
|
|
134
|
+
readonly allLocales: "All languages";
|
|
135
|
+
readonly locales: (names: string) => string;
|
|
136
|
+
readonly action: "Delete test";
|
|
137
|
+
readonly cancel: "Cancel";
|
|
138
|
+
readonly deleted: "Test deleted.";
|
|
139
|
+
readonly title: (name: string) => string;
|
|
140
|
+
readonly consequences: "This permanently deletes the test and all its rounds and results.";
|
|
141
|
+
readonly alreadyDeleted: "This test was already deleted.";
|
|
142
|
+
readonly checking: "Checking what visitors will see…";
|
|
143
|
+
readonly checkFailed: "Couldn't check what visitors will see after deletion. You can still choose to delete this test.";
|
|
144
|
+
readonly noEffect: "Deleting this test will not change what visitors see.";
|
|
145
|
+
readonly versionChange: (before: string, after: string) => string;
|
|
146
|
+
readonly morePages: (count: number) => string;
|
|
147
|
+
};
|
|
148
|
+
export declare function deleteStatusCopy(status: string, kind?: ExperimentKind): string;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { ACTIONS_COPY } from './actions.js';
|
|
2
|
+
import { API_MESSAGES } from './common.js';
|
|
3
|
+
import { PLACEMENT_LANGUAGES } from './languages.js';
|
|
1
4
|
const guardrailsShort = 'Must not get worse';
|
|
2
5
|
const secondaryShort = 'Also keep an eye on';
|
|
3
6
|
export const TEST_PAGE = {
|
|
@@ -5,8 +8,20 @@ export const TEST_PAGE = {
|
|
|
5
8
|
editVersionsOnCanvas: 'Edit version content on the canvas.',
|
|
6
9
|
clickPageGroup: "On this test's page",
|
|
7
10
|
clickGoalHelp: 'A click shows interest, not the result you want.',
|
|
8
|
-
staleEdit: '
|
|
11
|
+
staleEdit: 'This test changed. Reload to see the latest settings and discard your unfinished edits.',
|
|
9
12
|
reload: 'Reload',
|
|
13
|
+
reloadAfterError: 'Reload to discard your unfinished edits and try again.',
|
|
14
|
+
draftNotSaved: 'Your edit is still unsaved.',
|
|
15
|
+
conflictChoice: 'Your edit is unsaved. Choose which value to keep. Saving your edit replaces the saved value shown below.',
|
|
16
|
+
keepEdit: 'Save my edit',
|
|
17
|
+
retryEdit: 'Try saving again',
|
|
18
|
+
editInvalid: 'Enter a valid value before saving.',
|
|
19
|
+
detachedEdit: (field)=>`Your edit to “${field}” is still unsaved. Return to the field to finish it, or copy your edit and discard it here.`,
|
|
20
|
+
discardEdit: 'Discard edit',
|
|
21
|
+
savedValueChanged: 'This field changed while you were editing.',
|
|
22
|
+
savedValue: 'Saved value',
|
|
23
|
+
emptyValue: '(empty)',
|
|
24
|
+
useSavedValue: 'Use saved value',
|
|
10
25
|
loading: 'Loading test…',
|
|
11
26
|
forbidden: "You don't have access to this test.",
|
|
12
27
|
missing: 'This test no longer exists.',
|
|
@@ -84,6 +99,7 @@ export const TEST_PAGE = {
|
|
|
84
99
|
addRule: 'Add a rule',
|
|
85
100
|
removeRule: 'Remove rule',
|
|
86
101
|
blockPathRule: 'This rule no longer applies to page block tests; remove it.',
|
|
102
|
+
targetingValue: (attribute)=>`Value for ${attribute}`,
|
|
87
103
|
attribute: 'Attribute',
|
|
88
104
|
comparison: 'Comparison',
|
|
89
105
|
value: 'Value',
|
|
@@ -109,3 +125,39 @@ export const NUMBER_COMPARISONS = {
|
|
|
109
125
|
lte: 'is at most'
|
|
110
126
|
};
|
|
111
127
|
export const placementCount = (count)=>` (placed ${count} times)`;
|
|
128
|
+
export const DELETE_TEST = {
|
|
129
|
+
action: 'Delete test',
|
|
130
|
+
cancel: 'Cancel',
|
|
131
|
+
deleted: 'Test deleted.',
|
|
132
|
+
title: (name)=>`Delete “${name}”?`,
|
|
133
|
+
consequences: 'This permanently deletes the test and all its rounds and results.',
|
|
134
|
+
alreadyDeleted: 'This test was already deleted.',
|
|
135
|
+
checking: 'Checking what visitors will see…',
|
|
136
|
+
checkFailed: "Couldn't check what visitors will see after deletion. You can still choose to delete this test.",
|
|
137
|
+
noEffect: 'Deleting this test will not change what visitors see.',
|
|
138
|
+
versionChange: (before, after)=>`${before} → ${after}`,
|
|
139
|
+
morePages: (count)=>`${count} more ${count === 1 ? 'page' : 'pages'}.`,
|
|
140
|
+
...PLACEMENT_LANGUAGES,
|
|
141
|
+
blockWinner: (label)=>`On these pages, visitors will see ${label} again, or nothing where it is empty:`,
|
|
142
|
+
currentSite: 'This list reflects the site right now.',
|
|
143
|
+
changedPages: (count)=>`${count} ${count === 1 ? 'page' : 'pages'} will change`,
|
|
144
|
+
unreadablePages: (count, total)=>total === 1 ? "You can't open this page." : count === total ? "You can't open any of these pages." : `You can't open ${count} of these pages.`,
|
|
145
|
+
pageWinner: 'These addresses will change where they send visitors:',
|
|
146
|
+
content: 'Deleting the test does not delete your page content. An Experiment block that used this test stays on its page and says the test was deleted.',
|
|
147
|
+
archiveFirst: 'You can delete this test after it is archived.',
|
|
148
|
+
close: 'Close'
|
|
149
|
+
};
|
|
150
|
+
export function deleteStatusCopy(status, kind) {
|
|
151
|
+
switch(status){
|
|
152
|
+
case 'running':
|
|
153
|
+
return 'Stop the test, then archive it before deleting it.';
|
|
154
|
+
case 'stopped':
|
|
155
|
+
return DELETE_TEST.archiveFirst;
|
|
156
|
+
case 'decided':
|
|
157
|
+
if (!kind) return `${DELETE_TEST.archiveFirst} Open the test to see the available archive options.`;
|
|
158
|
+
if (kind === 'code') return `${DELETE_TEST.archiveFirst} To archive it, choose the action that confirms the developer has put the winner in the code, or choose ${ACTIONS_COPY.discard}. Type the confirmation for either choice.`;
|
|
159
|
+
return `${DELETE_TEST.archiveFirst} Choose ${ACTIONS_COPY.makeContent} to keep the winner, or choose ${ACTIONS_COPY.discard} and type the confirmation. If every entry in the content report is updated or dismissed, choose ${ACTIONS_COPY.finish}.`;
|
|
160
|
+
default:
|
|
161
|
+
return API_MESSAGES.deleteInvalidStatus;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PreflightResult } from '../types/endpoints.js';
|
|
2
|
+
type Placement = PreflightResult['placements'][number];
|
|
3
|
+
/** Shared row identity. Legacy previews and edit links omit publication state;
|
|
4
|
+
* Binding already showed it on single-language sites. */
|
|
5
|
+
export declare function placementLabel(placement: Placement, showState?: boolean, states?: string[]): string;
|
|
6
|
+
/** A shared editor link describes the union of its rows, retaining their first page title. */
|
|
7
|
+
export declare function placementGroupLabel(placements: readonly Placement[], configuredLanguages?: readonly string[]): string;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { placementLanguageSuffix } from './copy/languages.js';
|
|
2
|
+
/** Shared row identity. Legacy previews and edit links omit publication state;
|
|
3
|
+
* Binding already showed it on single-language sites. */ export function placementLabel(placement, showState = Boolean(placement.allLocales || placement.locales?.length), states = [
|
|
4
|
+
placement.detail === 'Published' ? 'Published' : 'Draft'
|
|
5
|
+
]) {
|
|
6
|
+
return `${placement.title}${showState ? ` (${states.join(', ')})` : ''}${placementLanguageSuffix(placement)}`;
|
|
7
|
+
}
|
|
8
|
+
/** A shared editor link describes the union of its rows, retaining their first page title. */ export function placementGroupLabel(placements, configuredLanguages) {
|
|
9
|
+
const first = placements[0];
|
|
10
|
+
const locales = [
|
|
11
|
+
...new Set(placements.flatMap((row)=>row.locales ?? []))
|
|
12
|
+
];
|
|
13
|
+
const allLocales = placements.some((row)=>row.allLocales) || Boolean(configuredLanguages?.length && configuredLanguages.every((name)=>locales.includes(name)));
|
|
14
|
+
const states = [
|
|
15
|
+
...new Set(placements.map((row)=>row.detail === 'Published' ? 'Published' : 'Draft'))
|
|
16
|
+
];
|
|
17
|
+
return placementLabel({
|
|
18
|
+
...first,
|
|
19
|
+
locales,
|
|
20
|
+
...allLocales ? {
|
|
21
|
+
allLocales: true
|
|
22
|
+
} : {}
|
|
23
|
+
}, true, states);
|
|
24
|
+
}
|
|
@@ -7,5 +7,7 @@ export declare function resolvedPlacementLabel(value: unknown, match: {
|
|
|
7
7
|
id?: DocId | null;
|
|
8
8
|
title?: string;
|
|
9
9
|
editorUrl?: string;
|
|
10
|
+
locales?: string[];
|
|
11
|
+
allLocales?: true;
|
|
10
12
|
} | undefined, adminRoute: string): PlacementLabel;
|
|
11
13
|
export declare function preflightPlacementLabel(value: unknown, preflight: PreflightResult, adminRoute: string): PlacementLabel;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { placementLanguageSuffix } from '../copy/languages.js';
|
|
1
2
|
import { formatAdminURL } from '../format/adminURL.js';
|
|
2
3
|
import { placementDetail } from './placementLabels.model.js';
|
|
3
4
|
export { placementDetailKey, placementDetail, fallbackPlacementLabel } from './placementLabels.model.js';
|
|
@@ -5,7 +6,7 @@ export function resolvedPlacementLabel(value, match, adminRoute) {
|
|
|
5
6
|
const detail = placementDetail(value);
|
|
6
7
|
const id = match?.id ?? detail.id;
|
|
7
8
|
return {
|
|
8
|
-
title: match?.title?.trim() || detail.path || 'This page'
|
|
9
|
+
title: `${match?.title?.trim() || detail.path || 'This page'}${placementLanguageSuffix(match ?? {})}`,
|
|
9
10
|
...id != null && detail.collection ? {
|
|
10
11
|
href: match?.editorUrl || formatAdminURL({
|
|
11
12
|
adminRoute,
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { PreflightResult } from '../types/endpoints.js';
|
|
2
2
|
export declare const PREFLIGHT_TIMEOUT_MS = 15000;
|
|
3
|
+
export declare const READINESS_REFRESH_MS = 30000;
|
|
4
|
+
type DocumentVersion = NonNullable<PreflightResult['document']>;
|
|
5
|
+
export declare function statusOrRoundChanged(answer: DocumentVersion | undefined, current: DocumentVersion): boolean;
|
|
6
|
+
export declare function documentChanged(answer: DocumentVersion | undefined, current: DocumentVersion): boolean;
|
|
3
7
|
/** The answer must support both readiness and placement consumers. */
|
|
4
8
|
export declare function isPreflightResult(value: unknown): value is PreflightResult;
|
|
5
9
|
/** Bound the response and body read, even when a producer ignores cancellation. */
|
|
@@ -7,3 +11,4 @@ export declare function readPreflight(request: (signal: AbortSignal) => Promise<
|
|
|
7
11
|
response: Response;
|
|
8
12
|
body: unknown;
|
|
9
13
|
}>;
|
|
14
|
+
export {};
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
export const PREFLIGHT_TIMEOUT_MS = 15_000;
|
|
2
|
+
export const READINESS_REFRESH_MS = 30_000;
|
|
3
|
+
export function statusOrRoundChanged(answer, current) {
|
|
4
|
+
return !!answer && (answer.status !== current.status || answer.phase !== undefined && answer.phase !== current.phase);
|
|
5
|
+
}
|
|
6
|
+
export function documentChanged(answer, current) {
|
|
7
|
+
return statusOrRoundChanged(answer, current) || answer?.updatedAt !== undefined && answer.updatedAt !== current.updatedAt;
|
|
8
|
+
}
|
|
2
9
|
/** The answer must support both readiness and placement consumers. */ export function isPreflightResult(value) {
|
|
3
10
|
const data = value;
|
|
4
11
|
return !!data && Array.isArray(data.placements) && Array.isArray(data.checks) && data.checks.every((check)=>check && typeof check.code === 'string' && typeof check.ok === 'boolean');
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PreflightResult } from '../types/endpoints.js';
|
|
2
|
+
import type { DocId } from '../types/contracts.js';
|
|
2
3
|
export type ReadinessRead = ReturnType<typeof classifyReadinessRead>;
|
|
3
4
|
/** One read policy for every surface. Pending retains this settled value verbatim. */
|
|
4
5
|
export declare function classifyReadinessRead(status: number, body?: unknown, failures?: number, context?: {
|
|
@@ -39,6 +40,8 @@ export declare function readyToStart(test: {
|
|
|
39
40
|
preflightError: string | null;
|
|
40
41
|
preflightRead?: ReadinessRead;
|
|
41
42
|
}, placementMessage?: string): boolean;
|
|
43
|
+
/** A pending edit can change the selected goal before the next readiness response. */
|
|
44
|
+
export declare function hasBrowserWritablePrimary(preflight: PreflightResult | null, primary: DocId | null | undefined): boolean;
|
|
42
45
|
/** Pending changes only the ability to fire Start, never the settled display. */
|
|
43
46
|
export declare function canStartTest(test: {
|
|
44
47
|
preflight: PreflightResult | null;
|
|
@@ -41,6 +41,10 @@ import { isPreflightResult } from './readPreflight.js';
|
|
|
41
41
|
/** Settled display is independent of a refresh in progress. */ export function readyToStart(test, placementMessage) {
|
|
42
42
|
return !!test.preflight && !placementMessage && readinessRead(test).kind === 'answered' && !test.preflightError && test.preflight.checks.every((check)=>check.ok);
|
|
43
43
|
}
|
|
44
|
+
/** A pending edit can change the selected goal before the next readiness response. */ export function hasBrowserWritablePrimary(preflight, primary) {
|
|
45
|
+
const reported = preflight?.browserWritablePrimaryId;
|
|
46
|
+
return reported != null && primary != null && String(reported) === String(primary);
|
|
47
|
+
}
|
|
44
48
|
/** Pending changes only the ability to fire Start, never the settled display. */ export function canStartTest(test, placementMessage) {
|
|
45
49
|
return readyToStart(test, placementMessage) && !test.preflightPending && !test.hasUnsaved && test.saving !== 'saving';
|
|
46
50
|
}
|
|
@@ -8,6 +8,7 @@ export interface VerdictHeroProps {
|
|
|
8
8
|
sinceShipping?: string | null;
|
|
9
9
|
meta?: ReactNode;
|
|
10
10
|
recommendation?: string;
|
|
11
|
+
browserWritablePrimary?: boolean;
|
|
11
12
|
}
|
|
12
13
|
import './results.css';
|
|
13
|
-
export declare function VerdictHero({ model, guardrails, power, collecting, sinceShipping, meta, recommendation }: VerdictHeroProps): import("react").JSX.Element;
|
|
14
|
+
export declare function VerdictHero({ model, guardrails, power, collecting, sinceShipping, meta, recommendation, browserWritablePrimary }: VerdictHeroProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { METRICS_COPY } from '../copy/metrics.js';
|
|
3
4
|
import './results.css';
|
|
4
|
-
export function VerdictHero({ model, guardrails = [], power, collecting, sinceShipping, meta, recommendation }) {
|
|
5
|
+
export function VerdictHero({ model, guardrails = [], power, collecting, sinceShipping, meta, recommendation, browserWritablePrimary }) {
|
|
5
6
|
return /*#__PURE__*/ _jsxs("section", {
|
|
6
7
|
className: "xp-verdict-hero",
|
|
7
8
|
children: [
|
|
@@ -25,6 +26,9 @@ export function VerdictHero({ model, guardrails = [], power, collecting, sinceSh
|
|
|
25
26
|
className: "xp-collecting",
|
|
26
27
|
children: collecting
|
|
27
28
|
}) : null,
|
|
29
|
+
browserWritablePrimary ? /*#__PURE__*/ _jsx("p", {
|
|
30
|
+
children: METRICS_COPY.browserWritablePrimary
|
|
31
|
+
}) : null,
|
|
28
32
|
recommendation ? /*#__PURE__*/ _jsx("p", {
|
|
29
33
|
className: "xp-recommendation",
|
|
30
34
|
children: recommendation
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
:where(.xp-test-surface) .xp-verdict-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--xp-space-3); margin-top: var(--xp-space-5); padding-top: var(--xp-space-4); border-top: 1px solid var(--xp-border); color: var(--xp-text-3); font: var(--xp-text-small); }
|
|
7
7
|
:where(.xp-test-surface) .xp-round-meta { display: flex; align-items: center; flex-wrap: wrap; gap: var(--xp-space-2); min-width: 0; }
|
|
8
8
|
:where(.xp-test-surface) .xp-round-meta .xp-ui-field { display: flex; align-items: center; gap: var(--xp-space-2); margin: 0; min-width: 0; }
|
|
9
|
-
:where(.xp-test-surface) .xp-round-meta .xp-ui-
|
|
9
|
+
:where(.xp-test-surface) .xp-round-meta .xp-ui-combobox-wrap { width: auto; max-width: 100%; }
|
|
10
10
|
:where(.xp-test-surface) .xp-results-chips { display: flex; flex-wrap: wrap; gap: var(--xp-space-2); list-style: none; padding: 0; margin-bottom: 0; }
|
|
11
11
|
:where(.xp-test-surface) .xp-stat-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--xp-border); border-radius: var(--xp-radius-card); background: var(--xp-surface); overflow: hidden; }
|
|
12
12
|
:where(.xp-test-surface) .xp-stat-tile { padding: 20px; min-width: 0; }
|
|
@@ -80,7 +80,7 @@ export declare function armRows({ snapshot, phase, metricId }: {
|
|
|
80
80
|
}): ArmRow[];
|
|
81
81
|
export declare function guardrailChips(snapshot: DisplaySnapshot): {
|
|
82
82
|
name: string;
|
|
83
|
-
status: "
|
|
83
|
+
status: "OK" | "Watch" | "Failing" | "Too little data";
|
|
84
84
|
}[];
|
|
85
85
|
interface RoundLineInput {
|
|
86
86
|
snapshot: DisplaySnapshot;
|
|
@@ -132,14 +132,18 @@ function smallest(values) {
|
|
|
132
132
|
return collectingCopy(formatCount(smallest(keys.map((key)=>snapshot.exposures.perArm[key]))), formatCount(isLegacySnapshot(snapshot) ? legacyMinimum(snapshot, ctx) : snapshot.minExposuresPerArm), formatCount(smallest(keys.map((key)=>primary?.perArm.find((arm)=>arm.arm === key)?.converters))), formatCount(primary ? snapshot.params.minSampleSizes[primary.metricId] : undefined));
|
|
133
133
|
}
|
|
134
134
|
export function dataQuality(snapshot, ctx = {}) {
|
|
135
|
-
const items = (snapshot.health ?? []).map((item)=>
|
|
135
|
+
const items = (snapshot.health ?? []).map((item)=>item.code === 'rapid-browser-events' ? {
|
|
136
|
+
id: item.code,
|
|
137
|
+
message: RESULTS_COPY.rapidBrowserEvents,
|
|
138
|
+
nextStep: RESULTS_COPY.rapidBrowserEventsNext
|
|
139
|
+
} : {
|
|
136
140
|
id: item.code === 'placement-unchecked' ? `${item.code}:${JSON.stringify(item.detail)}` : `${item.code}:${'path' in item ? item.path : item.metricId}`,
|
|
137
141
|
message: item.code === 'placement-unchecked' ? placementUncheckedCopy(ctx.placementLabels?.get(placementDetailKey(item.detail))?.title ?? item.detail.path ?? 'This page') : item.code === 'goal-in-some-versions' ? `${item.name} now appears in some versions but not all, so this result is no longer a fair comparison. Add it to every version, or remove it.` : READINESS_COPY.needsAttention,
|
|
138
142
|
...item.code === 'placement-unchecked' ? {
|
|
139
143
|
href: ctx.placementLabels?.get(placementDetailKey(item.detail))?.href
|
|
140
144
|
} : {},
|
|
141
145
|
nextStep: item.code === 'placement-unchecked' ? `Open ${ctx.placementLabels?.get(placementDetailKey(item.detail))?.title ?? item.detail.path ?? 'the page'}` : item.code === 'goal-in-some-versions' ? 'Edit the versions' : item.code === 'version-page-unavailable' ? versionPageUnavailableCopy(item.path, ctx.status) : versionPageUncheckedCopy(item.path, ctx.status)
|
|
142
|
-
})
|
|
146
|
+
});
|
|
143
147
|
// Test snapshots store null by design; only rollout snapshots record the shipped winner.
|
|
144
148
|
if (!isLegacySnapshot(snapshot) && snapshot.phaseKind === 'rollout' && snapshot.winnerArm === null) items.push({
|
|
145
149
|
id: 'missing-winner',
|